@openora/core 0.4.1-canary.57 → 0.4.1-canary.59
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -10
- package/dist/.tsbuildinfo +1 -1
- package/dist/admin-console/plugin.d.ts +107 -1
- package/dist/admin-console/plugin.d.ts.map +1 -1
- package/dist/admin-console/plugin.js +3 -3
- package/dist/admin-console/plugin.js.map +1 -1
- package/dist/analytics/plugin.d.ts +107 -1
- package/dist/analytics/plugin.d.ts.map +1 -1
- package/dist/analytics/plugin.js +3 -3
- package/dist/analytics/plugin.js.map +1 -1
- package/dist/audit/plugin.d.ts +106 -1
- package/dist/audit/plugin.d.ts.map +1 -1
- package/dist/audit/plugin.js +3 -3
- package/dist/audit/plugin.js.map +1 -1
- package/dist/casino/gaming/plugin.d.ts +108 -1
- package/dist/casino/gaming/plugin.d.ts.map +1 -1
- package/dist/casino/gaming/plugin.js +3 -3
- package/dist/casino/gaming/plugin.js.map +1 -1
- package/dist/casino/lobby/plugin.d.ts +106 -1
- package/dist/casino/lobby/plugin.d.ts.map +1 -1
- package/dist/casino/lobby/plugin.js +3 -3
- package/dist/casino/lobby/plugin.js.map +1 -1
- package/dist/cms/plugin.d.ts +106 -1
- package/dist/cms/plugin.d.ts.map +1 -1
- package/dist/cms/plugin.js +3 -3
- package/dist/cms/plugin.js.map +1 -1
- package/dist/compliance/plugin.d.ts +109 -1
- package/dist/compliance/plugin.d.ts.map +1 -1
- package/dist/compliance/plugin.js +3 -3
- package/dist/compliance/plugin.js.map +1 -1
- package/dist/compliance/service/kyc.service.d.ts +8 -11
- package/dist/compliance/service/kyc.service.d.ts.map +1 -1
- package/dist/compliance/service/kyc.service.js +8 -11
- package/dist/compliance/service/kyc.service.js.map +1 -1
- package/dist/contracts/adapters/admin-game-reporting.d.ts +12 -0
- package/dist/contracts/adapters/admin-game-reporting.d.ts.map +1 -1
- package/dist/contracts/adapters/admin-game-reporting.js +6 -4
- package/dist/contracts/adapters/admin-game-reporting.js.map +1 -1
- package/dist/contracts/adapters/admin-permission.d.ts +10 -0
- package/dist/contracts/adapters/admin-permission.d.ts.map +1 -1
- package/dist/contracts/adapters/admin-permission.js +6 -4
- package/dist/contracts/adapters/admin-permission.js.map +1 -1
- package/dist/contracts/adapters/admin-player-activity.d.ts +22 -0
- package/dist/contracts/adapters/admin-player-activity.d.ts.map +1 -1
- package/dist/contracts/adapters/admin-player-activity.js.map +1 -1
- package/dist/contracts/adapters/admin-user-directory.d.ts +27 -0
- package/dist/contracts/adapters/admin-user-directory.d.ts.map +1 -1
- package/dist/contracts/adapters/admin-user-directory.js.map +1 -1
- package/dist/contracts/adapters/admin-wallet-reporting.d.ts +6 -0
- package/dist/contracts/adapters/admin-wallet-reporting.d.ts.map +1 -1
- package/dist/contracts/adapters/admin-wallet-reporting.js.map +1 -1
- package/dist/contracts/adapters/aggregator.d.ts +12 -0
- package/dist/contracts/adapters/aggregator.d.ts.map +1 -1
- package/dist/contracts/adapters/aggregator.js +5 -3
- package/dist/contracts/adapters/aggregator.js.map +1 -1
- package/dist/contracts/adapters/audit.d.ts +17 -0
- package/dist/contracts/adapters/audit.d.ts.map +1 -1
- package/dist/contracts/adapters/audit.js.map +1 -1
- package/dist/contracts/adapters/broker.d.ts +23 -0
- package/dist/contracts/adapters/broker.d.ts.map +1 -1
- package/dist/contracts/adapters/broker.js +8 -6
- package/dist/contracts/adapters/broker.js.map +1 -1
- package/dist/contracts/adapters/cache.d.ts +8 -0
- package/dist/contracts/adapters/cache.d.ts.map +1 -1
- package/dist/contracts/adapters/cache.js +8 -6
- package/dist/contracts/adapters/cache.js.map +1 -1
- package/dist/contracts/adapters/chat-block-writer.d.ts +4 -0
- package/dist/contracts/adapters/chat-block-writer.d.ts.map +1 -1
- package/dist/contracts/adapters/chat-block-writer.js.map +1 -1
- package/dist/contracts/adapters/email-template.d.ts +8 -0
- package/dist/contracts/adapters/email-template.d.ts.map +1 -1
- package/dist/contracts/adapters/email-template.js +8 -6
- package/dist/contracts/adapters/email-template.js.map +1 -1
- package/dist/contracts/adapters/email.d.ts +7 -0
- package/dist/contracts/adapters/email.d.ts.map +1 -1
- package/dist/contracts/adapters/email.js +7 -5
- package/dist/contracts/adapters/email.js.map +1 -1
- package/dist/contracts/adapters/game.d.ts +4 -0
- package/dist/contracts/adapters/game.d.ts.map +1 -1
- package/dist/contracts/adapters/game.js +4 -2
- package/dist/contracts/adapters/game.js.map +1 -1
- package/dist/contracts/adapters/geo-ip.d.ts +4 -0
- package/dist/contracts/adapters/geo-ip.d.ts.map +1 -1
- package/dist/contracts/adapters/geo-ip.js +4 -2
- package/dist/contracts/adapters/geo-ip.js.map +1 -1
- package/dist/contracts/adapters/identity.d.ts +4 -0
- package/dist/contracts/adapters/identity.d.ts.map +1 -1
- package/dist/contracts/adapters/identity.js +4 -2
- package/dist/contracts/adapters/identity.js.map +1 -1
- package/dist/contracts/adapters/index.d.ts +7 -1
- package/dist/contracts/adapters/index.d.ts.map +1 -1
- package/dist/contracts/adapters/index.js +6 -4
- package/dist/contracts/adapters/index.js.map +1 -1
- package/dist/contracts/adapters/job-queue.d.ts +55 -0
- package/dist/contracts/adapters/job-queue.d.ts.map +1 -1
- package/dist/contracts/adapters/job-queue.js +11 -9
- package/dist/contracts/adapters/job-queue.js.map +1 -1
- package/dist/contracts/adapters/login-enforcement.d.ts +8 -0
- package/dist/contracts/adapters/login-enforcement.d.ts.map +1 -1
- package/dist/contracts/adapters/login-enforcement.js +8 -6
- package/dist/contracts/adapters/login-enforcement.js.map +1 -1
- package/dist/contracts/adapters/notification.d.ts +7 -0
- package/dist/contracts/adapters/notification.d.ts.map +1 -1
- package/dist/contracts/adapters/notification.js +7 -5
- package/dist/contracts/adapters/notification.js.map +1 -1
- package/dist/contracts/adapters/outbox.d.ts +14 -0
- package/dist/contracts/adapters/outbox.d.ts.map +1 -1
- package/dist/contracts/adapters/outbox.js +14 -12
- package/dist/contracts/adapters/outbox.js.map +1 -1
- package/dist/contracts/adapters/payment.d.ts +5 -0
- package/dist/contracts/adapters/payment.d.ts.map +1 -1
- package/dist/contracts/adapters/payment.js +5 -3
- package/dist/contracts/adapters/payment.js.map +1 -1
- package/dist/contracts/adapters/player-tags.d.ts +4 -0
- package/dist/contracts/adapters/player-tags.d.ts.map +1 -1
- package/dist/contracts/adapters/player-tags.js.map +1 -1
- package/dist/contracts/adapters/rate-limit.d.ts +17 -0
- package/dist/contracts/adapters/rate-limit.d.ts.map +1 -1
- package/dist/contracts/adapters/rate-limit.js +9 -6
- package/dist/contracts/adapters/rate-limit.js.map +1 -1
- package/dist/contracts/adapters/realtime.d.ts +90 -3
- package/dist/contracts/adapters/realtime.d.ts.map +1 -1
- package/dist/contracts/adapters/realtime.js +24 -22
- package/dist/contracts/adapters/realtime.js.map +1 -1
- package/dist/contracts/adapters/rng.d.ts +11 -0
- package/dist/contracts/adapters/rng.d.ts.map +1 -1
- package/dist/contracts/adapters/rng.js +11 -9
- package/dist/contracts/adapters/rng.js.map +1 -1
- package/dist/contracts/adapters/sms.d.ts +6 -0
- package/dist/contracts/adapters/sms.d.ts.map +1 -1
- package/dist/contracts/adapters/sms.js +6 -4
- package/dist/contracts/adapters/sms.js.map +1 -1
- package/dist/contracts/adapters/tag-evaluation-commands.d.ts +10 -0
- package/dist/contracts/adapters/tag-evaluation-commands.d.ts.map +1 -1
- package/dist/contracts/adapters/tag-evaluation-commands.js +10 -8
- package/dist/contracts/adapters/tag-evaluation-commands.js.map +1 -1
- package/dist/contracts/adapters/token.d.ts +21 -1
- package/dist/contracts/adapters/token.d.ts.map +1 -1
- package/dist/contracts/adapters/token.js +6 -4
- package/dist/contracts/adapters/token.js.map +1 -1
- package/dist/contracts/adapters/wallet-commands.d.ts +4 -0
- package/dist/contracts/adapters/wallet-commands.d.ts.map +1 -1
- package/dist/contracts/adapters/wallet-commands.js.map +1 -1
- package/dist/contracts/schemas/igaming-config.d.ts +25 -1
- package/dist/contracts/schemas/igaming-config.d.ts.map +1 -1
- package/dist/contracts/schemas/igaming-config.js +2 -1
- package/dist/contracts/schemas/igaming-config.js.map +1 -1
- package/dist/engagement/chat/plugin.d.ts +107 -1
- package/dist/engagement/chat/plugin.d.ts.map +1 -1
- package/dist/engagement/chat/plugin.js +3 -3
- package/dist/engagement/chat/plugin.js.map +1 -1
- package/dist/engagement/chat-commands/plugin.d.ts +107 -1
- package/dist/engagement/chat-commands/plugin.d.ts.map +1 -1
- package/dist/engagement/chat-commands/plugin.js +3 -3
- package/dist/engagement/chat-commands/plugin.js.map +1 -1
- package/dist/engagement/notifications/plugin.d.ts +108 -1
- package/dist/engagement/notifications/plugin.d.ts.map +1 -1
- package/dist/engagement/notifications/plugin.js +3 -3
- package/dist/engagement/notifications/plugin.js.map +1 -1
- package/dist/iam/__tests__/iam.service.int.test.js +49 -1
- package/dist/iam/__tests__/iam.service.int.test.js.map +1 -1
- package/dist/iam/contract/index.d.ts +10 -0
- package/dist/iam/contract/index.d.ts.map +1 -1
- package/dist/iam/contract/index.js +4 -0
- package/dist/iam/contract/index.js.map +1 -1
- package/dist/iam/plugin.d.ts +107 -1
- package/dist/iam/plugin.d.ts.map +1 -1
- package/dist/iam/plugin.js +5 -5
- package/dist/iam/plugin.js.map +1 -1
- package/dist/iam/router/index.d.ts +10 -0
- package/dist/iam/router/index.d.ts.map +1 -1
- package/dist/iam/router/index.js +4 -0
- package/dist/iam/router/index.js.map +1 -1
- package/dist/iam/service/iam.service.d.ts +11 -3
- package/dist/iam/service/iam.service.d.ts.map +1 -1
- package/dist/iam/service/iam.service.js +20 -1
- package/dist/iam/service/iam.service.js.map +1 -1
- package/dist/pam/identity/plugin.d.ts +106 -1
- package/dist/pam/identity/plugin.d.ts.map +1 -1
- package/dist/pam/identity/plugin.js +3 -3
- package/dist/pam/identity/plugin.js.map +1 -1
- package/dist/pam/player-management/plugin.d.ts +107 -1
- package/dist/pam/player-management/plugin.d.ts.map +1 -1
- package/dist/pam/player-management/plugin.js +3 -3
- package/dist/pam/player-management/plugin.js.map +1 -1
- package/dist/pam/player-management/service/kyc-status-writer.d.ts +1 -1
- package/dist/pam/player-management/service/kyc-status-writer.js +1 -1
- package/dist/pam/player-note/plugin.d.ts +106 -1
- package/dist/pam/player-note/plugin.d.ts.map +1 -1
- package/dist/pam/player-note/plugin.js +3 -3
- package/dist/pam/player-note/plugin.js.map +1 -1
- package/dist/pam/profile/plugin.d.ts +106 -1
- package/dist/pam/profile/plugin.d.ts.map +1 -1
- package/dist/pam/profile/plugin.js +3 -3
- package/dist/pam/profile/plugin.js.map +1 -1
- package/dist/pam/tag/plugin.d.ts +107 -1
- package/dist/pam/tag/plugin.d.ts.map +1 -1
- package/dist/pam/tag/plugin.js +3 -3
- package/dist/pam/tag/plugin.js.map +1 -1
- package/dist/server/kernel/container.d.ts +6 -7
- package/dist/server/kernel/container.d.ts.map +1 -1
- package/dist/server/kernel/container.js +3 -0
- package/dist/server/kernel/container.js.map +1 -1
- package/dist/server/plugin-host/__tests__/core-plugins.test.js +1 -1
- package/dist/server/plugin-host/__tests__/core-plugins.test.js.map +1 -1
- package/dist/server/plugin-host/__tests__/load-plugins.test.js +10 -1
- package/dist/server/plugin-host/__tests__/load-plugins.test.js.map +1 -1
- package/dist/server/plugin-host/__tests__/module-registry.test.js.map +1 -1
- package/dist/server/plugin-host/__tests__/required-ports.test.js +1 -0
- package/dist/server/plugin-host/__tests__/required-ports.test.js.map +1 -1
- package/dist/server/plugin-host/__tests__/typed-plugin.test.js +56 -17
- package/dist/server/plugin-host/__tests__/typed-plugin.test.js.map +1 -1
- package/dist/server/plugin-host/core-plugins.js +19 -19
- package/dist/server/plugin-host/core-plugins.js.map +1 -1
- package/dist/server/plugin-host/define-plugin.d.ts +20 -21
- package/dist/server/plugin-host/define-plugin.d.ts.map +1 -1
- package/dist/server/plugin-host/define-plugin.js +1 -8
- package/dist/server/plugin-host/define-plugin.js.map +1 -1
- package/dist/server/plugin-host/index.d.ts +2 -3
- package/dist/server/plugin-host/index.d.ts.map +1 -1
- package/dist/server/plugin-host/index.js +1 -2
- package/dist/server/plugin-host/index.js.map +1 -1
- package/dist/server/plugin-host/load-plugins.d.ts +6 -21
- package/dist/server/plugin-host/load-plugins.d.ts.map +1 -1
- package/dist/server/plugin-host/load-plugins.js +9 -4
- package/dist/server/plugin-host/load-plugins.js.map +1 -1
- package/dist/server/plugin-host/module-registry.d.ts +8 -13
- package/dist/server/plugin-host/module-registry.d.ts.map +1 -1
- package/dist/server/plugin-host/module-registry.js +2 -9
- package/dist/server/plugin-host/module-registry.js.map +1 -1
- package/dist/server/runtime/__tests__/create-app.test.js +8 -3
- package/dist/server/runtime/__tests__/create-app.test.js.map +1 -1
- package/dist/server/runtime/core-token-catalog.d.ts +106 -0
- package/dist/server/runtime/core-token-catalog.d.ts.map +1 -0
- package/dist/server/runtime/core-token-catalog.js +53 -0
- package/dist/server/runtime/core-token-catalog.js.map +1 -0
- package/dist/server/runtime/create-app.d.ts +3 -14
- package/dist/server/runtime/create-app.d.ts.map +1 -1
- package/dist/server/runtime/create-app.js +13 -17
- package/dist/server/runtime/create-app.js.map +1 -1
- package/dist/server/runtime/index.d.ts +2 -3
- package/dist/server/runtime/index.d.ts.map +1 -1
- package/dist/server/runtime/index.js +0 -2
- package/dist/server/runtime/index.js.map +1 -1
- package/dist/wallet/plugin.d.ts +107 -1
- package/dist/wallet/plugin.d.ts.map +1 -1
- package/dist/wallet/plugin.js +3 -3
- package/dist/wallet/plugin.js.map +1 -1
- package/generators/src/config.ts +1 -28
- package/generators/src/templates/adapter.hbs +3 -3
- package/generators/src/templates/contract.hbs +1 -1
- package/generators/src/templates/job-worker.hbs +3 -3
- package/generators/src/templates/module/plugin.hbs +4 -3
- package/generators/src/templates/plugin.hbs +3 -3
- package/package.json +1 -1
- package/dist/server/runtime/openapi.d.ts +0 -15
- package/dist/server/runtime/openapi.d.ts.map +0 -1
- package/dist/server/runtime/openapi.js +0 -26
- package/dist/server/runtime/openapi.js.map +0 -1
- package/generators/src/templates/module/agents.hbs +0 -17
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Push port for Responsible-Gambling login enforcement. Owned + bound by the identity
|
|
3
|
+
* module (it owns the `user` table); compliance depends only on this port to block or
|
|
4
|
+
* unblock a player's login, never on the identity schema. `block` also revokes all of
|
|
5
|
+
* the player's active sessions (the RG session-termination requirement). `until: null`
|
|
6
|
+
* means an indefinite block (self-exclusion / permanent); a Date is the cooling-off
|
|
7
|
+
* expiry the login gate auto-clears once elapsed. See ADR-0017.
|
|
8
|
+
*/
|
|
7
9
|
import { createToken } from './token.js';
|
|
8
10
|
export const LOGIN_ENFORCEMENT = createToken('LOGIN_ENFORCEMENT');
|
|
9
11
|
//# sourceMappingURL=login-enforcement.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"login-enforcement.js","sourceRoot":"","sources":["../../../src/contracts/adapters/login-enforcement.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"login-enforcement.js","sourceRoot":"","sources":["../../../src/contracts/adapters/login-enforcement.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,WAAW,EAAc,MAAM,YAAY,CAAC;AAOrD,MAAM,CAAC,MAAM,iBAAiB,GAAgC,WAAW,CAAC,mBAAmB,CAAC,CAAC"}
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Notification-delivery seam. Custom implementation expected (no prescribed vendor).
|
|
3
|
+
* The notifications module ships MockNotificationDeliveryAdapter (logs to stdout) as default.
|
|
4
|
+
* Override via overlay: ctx.provide(NOTIFICATION_DELIVERY_ADAPTER, () => new MyAdapter())
|
|
5
|
+
* Load your overlay AFTER the notifications plugin in extensions.config.ts (last registration wins).
|
|
6
|
+
* See docs/adapters/notification.md for the full binding guide.
|
|
7
|
+
*/
|
|
1
8
|
import { type Token } from './token.js';
|
|
2
9
|
export type NotificationDeliveryAdapter = {
|
|
3
10
|
sendEmail(to: string, subject: string, body: string): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notification.d.ts","sourceRoot":"","sources":["../../../src/contracts/adapters/notification.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"notification.d.ts","sourceRoot":"","sources":["../../../src/contracts/adapters/notification.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAe,KAAK,KAAK,EAAE,MAAM,YAAY,CAAC;AAErD,MAAM,MAAM,2BAA2B,GAAG;IACxC,SAAS,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACrE,CAAC;AAEF,eAAO,MAAM,6BAA6B,EAAE,KAAK,CAAC,2BAA2B,CAE5E,CAAC"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Notification-delivery seam. Custom implementation expected (no prescribed vendor).
|
|
3
|
+
* The notifications module ships MockNotificationDeliveryAdapter (logs to stdout) as default.
|
|
4
|
+
* Override via overlay: ctx.provide(NOTIFICATION_DELIVERY_ADAPTER, () => new MyAdapter())
|
|
5
|
+
* Load your overlay AFTER the notifications plugin in extensions.config.ts (last registration wins).
|
|
6
|
+
* See docs/adapters/notification.md for the full binding guide.
|
|
7
|
+
*/
|
|
6
8
|
import { createToken } from './token.js';
|
|
7
9
|
export const NOTIFICATION_DELIVERY_ADAPTER = createToken('NOTIFICATION_DELIVERY_ADAPTER');
|
|
8
10
|
//# sourceMappingURL=notification.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notification.js","sourceRoot":"","sources":["../../../src/contracts/adapters/notification.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"notification.js","sourceRoot":"","sources":["../../../src/contracts/adapters/notification.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,WAAW,EAAc,MAAM,YAAY,CAAC;AAMrD,MAAM,CAAC,MAAM,6BAA6B,GAAuC,WAAW,CAC1F,+BAA+B,CAChC,CAAC"}
|
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Transactional-outbox seam. A money/critical service, INSIDE its db.transaction,
|
|
3
|
+
* records the event through this port; the row commits atomically with the state
|
|
4
|
+
* change. A relay then publishes it to the MESSAGE_BROKER after commit, closing
|
|
5
|
+
* the gap where a crash between "state committed" and "event published" would
|
|
6
|
+
* otherwise lose the event. This is the primitive that makes cross-service,
|
|
7
|
+
* at-least-once domain events reliable - and the reason a module can be extracted
|
|
8
|
+
* to its own process without dropping events. See ADR-0016.
|
|
9
|
+
*
|
|
10
|
+
* `tx` is the active transaction handle, typed `unknown` here to keep @openora/core/contracts
|
|
11
|
+
* ORM-free; the Drizzle implementation in @openora/core/server narrows it. Services never touch
|
|
12
|
+
* this port directly - they call EventBus.emitInTransaction(tx, ...), which builds
|
|
13
|
+
* the envelope and delegates here.
|
|
14
|
+
*/
|
|
1
15
|
import { type Token } from './token.js';
|
|
2
16
|
import type { EventEnvelope } from './broker.js';
|
|
3
17
|
export type OutboxWriter = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"outbox.d.ts","sourceRoot":"","sources":["../../../src/contracts/adapters/outbox.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"outbox.d.ts","sourceRoot":"","sources":["../../../src/contracts/adapters/outbox.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAe,KAAK,KAAK,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD,MAAM,MAAM,YAAY,GAAG;IACzB,KAAK,CAAC,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC5D,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,YAAY,CAAyB,CAAC"}
|
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Transactional-outbox seam. A money/critical service, INSIDE its db.transaction,
|
|
3
|
+
* records the event through this port; the row commits atomically with the state
|
|
4
|
+
* change. A relay then publishes it to the MESSAGE_BROKER after commit, closing
|
|
5
|
+
* the gap where a crash between "state committed" and "event published" would
|
|
6
|
+
* otherwise lose the event. This is the primitive that makes cross-service,
|
|
7
|
+
* at-least-once domain events reliable - and the reason a module can be extracted
|
|
8
|
+
* to its own process without dropping events. See ADR-0016.
|
|
9
|
+
*
|
|
10
|
+
* `tx` is the active transaction handle, typed `unknown` here to keep @openora/core/contracts
|
|
11
|
+
* ORM-free; the Drizzle implementation in @openora/core/server narrows it. Services never touch
|
|
12
|
+
* this port directly - they call EventBus.emitInTransaction(tx, ...), which builds
|
|
13
|
+
* the envelope and delegates here.
|
|
14
|
+
*/
|
|
13
15
|
import { createToken } from './token.js';
|
|
14
16
|
export const OUTBOX = createToken('OUTBOX');
|
|
15
17
|
//# sourceMappingURL=outbox.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"outbox.js","sourceRoot":"","sources":["../../../src/contracts/adapters/outbox.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"outbox.js","sourceRoot":"","sources":["../../../src/contracts/adapters/outbox.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAE,WAAW,EAAc,MAAM,YAAY,CAAC;AAOrD,MAAM,CAAC,MAAM,MAAM,GAAwB,WAAW,CAAC,QAAQ,CAAC,CAAC"}
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Payment seam. A PSP (card/bank/e-wallet) or a custody/address-issuing crypto vendor
|
|
3
|
+
* implements PaymentAdapter; bind a concrete adapter to PAYMENT_ADAPTER in the wallet
|
|
4
|
+
* module's plugin.ts. See docs/adapters/payment.md for the full binding guide.
|
|
5
|
+
*/
|
|
1
6
|
import { type Token } from './token.js';
|
|
2
7
|
/**
|
|
3
8
|
* Normalized shape of an inbound payment-vendor webhook, produced by a
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"payment.d.ts","sourceRoot":"","sources":["../../../src/contracts/adapters/payment.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"payment.d.ts","sourceRoot":"","sources":["../../../src/contracts/adapters/payment.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAe,KAAK,KAAK,EAAE,MAAM,YAAY,CAAC;AAErD;;;;;;;GAOG;AACH,MAAM,MAAM,mBAAmB,GAC3B;IACE,IAAI,EAAE,SAAS,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;CACpB,GACD;IACE,IAAI,EAAE,YAAY,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,YAAY,GAAG,WAAW,GAAG,QAAQ,CAAC;IAC9C,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEN,MAAM,MAAM,cAAc,GAAG;IAC3B,cAAc,CACZ,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAChC,OAAO,CAAC;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAEnD;;;;;;;;OAQG;IACH,iBAAiB,CACf,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAChC,OAAO,CAAC;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAEnD;;;;;;OAMG;IACH,mBAAmB,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAErF;;;;OAIG;IACH,YAAY,CAAC,CACX,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAAC,GACrD,mBAAmB,GAAG,IAAI,CAAC;CAC/B,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,cAAc,CAAkC,CAAC;AAErF;;;;;;GAMG;AACH,MAAM,MAAM,sBAAsB,GAAG;IACnC,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAAC,GAAG,OAAO,CAAC;CAC1F,CAAC;AAEF,eAAO,MAAM,wBAAwB,EAAE,KAAK,CAAC,sBAAsB,CAElE,CAAC"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Payment seam. A PSP (card/bank/e-wallet) or a custody/address-issuing crypto vendor
|
|
3
|
+
* implements PaymentAdapter; bind a concrete adapter to PAYMENT_ADAPTER in the wallet
|
|
4
|
+
* module's plugin.ts. See docs/adapters/payment.md for the full binding guide.
|
|
5
|
+
*/
|
|
4
6
|
import { createToken } from './token.js';
|
|
5
7
|
export const PAYMENT_ADAPTER = createToken('PAYMENT_ADAPTER');
|
|
6
8
|
export const PAYMENT_WEBHOOK_VERIFIER = createToken('PAYMENT_WEBHOOK_VERIFIER');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"payment.js","sourceRoot":"","sources":["../../../src/contracts/adapters/payment.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"payment.js","sourceRoot":"","sources":["../../../src/contracts/adapters/payment.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,WAAW,EAAc,MAAM,YAAY,CAAC;AAoErD,MAAM,CAAC,MAAM,eAAe,GAA0B,WAAW,CAAC,iBAAiB,CAAC,CAAC;AAarF,MAAM,CAAC,MAAM,wBAAwB,GAAkC,WAAW,CAChF,0BAA0B,CAC3B,CAAC"}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { type Token } from './token.js';
|
|
2
2
|
import type { TagKey } from '../schemas/tag.js';
|
|
3
|
+
/**
|
|
4
|
+
* Read-only seam letting the wallet auto-withdrawal evaluator query a player's tags
|
|
5
|
+
* without importing the tag module's schema (module isolation). Absent from the map == no active tags.
|
|
6
|
+
*/
|
|
3
7
|
export type PlayerTags = {
|
|
4
8
|
getActiveTagKeys(userIds: readonly string[]): Promise<Map<string, TagKey[]>>;
|
|
5
9
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"player-tags.d.ts","sourceRoot":"","sources":["../../../src/contracts/adapters/player-tags.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,KAAK,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"player-tags.d.ts","sourceRoot":"","sources":["../../../src/contracts/adapters/player-tags.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,KAAK,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAEhD;;;GAGG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB,gBAAgB,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC;CAC9E,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,UAAU,CAA8B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"player-tags.js","sourceRoot":"","sources":["../../../src/contracts/adapters/player-tags.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAc,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"player-tags.js","sourceRoot":"","sources":["../../../src/contracts/adapters/player-tags.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAc,MAAM,YAAY,CAAC;AAWrD,MAAM,CAAC,MAAM,WAAW,GAAsB,WAAW,CAAC,aAAa,CAAC,CAAC"}
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Rate-limiter seam. Abuse-prone routes (auth flows, money mutations) consume
|
|
3
|
+
* from this adapter so the throttling backend is swappable: the default binding
|
|
4
|
+
* is an in-process fixed-window limiter (zero deps - good for `pnpm dev`, seed
|
|
5
|
+
* and tests), process-local so it does NOT coordinate across replicas. Set
|
|
6
|
+
* REDIS_URL to bind the shipped Redis reference adapter (distributed fixed-window)
|
|
7
|
+
* with zero consumer code; rebind RATE_LIMITER via an overlay for any other backend.
|
|
8
|
+
*/
|
|
1
9
|
import { type Token } from './token.js';
|
|
2
10
|
export declare const RATE_LIMIT_KEYS: {
|
|
3
11
|
readonly REGISTER: "register";
|
|
@@ -14,17 +22,26 @@ export declare const RATE_LIMIT_KEYS: {
|
|
|
14
22
|
readonly WALLET_MUTATION: "wallet-mutation";
|
|
15
23
|
readonly CHAT_ROOM_JOIN: "chat-room-join";
|
|
16
24
|
readonly CHAT_SEND: "chat-send";
|
|
25
|
+
readonly REPORT_ACCESS_DENIED: "report-access-denied";
|
|
17
26
|
};
|
|
18
27
|
export type RateLimitKeyPrefix = (typeof RATE_LIMIT_KEYS)[keyof typeof RATE_LIMIT_KEYS];
|
|
19
28
|
export type RateLimitKey = `${RateLimitKeyPrefix}:${string}`;
|
|
20
29
|
export declare function makeRateLimitKey(prefix: RateLimitKeyPrefix, id: string): RateLimitKey;
|
|
21
30
|
export type RateLimitOptions = {
|
|
31
|
+
/** Max allowed consumptions per window per key. */
|
|
22
32
|
limit: number;
|
|
23
33
|
windowMs: number;
|
|
34
|
+
/**
|
|
35
|
+
* What to do when the backing store is unreachable: 'allow' keeps availability
|
|
36
|
+
* (throttling pauses during an outage); 'deny' fails closed for keys where an
|
|
37
|
+
* unthrottled window is worse than a 429 (credential guessing). Default 'allow'.
|
|
38
|
+
* The in-process default is never unavailable, so it ignores this.
|
|
39
|
+
*/
|
|
24
40
|
onUnavailable?: 'allow' | 'deny';
|
|
25
41
|
};
|
|
26
42
|
export type RateLimitResult = {
|
|
27
43
|
allowed: boolean;
|
|
44
|
+
/** Milliseconds until the window resets. 0 when allowed. */
|
|
28
45
|
retryAfterMs: number;
|
|
29
46
|
};
|
|
30
47
|
export type RateLimiterAdapter<Key extends string = string> = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rate-limit.d.ts","sourceRoot":"","sources":["../../../src/contracts/adapters/rate-limit.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"rate-limit.d.ts","sourceRoot":"","sources":["../../../src/contracts/adapters/rate-limit.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAe,KAAK,KAAK,EAAE,MAAM,YAAY,CAAC;AAErD,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;CAgBlB,CAAC;AAEX,MAAM,MAAM,kBAAkB,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,OAAO,eAAe,CAAC,CAAC;AAExF,MAAM,MAAM,YAAY,GAAG,GAAG,kBAAkB,IAAI,MAAM,EAAE,CAAC;AAE7D,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,kBAAkB,EAAE,EAAE,EAAE,MAAM,GAAG,YAAY,CAErF;AAED,MAAM,MAAM,gBAAgB,GAAG;IAC7B,mDAAmD;IACnD,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;;OAKG;IACH,aAAa,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;CAClC,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,OAAO,EAAE,OAAO,CAAC;IACjB,4DAA4D;IAC5D,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,kBAAkB,CAAC,GAAG,SAAS,MAAM,GAAG,MAAM,IAAI;IAC5D,OAAO,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,gBAAgB,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;IACpE,KAAK,CAAC,GAAG,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAChC,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,kBAAkB,CAAC,YAAY,CAAC,CAA+B,CAAC"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Rate-limiter seam. Abuse-prone routes (auth flows, money mutations) consume
|
|
3
|
+
* from this adapter so the throttling backend is swappable: the default binding
|
|
4
|
+
* is an in-process fixed-window limiter (zero deps - good for `pnpm dev`, seed
|
|
5
|
+
* and tests), process-local so it does NOT coordinate across replicas. Set
|
|
6
|
+
* REDIS_URL to bind the shipped Redis reference adapter (distributed fixed-window)
|
|
7
|
+
* with zero consumer code; rebind RATE_LIMITER via an overlay for any other backend.
|
|
8
|
+
*/
|
|
7
9
|
import { createToken } from './token.js';
|
|
8
10
|
export const RATE_LIMIT_KEYS = {
|
|
9
11
|
REGISTER: 'register',
|
|
@@ -20,6 +22,7 @@ export const RATE_LIMIT_KEYS = {
|
|
|
20
22
|
WALLET_MUTATION: 'wallet-mutation',
|
|
21
23
|
CHAT_ROOM_JOIN: 'chat-room-join',
|
|
22
24
|
CHAT_SEND: 'chat-send',
|
|
25
|
+
REPORT_ACCESS_DENIED: 'report-access-denied',
|
|
23
26
|
};
|
|
24
27
|
export function makeRateLimitKey(prefix, id) {
|
|
25
28
|
return `${prefix}:${id}`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rate-limit.js","sourceRoot":"","sources":["../../../src/contracts/adapters/rate-limit.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"rate-limit.js","sourceRoot":"","sources":["../../../src/contracts/adapters/rate-limit.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,WAAW,EAAc,MAAM,YAAY,CAAC;AAErD,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,QAAQ,EAAE,UAAU;IACpB,KAAK,EAAE,OAAO;IACd,UAAU,EAAE,WAAW;IACvB,UAAU,EAAE,WAAW;IACvB,WAAW,EAAE,YAAY;IACzB,sBAAsB,EAAE,aAAa;IACrC,qBAAqB,EAAE,gBAAgB;IACvC,cAAc,EAAE,SAAS;IACzB,eAAe,EAAE,iBAAiB;IAClC,kBAAkB,EAAE,cAAc;IAClC,YAAY,EAAE,cAAc;IAC5B,eAAe,EAAE,iBAAiB;IAClC,cAAc,EAAE,gBAAgB;IAChC,SAAS,EAAE,WAAW;IACtB,oBAAoB,EAAE,sBAAsB;CACpC,CAAC;AAMX,MAAM,UAAU,gBAAgB,CAAC,MAA0B,EAAE,EAAU;IACrE,OAAO,GAAG,MAAM,IAAI,EAAE,EAAE,CAAC;AAC3B,CAAC;AA0BD,MAAM,CAAC,MAAM,YAAY,GAA4C,WAAW,CAAC,cAAc,CAAC,CAAC"}
|
|
@@ -1,39 +1,126 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Realtime-transport seam. Client-facing push (live chat messages, PvP round
|
|
3
|
+
* state, live odds, big-win/jackpot feeds) flows through this adapter, so the
|
|
4
|
+
* transport is swappable: the default binding is a first-party in-process
|
|
5
|
+
* fan-out (served to clients as oRPC event-iterators over SSE); a downstream
|
|
6
|
+
* operator binds a managed transport (Ably / GetStream / PubNub) to
|
|
7
|
+
* REALTIME_TRANSPORT without touching modules. This realizes ADR-0007's
|
|
8
|
+
* `ChatTransportPort` as a generic primitive shared across modules - it is NOT
|
|
9
|
+
* the inter-module MESSAGE_BROKER (ADR-0010 #4 keeps client push separate from
|
|
10
|
+
* the event broker, which has delivery guarantees/acks). Money and moderation
|
|
11
|
+
* stay first-party domain logic; they are never delegated to the transport.
|
|
12
|
+
*
|
|
13
|
+
* CHAT_REALTIME_TRANSPORT / CHAT_REALTIME_CLIENT_AUTHORIZER are the SAME two
|
|
14
|
+
* port shapes, scoped to chat only. The chat module defaults them to whatever
|
|
15
|
+
* REALTIME_TRANSPORT/REALTIME_CLIENT_AUTHORIZER resolve to (so out of the box
|
|
16
|
+
* chat behaves identically to every other realtime consumer), but an operator
|
|
17
|
+
* can rebind just the CHAT_-prefixed tokens to run chat on a managed vendor
|
|
18
|
+
* (eg Ably) while KYC status updates and everything else stay first-party SSE
|
|
19
|
+
* - the two seams are independently swappable. `chat-commands` shares the SAME
|
|
20
|
+
* chat channels (gift claims, rain), so it consumes CHAT_REALTIME_TRANSPORT
|
|
21
|
+
* too, never the generic token.
|
|
22
|
+
*/
|
|
1
23
|
import { type Token } from './token.js';
|
|
24
|
+
/**
|
|
25
|
+
* Optional presence capability. A first-party transport can offer a simple
|
|
26
|
+
* connected-member count; managed vendors provide richer presence. Kept optional
|
|
27
|
+
* (a capability flag, per ADR-0007) so the base port is the common denominator.
|
|
28
|
+
*/
|
|
2
29
|
export type RealtimePresence = {
|
|
30
|
+
/**
|
|
31
|
+
* `connectionId` distinguishes concurrent tabs for the same member. Counts remain
|
|
32
|
+
* per member, so one tab leaving never marks a user offline while another is active.
|
|
33
|
+
*/
|
|
3
34
|
join(channel: string, memberId: string, connectionId: string): void;
|
|
4
35
|
leave(channel: string, memberId: string, connectionId: string): void;
|
|
5
36
|
count(channel: string): number | Promise<number>;
|
|
6
37
|
};
|
|
7
38
|
export type RealtimeTransport = {
|
|
39
|
+
/**
|
|
40
|
+
* Fan a message out to every subscriber of `channel`. Best-effort, at-most-once
|
|
41
|
+
* for late joiners (the transport is not a system of record - persist first).
|
|
42
|
+
*/
|
|
8
43
|
publish<T>(channel: string, event: T): void | Promise<void>;
|
|
44
|
+
/**
|
|
45
|
+
* Subscribe a handler to a channel. Returns an unsubscribe fn the caller MUST
|
|
46
|
+
* invoke on teardown (eg an SSE handler on request abort).
|
|
47
|
+
*/
|
|
9
48
|
subscribe<T>(channel: string, handler: (event: T) => void): () => void;
|
|
49
|
+
/** Revoke managed-provider credentials for a client after access is removed. */
|
|
10
50
|
revokeClient?: (clientId: string) => void | Promise<void>;
|
|
11
51
|
presence?: RealtimePresence;
|
|
52
|
+
/**
|
|
53
|
+
* Returns the set of authenticated user IDs currently online in `channel`.
|
|
54
|
+
* Anonymous connections (memberIds beginning with 'anonymous:') are excluded.
|
|
55
|
+
*/
|
|
12
56
|
getOnlineUserIds(channel: string): Promise<string[]>;
|
|
13
57
|
};
|
|
14
58
|
export declare const REALTIME_TRANSPORT: Token<RealtimeTransport>;
|
|
59
|
+
/** Chat-scoped realtime transport - see the module header comment above. */
|
|
15
60
|
export declare const CHAT_REALTIME_TRANSPORT: Token<RealtimeTransport>;
|
|
16
|
-
|
|
61
|
+
/**
|
|
62
|
+
* Client connection provisioning - the complement to REALTIME_TRANSPORT.
|
|
63
|
+
*
|
|
64
|
+
* REALTIME_TRANSPORT is how the SERVER fans a message out. This seam is how a
|
|
65
|
+
* CLIENT learns to CONNECT and receive. The two models differ by provider:
|
|
66
|
+
* - first-party (default): the client pulls from our own API over SSE, so the
|
|
67
|
+
* "grant" is just the stream path - no secret, the session cookie authorizes.
|
|
68
|
+
* - managed vendor (Ably/GetStream/PubNub): the client connects DIRECTLY to the
|
|
69
|
+
* vendor edge, so the backend must mint a per-player, capability-scoped token
|
|
70
|
+
* (never ship the vendor API key to the browser). The grant carries that token.
|
|
71
|
+
* A downstream operator binds this token to its provider's authorizer without any
|
|
72
|
+
* module change; the chat module just hands the grant to the caller. See ADR-0007.
|
|
73
|
+
*/
|
|
74
|
+
/**
|
|
75
|
+
* What the client needs to start receiving, tagged by `provider` so a pluggable
|
|
76
|
+
* client-side adapter can pick the right transport. Open union - a new vendor adds
|
|
77
|
+
* its own variant without editing core.
|
|
78
|
+
*/
|
|
79
|
+
export type RealtimeConnectionGrant =
|
|
80
|
+
/** First-party SSE: subscribe by opening this event-iterator path on our API. */
|
|
81
|
+
{
|
|
17
82
|
provider: 'sse';
|
|
18
83
|
streamPath: string;
|
|
19
84
|
channels: string[];
|
|
20
|
-
}
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Ably: a signed TokenRequest the browser exchanges for a scoped token, plus the
|
|
88
|
+
* channels the player may subscribe to. `tokenRequest` is opaque here (the Ably
|
|
89
|
+
* SDK shape lives in the consumer, not in vendor-neutral core).
|
|
90
|
+
*/
|
|
91
|
+
| {
|
|
21
92
|
provider: 'ably';
|
|
22
93
|
tokenRequest: unknown;
|
|
23
94
|
channels: string[];
|
|
24
|
-
}
|
|
95
|
+
}
|
|
96
|
+
/** Escape hatch for any other vendor (GetStream, PubNub, ...). */
|
|
97
|
+
| {
|
|
25
98
|
provider: string;
|
|
26
99
|
channels: string[];
|
|
27
100
|
[key: string]: unknown;
|
|
28
101
|
};
|
|
29
102
|
export type RealtimeClientAuthorizerInput = {
|
|
103
|
+
/**
|
|
104
|
+
* The authenticated caller; becomes the vendor `clientId` so presence/identity
|
|
105
|
+
* is bound server-side and cannot be spoofed by the browser.
|
|
106
|
+
*/
|
|
30
107
|
userId: string;
|
|
108
|
+
/** A stable per-connection id from the client (defaults to userId when absent). */
|
|
31
109
|
clientId: string;
|
|
110
|
+
/**
|
|
111
|
+
* The channels the caller is allowed to subscribe to (the module computes these
|
|
112
|
+
* from the player's access - eg the global channel plus their rooms).
|
|
113
|
+
*/
|
|
32
114
|
channels: string[];
|
|
33
115
|
};
|
|
34
116
|
export type RealtimeClientAuthorizer = {
|
|
117
|
+
/**
|
|
118
|
+
* Mint a connection grant for an authenticated caller. Async because a managed
|
|
119
|
+
* vendor signs a token request over its SDK.
|
|
120
|
+
*/
|
|
35
121
|
issueGrant(input: RealtimeClientAuthorizerInput): RealtimeConnectionGrant | Promise<RealtimeConnectionGrant>;
|
|
36
122
|
};
|
|
37
123
|
export declare const REALTIME_CLIENT_AUTHORIZER: Token<RealtimeClientAuthorizer>;
|
|
124
|
+
/** Chat-scoped client authorizer - see the module header comment above. */
|
|
38
125
|
export declare const CHAT_REALTIME_CLIENT_AUTHORIZER: Token<RealtimeClientAuthorizer>;
|
|
39
126
|
//# sourceMappingURL=realtime.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"realtime.d.ts","sourceRoot":"","sources":["../../../src/contracts/adapters/realtime.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"realtime.d.ts","sourceRoot":"","sources":["../../../src/contracts/adapters/realtime.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,OAAO,EAAe,KAAK,KAAK,EAAE,MAAM,YAAY,CAAC;AAErD;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B;;;OAGG;IACH,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IACpE,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IACrE,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CAClD,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;;OAGG;IACH,OAAO,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5D;;;OAGG;IACH,SAAS,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,GAAG,MAAM,IAAI,CAAC;IACvE,gFAAgF;IAChF,YAAY,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1D,QAAQ,CAAC,EAAE,gBAAgB,CAAC;IAC5B;;;OAGG;IACH,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;CACtD,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,iBAAiB,CAAqC,CAAC;AAE9F,4EAA4E;AAC5E,eAAO,MAAM,uBAAuB,EAAE,KAAK,CAAC,iBAAiB,CACrB,CAAC;AAEzC;;;;;;;;;;;;GAYG;AAEH;;;;GAIG;AACH,MAAM,MAAM,uBAAuB;AACjC,iFAAiF;AAC/E;IAAE,QAAQ,EAAE,KAAK,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,EAAE,CAAA;CAAE;AAC7D;;;;GAIG;GACD;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,OAAO,CAAC;IAAC,QAAQ,EAAE,MAAM,EAAE,CAAA;CAAE;AACjE,kEAAkE;GAChE;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,EAAE,CAAC;IAAC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE,CAAC;AAErE,MAAM,MAAM,6BAA6B,GAAG;IAC1C;;;OAGG;IACH,MAAM,EAAE,MAAM,CAAC;IACf,mFAAmF;IACnF,QAAQ,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG;IACrC;;;OAGG;IACH,UAAU,CACR,KAAK,EAAE,6BAA6B,GACnC,uBAAuB,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAC;CAC/D,CAAC;AAEF,eAAO,MAAM,0BAA0B,EAAE,KAAK,CAAC,wBAAwB,CAEtE,CAAC;AAEF,2EAA2E;AAC3E,eAAO,MAAM,+BAA+B,EAAE,KAAK,CAAC,wBAAwB,CAE3E,CAAC"}
|
|
@@ -1,28 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Realtime-transport seam. Client-facing push (live chat messages, PvP round
|
|
3
|
+
* state, live odds, big-win/jackpot feeds) flows through this adapter, so the
|
|
4
|
+
* transport is swappable: the default binding is a first-party in-process
|
|
5
|
+
* fan-out (served to clients as oRPC event-iterators over SSE); a downstream
|
|
6
|
+
* operator binds a managed transport (Ably / GetStream / PubNub) to
|
|
7
|
+
* REALTIME_TRANSPORT without touching modules. This realizes ADR-0007's
|
|
8
|
+
* `ChatTransportPort` as a generic primitive shared across modules - it is NOT
|
|
9
|
+
* the inter-module MESSAGE_BROKER (ADR-0010 #4 keeps client push separate from
|
|
10
|
+
* the event broker, which has delivery guarantees/acks). Money and moderation
|
|
11
|
+
* stay first-party domain logic; they are never delegated to the transport.
|
|
12
|
+
*
|
|
13
|
+
* CHAT_REALTIME_TRANSPORT / CHAT_REALTIME_CLIENT_AUTHORIZER are the SAME two
|
|
14
|
+
* port shapes, scoped to chat only. The chat module defaults them to whatever
|
|
15
|
+
* REALTIME_TRANSPORT/REALTIME_CLIENT_AUTHORIZER resolve to (so out of the box
|
|
16
|
+
* chat behaves identically to every other realtime consumer), but an operator
|
|
17
|
+
* can rebind just the CHAT_-prefixed tokens to run chat on a managed vendor
|
|
18
|
+
* (eg Ably) while KYC status updates and everything else stay first-party SSE
|
|
19
|
+
* - the two seams are independently swappable. `chat-commands` shares the SAME
|
|
20
|
+
* chat channels (gift claims, rain), so it consumes CHAT_REALTIME_TRANSPORT
|
|
21
|
+
* too, never the generic token.
|
|
22
|
+
*/
|
|
21
23
|
import { createToken } from './token.js';
|
|
22
24
|
export const REALTIME_TRANSPORT = createToken('REALTIME_TRANSPORT');
|
|
23
|
-
|
|
25
|
+
/** Chat-scoped realtime transport - see the module header comment above. */
|
|
24
26
|
export const CHAT_REALTIME_TRANSPORT = createToken('CHAT_REALTIME_TRANSPORT');
|
|
25
27
|
export const REALTIME_CLIENT_AUTHORIZER = createToken('REALTIME_CLIENT_AUTHORIZER');
|
|
26
|
-
|
|
28
|
+
/** Chat-scoped client authorizer - see the module header comment above. */
|
|
27
29
|
export const CHAT_REALTIME_CLIENT_AUTHORIZER = createToken('CHAT_REALTIME_CLIENT_AUTHORIZER');
|
|
28
30
|
//# sourceMappingURL=realtime.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"realtime.js","sourceRoot":"","sources":["../../../src/contracts/adapters/realtime.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"realtime.js","sourceRoot":"","sources":["../../../src/contracts/adapters/realtime.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,OAAO,EAAE,WAAW,EAAc,MAAM,YAAY,CAAC;AAsCrD,MAAM,CAAC,MAAM,kBAAkB,GAA6B,WAAW,CAAC,oBAAoB,CAAC,CAAC;AAE9F,4EAA4E;AAC5E,MAAM,CAAC,MAAM,uBAAuB,GAClC,WAAW,CAAC,yBAAyB,CAAC,CAAC;AA0DzC,MAAM,CAAC,MAAM,0BAA0B,GAAoC,WAAW,CACpF,4BAA4B,CAC7B,CAAC;AAEF,2EAA2E;AAC3E,MAAM,CAAC,MAAM,+BAA+B,GAAoC,WAAW,CACzF,iCAAiC,CAClC,CAAC"}
|
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Random number generator seam. For dev / demo / non-certified game contexts.
|
|
3
|
+
*
|
|
4
|
+
* IMPORTANT: production game outcomes are governed by the SEALED
|
|
5
|
+
* `GAME_OUTCOME_AUTHORITY` token in `@openora/core/compliance` (regulator
|
|
6
|
+
* mandate - GLI / eCOGRA / BMM / iTechLabs). `RNG_ADAPTER` is NOT a substitute
|
|
7
|
+
* for a lab-certified RGS. Use this seam to swap deterministic mocks in tests,
|
|
8
|
+
* to plug in a seedable provider for replay debugging, or to back demo games
|
|
9
|
+
* that never resolve real money. Real-money RTP must flow through the sealed
|
|
10
|
+
* authority.
|
|
11
|
+
*/
|
|
1
12
|
import { type Token } from './token.js';
|
|
2
13
|
export type RngAdapter = {
|
|
3
14
|
/** Uniform float in [0, 1). */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rng.d.ts","sourceRoot":"","sources":["../../../src/contracts/adapters/rng.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"rng.d.ts","sourceRoot":"","sources":["../../../src/contracts/adapters/rng.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAe,KAAK,KAAK,EAAE,MAAM,YAAY,CAAC;AAErD,MAAM,MAAM,UAAU,GAAG;IACvB,+BAA+B;IAC/B,SAAS,IAAI,MAAM,CAAC;IACpB,8CAA8C;IAC9C,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,MAAM,CAAC;IACnD,qFAAqF;IACrF,IAAI,CAAC,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,UAAU,CAA8B,CAAC"}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Random number generator seam. For dev / demo / non-certified game contexts.
|
|
3
|
+
*
|
|
4
|
+
* IMPORTANT: production game outcomes are governed by the SEALED
|
|
5
|
+
* `GAME_OUTCOME_AUTHORITY` token in `@openora/core/compliance` (regulator
|
|
6
|
+
* mandate - GLI / eCOGRA / BMM / iTechLabs). `RNG_ADAPTER` is NOT a substitute
|
|
7
|
+
* for a lab-certified RGS. Use this seam to swap deterministic mocks in tests,
|
|
8
|
+
* to plug in a seedable provider for replay debugging, or to back demo games
|
|
9
|
+
* that never resolve real money. Real-money RTP must flow through the sealed
|
|
10
|
+
* authority.
|
|
11
|
+
*/
|
|
10
12
|
import { createToken } from './token.js';
|
|
11
13
|
export const RNG_ADAPTER = createToken('RNG_ADAPTER');
|
|
12
14
|
//# sourceMappingURL=rng.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rng.js","sourceRoot":"","sources":["../../../src/contracts/adapters/rng.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"rng.js","sourceRoot":"","sources":["../../../src/contracts/adapters/rng.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,WAAW,EAAc,MAAM,YAAY,CAAC;AAWrD,MAAM,CAAC,MAAM,WAAW,GAAsB,WAAW,CAAC,aAAa,CAAC,CAAC"}
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SMS delivery seam. The phone-login OTP flow sends codes through this adapter so the
|
|
3
|
+
* transport is swappable: the platform default (bound in identity/plugin.ts) is a
|
|
4
|
+
* log-to-stdout mock, safe for dev/stage. A consumer overlay rebinds SMS_ADAPTER to a
|
|
5
|
+
* real vendor (Twilio, AWS SNS) in production. See AGENTS.md "third-party integration".
|
|
6
|
+
*/
|
|
1
7
|
import { type Token } from './token.js';
|
|
2
8
|
export type SmsAdapter = {
|
|
3
9
|
sendOtp(params: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sms.d.ts","sourceRoot":"","sources":["../../../src/contracts/adapters/sms.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sms.d.ts","sourceRoot":"","sources":["../../../src/contracts/adapters/sms.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAe,KAAK,KAAK,EAAE,MAAM,YAAY,CAAC;AAErD,MAAM,MAAM,UAAU,GAAG;IACvB,OAAO,CAAC,MAAM,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC9D,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,UAAU,CAA8B,CAAC"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
/**
|
|
2
|
+
* SMS delivery seam. The phone-login OTP flow sends codes through this adapter so the
|
|
3
|
+
* transport is swappable: the platform default (bound in identity/plugin.ts) is a
|
|
4
|
+
* log-to-stdout mock, safe for dev/stage. A consumer overlay rebinds SMS_ADAPTER to a
|
|
5
|
+
* real vendor (Twilio, AWS SNS) in production. See AGENTS.md "third-party integration".
|
|
6
|
+
*/
|
|
5
7
|
import { createToken } from './token.js';
|
|
6
8
|
export const SMS_ADAPTER = createToken('SMS_ADAPTER');
|
|
7
9
|
//# sourceMappingURL=sms.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sms.js","sourceRoot":"","sources":["../../../src/contracts/adapters/sms.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"sms.js","sourceRoot":"","sources":["../../../src/contracts/adapters/sms.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,WAAW,EAAc,MAAM,YAAY,CAAC;AAMrD,MAAM,CAAC,MAAM,WAAW,GAAsB,WAAW,CAAC,aAAa,CAAC,CAAC"}
|
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tag-evaluation command port: wallet's withdraw() calls this synchronously, on its own
|
|
3
|
+
* transaction handle, so a withdrawal_review assignment is guaranteed to commit before
|
|
4
|
+
* maybeAutoApprove reads risk tags - closing the race an unawaited EventBus emit alone
|
|
5
|
+
* leaves open (`wallet.withdrawal.requested` is still fired for other consumers, but
|
|
6
|
+
* auto-approval's money decision must never depend on that fire-and-forget fan-out; see
|
|
7
|
+
* messaging-and-microservices "money never flows over events"). Mirrors the WALLET_COMMANDS
|
|
8
|
+
* command-port idiom (ADR-0017): `tx: unknown` so the caller's transaction handle threads
|
|
9
|
+
* through without either side importing the other's DB module.
|
|
10
|
+
*/
|
|
1
11
|
import { type Token } from './token.js';
|
|
2
12
|
export type TagEvaluationWithdrawalRequestedArgs = {
|
|
3
13
|
userId: string;
|