@zeitvu97/cms-sdk 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +478 -0
- package/dist/chunks/_shared-48T7q0V3.js +26 -0
- package/dist/chunks/_shared-48T7q0V3.js.map +1 -0
- package/dist/chunks/auth.constant-DO7ZmsKg.js +68 -0
- package/dist/chunks/auth.constant-DO7ZmsKg.js.map +1 -0
- package/dist/chunks/mt5Retcode-DlZLQOLA.js +178 -0
- package/dist/chunks/mt5Retcode-DlZLQOLA.js.map +1 -0
- package/dist/chunks/storage.constant--64BDSPW.js +44 -0
- package/dist/chunks/storage.constant--64BDSPW.js.map +1 -0
- package/dist/common/constants/auth.constant.d.ts +54 -0
- package/dist/common/constants/auth.constant.d.ts.map +1 -0
- package/dist/common/constants/bars.constant.d.ts +15 -0
- package/dist/common/constants/bars.constant.d.ts.map +1 -0
- package/dist/common/constants/content-types.constant.d.ts +29 -0
- package/dist/common/constants/content-types.constant.d.ts.map +1 -0
- package/dist/common/constants/content.constant.d.ts +114 -0
- package/dist/common/constants/content.constant.d.ts.map +1 -0
- package/dist/common/constants/executions.constant.d.ts +56 -0
- package/dist/common/constants/executions.constant.d.ts.map +1 -0
- package/dist/common/constants/gov.constant.d.ts +118 -0
- package/dist/common/constants/gov.constant.d.ts.map +1 -0
- package/dist/common/constants/history.constant.d.ts +108 -0
- package/dist/common/constants/history.constant.d.ts.map +1 -0
- package/dist/common/constants/http.constant.d.ts +46 -0
- package/dist/common/constants/http.constant.d.ts.map +1 -0
- package/dist/common/constants/index.d.ts +16 -0
- package/dist/common/constants/index.d.ts.map +1 -0
- package/dist/common/constants/kalshi.constant.d.ts +35 -0
- package/dist/common/constants/kalshi.constant.d.ts.map +1 -0
- package/dist/common/constants/llm.constant.d.ts +37 -0
- package/dist/common/constants/llm.constant.d.ts.map +1 -0
- package/dist/common/constants/mt5-action.constant.d.ts +131 -0
- package/dist/common/constants/mt5-action.constant.d.ts.map +1 -0
- package/dist/common/constants/mt5.constant.d.ts +254 -0
- package/dist/common/constants/mt5.constant.d.ts.map +1 -0
- package/dist/common/constants/notifications.constant.d.ts +45 -0
- package/dist/common/constants/notifications.constant.d.ts.map +1 -0
- package/dist/common/constants/people.constant.d.ts +269 -0
- package/dist/common/constants/people.constant.d.ts.map +1 -0
- package/dist/common/constants/rules.constant.d.ts +14 -0
- package/dist/common/constants/rules.constant.d.ts.map +1 -0
- package/dist/common/constants/settings.constant.d.ts +17 -0
- package/dist/common/constants/settings.constant.d.ts.map +1 -0
- package/dist/common/constants/sort.constant.d.ts +14 -0
- package/dist/common/constants/sort.constant.d.ts.map +1 -0
- package/dist/common/constants/storage.constant.d.ts +74 -0
- package/dist/common/constants/storage.constant.d.ts.map +1 -0
- package/dist/common/helpers/format.d.ts +7 -0
- package/dist/common/helpers/format.d.ts.map +1 -0
- package/dist/common/helpers/format.js +20 -0
- package/dist/common/helpers/format.js.map +1 -0
- package/dist/common/helpers/mt5Retcode.d.ts +18 -0
- package/dist/common/helpers/mt5Retcode.d.ts.map +1 -0
- package/dist/common/helpers/mt5Retcode.js +2 -0
- package/dist/common/helpers/mt5Retcode.js.map +1 -0
- package/dist/common/utils/case.d.ts +12 -0
- package/dist/common/utils/case.d.ts.map +1 -0
- package/dist/common/utils/clone.d.ts +9 -0
- package/dist/common/utils/clone.d.ts.map +1 -0
- package/dist/composables/cbsStateKey.d.ts +27 -0
- package/dist/composables/cbsStateKey.d.ts.map +1 -0
- package/dist/core/createApi.d.ts +69 -0
- package/dist/core/createApi.d.ts.map +1 -0
- package/dist/core/createCmsSDK.d.ts +19 -0
- package/dist/core/createCmsSDK.d.ts.map +1 -0
- package/dist/core/credentials/TokenManager.d.ts +38 -0
- package/dist/core/credentials/TokenManager.d.ts.map +1 -0
- package/dist/core/credentials/credential.type.d.ts +16 -0
- package/dist/core/credentials/credential.type.d.ts.map +1 -0
- package/dist/core/credentials/resolveStorage.d.ts +6 -0
- package/dist/core/credentials/resolveStorage.d.ts.map +1 -0
- package/dist/core/credentials/storages/cookieStorage.d.ts +18 -0
- package/dist/core/credentials/storages/cookieStorage.d.ts.map +1 -0
- package/dist/core/credentials/storages/localStorageAdapter.d.ts +8 -0
- package/dist/core/credentials/storages/localStorageAdapter.d.ts.map +1 -0
- package/dist/core/credentials/storages/memoryStorage.d.ts +7 -0
- package/dist/core/credentials/storages/memoryStorage.d.ts.map +1 -0
- package/dist/core/errors.d.ts +26 -0
- package/dist/core/errors.d.ts.map +1 -0
- package/dist/core/sdk.type.d.ts +115 -0
- package/dist/core/sdk.type.d.ts.map +1 -0
- package/dist/core/ws/createEaeraWebSocket.d.ts +21 -0
- package/dist/core/ws/createEaeraWebSocket.d.ts.map +1 -0
- package/dist/core/ws/index.d.ts +4 -0
- package/dist/core/ws/index.d.ts.map +1 -0
- package/dist/core/ws/ws.constants.d.ts +246 -0
- package/dist/core/ws/ws.constants.d.ts.map +1 -0
- package/dist/core/ws/ws.events.d.ts +264 -0
- package/dist/core/ws/ws.events.d.ts.map +1 -0
- package/dist/core/ws/ws.type.d.ts +225 -0
- package/dist/core/ws/ws.type.d.ts.map +1 -0
- package/dist/index.d.ts +130 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +8416 -0
- package/dist/index.js.map +1 -0
- package/dist/nuxt.d.ts +49 -0
- package/dist/nuxt.d.ts.map +1 -0
- package/dist/nuxt.js +47 -0
- package/dist/nuxt.js.map +1 -0
- package/dist/runtime/plugin.d.ts +6 -0
- package/dist/runtime/plugin.js +188 -0
- package/dist/runtime/plugin.js.map +1 -0
- package/dist/server/auth/cbs-callback.post.js +42 -0
- package/dist/server/auth/cbs-callback.post.js.map +1 -0
- package/dist/server/auth/cbs-start.post.js +34 -0
- package/dist/server/auth/cbs-start.post.js.map +1 -0
- package/dist/server/auth/idp-callback.get.js +52 -0
- package/dist/server/auth/idp-callback.get.js.map +1 -0
- package/dist/server/auth/idp-link.post.js +38 -0
- package/dist/server/auth/idp-link.post.js.map +1 -0
- package/dist/server/auth/idp-login.get.js +42 -0
- package/dist/server/auth/idp-login.get.js.map +1 -0
- package/dist/server/auth/idp-unlink.delete.js +38 -0
- package/dist/server/auth/idp-unlink.delete.js.map +1 -0
- package/dist/server/auth/login.post.js +42 -0
- package/dist/server/auth/login.post.js.map +1 -0
- package/dist/server/auth/logout.post.js +31 -0
- package/dist/server/auth/logout.post.js.map +1 -0
- package/dist/server/auth/refresh.post.js +46 -0
- package/dist/server/auth/refresh.post.js.map +1 -0
- package/dist/server/clear-token.delete.js +12 -0
- package/dist/server/clear-token.delete.js.map +1 -0
- package/dist/server/persist.post.js +31 -0
- package/dist/server/persist.post.js.map +1 -0
- package/dist/server/set-token.post.js +27 -0
- package/dist/server/set-token.post.js.map +1 -0
- package/dist/services/auth/auth.type.d.ts +66 -0
- package/dist/services/auth/auth.type.d.ts.map +1 -0
- package/dist/services/auth/index.d.ts +127 -0
- package/dist/services/auth/index.d.ts.map +1 -0
- package/dist/services/auth/mock.d.ts +13 -0
- package/dist/services/auth/mock.d.ts.map +1 -0
- package/dist/services/bars/bars.type.d.ts +78 -0
- package/dist/services/bars/bars.type.d.ts.map +1 -0
- package/dist/services/bars/index.d.ts +24 -0
- package/dist/services/bars/index.d.ts.map +1 -0
- package/dist/services/bars/mock.d.ts +23 -0
- package/dist/services/bars/mock.d.ts.map +1 -0
- package/dist/services/content/content.type.d.ts +832 -0
- package/dist/services/content/content.type.d.ts.map +1 -0
- package/dist/services/content/filter.d.ts +46 -0
- package/dist/services/content/filter.d.ts.map +1 -0
- package/dist/services/content/index.d.ts +35 -0
- package/dist/services/content/index.d.ts.map +1 -0
- package/dist/services/content/mock.d.ts +16 -0
- package/dist/services/content/mock.d.ts.map +1 -0
- package/dist/services/content-types/content-types.type.d.ts +70 -0
- package/dist/services/content-types/content-types.type.d.ts.map +1 -0
- package/dist/services/content-types/index.d.ts +18 -0
- package/dist/services/content-types/index.d.ts.map +1 -0
- package/dist/services/content-types/mock.d.ts +15 -0
- package/dist/services/content-types/mock.d.ts.map +1 -0
- package/dist/services/executions/executions.type.d.ts +67 -0
- package/dist/services/executions/executions.type.d.ts.map +1 -0
- package/dist/services/executions/index.d.ts +30 -0
- package/dist/services/executions/index.d.ts.map +1 -0
- package/dist/services/executions/mock.d.ts +29 -0
- package/dist/services/executions/mock.d.ts.map +1 -0
- package/dist/services/gov/gov.type.d.ts +740 -0
- package/dist/services/gov/gov.type.d.ts.map +1 -0
- package/dist/services/gov/index.d.ts +84 -0
- package/dist/services/gov/index.d.ts.map +1 -0
- package/dist/services/history/history.type.d.ts +167 -0
- package/dist/services/history/history.type.d.ts.map +1 -0
- package/dist/services/history/index.d.ts +38 -0
- package/dist/services/history/index.d.ts.map +1 -0
- package/dist/services/history/mock.d.ts +21 -0
- package/dist/services/history/mock.d.ts.map +1 -0
- package/dist/services/kalshi/index.d.ts +19 -0
- package/dist/services/kalshi/index.d.ts.map +1 -0
- package/dist/services/kalshi/kalshi.type.d.ts +99 -0
- package/dist/services/kalshi/kalshi.type.d.ts.map +1 -0
- package/dist/services/kalshi/mock.d.ts +5 -0
- package/dist/services/kalshi/mock.d.ts.map +1 -0
- package/dist/services/llm/index.d.ts +38 -0
- package/dist/services/llm/index.d.ts.map +1 -0
- package/dist/services/llm/llm.type.d.ts +106 -0
- package/dist/services/llm/llm.type.d.ts.map +1 -0
- package/dist/services/notifications/index.d.ts +38 -0
- package/dist/services/notifications/index.d.ts.map +1 -0
- package/dist/services/notifications/mock.d.ts +39 -0
- package/dist/services/notifications/mock.d.ts.map +1 -0
- package/dist/services/notifications/notifications.type.d.ts +75 -0
- package/dist/services/notifications/notifications.type.d.ts.map +1 -0
- package/dist/services/people/_invoke.d.ts +26 -0
- package/dist/services/people/_invoke.d.ts.map +1 -0
- package/dist/services/people/copilot/index.d.ts +132 -0
- package/dist/services/people/copilot/index.d.ts.map +1 -0
- package/dist/services/people/identity/actions.d.ts +116 -0
- package/dist/services/people/identity/actions.d.ts.map +1 -0
- package/dist/services/people/identity/ct.types.d.ts +133 -0
- package/dist/services/people/identity/ct.types.d.ts.map +1 -0
- package/dist/services/people/identity/index.d.ts +14 -0
- package/dist/services/people/identity/index.d.ts.map +1 -0
- package/dist/services/people/identity/projections.d.ts +63 -0
- package/dist/services/people/identity/projections.d.ts.map +1 -0
- package/dist/services/people/index.d.ts +31 -0
- package/dist/services/people/index.d.ts.map +1 -0
- package/dist/services/people/legal/actions.d.ts +161 -0
- package/dist/services/people/legal/actions.d.ts.map +1 -0
- package/dist/services/people/legal/ct.types.d.ts +186 -0
- package/dist/services/people/legal/ct.types.d.ts.map +1 -0
- package/dist/services/people/legal/index.d.ts +15 -0
- package/dist/services/people/legal/index.d.ts.map +1 -0
- package/dist/services/people/packops/index.d.ts +70 -0
- package/dist/services/people/packops/index.d.ts.map +1 -0
- package/dist/services/people/packops/packops.type.d.ts +183 -0
- package/dist/services/people/packops/packops.type.d.ts.map +1 -0
- package/dist/services/people/perms/actions.d.ts +214 -0
- package/dist/services/people/perms/actions.d.ts.map +1 -0
- package/dist/services/people/perms/ct.types.d.ts +140 -0
- package/dist/services/people/perms/ct.types.d.ts.map +1 -0
- package/dist/services/people/perms/index.d.ts +14 -0
- package/dist/services/people/perms/index.d.ts.map +1 -0
- package/dist/services/people/perms/projections.d.ts +47 -0
- package/dist/services/people/perms/projections.d.ts.map +1 -0
- package/dist/services/people/process/actions.d.ts +154 -0
- package/dist/services/people/process/actions.d.ts.map +1 -0
- package/dist/services/people/process/ct.types.d.ts +304 -0
- package/dist/services/people/process/ct.types.d.ts.map +1 -0
- package/dist/services/people/process/index.d.ts +12 -0
- package/dist/services/people/process/index.d.ts.map +1 -0
- package/dist/services/people/shared.types.d.ts +36 -0
- package/dist/services/people/shared.types.d.ts.map +1 -0
- package/dist/services/rules/conditions.d.ts +264 -0
- package/dist/services/rules/conditions.d.ts.map +1 -0
- package/dist/services/rules/index.d.ts +49 -0
- package/dist/services/rules/index.d.ts.map +1 -0
- package/dist/services/rules/llm-rule.constant.d.ts +84 -0
- package/dist/services/rules/llm-rule.constant.d.ts.map +1 -0
- package/dist/services/rules/mock.d.ts +20 -0
- package/dist/services/rules/mock.d.ts.map +1 -0
- package/dist/services/rules/rules.type.d.ts +262 -0
- package/dist/services/rules/rules.type.d.ts.map +1 -0
- package/dist/services/rules/triggers.d.ts +140 -0
- package/dist/services/rules/triggers.d.ts.map +1 -0
- package/dist/services/settings/index.d.ts +36 -0
- package/dist/services/settings/index.d.ts.map +1 -0
- package/dist/services/settings/mock.d.ts +14 -0
- package/dist/services/settings/mock.d.ts.map +1 -0
- package/dist/services/settings/settings.type.d.ts +39 -0
- package/dist/services/settings/settings.type.d.ts.map +1 -0
- package/dist/stores/auth.d.ts +192 -0
- package/dist/stores/auth.d.ts.map +1 -0
- package/dist/stores/bars.d.ts +288 -0
- package/dist/stores/bars.d.ts.map +1 -0
- package/dist/stores/content.d.ts +4101 -0
- package/dist/stores/content.d.ts.map +1 -0
- package/dist/stores/executions.d.ts +249 -0
- package/dist/stores/executions.d.ts.map +1 -0
- package/dist/stores/gov.d.ts +238 -0
- package/dist/stores/gov.d.ts.map +1 -0
- package/dist/stores/history.d.ts +833 -0
- package/dist/stores/history.d.ts.map +1 -0
- package/dist/stores/index.d.ts +15 -0
- package/dist/stores/index.d.ts.map +1 -0
- package/dist/stores/kalshi.d.ts +728 -0
- package/dist/stores/kalshi.d.ts.map +1 -0
- package/dist/stores/llm-providers.d.ts +97 -0
- package/dist/stores/llm-providers.d.ts.map +1 -0
- package/dist/stores/llm.d.ts +102 -0
- package/dist/stores/llm.d.ts.map +1 -0
- package/dist/stores/people.d.ts +596 -0
- package/dist/stores/people.d.ts.map +1 -0
- package/dist/stores/persist.d.ts +58 -0
- package/dist/stores/persist.d.ts.map +1 -0
- package/dist/stores/rules.d.ts +485 -0
- package/dist/stores/rules.d.ts.map +1 -0
- package/dist/stores/settings.d.ts +36 -0
- package/dist/stores/settings.d.ts.map +1 -0
- package/dist/stores/ws.d.ts +66 -0
- package/dist/stores/ws.d.ts.map +1 -0
- package/package.json +90 -0
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
const WS_CONNECTION_STATE = {
|
|
2
|
+
IDLE: "idle",
|
|
3
|
+
OPENING: "opening",
|
|
4
|
+
AUTHENTICATING: "authenticating",
|
|
5
|
+
OPEN: "open",
|
|
6
|
+
RECONNECTING: "reconnecting",
|
|
7
|
+
CLOSED: "closed"
|
|
8
|
+
};
|
|
9
|
+
const WS_CLOSE_CODE = {
|
|
10
|
+
/** RFC 6455 — clean shutdown (e.g. user logout). */
|
|
11
|
+
NORMAL: 1e3,
|
|
12
|
+
/** RFC 6455 — `invalid_token` / `token_expired` / `auth_timeout`. */
|
|
13
|
+
POLICY_VIOLATION: 1008,
|
|
14
|
+
/** RFC 6455 — `service_unavailable` (token service not configured). */
|
|
15
|
+
INTERNAL_ERROR: 1011,
|
|
16
|
+
/** RFC 6455 — graceful server shutdown. */
|
|
17
|
+
TRY_AGAIN_LATER: 1013,
|
|
18
|
+
/**
|
|
19
|
+
* Non-standard — client-side deadline: server did not reply to `auth`
|
|
20
|
+
* within `WS_AUTH_TIMEOUT_MS`. Closes the socket so the consumer can
|
|
21
|
+
* react.
|
|
22
|
+
*/
|
|
23
|
+
CLIENT_AUTH_TIMEOUT: 4e3
|
|
24
|
+
};
|
|
25
|
+
const WS_AUTH_ERROR_CODE = {
|
|
26
|
+
INVALID_TOKEN: "invalid_token",
|
|
27
|
+
TOKEN_EXPIRED: "token_expired",
|
|
28
|
+
AUTH_TIMEOUT: "auth_timeout",
|
|
29
|
+
INVALID_MESSAGE: "invalid_message",
|
|
30
|
+
SERVICE_UNAVAILABLE: "service_unavailable"
|
|
31
|
+
};
|
|
32
|
+
const WS_CLOSE_REASON = {
|
|
33
|
+
NORMAL: "normal",
|
|
34
|
+
INVALID_TOKEN: "invalid_token",
|
|
35
|
+
TOKEN_EXPIRED: "token_expired",
|
|
36
|
+
AUTH_TIMEOUT: "auth_timeout",
|
|
37
|
+
PING_TIMEOUT: "ping_timeout",
|
|
38
|
+
AUTH_REQUIRED: "auth required",
|
|
39
|
+
AUTH_SERVICE_UNAVAILABLE: "auth service unavailable",
|
|
40
|
+
SERVER_SHUTTING_DOWN: "server shutting down"
|
|
41
|
+
};
|
|
42
|
+
const WS_ACTION_ACCEPTED_ERROR_CODE = {
|
|
43
|
+
VALIDATION_ERROR: "validation_error",
|
|
44
|
+
NOT_FOUND: "not_found",
|
|
45
|
+
PERMISSION_DENIED: "permission_denied",
|
|
46
|
+
DUPLICATE: "duplicate",
|
|
47
|
+
INTERNAL_ERROR: "internal_error",
|
|
48
|
+
CONFIGURATION_ERROR: "configuration_error"
|
|
49
|
+
};
|
|
50
|
+
const WS_ACTION_RESULT_ERROR_CODE = {
|
|
51
|
+
TIMEOUT: "timeout"
|
|
52
|
+
};
|
|
53
|
+
const WS_ACTION_ERROR_CODE = {
|
|
54
|
+
...WS_ACTION_ACCEPTED_ERROR_CODE,
|
|
55
|
+
...WS_ACTION_RESULT_ERROR_CODE
|
|
56
|
+
};
|
|
57
|
+
const WS_MESSAGE_TYPE = {
|
|
58
|
+
// server → client
|
|
59
|
+
AUTH_OK: "auth_ok",
|
|
60
|
+
AUTH_FAIL: "auth_fail",
|
|
61
|
+
AUTH_EXPIRED: "auth_expired",
|
|
62
|
+
SUB_OK: "sub_ok",
|
|
63
|
+
SUB_ERROR: "sub_error",
|
|
64
|
+
UNSUB_OK: "unsub_ok",
|
|
65
|
+
PING: "ping",
|
|
66
|
+
EVENT: "event",
|
|
67
|
+
ACTION_ACCEPTED: "action_accepted",
|
|
68
|
+
ACTION_RESULT: "action_result",
|
|
69
|
+
ERROR: "error",
|
|
70
|
+
ADMIN_DISCONNECT: "admin_disconnect",
|
|
71
|
+
// client → server
|
|
72
|
+
AUTH: "auth",
|
|
73
|
+
SUBSCRIBE: "subscribe",
|
|
74
|
+
UNSUBSCRIBE: "unsubscribe",
|
|
75
|
+
UNSUBSCRIBE_ALL: "unsubscribe_all",
|
|
76
|
+
PONG: "pong",
|
|
77
|
+
ACTION: "action",
|
|
78
|
+
FETCH_RESULT: "fetch_result"
|
|
79
|
+
};
|
|
80
|
+
const WS_TOPIC_NAMESPACE = {
|
|
81
|
+
RISK: "risk",
|
|
82
|
+
MT5: "mt5",
|
|
83
|
+
SYMBOL: "symbol",
|
|
84
|
+
ACCOUNT: "account",
|
|
85
|
+
USER: "user",
|
|
86
|
+
STREAM: "stream",
|
|
87
|
+
ADMIN: "admin"
|
|
88
|
+
};
|
|
89
|
+
const WS_TOPIC = {
|
|
90
|
+
RISK_RULES: "risk:rules",
|
|
91
|
+
RISK_EXECUTIONS: "risk:executions"
|
|
92
|
+
};
|
|
93
|
+
const WS_MT5_EVENT_TYPE = {
|
|
94
|
+
TICK: "tick",
|
|
95
|
+
ORDER: "order",
|
|
96
|
+
POSITION: "position",
|
|
97
|
+
STATEMENT: "statement",
|
|
98
|
+
DEAL: "deal"
|
|
99
|
+
};
|
|
100
|
+
const mt5Topic = (serverName, eventType) => `mt5:events:${serverName}:${eventType}`;
|
|
101
|
+
const accountTopic = (accountUuid) => `account:${accountUuid}`;
|
|
102
|
+
const symbolTopic = (serverName, symbol) => `symbol:${serverName}:${symbol}`;
|
|
103
|
+
const userTopic = (userId) => `user:${userId}`;
|
|
104
|
+
const streamTopic = (streamId) => `stream:${streamId}`;
|
|
105
|
+
const adminTopic = (name) => `admin:${name}`;
|
|
106
|
+
const WS_MAX_SUBSCRIPTIONS = 50;
|
|
107
|
+
const WS_RECONNECT_INITIAL_MS = 1e3;
|
|
108
|
+
const WS_RECONNECT_MAX_MS = 3e4;
|
|
109
|
+
const WS_RECONNECT_JITTER_MS = 250;
|
|
110
|
+
const WS_PING_INTERVAL_MS = 3e4;
|
|
111
|
+
const WS_PING_WATCHDOG_FACTOR = 1.5;
|
|
112
|
+
const WS_PING_WATCHDOG_CHECK_MS = 15e3;
|
|
113
|
+
const WS_MAX_RECONNECT_ATTEMPTS = 10;
|
|
114
|
+
const WS_AUTH_TIMEOUT_MS = 1e4;
|
|
115
|
+
const WS_ACTION_RESULT_TTL_MS = 5 * 60 * 1e3;
|
|
116
|
+
const MT5_RETCODE = {
|
|
117
|
+
REQ_REJECT: 10004,
|
|
118
|
+
REQ_CANCELLED: 10006,
|
|
119
|
+
PRICE_OFF_QUOTES: 10016,
|
|
120
|
+
REQUEST_CHANGED: 10024,
|
|
121
|
+
PRICE_OFF: 10030,
|
|
122
|
+
CONNECTION_LOST: 10031,
|
|
123
|
+
NETWORK_ERROR: 10032
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
function viewMt5Retcode(retcode) {
|
|
127
|
+
if (retcode == null) return null;
|
|
128
|
+
switch (retcode) {
|
|
129
|
+
case MT5_RETCODE.REQ_REJECT:
|
|
130
|
+
return {
|
|
131
|
+
code: retcode,
|
|
132
|
+
label: "REQ_REJECT",
|
|
133
|
+
message: "Order rejected by broker.",
|
|
134
|
+
suggestion: "show-as-rejected"
|
|
135
|
+
};
|
|
136
|
+
case MT5_RETCODE.REQ_CANCELLED:
|
|
137
|
+
return {
|
|
138
|
+
code: retcode,
|
|
139
|
+
label: "REQ_CANCELLED",
|
|
140
|
+
message: "Order cancelled by dealer.",
|
|
141
|
+
suggestion: "show-as-cancelled"
|
|
142
|
+
};
|
|
143
|
+
case MT5_RETCODE.PRICE_OFF_QUOTES:
|
|
144
|
+
return {
|
|
145
|
+
code: retcode,
|
|
146
|
+
label: "PRICE_OFF_QUOTES",
|
|
147
|
+
message: "Price moved past the band — please re-quote and try again.",
|
|
148
|
+
suggestion: "re-quote-and-retry"
|
|
149
|
+
};
|
|
150
|
+
case MT5_RETCODE.REQUEST_CHANGED:
|
|
151
|
+
return {
|
|
152
|
+
code: retcode,
|
|
153
|
+
label: "REQUEST_CHANGED",
|
|
154
|
+
message: "The dealer mutated your order — refreshing the order book now.",
|
|
155
|
+
suggestion: "show-new-params"
|
|
156
|
+
};
|
|
157
|
+
case MT5_RETCODE.PRICE_OFF:
|
|
158
|
+
return {
|
|
159
|
+
code: retcode,
|
|
160
|
+
label: "PRICE_OFF",
|
|
161
|
+
message: "No quotes available — the market may be closed.",
|
|
162
|
+
suggestion: "show-no-quotes"
|
|
163
|
+
};
|
|
164
|
+
case MT5_RETCODE.CONNECTION_LOST:
|
|
165
|
+
case MT5_RETCODE.NETWORK_ERROR:
|
|
166
|
+
return {
|
|
167
|
+
code: retcode,
|
|
168
|
+
label: "CONNECTION_LOST",
|
|
169
|
+
message: "Broker connection issue — please retry shortly.",
|
|
170
|
+
suggestion: "retry-shortly"
|
|
171
|
+
};
|
|
172
|
+
default:
|
|
173
|
+
return null;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
export { viewMt5Retcode as A, MT5_RETCODE as M, WS_RECONNECT_INITIAL_MS as W, WS_RECONNECT_MAX_MS as a, WS_CONNECTION_STATE as b, WS_PING_INTERVAL_MS as c, WS_MESSAGE_TYPE as d, WS_CLOSE_CODE as e, WS_MAX_RECONNECT_ATTEMPTS as f, WS_AUTH_TIMEOUT_MS as g, WS_RECONNECT_JITTER_MS as h, WS_PING_WATCHDOG_CHECK_MS as i, WS_MAX_SUBSCRIPTIONS as j, WS_PING_WATCHDOG_FACTOR as k, WS_ACTION_ACCEPTED_ERROR_CODE as l, WS_ACTION_ERROR_CODE as m, WS_ACTION_RESULT_ERROR_CODE as n, WS_ACTION_RESULT_TTL_MS as o, WS_AUTH_ERROR_CODE as p, WS_CLOSE_REASON as q, WS_MT5_EVENT_TYPE as r, WS_TOPIC as s, WS_TOPIC_NAMESPACE as t, accountTopic as u, adminTopic as v, mt5Topic as w, streamTopic as x, symbolTopic as y, userTopic as z };
|
|
178
|
+
//# sourceMappingURL=mt5Retcode-DlZLQOLA.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mt5Retcode-DlZLQOLA.js","sources":["../../src/core/ws/ws.constants.ts","../../src/common/helpers/mt5Retcode.ts"],"sourcesContent":["/**\n * WebSocket-layer defaults + protocol constants.\n *\n * Pattern (per FE coding rules §1.5):\n * `export const X = { FOO: 'foo', BAR: 'bar' } as const;`\n * `export type XKey = (typeof X)[keyof typeof X];`\n *\n * See `eaera-docs/cbs/eaera-cms/docs/eaera-cms-websocket-integration-guide.md`\n * for the wire protocol this client implements.\n */\n\n/* ───────────────────────── Re-exports ─────────────────────────────────── */\n\n/**\n * Re-export the MT5 domain constants so WS consumers can grab the server\n * name + interval enum from the same place they import the topic builders.\n */\nexport { MT5_INTERVAL, MT5_SERVER_NAME } from '../../common/constants/mt5.constant';\nexport type { MT5Interval, MT5ServerName } from '../../common/constants/mt5.constant';\n\n/* ───────────────────────── Connection lifecycle ───────────────────────── */\n\n/** Lifecycle states surfaced by `IWsClient.connectionState`. */\nexport const WS_CONNECTION_STATE = {\n IDLE: 'idle',\n OPENING: 'opening',\n AUTHENTICATING: 'authenticating',\n OPEN: 'open',\n RECONNECTING: 'reconnecting',\n CLOSED: 'closed',\n} as const;\nexport type WsConnectionState = (typeof WS_CONNECTION_STATE)[keyof typeof WS_CONNECTION_STATE];\n\n/* ───────────────────────── WebSocket close codes ─────────────────────── */\n\n/**\n * WebSocket close codes. `NORMAL` is the only one the client sends; the\n * rest mirror what the CMS server uses (see FEAT-010 guide §3).\n */\nexport const WS_CLOSE_CODE = {\n /** RFC 6455 — clean shutdown (e.g. user logout). */\n NORMAL: 1000,\n /** RFC 6455 — `invalid_token` / `token_expired` / `auth_timeout`. */\n POLICY_VIOLATION: 1008,\n /** RFC 6455 — `service_unavailable` (token service not configured). */\n INTERNAL_ERROR: 1011,\n /** RFC 6455 — graceful server shutdown. */\n TRY_AGAIN_LATER: 1013,\n /**\n * Non-standard — client-side deadline: server did not reply to `auth`\n * within `WS_AUTH_TIMEOUT_MS`. Closes the socket so the consumer can\n * react.\n */\n CLIENT_AUTH_TIMEOUT: 4000,\n} as const;\nexport type WsCloseCode = (typeof WS_CLOSE_CODE)[keyof typeof WS_CLOSE_CODE];\n\n/* ───────────────────────── Auth error codes ──────────────────────────── */\n\n/** Server-emitted error codes during the `auth` handshake / mid-session (ws-guide §3.4). */\nexport const WS_AUTH_ERROR_CODE = {\n INVALID_TOKEN: 'invalid_token',\n TOKEN_EXPIRED: 'token_expired',\n AUTH_TIMEOUT: 'auth_timeout',\n INVALID_MESSAGE: 'invalid_message',\n SERVICE_UNAVAILABLE: 'service_unavailable',\n} as const;\nexport type WsAuthErrorCode = (typeof WS_AUTH_ERROR_CODE)[keyof typeof WS_AUTH_ERROR_CODE];\n\n/**\n * Close-frame reason strings (ws-guide §4.1). These accompany the RFC 6455\n * close codes in `WS_CLOSE_CODE` — they are NOT auth error codes. Surfaced so\n * consumers can match `CloseEvent.reason` against stable strings.\n */\nexport const WS_CLOSE_REASON = {\n NORMAL: 'normal',\n INVALID_TOKEN: 'invalid_token',\n TOKEN_EXPIRED: 'token_expired',\n AUTH_TIMEOUT: 'auth_timeout',\n PING_TIMEOUT: 'ping_timeout',\n AUTH_REQUIRED: 'auth required',\n AUTH_SERVICE_UNAVAILABLE: 'auth service unavailable',\n SERVER_SHUTTING_DOWN: 'server shutting down',\n} as const;\nexport type WsCloseReason = (typeof WS_CLOSE_REASON)[keyof typeof WS_CLOSE_REASON];\n\n/* ───────────────────────── Action error codes ────────────────────────── */\n\n/** Server-emitted error codes on the action invocation path (FEAT-008). */\n/** Accepted-stage error codes — returned on `action_accepted` (ws-guide §9.3). */\nexport const WS_ACTION_ACCEPTED_ERROR_CODE = {\n VALIDATION_ERROR: 'validation_error',\n NOT_FOUND: 'not_found',\n PERMISSION_DENIED: 'permission_denied',\n DUPLICATE: 'duplicate',\n INTERNAL_ERROR: 'internal_error',\n CONFIGURATION_ERROR: 'configuration_error',\n} as const;\nexport type WsActionAcceptedErrorCode =\n (typeof WS_ACTION_ACCEPTED_ERROR_CODE)[keyof typeof WS_ACTION_ACCEPTED_ERROR_CODE];\n\n/** Result-stage error codes — returned on `action_result` (ws-guide §9.4). */\nexport const WS_ACTION_RESULT_ERROR_CODE = {\n TIMEOUT: 'timeout',\n} as const;\nexport type WsActionResultErrorCode =\n (typeof WS_ACTION_RESULT_ERROR_CODE)[keyof typeof WS_ACTION_RESULT_ERROR_CODE];\n\n/**\n * All action error codes — union of the accepted-stage and result-stage maps\n * (ws-guide §9.3 + §9.4). Kept for back-compat with consumers that do not yet\n * distinguish the stage; prefer the stage-specific maps above for new code.\n */\nexport const WS_ACTION_ERROR_CODE = {\n ...WS_ACTION_ACCEPTED_ERROR_CODE,\n ...WS_ACTION_RESULT_ERROR_CODE,\n} as const;\nexport type WsActionErrorCode = (typeof WS_ACTION_ERROR_CODE)[keyof typeof WS_ACTION_ERROR_CODE];\n\n/* ───────────────────────── Message type discriminators ────────────────── */\n\n/**\n * Wire `type` field for every server→client and client→server message.\n *\n * TypeScript discriminated unions require the `type` field to be a string\n * literal (not a const reference) on each interface — so these constants are\n * used for **runtime comparisons** (`switch (msg.type)`) and the interfaces\n * in `ws.type.ts` keep their literal `type: '…'` annotations for narrowing.\n */\nexport const WS_MESSAGE_TYPE = {\n // server → client\n AUTH_OK: 'auth_ok',\n AUTH_FAIL: 'auth_fail',\n AUTH_EXPIRED: 'auth_expired',\n SUB_OK: 'sub_ok',\n SUB_ERROR: 'sub_error',\n UNSUB_OK: 'unsub_ok',\n PING: 'ping',\n EVENT: 'event',\n ACTION_ACCEPTED: 'action_accepted',\n ACTION_RESULT: 'action_result',\n ERROR: 'error',\n ADMIN_DISCONNECT: 'admin_disconnect',\n // client → server\n AUTH: 'auth',\n SUBSCRIBE: 'subscribe',\n UNSUBSCRIBE: 'unsubscribe',\n UNSUBSCRIBE_ALL: 'unsubscribe_all',\n PONG: 'pong',\n ACTION: 'action',\n FETCH_RESULT: 'fetch_result',\n} as const;\nexport type WsMessageType = (typeof WS_MESSAGE_TYPE)[keyof typeof WS_MESSAGE_TYPE];\n\n/* ───────────────────────── Built-in topic namespaces ─────────────────── */\n\n/**\n * Built-in topic namespaces (guide §5.4). Server-side permissions are\n * enforced (`risk:*` requires `content:read`, `mt5:*` requires `mt5:viewer`,\n * etc.). Use these as the first segment of every topic you publish /\n * subscribe to.\n */\nexport const WS_TOPIC_NAMESPACE = {\n RISK: 'risk',\n MT5: 'mt5',\n SYMBOL: 'symbol',\n ACCOUNT: 'account',\n USER: 'user',\n STREAM: 'stream',\n ADMIN: 'admin',\n} as const;\nexport type WsTopicNamespace = (typeof WS_TOPIC_NAMESPACE)[keyof typeof WS_TOPIC_NAMESPACE];\n\n/**\n * Canonical topic strings for the built-in namespaces. The server-side\n * authz pipeline (FEAT-011) checks the prefix against the user's effective\n * permissions.\n *\n * MT5 topics must be built with `mt5Topic(server, eventType)` — the server\n * segment must match `MT5_SERVER_NAME` exactly (including spaces).\n */\nexport const WS_TOPIC = {\n RISK_RULES: 'risk:rules',\n RISK_EXECUTIONS: 'risk:executions',\n} as const;\nexport type WsTopic = (typeof WS_TOPIC)[keyof typeof WS_TOPIC];\n\n/** MT5 event types — third segment of `mt5:events:{server}:{event_type}`. */\nexport const WS_MT5_EVENT_TYPE = {\n TICK: 'tick',\n ORDER: 'order',\n POSITION: 'position',\n STATEMENT: 'statement',\n DEAL: 'deal',\n} as const;\nexport type WsMt5EventType = (typeof WS_MT5_EVENT_TYPE)[keyof typeof WS_MT5_EVENT_TYPE];\n\n/**\n * Build an MT5 topic for a specific server + event type. The server segment\n * MUST match `MT5_SERVER_NAME` exactly (including spaces).\n */\nexport const mt5Topic = (serverName: string, eventType: WsMt5EventType): string =>\n `mt5:events:${serverName}:${eventType}`;\n\n/**\n * Build a per-account state topic: `account:<Mt5Account.uuid>`.\n * Subscribe with the account's UUID (NOT the numeric login) [ws§7.4, api-inventory §9.9].\n */\nexport const accountTopic = (accountUuid: string): string => `account:${accountUuid}`;\n\n/**\n * Build a per-symbol tick topic: `symbol:<server>:<SYMBOL>`.\n * The preferred live-tick path for charts (one topic per (server, symbol) isolates\n * per-connection cost to one symbol's tick rate) [ws§7.3, api-inventory §9.3].\n */\nexport const symbolTopic = (serverName: string, symbol: string): string =>\n `symbol:${serverName}:${symbol}`;\n\n/**\n * Build a user-scoped notification topic: `user:<id>` [ws§5].\n */\nexport const userTopic = (userId: number | string): string => `user:${userId}`;\n\n/**\n * Build a stream-processor output topic: `stream:<id>` [ws§5].\n */\nexport const streamTopic = (streamId: string): string => `stream:${streamId}`;\n\n/**\n * Build an admin topic: `admin:<name>` [ws§5].\n */\nexport const adminTopic = (name: string): string => `admin:${name}`;\n\n/* ───────────────────────── Numeric defaults ──────────────────────────── */\n\n/** Hard cap on topics per connection (server-side default). */\nexport const WS_MAX_SUBSCRIPTIONS = 50;\n\n/** Reconnect backoff schedule (matches the integration guide's recommendation). */\nexport const WS_RECONNECT_INITIAL_MS = 1000;\nexport const WS_RECONNECT_MAX_MS = 30000;\n/** Random jitter added to each reconnect delay, in milliseconds. */\nexport const WS_RECONNECT_JITTER_MS = 250;\n\n/** Server-driven ping interval (server sends `ping` every N seconds). */\nexport const WS_PING_INTERVAL_MS = 30000;\n\n/**\n * Client-side ping-watchdog multiplier. The watchdog force-closes the socket\n * after `pingIntervalMs * WS_PING_WATCHDOG_FACTOR` without a server `ping`,\n * catching half-open (sleep / NAT-timeout) connections before the server's\n * own 2-missed-pong timeout (ws-guide §8).\n */\nexport const WS_PING_WATCHDOG_FACTOR = 1.5;\n/** Floor for the watchdog interval check (never probe more often than this). */\nexport const WS_PING_WATCHDOG_CHECK_MS = 15000;\n\n/**\n * Max reconnect attempts before the client transitions to terminal `CLOSED`\n * (ws-guide §10). Prevents an infinite `RECONNECTING` loop on a prolonged\n * outage so consumers (e.g. the Nuxt recovery plugin) can surface a\n * \"connection lost\" notification instead of retrying silently forever.\n */\nexport const WS_MAX_RECONNECT_ATTEMPTS = 10;\n\n/** Window in which the server expects the first `auth` message. */\nexport const WS_AUTH_TIMEOUT_MS = 10000;\n\n/**\n * Server-side TTL for an in-flight `action` after disconnect. The client\n * uses `fetch_result` within this window to recover a missed `action_result`.\n */\nexport const WS_ACTION_RESULT_TTL_MS = 5 * 60 * 1000;\n\n/* ───────────────────────── MT5 broker retcodes ───────────────────────── */\n\n/**\n * MT5 broker retcodes surfaced through `action_result.output.data.retcode`.\n * Source: eaera-docs §7.5 / ws-guide §12.6.\n */\nexport const MT5_RETCODE = {\n REQ_REJECT: 10004,\n REQ_CANCELLED: 10006,\n PRICE_OFF_QUOTES: 10016,\n REQUEST_CHANGED: 10024,\n PRICE_OFF: 10030,\n CONNECTION_LOST: 10031,\n NETWORK_ERROR: 10032,\n} as const;\nexport type Mt5Retcode = (typeof MT5_RETCODE)[keyof typeof MT5_RETCODE];\n","/**\n * MT5 broker retcode → human-friendly message + suggested FE action.\n *\n * Source: eaera-docs/cbs/eaera-cms/docs/eaera-cms-api-inventory.md §7.5,\n * §12.3, §12.6 (mirrored in ws-guide §12.6).\n *\n * The retcode is delivered INSIDE `output.data.retcode` (NOT top-level\n * output) — pass the full `action_result.output.data` object here.\n */\nimport { MT5_RETCODE } from '../../core/ws/ws.constants';\n\nexport interface IMt5RetcodeView {\n /** Stable machine code (one of the MT5_RETCODE values). */\n code: number;\n /** Short human label, e.g. `PRICE_OFF_QUOTES`. */\n label: string;\n /** One-line FE-facing message. */\n message: string;\n /** What the FE should do — surface a toast, re-quote, retry, etc. */\n suggestion:\n | 'show-as-rejected'\n | 'show-as-cancelled'\n | 're-quote-and-retry'\n | 'show-new-params'\n | 'show-no-quotes'\n | 'retry-shortly';\n}\n\n/**\n * Look up an MT5 broker retcode. Returns `null` if the code is unknown —\n * FE should fall back to `error.message` from `action_result.error`.\n *\n * @param retcode — the integer from `action_result.output.data.retcode`\n */\nexport function viewMt5Retcode(retcode: number | null | undefined): IMt5RetcodeView | null {\n if (retcode == null) return null;\n switch (retcode) {\n case MT5_RETCODE.REQ_REJECT:\n return {\n code: retcode,\n label: 'REQ_REJECT',\n message: 'Order rejected by broker.',\n suggestion: 'show-as-rejected',\n };\n case MT5_RETCODE.REQ_CANCELLED:\n return {\n code: retcode,\n label: 'REQ_CANCELLED',\n message: 'Order cancelled by dealer.',\n suggestion: 'show-as-cancelled',\n };\n case MT5_RETCODE.PRICE_OFF_QUOTES:\n return {\n code: retcode,\n label: 'PRICE_OFF_QUOTES',\n message: 'Price moved past the band — please re-quote and try again.',\n suggestion: 're-quote-and-retry',\n };\n case MT5_RETCODE.REQUEST_CHANGED:\n return {\n code: retcode,\n label: 'REQUEST_CHANGED',\n message: 'The dealer mutated your order — refreshing the order book now.',\n suggestion: 'show-new-params',\n };\n case MT5_RETCODE.PRICE_OFF:\n return {\n code: retcode,\n label: 'PRICE_OFF',\n message: 'No quotes available — the market may be closed.',\n suggestion: 'show-no-quotes',\n };\n case MT5_RETCODE.CONNECTION_LOST:\n case MT5_RETCODE.NETWORK_ERROR:\n return {\n code: retcode,\n label: 'CONNECTION_LOST',\n message: 'Broker connection issue — please retry shortly.',\n suggestion: 'retry-shortly',\n };\n default:\n return null;\n }\n}\n"],"names":[],"mappings":"AAuBO,MAAM,mBAAA,GAAsB;AAAA,EACjC,IAAA,EAAM,MAAA;AAAA,EACN,OAAA,EAAS,SAAA;AAAA,EACT,cAAA,EAAgB,gBAAA;AAAA,EAChB,IAAA,EAAM,MAAA;AAAA,EACN,YAAA,EAAc,cAAA;AAAA,EACd,MAAA,EAAQ;AACV;AASO,MAAM,aAAA,GAAgB;AAAA;AAAA,EAE3B,MAAA,EAAQ,GAAA;AAAA;AAAA,EAER,gBAAA,EAAkB,IAAA;AAAA;AAAA,EAElB,cAAA,EAAgB,IAAA;AAAA;AAAA,EAEhB,eAAA,EAAiB,IAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMjB,mBAAA,EAAqB;AACvB;AAMO,MAAM,kBAAA,GAAqB;AAAA,EAChC,aAAA,EAAe,eAAA;AAAA,EACf,aAAA,EAAe,eAAA;AAAA,EACf,YAAA,EAAc,cAAA;AAAA,EACd,eAAA,EAAiB,iBAAA;AAAA,EACjB,mBAAA,EAAqB;AACvB;AAQO,MAAM,eAAA,GAAkB;AA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A;AAAA,IACjB,KAAK,WAAA,CAAY,aAAA;AACf,MAAA,OAAO;AAAA,QACL,IAAA,EAAM,OAAA;AAAA,QACN,KAAA,EAAO,iBAAA;AAAA,QACP,OAAA,EAAS,iDAAA;AAAA,QACT,UAAA,EAAY;AAAA,OACd;AAAA,IACF;AACE,MAAA,OAAO,IAAA;AAAA;AAEb;;;;"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
const TOKEN_STORAGE_KEY = "cms_access_token";
|
|
2
|
+
const REFRESH_TOKEN_STORAGE_KEY = "cms_refresh_token";
|
|
3
|
+
const COOKIE_DEFAULTS = {
|
|
4
|
+
MAX_AGE_SECONDS: 60 * 60 * 24 * 30,
|
|
5
|
+
// 30 days
|
|
6
|
+
PATH: "/",
|
|
7
|
+
SECURE: true,
|
|
8
|
+
SAME_SITE: "Lax",
|
|
9
|
+
HTTP_ONLY: true
|
|
10
|
+
};
|
|
11
|
+
const STORE_PERSIST_KEY = {
|
|
12
|
+
AUTH: "cms-auth-v1",
|
|
13
|
+
CONTENT: "cms-content-v1",
|
|
14
|
+
RULES: "cms-rules-v1",
|
|
15
|
+
EXECUTIONS: "cms-executions-v1",
|
|
16
|
+
SETTINGS: "cms-settings-v1",
|
|
17
|
+
LLM: "cms-llm-v1",
|
|
18
|
+
LLM_PROVIDERS: "cms-llm-providers-v1",
|
|
19
|
+
BARS: "cms-bars-v1",
|
|
20
|
+
HISTORY: "cms-history-v1",
|
|
21
|
+
KALSHI: "cms-kalshi-v1",
|
|
22
|
+
GOV: "cms-gov-v1",
|
|
23
|
+
PEOPLE: "cms-people-v1"
|
|
24
|
+
};
|
|
25
|
+
const PERSIST_PREFIX = "cms-persist-";
|
|
26
|
+
const PERSIST_KEY = {
|
|
27
|
+
AUTH: "cms-persist-auth"
|
|
28
|
+
};
|
|
29
|
+
const PERSIST_MAX_BYTES = 3500;
|
|
30
|
+
const PERSIST_ALLOWED_KEYS = [`${PERSIST_KEY.AUTH}.authUser`];
|
|
31
|
+
const STORAGE_NAME = {
|
|
32
|
+
MEMORY: "memory",
|
|
33
|
+
LOCAL_STORAGE: "localStorage",
|
|
34
|
+
COOKIE: "cookie",
|
|
35
|
+
HTTP_ONLY_BRIDGE: "httpOnlyBridge"
|
|
36
|
+
};
|
|
37
|
+
const COOKIE_SAME_SITE = {
|
|
38
|
+
STRICT: "Strict",
|
|
39
|
+
LAX: "Lax",
|
|
40
|
+
NONE: "None"
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export { COOKIE_SAME_SITE as C, PERSIST_KEY as P, REFRESH_TOKEN_STORAGE_KEY as R, STORE_PERSIST_KEY as S, TOKEN_STORAGE_KEY as T, COOKIE_DEFAULTS as a, PERSIST_ALLOWED_KEYS as b, PERSIST_MAX_BYTES as c, PERSIST_PREFIX as d, STORAGE_NAME as e };
|
|
44
|
+
//# sourceMappingURL=storage.constant--64BDSPW.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storage.constant--64BDSPW.js","sources":["../../src/common/constants/storage.constant.ts"],"sourcesContent":["/**\n * Token storage constants — the single source for the storage key so the\n * memory/localStorage/cookie adapters never drift apart.\n */\nexport const TOKEN_STORAGE_KEY = 'cms_access_token' as const;\n\n/**\n * Refresh-token cookie key. Stored as an httpOnly cookie (parallel to the access\n * token) so the SDK can silently rotate the access token when it expires.\n */\nexport const REFRESH_TOKEN_STORAGE_KEY = 'cms_refresh_token' as const;\n\n/** Cookie adapter defaults (overridable via `credentials.cookie`). */\nexport const COOKIE_DEFAULTS = {\n MAX_AGE_SECONDS: 60 * 60 * 24 * 30, // 30 days\n PATH: '/',\n SECURE: true,\n SAME_SITE: 'Lax',\n HTTP_ONLY: true,\n} as const;\n\n/** Pinia persistence keys (versioned for schema migration). */\nexport const STORE_PERSIST_KEY = {\n AUTH: 'cms-auth-v1',\n CONTENT: 'cms-content-v1',\n RULES: 'cms-rules-v1',\n EXECUTIONS: 'cms-executions-v1',\n SETTINGS: 'cms-settings-v1',\n LLM: 'cms-llm-v1',\n LLM_PROVIDERS: 'cms-llm-providers-v1',\n BARS: 'cms-bars-v1',\n HISTORY: 'cms-history-v1',\n KALSHI: 'cms-kalshi-v1',\n GOV: 'cms-gov-v1',\n PEOPLE: 'cms-people-v1',\n} as const;\n\n/**\n * Internal cookie persistence (replaces pinia-plugin-persistedstate).\n *\n * Each persisted state → its own cookie `${PERSIST_KEY.<store>}.${field}`.\n * The common `/api/cms-sdk/persist` endpoint may only set keys in\n * `PERSIST_ALLOWED_KEYS` (single source of truth, shared by the plugin + the\n * endpoint). The token key is always excluded as a belt-and-suspenders guard.\n */\nexport const PERSIST_PREFIX = 'cms-persist-' as const;\n\nexport const PERSIST_KEY = {\n AUTH: 'cms-persist-auth',\n} as const;\n\n/** Max bytes per persisted cookie value (~4KB cookie cap, with headroom). */\nexport const PERSIST_MAX_BYTES = 3500;\n\n/** Allowlist of cookie keys the persist endpoint may set. */\nexport const PERSIST_ALLOWED_KEYS = [`${PERSIST_KEY.AUTH}.authUser`] as const;\n\n/**\n * Storage backend names accepted by `TokenManager`. Kept in sync with\n * `IStorageName` in `core/credentials/credential.type.ts`. The\n * `httpOnlyBridge` value is the recommended production backend (delegates\n * to a Nuxt server route).\n */\nexport const STORAGE_NAME = {\n MEMORY: 'memory',\n LOCAL_STORAGE: 'localStorage',\n COOKIE: 'cookie',\n HTTP_ONLY_BRIDGE: 'httpOnlyBridge',\n} as const;\nexport type StorageName = (typeof STORAGE_NAME)[keyof typeof STORAGE_NAME];\n\n/**\n * `Cookie SameSite` values (RFC 6265). Used by `cookieStorage` and the\n * SDK Nuxt module when setting the httpOnly access-token cookie. Mirrors\n * the `CookieSameSite` type in `core/credentials/storages/cookieStorage.ts`.\n */\nexport const COOKIE_SAME_SITE = {\n STRICT: 'Strict',\n LAX: 'Lax',\n NONE: 'None',\n} as const;\nexport type CookieSameSite = (typeof COOKIE_SAME_SITE)[keyof typeof COOKIE_SAME_SITE];\n"],"names":[],"mappings":"AAIO,MAAM,i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
+
* - LOGIN (POST /api/auth/login) — confirmed against the real backend
|
|
6
|
+
* - LOGOUT (POST /api/auth/logout) — confirmed (real backend logout is POST)
|
|
7
|
+
* - REFRESH (POST /api/oauth/token) — confirmed — OAuth token endpoint;
|
|
8
|
+
* grant_type=refresh_token
|
|
9
|
+
*
|
|
10
|
+
* Path params are appended at call sites.
|
|
11
|
+
*/
|
|
12
|
+
export declare const AUTH_ENDPOINT: {
|
|
13
|
+
readonly LOGIN: "/api/auth/login";
|
|
14
|
+
readonly LOGOUT: "/api/auth/logout";
|
|
15
|
+
readonly REFRESH: "/api/oauth/token";
|
|
16
|
+
/** User registry (GET /api/auth/users) — list of the CMS auth users. */
|
|
17
|
+
readonly USERS: "/api/auth/users";
|
|
18
|
+
/** "Login with CBS" — init (PKCE verifier + state stay server-side). */
|
|
19
|
+
readonly CBS_START: "/api/v1/auth/oauth/cbs/start";
|
|
20
|
+
/** "Login with CBS" — complete (exchange code → CMS session JWT). */
|
|
21
|
+
readonly CBS_CALLBACK: "/api/v1/auth/oauth/cbs/callback";
|
|
22
|
+
/** IdP SSO — init (`GET /api/auth/{provider}/login?redirect_uri=…`). */
|
|
23
|
+
readonly idpLogin: (provider: string) => string;
|
|
24
|
+
/** IdP SSO — callback (`GET /api/auth/{provider}/callback?code&state&redirect_uri`). */
|
|
25
|
+
readonly idpCallback: (provider: string) => string;
|
|
26
|
+
/** IdP SSO — link an already-authenticated user to the provider (needs Bearer). */
|
|
27
|
+
readonly idpLink: (provider: string) => string;
|
|
28
|
+
/** IdP SSO — unlink the provider from the current user (needs Bearer). */
|
|
29
|
+
readonly idpUnlink: (provider: string) => string;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Client→proxy route paths for token-lifecycle flows.
|
|
33
|
+
*
|
|
34
|
+
* When the Nuxt module is in use, login/logout/token route through the
|
|
35
|
+
* app-origin server proxies (`/api/cms/*`) so the httpOnly cookies are
|
|
36
|
+
* set/cleared/rotated atomically. These are the paths the auth service calls
|
|
37
|
+
* on its `routeApi` (whose baseURL is `/api/cms`).
|
|
38
|
+
*/
|
|
39
|
+
export declare const AUTH_PROXY_PATH: {
|
|
40
|
+
readonly LOGIN: "/login";
|
|
41
|
+
readonly LOGOUT: "/logout";
|
|
42
|
+
readonly REFRESH: "/refresh";
|
|
43
|
+
readonly CBS_START: "/cbs-start";
|
|
44
|
+
readonly CBS_CALLBACK: "/cbs-callback";
|
|
45
|
+
/** IdP SSO — init (query: `provider`, `redirect_uri`). */
|
|
46
|
+
readonly IDP_LOGIN: "/idp-login";
|
|
47
|
+
/** IdP SSO — callback (query: `provider`, `code`, `state`, `redirect_uri`). */
|
|
48
|
+
readonly IDP_CALLBACK: "/idp-callback";
|
|
49
|
+
/** IdP SSO — link (body: `{ provider }`; forwards the token cookie as Bearer). */
|
|
50
|
+
readonly IDP_LINK: "/idp-link";
|
|
51
|
+
/** IdP SSO — unlink (query: `provider`; forwards the token cookie as Bearer). */
|
|
52
|
+
readonly IDP_UNLINK: "/idp-unlink";
|
|
53
|
+
};
|
|
54
|
+
//# sourceMappingURL=auth.constant.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.constant.d.ts","sourceRoot":"","sources":["../../../src/common/constants/auth.constant.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,eAAO,MAAM,aAAa;;;;IAIxB,wEAAwE;;IAExE,wEAAwE;;IAExE,qEAAqE;;IAErE,wEAAwE;kCACnD,MAAM,KAAG,MAAM;IACpC,wFAAwF;qCAChE,MAAM,KAAG,MAAM;IACvC,mFAAmF;iCAC/D,MAAM,KAAG,MAAM;IACnC,0EAA0E;mCACpD,MAAM,KAAG,MAAM;CAC7B,CAAC;AAEX;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe;;;;;;IAM1B,0DAA0D;;IAE1D,+EAA+E;;IAE/E,kFAAkF;;IAElF,iFAAiF;;CAEzE,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Chart-bars endpoints (`eaera_cms/chart/routes.py`).
|
|
3
|
+
* The canonical OHLC read path for chart rendering of any timeframe.
|
|
4
|
+
*/
|
|
5
|
+
export declare const BARS_ENDPOINT: {
|
|
6
|
+
readonly BASE: "/api/v1/chart/bars";
|
|
7
|
+
};
|
|
8
|
+
/** Chart-bars query defaults (doc §5.5.1). */
|
|
9
|
+
export declare const BARS_DEFAULTS: {
|
|
10
|
+
readonly LIMIT: 1000;
|
|
11
|
+
readonly LIMIT_MIN: 1;
|
|
12
|
+
readonly LIMIT_MAX: 5000;
|
|
13
|
+
readonly SORT_DIRECTION: "asc";
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=bars.constant.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bars.constant.d.ts","sourceRoot":"","sources":["../../../src/common/constants/bars.constant.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,aAAa;;CAEhB,CAAC;AAEX,8CAA8C;AAC9C,eAAO,MAAM,aAAa;;;;;CAKhB,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Content-type metadata endpoints (engine `core/types/routes.py`).
|
|
3
|
+
*
|
|
4
|
+
* Source of truth: `eaera-docs/company-os/eaera-people/be-docs/api_references.md`
|
|
5
|
+
* §7.1 — the portal renders forms, status badges and action availability
|
|
6
|
+
* from CT metadata instead of hardcoding field lists.
|
|
7
|
+
*/
|
|
8
|
+
/** `GET /api/v1/content-types` — list content types (optionally category-filtered). */
|
|
9
|
+
export declare const CONTENT_TYPES_ENDPOINT: {
|
|
10
|
+
readonly BASE: "/api/v1/content-types";
|
|
11
|
+
/** `GET /api/v1/content-types/name/{name}` — one CT by wire name; unknown ⇒ 404. */
|
|
12
|
+
readonly byName: (name: string) => string;
|
|
13
|
+
};
|
|
14
|
+
/** Pagination defaults for the list route (mirrors the engine's). */
|
|
15
|
+
export declare const CONTENT_TYPES_DEFAULTS: {
|
|
16
|
+
readonly PAGE: 1;
|
|
17
|
+
readonly PER_PAGE: 100;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Known `category` values. Packs register their CTs under `pack`; the
|
|
21
|
+
* engine's own types (users, settings, …) live under `core`. The union stays
|
|
22
|
+
* open — packs may declare their own categories.
|
|
23
|
+
*/
|
|
24
|
+
export declare const CONTENT_TYPE_CATEGORY: {
|
|
25
|
+
readonly PACK: "pack";
|
|
26
|
+
readonly CORE: "core";
|
|
27
|
+
};
|
|
28
|
+
export type ContentTypeCategory = (typeof CONTENT_TYPE_CATEGORY)[keyof typeof CONTENT_TYPE_CATEGORY] | (string & {});
|
|
29
|
+
//# sourceMappingURL=content-types.constant.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"content-types.constant.d.ts","sourceRoot":"","sources":["../../../src/common/constants/content-types.constant.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,uFAAuF;AACvF,eAAO,MAAM,sBAAsB;;IAEjC,oFAAoF;4BACrE,MAAM,KAAG,MAAM;CACtB,CAAC;AAEX,qEAAqE;AACrE,eAAO,MAAM,sBAAsB;;;CAGzB,CAAC;AAEX;;;;GAIG;AACH,eAAO,MAAM,qBAAqB;;;CAGxB,CAAC;AACX,MAAM,MAAM,mBAAmB,GAC3B,CAAC,OAAO,qBAAqB,CAAC,CAAC,MAAM,OAAO,qBAAqB,CAAC,GAClE,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CMS content CRUD endpoints (`eaera_cms/core/content/routes.py`).
|
|
3
|
+
*
|
|
4
|
+
* NOTE: the **singular** `/api/v1/content` namespace is the CRUD path.
|
|
5
|
+
* The plural `/api/v1/contents` (`query/routes.py`) is a read-only query
|
|
6
|
+
* path (list/search/count) and does NOT support `{uuid}` mutations.
|
|
7
|
+
*/
|
|
8
|
+
export declare const CONTENT_ENDPOINT: {
|
|
9
|
+
readonly BASE: "/api/v1/content";
|
|
10
|
+
readonly detail: (uuid: string) => string;
|
|
11
|
+
/** List available CT actions for a content item (GET). */
|
|
12
|
+
readonly actions: (uuid: string) => string;
|
|
13
|
+
/** Invoke a CT action on a content item (POST). */
|
|
14
|
+
readonly action: (uuid: string, actionName: string) => string;
|
|
15
|
+
};
|
|
16
|
+
/** Content list defaults (`/api/v1/content` paginates with page/perPage). */
|
|
17
|
+
export declare const CONTENT_DEFAULTS: {
|
|
18
|
+
readonly PAGE: 1;
|
|
19
|
+
readonly PER_PAGE: 100;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Content Type names registered by the mt5 pack (`eaera_mt5/pack.yaml`).
|
|
23
|
+
*
|
|
24
|
+
* The SDK holds a typed slice per CT in `useContentStore` and a generic
|
|
25
|
+
* `fetchByType(typeName, ...)` action that accepts any of these names.
|
|
26
|
+
*
|
|
27
|
+
* Full schema for each CT lives in `eaera-docs/cbs/eaera-mt5/data/data-design.md` §2
|
|
28
|
+
* and the per-CT action inventory lives in
|
|
29
|
+
* `eaera-docs/cbs/cms-sdk/services/content.md#content-types-registered-by-the-mt5-pack`.
|
|
30
|
+
*/
|
|
31
|
+
export declare const CONTENT_TYPE: {
|
|
32
|
+
readonly MT5_SERVER: "Mt5Server";
|
|
33
|
+
readonly MT5_ACCOUNT: "Mt5Account";
|
|
34
|
+
readonly MT5_GROUP: "Mt5Group";
|
|
35
|
+
readonly MT5_SYNC_STATE: "Mt5SyncState";
|
|
36
|
+
readonly REPORT_DEFINITION: "ReportDefinition";
|
|
37
|
+
readonly LLM_CONVERSATION: "LlmConversation";
|
|
38
|
+
readonly KALSHI_SERVER: "KalshiServer";
|
|
39
|
+
readonly KALSHI_EVENT: "KalshiEvent";
|
|
40
|
+
readonly KALSHI_FUTURE: "KalshiFuture";
|
|
41
|
+
readonly MT5_SYMBOL: "Mt5Symbol";
|
|
42
|
+
readonly MT5_CATEGORY: "Mt5Category";
|
|
43
|
+
readonly MT5_WATCHLIST: "Mt5Watchlist";
|
|
44
|
+
readonly MT5_CHART_BAR: "Mt5ChartBar";
|
|
45
|
+
readonly MT5_POSITION_HISTORY: "Mt5PositionHistory";
|
|
46
|
+
readonly MT5_ORDER_HISTORY: "Mt5OrderHistory";
|
|
47
|
+
readonly MT5_DEAL_HISTORY: "Mt5DealHistory";
|
|
48
|
+
readonly MT5_DRAWING: "Mt5Drawing";
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* Union of every CT name as a TypeScript string-literal type.
|
|
52
|
+
* Use this when typing variables instead of importing the constants object.
|
|
53
|
+
*/
|
|
54
|
+
export type ContentTypeName = (typeof CONTENT_TYPE)[keyof typeof CONTENT_TYPE];
|
|
55
|
+
/** Convenience: every CT name as a readonly array (iteration, validation). */
|
|
56
|
+
export declare const CONTENT_TYPE_NAMES: readonly ContentTypeName[];
|
|
57
|
+
/**
|
|
58
|
+
* Filter DSL operators accepted by the eaera-cms content filter param
|
|
59
|
+
* (`?filter=field:op:value AND …`). Mirrors the backend `OPERATORS` dict in
|
|
60
|
+
* `eaera_cms/.../parser` — see `eaera-docs/cbs/cms-sdk/services/query.md#filter-dsl`.
|
|
61
|
+
*
|
|
62
|
+
* The scalar subset (see {@link CONTENT_FILTER_SCALAR_OPERATOR}) is what the
|
|
63
|
+
* `buildFilter()` helper serializes; the list / no-value / jsonb operators are
|
|
64
|
+
* exported here for callers that hand-roll their DSL string.
|
|
65
|
+
*/
|
|
66
|
+
export declare const CONTENT_FILTER_OPERATOR: {
|
|
67
|
+
readonly EQ: "eq";
|
|
68
|
+
readonly NEQ: "neq";
|
|
69
|
+
readonly GT: "gt";
|
|
70
|
+
readonly GTE: "gte";
|
|
71
|
+
readonly LT: "lt";
|
|
72
|
+
readonly LTE: "lte";
|
|
73
|
+
readonly IN: "in";
|
|
74
|
+
readonly NOT_IN: "not_in";
|
|
75
|
+
readonly IS_NULL: "is_null";
|
|
76
|
+
readonly IS_NOT_NULL: "is_not_null";
|
|
77
|
+
readonly CONTAINS: "contains";
|
|
78
|
+
readonly STARTS_WITH: "starts_with";
|
|
79
|
+
readonly ENDS_WITH: "ends_with";
|
|
80
|
+
readonly REGEX: "regex";
|
|
81
|
+
readonly LIKE: "like";
|
|
82
|
+
readonly ILIKE: "ilike";
|
|
83
|
+
readonly BETWEEN: "between";
|
|
84
|
+
readonly JSON_CONTAINS: "json_contains";
|
|
85
|
+
readonly JSON_HAS_KEY: "json_has_key";
|
|
86
|
+
readonly JSON_TYPE: "json_type";
|
|
87
|
+
};
|
|
88
|
+
export type ContentFilterOperator = (typeof CONTENT_FILTER_OPERATOR)[keyof typeof CONTENT_FILTER_OPERATOR];
|
|
89
|
+
/**
|
|
90
|
+
* Operators supported by {@link buildFilter}: the scalar comparison +
|
|
91
|
+
* text-pattern operators that take a single value, plus the list operator
|
|
92
|
+
* `in` (comma-separated values — pass an array as the condition value).
|
|
93
|
+
* Excludes the remaining list operators (`not_in`/`between`), the no-value
|
|
94
|
+
* operators (`is_null`/`is_not_null`), and the jsonb operators (`json_*`) —
|
|
95
|
+
* callers needing those build the DSL string manually with
|
|
96
|
+
* {@link CONTENT_FILTER_OPERATOR}.
|
|
97
|
+
*/
|
|
98
|
+
export declare const CONTENT_FILTER_SCALAR_OPERATOR: {
|
|
99
|
+
readonly EQ: "eq";
|
|
100
|
+
readonly NEQ: "neq";
|
|
101
|
+
readonly GT: "gt";
|
|
102
|
+
readonly GTE: "gte";
|
|
103
|
+
readonly LT: "lt";
|
|
104
|
+
readonly LTE: "lte";
|
|
105
|
+
readonly IN: "in";
|
|
106
|
+
readonly CONTAINS: "contains";
|
|
107
|
+
readonly STARTS_WITH: "starts_with";
|
|
108
|
+
readonly ENDS_WITH: "ends_with";
|
|
109
|
+
readonly REGEX: "regex";
|
|
110
|
+
readonly LIKE: "like";
|
|
111
|
+
readonly ILIKE: "ilike";
|
|
112
|
+
};
|
|
113
|
+
export type ContentFilterScalarOperator = (typeof CONTENT_FILTER_SCALAR_OPERATOR)[keyof typeof CONTENT_FILTER_SCALAR_OPERATOR];
|
|
114
|
+
//# sourceMappingURL=content.constant.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"content.constant.d.ts","sourceRoot":"","sources":["../../../src/common/constants/content.constant.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB;;4BAEZ,MAAM,KAAG,MAAM;IAC9B,0DAA0D;6BAC1C,MAAM,KAAG,MAAM;IAC/B,mDAAmD;4BACpC,MAAM,cAAc,MAAM,KAAG,MAAM;CAE1C,CAAC;AAEX,6EAA6E;AAC7E,eAAO,MAAM,gBAAgB;;;CAGnB,CAAC;AAEX;;;;;;;;;GASG;AACH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;CAyBf,CAAC;AAEX;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,OAAO,YAAY,CAAC,CAAC;AAE/E,8EAA8E;AAC9E,eAAO,MAAM,kBAAkB,EAAE,SAAS,eAAe,EAExD,CAAC;AAIF;;;;;;;;GAQG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;CAqB1B,CAAC;AACX,MAAM,MAAM,qBAAqB,GAC/B,CAAC,OAAO,uBAAuB,CAAC,CAAC,MAAM,OAAO,uBAAuB,CAAC,CAAC;AAEzE;;;;;;;;GAQG;AACH,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;CAcjC,CAAC;AACX,MAAM,MAAM,2BAA2B,GACrC,CAAC,OAAO,8BAA8B,CAAC,CAAC,MAAM,OAAO,8BAA8B,CAAC,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Content-executions endpoints (`eaera_cms/core/executions/routes.py`).
|
|
3
|
+
* Rule-scoped executions live under the rules namespace.
|
|
4
|
+
*/
|
|
5
|
+
export declare const EXECUTIONS_ENDPOINT: {
|
|
6
|
+
readonly BASE: "/api/v1/executions";
|
|
7
|
+
readonly detail: (uuid: string) => string;
|
|
8
|
+
readonly byContent: (id: number | string) => string;
|
|
9
|
+
};
|
|
10
|
+
/** Execution list query defaults. */
|
|
11
|
+
export declare const EXECUTIONS_DEFAULTS: {
|
|
12
|
+
readonly PAGE: 1;
|
|
13
|
+
readonly PER_PAGE: 50;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* `transition_name` values written to `content_executions.transition_name`
|
|
17
|
+
* by the rule engine and the content executor. The dashboard uses these
|
|
18
|
+
* to project an execution row back into the action that actually ran.
|
|
19
|
+
*
|
|
20
|
+
* `action` — outer audit row, committed by the trigger pod /
|
|
21
|
+
* API pod / cron evaluator when dispatch starts.
|
|
22
|
+
* `__action__` — inner audit row, committed by the executor pod when
|
|
23
|
+
* the pack handler returns (the row that proves the
|
|
24
|
+
* handler actually ran).
|
|
25
|
+
* `__update__` — generic content-field writer path used by
|
|
26
|
+
* `executionType: 'set_field'`. The executor projects
|
|
27
|
+
* this back to the friendly actionName `'set_field'`.
|
|
28
|
+
*/
|
|
29
|
+
export declare const EXECUTION_TRANSITION: {
|
|
30
|
+
readonly ACTION: "action";
|
|
31
|
+
readonly INNER_ACTION: "__action__";
|
|
32
|
+
readonly INNER_UPDATE: "__update__";
|
|
33
|
+
};
|
|
34
|
+
export type ExecutionTransition = (typeof EXECUTION_TRANSITION)[keyof typeof EXECUTION_TRANSITION];
|
|
35
|
+
/**
|
|
36
|
+
* `ContentExecution.status` lifecycle values
|
|
37
|
+
* (`eaera_cms/core/executions/routes.py` `ExecutionStatus` enum, mirrored
|
|
38
|
+
* by the SDK's `ExecutionStatus` type in `cms-sdk/.../executions.type.ts`).
|
|
39
|
+
*
|
|
40
|
+
* Use this constant when you need the bare string (the type alone isn't
|
|
41
|
+
* always importable from downstream utilities that don't depend on the
|
|
42
|
+
* SDK).
|
|
43
|
+
*/
|
|
44
|
+
export declare const EXECUTION_STATUS: {
|
|
45
|
+
readonly PENDING: "pending";
|
|
46
|
+
readonly RUNNING: "running";
|
|
47
|
+
readonly COMPLETED: "completed";
|
|
48
|
+
readonly FAILED: "failed";
|
|
49
|
+
readonly TIMEOUT: "timeout";
|
|
50
|
+
readonly ABORTED: "aborted";
|
|
51
|
+
readonly CANCELLED: "cancelled";
|
|
52
|
+
};
|
|
53
|
+
export type ExecutionStatus = (typeof EXECUTION_STATUS)[keyof typeof EXECUTION_STATUS];
|
|
54
|
+
/** UI-ordered list for status filter dropdowns. */
|
|
55
|
+
export declare const EXECUTION_STATUSES: readonly (typeof EXECUTION_STATUS)[keyof typeof EXECUTION_STATUS][];
|
|
56
|
+
//# sourceMappingURL=executions.constant.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"executions.constant.d.ts","sourceRoot":"","sources":["../../../src/common/constants/executions.constant.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,mBAAmB;;4BAEf,MAAM,KAAG,MAAM;6BACd,MAAM,GAAG,MAAM,KAAG,MAAM;CAChC,CAAC;AAEX,qCAAqC;AACrC,eAAO,MAAM,mBAAmB;;;CAGtB,CAAC;AAEX;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,oBAAoB;;;;CAIvB,CAAC;AAEX,MAAM,MAAM,mBAAmB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,OAAO,oBAAoB,CAAC,CAAC;AAEnG;;;;;;;;GAQG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;CAQnB,CAAC;AACX,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,OAAO,gBAAgB,CAAC,CAAC;AAEvF,mDAAmD;AACnD,eAAO,MAAM,kBAAkB,EAAE,SAAS,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,OAAO,gBAAgB,CAAC,EAS/F,CAAC"}
|