@burdenoff/be-sdk 2026.510.79

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (220) hide show
  1. package/README.md +173 -0
  2. package/configs/eslint/index.js +492 -0
  3. package/configs/tsconfig/tsconfig.json +53 -0
  4. package/dist/EventQueueFactory-6NMSGECR.js +8 -0
  5. package/dist/EventQueueFactory-6NMSGECR.js.map +1 -0
  6. package/dist/auth/index.d.ts +66 -0
  7. package/dist/auth/index.js +8 -0
  8. package/dist/auth/index.js.map +1 -0
  9. package/dist/cache/index.d.ts +2 -0
  10. package/dist/cache/index.js +6 -0
  11. package/dist/cache/index.js.map +1 -0
  12. package/dist/captcha/index.d.ts +1 -0
  13. package/dist/captcha/index.js +4 -0
  14. package/dist/captcha/index.js.map +1 -0
  15. package/dist/chunk-2HANKZZM.js +245 -0
  16. package/dist/chunk-2HANKZZM.js.map +1 -0
  17. package/dist/chunk-2SD5L2F2.js +816 -0
  18. package/dist/chunk-2SD5L2F2.js.map +1 -0
  19. package/dist/chunk-3O2RQOPV.js +1068 -0
  20. package/dist/chunk-3O2RQOPV.js.map +1 -0
  21. package/dist/chunk-4B43DZIS.js +560 -0
  22. package/dist/chunk-4B43DZIS.js.map +1 -0
  23. package/dist/chunk-4XAEES25.js +2444 -0
  24. package/dist/chunk-4XAEES25.js.map +1 -0
  25. package/dist/chunk-4XGGWW36.js +1405 -0
  26. package/dist/chunk-4XGGWW36.js.map +1 -0
  27. package/dist/chunk-5LXDPGDH.js +245 -0
  28. package/dist/chunk-5LXDPGDH.js.map +1 -0
  29. package/dist/chunk-AI7L22ZJ.js +472 -0
  30. package/dist/chunk-AI7L22ZJ.js.map +1 -0
  31. package/dist/chunk-CBZNP6RF.js +286 -0
  32. package/dist/chunk-CBZNP6RF.js.map +1 -0
  33. package/dist/chunk-ELLX3K54.js +613 -0
  34. package/dist/chunk-ELLX3K54.js.map +1 -0
  35. package/dist/chunk-F5XEAGHQ.js +1875 -0
  36. package/dist/chunk-F5XEAGHQ.js.map +1 -0
  37. package/dist/chunk-FNZEQOJY.js +628 -0
  38. package/dist/chunk-FNZEQOJY.js.map +1 -0
  39. package/dist/chunk-GTEMQXCA.js +516 -0
  40. package/dist/chunk-GTEMQXCA.js.map +1 -0
  41. package/dist/chunk-HIWTWIGQ.js +226 -0
  42. package/dist/chunk-HIWTWIGQ.js.map +1 -0
  43. package/dist/chunk-IYE2NTRX.js +764 -0
  44. package/dist/chunk-IYE2NTRX.js.map +1 -0
  45. package/dist/chunk-J26YGR2U.js +1484 -0
  46. package/dist/chunk-J26YGR2U.js.map +1 -0
  47. package/dist/chunk-JG2FTZPI.js +509 -0
  48. package/dist/chunk-JG2FTZPI.js.map +1 -0
  49. package/dist/chunk-JVBTNSPG.js +1551 -0
  50. package/dist/chunk-JVBTNSPG.js.map +1 -0
  51. package/dist/chunk-L7ZMN2FJ.js +12 -0
  52. package/dist/chunk-L7ZMN2FJ.js.map +1 -0
  53. package/dist/chunk-M5IMU3US.js +473 -0
  54. package/dist/chunk-M5IMU3US.js.map +1 -0
  55. package/dist/chunk-MLW2HPS5.js +1267 -0
  56. package/dist/chunk-MLW2HPS5.js.map +1 -0
  57. package/dist/chunk-MNCGUYLJ.js +269 -0
  58. package/dist/chunk-MNCGUYLJ.js.map +1 -0
  59. package/dist/chunk-MOCUBSTW.js +373 -0
  60. package/dist/chunk-MOCUBSTW.js.map +1 -0
  61. package/dist/chunk-NGMEI42S.js +103 -0
  62. package/dist/chunk-NGMEI42S.js.map +1 -0
  63. package/dist/chunk-NUB5GQTU.js +270 -0
  64. package/dist/chunk-NUB5GQTU.js.map +1 -0
  65. package/dist/chunk-OVSYMNCI.js +145 -0
  66. package/dist/chunk-OVSYMNCI.js.map +1 -0
  67. package/dist/chunk-QLVKMWFA.js +94 -0
  68. package/dist/chunk-QLVKMWFA.js.map +1 -0
  69. package/dist/chunk-SAG6ZYWQ.js +89 -0
  70. package/dist/chunk-SAG6ZYWQ.js.map +1 -0
  71. package/dist/chunk-SAK2JCA7.js +198 -0
  72. package/dist/chunk-SAK2JCA7.js.map +1 -0
  73. package/dist/chunk-SBS4S2PJ.js +100 -0
  74. package/dist/chunk-SBS4S2PJ.js.map +1 -0
  75. package/dist/chunk-SNEOLWXT.js +148 -0
  76. package/dist/chunk-SNEOLWXT.js.map +1 -0
  77. package/dist/chunk-TKBD2ONF.js +564 -0
  78. package/dist/chunk-TKBD2ONF.js.map +1 -0
  79. package/dist/chunk-UBXFIIAW.js +127 -0
  80. package/dist/chunk-UBXFIIAW.js.map +1 -0
  81. package/dist/chunk-VI4VSNTI.js +57 -0
  82. package/dist/chunk-VI4VSNTI.js.map +1 -0
  83. package/dist/chunk-VWCN5PMD.js +268 -0
  84. package/dist/chunk-VWCN5PMD.js.map +1 -0
  85. package/dist/chunk-XC2YD6CF.js +913 -0
  86. package/dist/chunk-XC2YD6CF.js.map +1 -0
  87. package/dist/chunk-XE4OXN2W.js +10 -0
  88. package/dist/chunk-XE4OXN2W.js.map +1 -0
  89. package/dist/chunk-YMZEUTD2.js +110 -0
  90. package/dist/chunk-YMZEUTD2.js.map +1 -0
  91. package/dist/chunk-Z4IRLBWO.js +758 -0
  92. package/dist/chunk-Z4IRLBWO.js.map +1 -0
  93. package/dist/client/internal-client.d.ts +7 -0
  94. package/dist/client/internal-client.js +5 -0
  95. package/dist/client/internal-client.js.map +1 -0
  96. package/dist/client-CSjIrYKS.d.ts +77 -0
  97. package/dist/config-UKE2E3BW.js +4 -0
  98. package/dist/config-UKE2E3BW.js.map +1 -0
  99. package/dist/crypto/index.d.ts +1 -0
  100. package/dist/crypto/index.js +4 -0
  101. package/dist/crypto/index.js.map +1 -0
  102. package/dist/database/index.d.ts +117 -0
  103. package/dist/database/index.js +7 -0
  104. package/dist/database/index.js.map +1 -0
  105. package/dist/dataloader/index.d.ts +1 -0
  106. package/dist/dataloader/index.js +4 -0
  107. package/dist/dataloader/index.js.map +1 -0
  108. package/dist/esm-K6H7EIWK.js +1450 -0
  109. package/dist/esm-K6H7EIWK.js.map +1 -0
  110. package/dist/event-queue/index.d.ts +6 -0
  111. package/dist/event-queue/index.js +10 -0
  112. package/dist/event-queue/index.js.map +1 -0
  113. package/dist/export/index.d.ts +2 -0
  114. package/dist/export/index.js +9 -0
  115. package/dist/export/index.js.map +1 -0
  116. package/dist/feature-flags/index.d.ts +1 -0
  117. package/dist/feature-flags/index.js +4 -0
  118. package/dist/feature-flags/index.js.map +1 -0
  119. package/dist/gateway/index.d.ts +4 -0
  120. package/dist/gateway/index.js +8 -0
  121. package/dist/gateway/index.js.map +1 -0
  122. package/dist/gateway/security/index.d.ts +2 -0
  123. package/dist/gateway/security/index.js +5 -0
  124. package/dist/gateway/security/index.js.map +1 -0
  125. package/dist/graph/index.d.ts +9 -0
  126. package/dist/graph/index.js +13 -0
  127. package/dist/graph/index.js.map +1 -0
  128. package/dist/graph-emitter-Bk0FqD53.d.ts +47 -0
  129. package/dist/graphql/index.d.ts +2 -0
  130. package/dist/graphql/index.js +7 -0
  131. package/dist/graphql/index.js.map +1 -0
  132. package/dist/graphql/services/index.d.ts +24 -0
  133. package/dist/graphql/services/index.js +5 -0
  134. package/dist/graphql/services/index.js.map +1 -0
  135. package/dist/graphql-BAVrUgBF.d.ts +22 -0
  136. package/dist/i18n/index.d.ts +2 -0
  137. package/dist/i18n/index.js +5 -0
  138. package/dist/i18n/index.js.map +1 -0
  139. package/dist/i18n-DA6IPnYy.d.ts +101 -0
  140. package/dist/index-4gKQKZ2B.d.ts +71 -0
  141. package/dist/index-B18rrFru.d.ts +42 -0
  142. package/dist/index-B70b5mYS.d.ts +33 -0
  143. package/dist/index-BMq3lFjj.d.ts +247 -0
  144. package/dist/index-BODgvRtL.d.ts +316 -0
  145. package/dist/index-BS2idbnr.d.ts +874 -0
  146. package/dist/index-BV3G48cH.d.ts +124 -0
  147. package/dist/index-CHbVw5M7.d.ts +73 -0
  148. package/dist/index-Cq_xNjcv.d.ts +602 -0
  149. package/dist/index-CrQgidpx.d.ts +77 -0
  150. package/dist/index-CyVEg86m.d.ts +309 -0
  151. package/dist/index-DOcBnmMe.d.ts +166 -0
  152. package/dist/index-DSOpj8DI.d.ts +17 -0
  153. package/dist/index-DW9q22GH.d.ts +75 -0
  154. package/dist/index-DlFDFyWD.d.ts +55 -0
  155. package/dist/index-DoK0bjhH.d.ts +607 -0
  156. package/dist/index-Dtf6FBaD.d.ts +199 -0
  157. package/dist/index-KVWGHMbS.d.ts +415 -0
  158. package/dist/index-PaojfSdd.d.ts +71 -0
  159. package/dist/index-RU_M5c74.d.ts +163 -0
  160. package/dist/index-UhkH2eaB.d.ts +192 -0
  161. package/dist/index-e_18DzAg.d.ts +18 -0
  162. package/dist/index-jOuh_TKn.d.ts +59 -0
  163. package/dist/index.d.ts +584 -0
  164. package/dist/index.js +2626 -0
  165. package/dist/index.js.map +1 -0
  166. package/dist/init/index.d.ts +2 -0
  167. package/dist/init/index.js +12 -0
  168. package/dist/init/index.js.map +1 -0
  169. package/dist/instrumentation/index.d.ts +3 -0
  170. package/dist/instrumentation/index.js +5 -0
  171. package/dist/instrumentation/index.js.map +1 -0
  172. package/dist/layer/index.d.ts +2 -0
  173. package/dist/layer/index.js +6 -0
  174. package/dist/layer/index.js.map +1 -0
  175. package/dist/layer-DDip18KY.d.ts +67 -0
  176. package/dist/logger/index.d.ts +2 -0
  177. package/dist/logger/index.js +4 -0
  178. package/dist/logger/index.js.map +1 -0
  179. package/dist/middleware/index.d.ts +3 -0
  180. package/dist/middleware/index.js +5 -0
  181. package/dist/middleware/index.js.map +1 -0
  182. package/dist/notifications/index.d.ts +4 -0
  183. package/dist/notifications/index.js +7 -0
  184. package/dist/notifications/index.js.map +1 -0
  185. package/dist/observability/index.d.ts +3 -0
  186. package/dist/observability/index.js +5 -0
  187. package/dist/observability/index.js.map +1 -0
  188. package/dist/pino-logger-RYLGXPHZ.js +5 -0
  189. package/dist/pino-logger-RYLGXPHZ.js.map +1 -0
  190. package/dist/prisma/generator/index.d.ts +1 -0
  191. package/dist/prisma/generator/index.js +228 -0
  192. package/dist/prisma/generator/index.js.map +1 -0
  193. package/dist/prisma/index.d.ts +5 -0
  194. package/dist/prisma/index.js +12 -0
  195. package/dist/prisma/index.js.map +1 -0
  196. package/dist/prisma-extension-krXnYnrN.d.ts +30 -0
  197. package/dist/rbac/index.d.ts +116 -0
  198. package/dist/rbac/index.js +7 -0
  199. package/dist/rbac/index.js.map +1 -0
  200. package/dist/sdk-THO3IWEE.js +136 -0
  201. package/dist/sdk-THO3IWEE.js.map +1 -0
  202. package/dist/server/index.d.ts +359 -0
  203. package/dist/server/index.js +884 -0
  204. package/dist/server/index.js.map +1 -0
  205. package/dist/telemetry/index.d.ts +83 -0
  206. package/dist/telemetry/index.js +209 -0
  207. package/dist/telemetry/index.js.map +1 -0
  208. package/dist/temporal/index.d.ts +148 -0
  209. package/dist/temporal/index.js +6 -0
  210. package/dist/temporal/index.js.map +1 -0
  211. package/dist/tracker/index.d.ts +5 -0
  212. package/dist/tracker/index.js +9 -0
  213. package/dist/tracker/index.js.map +1 -0
  214. package/dist/types-Bo2wkjSP.d.ts +35 -0
  215. package/dist/utils/index.d.ts +1 -0
  216. package/dist/utils/index.js +4 -0
  217. package/dist/utils/index.js.map +1 -0
  218. package/dist/workspace-guard-LHBNK4TG.js +5 -0
  219. package/dist/workspace-guard-LHBNK4TG.js.map +1 -0
  220. package/package.json +241 -0
@@ -0,0 +1,584 @@
1
+ import { S as SDKContext, a as SDKConfig, N as NatsHealthStatus, T as TemporalHealthStatus, b as SDKHealthStatus, c as SDKShutdownOptions } from './index-CHbVw5M7.js';
2
+ export { L as LoggerConfig, d as LoggerTransport, e as NATSSDKConfig } from './index-CHbVw5M7.js';
3
+ import { L as Logger } from './index-CrQgidpx.js';
4
+ export { i as Logger } from './index-CrQgidpx.js';
5
+ import { AuthModule } from './auth/index.js';
6
+ import { T as TenantNotificationsModule, a as NotificationsModule } from './index-CyVEg86m.js';
7
+ export { t as Notifications } from './index-CyVEg86m.js';
8
+ import { RBACModule } from './rbac/index.js';
9
+ export { LayerAwareRBACConfig, RBACDirectiveConfig, createRBACDirective, createRBACDirectiveForLayer, createRBACDirectiveFromEnv } from './rbac/index.js';
10
+ import { A as ActivityModule, U as UsageModule, T as TrackerModule } from './index-KVWGHMbS.js';
11
+ import { DatabaseConfig, DatabaseModule } from './database/index.js';
12
+ import { E as EventsModule, I as IEventPublisher } from './index-Cq_xNjcv.js';
13
+ export { i as EventQueue } from './index-Cq_xNjcv.js';
14
+ import { G as GraphModule } from './index-BS2idbnr.js';
15
+ export { i as Graph } from './index-BS2idbnr.js';
16
+ import { B as BurdenoffGraphQLClient } from './graphql-BAVrUgBF.js';
17
+ import { TemporalModule } from './temporal/index.js';
18
+ export { TemporalClient, TemporalClientConfig, TemporalClientFactory, TemporalWorker, TemporalWorkerConfig, TemporalWorkerFactory, TemporalWorkerManager, WorkflowStartOptions } from './temporal/index.js';
19
+ export { createInternalClient, createInternalClientForTenant, createInternalClientForWorkspaces } from './client/internal-client.js';
20
+ export { i as Cache } from './index-BODgvRtL.js';
21
+ export { i as Middleware } from './index-DSOpj8DI.js';
22
+ export { i as Observability } from './index-4gKQKZ2B.js';
23
+ export { i as GraphQL } from './index-B18rrFru.js';
24
+ export { i as Prisma } from './index-Dtf6FBaD.js';
25
+ export { i as Utils } from './index-PaojfSdd.js';
26
+ export { i as I18n, I as I18nCapableContext, T as Translator, c as createTranslator, g as getLanguage, a as getLocale, h as hasI18n, t } from './index-BV3G48cH.js';
27
+ export { i as Export } from './index-BMq3lFjj.js';
28
+ export { i as Init } from './index-DOcBnmMe.js';
29
+ export { i as DataLoader } from './index-DW9q22GH.js';
30
+ export { a as Instrumentation } from './index-DoK0bjhH.js';
31
+ export { i as Layer } from './index-DlFDFyWD.js';
32
+ export { i as Crypto } from './index-e_18DzAg.js';
33
+ export { i as Gateway } from './index-RU_M5c74.js';
34
+ export { i as FeatureFlags } from './index-jOuh_TKn.js';
35
+ export { i as Captcha, R as RecaptchaVerifyOptions, a as RecaptchaVerifyResult, b as isCaptchaEnabled, v as verifyCaptcha, c as verifyCaptchaIfEnabled } from './index-B70b5mYS.js';
36
+ export { C as CircuitBreakerConfig, h as DEFAULT_CIRCUIT_BREAKER_CONFIG, i as DEFAULT_GATEWAY_RETRY_CONFIG, D as DEFAULT_GATEWAY_ROUTING, b as DEFAULT_LAYER_RESOURCES, c as DEFAULT_LAYER_STREAMS, f as GatewayRequestHeaders, g as GatewayRetryConfig, G as GatewayRoutingConfig, L as LayerConfig, a as LayerFullConfig, d as LayerGatewayConfig, e as LayerResourceUrls, S as ServiceLayer } from './layer-DDip18KY.js';
37
+ import 'graphql-request';
38
+ import '@envelop/core';
39
+ import '@clickhouse/client';
40
+ import './graph-emitter-Bk0FqD53.js';
41
+ import './client-CSjIrYKS.js';
42
+ import '@prisma/adapter-pg';
43
+ import 'pg';
44
+ import './prisma-extension-krXnYnrN.js';
45
+ import '@temporalio/client';
46
+ import '@temporalio/common';
47
+ import 'elysia';
48
+ import './types-Bo2wkjSP.js';
49
+ import './graphql/services/index.js';
50
+ import './i18n-DA6IPnYy.js';
51
+ import './index-UhkH2eaB.js';
52
+ import 'graphql-yoga';
53
+
54
+ declare class ContextManager {
55
+ static getContext(): SDKContext | undefined;
56
+ static setContext(context: SDKContext): void;
57
+ static withContext<T>(context: SDKContext, fn: () => Promise<T>): Promise<T>;
58
+ static withContextSync<T>(context: SDKContext, fn: () => T): T;
59
+ static clearContext(): void;
60
+ static getActorId(): string | undefined;
61
+ static getUser(): string | undefined;
62
+ static getWorkspace(): string | undefined;
63
+ static getTenant(): string | undefined;
64
+ static getOrganization(): string | undefined;
65
+ static getProject(): string | undefined;
66
+ static getApp(): string | undefined;
67
+ static getToken(): string | undefined;
68
+ static getProduct(): string | undefined;
69
+ static updateContext(updates: Partial<SDKContext>): void;
70
+ static hasContext(): boolean;
71
+ static getCustomField(key: string): unknown;
72
+ static setCustomField(key: string, value: unknown): void;
73
+ }
74
+
75
+ interface SearchOptions {
76
+ query: string;
77
+ resourceTypes?: string[];
78
+ workspaceId?: string;
79
+ organizationId?: string;
80
+ projectId?: string;
81
+ fields?: string[];
82
+ fuzziness?: number;
83
+ boosts?: Record<string, number>;
84
+ filters?: SearchFilter[];
85
+ sort?: SearchSort[];
86
+ limit?: number;
87
+ offset?: number;
88
+ highlight?: boolean;
89
+ }
90
+ interface SearchFilter {
91
+ field: string;
92
+ operator: 'eq' | 'ne' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'range';
93
+ value: unknown;
94
+ }
95
+ interface SearchSort {
96
+ field: string;
97
+ order: 'asc' | 'desc';
98
+ }
99
+ interface SearchResult {
100
+ id: string;
101
+ type: string;
102
+ title: string;
103
+ description?: string;
104
+ data: Record<string, unknown>;
105
+ workspaceId?: string;
106
+ organizationId?: string;
107
+ projectId?: string;
108
+ score: number;
109
+ highlights?: Record<string, string[]>;
110
+ createdAt: string;
111
+ updatedAt: string;
112
+ }
113
+ interface SearchResponse {
114
+ results: SearchResult[];
115
+ total: number;
116
+ took: number;
117
+ aggregations?: Record<string, SearchAggregation>;
118
+ }
119
+ interface SearchAggregation {
120
+ buckets: Array<{
121
+ key: string;
122
+ count: number;
123
+ }>;
124
+ }
125
+ interface IndexDocumentOptions {
126
+ id: string;
127
+ type: string;
128
+ title: string;
129
+ description?: string;
130
+ content?: string;
131
+ data: Record<string, unknown>;
132
+ workspaceId?: string;
133
+ organizationId?: string;
134
+ projectId?: string;
135
+ tags?: string[];
136
+ metadata?: Record<string, unknown>;
137
+ }
138
+ declare class SearchModule {
139
+ private client;
140
+ private context;
141
+ constructor(client: BurdenoffGraphQLClient, context: SDKContext);
142
+ search(options: SearchOptions): Promise<SearchResponse>;
143
+ indexDocument(options: IndexDocumentOptions): Promise<{
144
+ id: string;
145
+ indexed: boolean;
146
+ }>;
147
+ removeDocument(id: string, type: string): Promise<boolean>;
148
+ updateDocument(id: string, type: string, updates: Partial<IndexDocumentOptions>): Promise<{
149
+ id: string;
150
+ updated: boolean;
151
+ }>;
152
+ indexDocumentsBulk(documents: IndexDocumentOptions[]): Promise<{
153
+ indexed: number;
154
+ failed: number;
155
+ errors: string[];
156
+ }>;
157
+ suggest(prefix: string, options?: {
158
+ resourceTypes?: string[];
159
+ limit?: number;
160
+ }): Promise<Array<{
161
+ text: string;
162
+ score: number;
163
+ type?: string;
164
+ }>>;
165
+ getRelated(documentId: string, options?: {
166
+ limit?: number;
167
+ minScore?: number;
168
+ }): Promise<SearchResult[]>;
169
+ aggregate(query: string, aggregations: Array<{
170
+ field: string;
171
+ type: 'terms' | 'date_histogram' | 'range';
172
+ size?: number;
173
+ }>): Promise<Record<string, SearchAggregation>>;
174
+ clearIndex(workspaceId?: string): Promise<{
175
+ deletedCount: number;
176
+ }>;
177
+ reindex(options?: {
178
+ workspaceId?: string;
179
+ resourceTypes?: string[];
180
+ }): Promise<{
181
+ indexed: number;
182
+ failed: number;
183
+ }>;
184
+ }
185
+
186
+ type SupportedLanguage = 'en' | 'es' | 'fr' | 'de' | 'it' | 'pt' | 'ru' | 'zh' | 'ja' | 'ko' | 'ar' | 'hi' | 'bn' | 'ta' | 'te' | 'ml';
187
+ interface TranslationOptions {
188
+ text: string;
189
+ sourceLanguage?: SupportedLanguage;
190
+ targetLanguage: SupportedLanguage;
191
+ context?: string;
192
+ variables?: Record<string, string | number>;
193
+ }
194
+ interface Translation {
195
+ original: string;
196
+ translated: string;
197
+ sourceLanguage: string;
198
+ targetLanguage: string;
199
+ confidence?: number;
200
+ }
201
+ interface GetTranslationsOptions {
202
+ keys: string[];
203
+ language: SupportedLanguage;
204
+ namespace?: string;
205
+ fallbackLanguage?: SupportedLanguage;
206
+ }
207
+ interface TranslationKey {
208
+ key: string;
209
+ value: string;
210
+ language: SupportedLanguage;
211
+ namespace?: string;
212
+ description?: string;
213
+ variables?: string[];
214
+ }
215
+ interface SetTranslationOptions {
216
+ key: string;
217
+ value: string;
218
+ language: SupportedLanguage;
219
+ namespace?: string;
220
+ description?: string;
221
+ variables?: string[];
222
+ }
223
+ type TranslationExportFormat = 'JSON' | 'CSV' | 'XLSX' | 'PO' | 'XLIFF';
224
+ interface ProductTranslationTree {
225
+ [key: string]: string | ProductTranslationTree;
226
+ }
227
+ interface ExportProductTranslationsOptions {
228
+ productId?: string;
229
+ productName?: string;
230
+ languageCode?: string;
231
+ format?: TranslationExportFormat;
232
+ decodeJson?: boolean;
233
+ }
234
+ interface ProductTranslationsExportResult {
235
+ format: TranslationExportFormat;
236
+ url: string;
237
+ translations?: Record<string, unknown>;
238
+ }
239
+ interface UpsertProductTranslationsOptions {
240
+ productId?: string;
241
+ productName?: string;
242
+ languageCode: string;
243
+ translations: Record<string, string> | ProductTranslationTree;
244
+ defaultValues?: Record<string, string> | ProductTranslationTree;
245
+ updateExisting?: boolean;
246
+ publish?: boolean;
247
+ }
248
+ interface UpsertProductTranslationsResult {
249
+ productId: string;
250
+ languageCode: string;
251
+ keysProcessed: number;
252
+ createdKeys: number;
253
+ updatedKeyDefaults: number;
254
+ createdTranslations: number;
255
+ updatedTranslations: number;
256
+ }
257
+ declare class TranslationModule {
258
+ private client;
259
+ private context;
260
+ constructor(client: BurdenoffGraphQLClient, context: SDKContext);
261
+ translate(options: TranslationOptions): Promise<Translation>;
262
+ getTranslations(options: GetTranslationsOptions): Promise<Record<string, string>>;
263
+ get(key: string, language: SupportedLanguage, variables?: Record<string, string | number>): Promise<string>;
264
+ setTranslation(options: SetTranslationOptions): Promise<TranslationKey>;
265
+ deleteTranslation(key: string, language: SupportedLanguage, namespace?: string): Promise<boolean>;
266
+ setTranslationsBatch(translations: SetTranslationOptions[]): Promise<TranslationKey[]>;
267
+ getAllTranslations(language: SupportedLanguage, namespace?: string): Promise<TranslationKey[]>;
268
+ detectLanguage(text: string): Promise<{
269
+ language: SupportedLanguage;
270
+ confidence: number;
271
+ }>;
272
+ getSupportedLanguages(): Promise<Array<{
273
+ code: SupportedLanguage;
274
+ name: string;
275
+ nativeName: string;
276
+ }>>;
277
+ importTranslations(language: SupportedLanguage, translations: Record<string, string>, namespace?: string): Promise<{
278
+ imported: number;
279
+ failed: number;
280
+ }>;
281
+ exportTranslations(language: SupportedLanguage, namespace?: string): Promise<Record<string, string>>;
282
+ exportProductTranslations(options: ExportProductTranslationsOptions): Promise<ProductTranslationsExportResult>;
283
+ upsertProductTranslations(options: UpsertProductTranslationsOptions): Promise<UpsertProductTranslationsResult>;
284
+ private flattenTranslationTree;
285
+ private decodeDataUrlJson;
286
+ private resolveProductId;
287
+ private findTranslationKeyByKey;
288
+ private createTranslationKey;
289
+ private updateTranslationKeyDefaultValue;
290
+ private findGlobalTranslation;
291
+ private createLanguageTranslation;
292
+ private updateLanguageTranslation;
293
+ private escapeRegex;
294
+ private interpolate;
295
+ formatPlural(_language: SupportedLanguage, count: number, translations: {
296
+ zero?: string;
297
+ one: string;
298
+ other: string;
299
+ }): string;
300
+ formatDateTime(date: Date | string, language: SupportedLanguage, options?: Intl.DateTimeFormatOptions): string;
301
+ formatNumber(number: number, language: SupportedLanguage, options?: Intl.NumberFormatOptions): string;
302
+ formatCurrency(amount: number, currency: string, language: SupportedLanguage): string;
303
+ }
304
+
305
+ declare enum PaymentStatus {
306
+ PENDING = "pending",
307
+ PROCESSING = "processing",
308
+ SUCCEEDED = "succeeded",
309
+ FAILED = "failed",
310
+ CANCELLED = "cancelled",
311
+ REFUNDED = "refunded"
312
+ }
313
+ declare enum PaymentMethod {
314
+ CREDIT_CARD = "credit_card",
315
+ DEBIT_CARD = "debit_card",
316
+ BANK_TRANSFER = "bank_transfer",
317
+ UPI = "upi",
318
+ WALLET = "wallet",
319
+ PAYPAL = "paypal",
320
+ STRIPE = "stripe"
321
+ }
322
+ declare enum SubscriptionStatus {
323
+ ACTIVE = "active",
324
+ INACTIVE = "inactive",
325
+ CANCELLED = "cancelled",
326
+ EXPIRED = "expired",
327
+ PAST_DUE = "past_due",
328
+ TRIALING = "trialing"
329
+ }
330
+ interface CreatePaymentOptions {
331
+ amount: number;
332
+ currency: string;
333
+ paymentMethod: PaymentMethod;
334
+ customerId: string;
335
+ description?: string;
336
+ metadata?: Record<string, unknown>;
337
+ workspaceId?: string;
338
+ organizationId?: string;
339
+ }
340
+ interface Payment {
341
+ id: string;
342
+ amount: number;
343
+ currency: string;
344
+ status: PaymentStatus;
345
+ paymentMethod: PaymentMethod;
346
+ customerId: string;
347
+ description?: string;
348
+ metadata?: Record<string, unknown>;
349
+ workspaceId?: string;
350
+ organizationId?: string;
351
+ transactionId?: string;
352
+ failureReason?: string;
353
+ createdAt: string;
354
+ updatedAt: string;
355
+ }
356
+ interface CreateSubscriptionOptions {
357
+ customerId: string;
358
+ planId: string;
359
+ paymentMethod: PaymentMethod;
360
+ trialDays?: number;
361
+ metadata?: Record<string, unknown>;
362
+ workspaceId?: string;
363
+ organizationId?: string;
364
+ }
365
+ interface Subscription {
366
+ id: string;
367
+ customerId: string;
368
+ planId: string;
369
+ status: SubscriptionStatus;
370
+ currentPeriodStart: string;
371
+ currentPeriodEnd: string;
372
+ trialEnd?: string;
373
+ cancelledAt?: string;
374
+ endedAt?: string;
375
+ metadata?: Record<string, unknown>;
376
+ workspaceId?: string;
377
+ organizationId?: string;
378
+ createdAt: string;
379
+ updatedAt: string;
380
+ }
381
+ interface Plan {
382
+ id: string;
383
+ name: string;
384
+ description?: string;
385
+ amount: number;
386
+ currency: string;
387
+ interval: 'day' | 'week' | 'month' | 'year';
388
+ intervalCount: number;
389
+ features?: string[];
390
+ metadata?: Record<string, unknown>;
391
+ active: boolean;
392
+ createdAt: string;
393
+ }
394
+ interface GetPaymentsOptions {
395
+ customerId?: string;
396
+ status?: PaymentStatus;
397
+ workspaceId?: string;
398
+ organizationId?: string;
399
+ startDate?: string;
400
+ endDate?: string;
401
+ limit?: number;
402
+ offset?: number;
403
+ }
404
+ declare class PaymentsModule {
405
+ private client;
406
+ private context;
407
+ constructor(client: BurdenoffGraphQLClient, context: SDKContext);
408
+ createPayment(options: CreatePaymentOptions): Promise<Payment>;
409
+ getPayment(paymentId: string): Promise<Payment>;
410
+ getPayments(options: GetPaymentsOptions): Promise<{
411
+ payments: Payment[];
412
+ total: number;
413
+ }>;
414
+ refundPayment(paymentId: string, amount?: number, reason?: string): Promise<Payment>;
415
+ verifyPayment(paymentId: string, verificationData: Record<string, unknown>): Promise<{
416
+ verified: boolean;
417
+ status: PaymentStatus;
418
+ }>;
419
+ createSubscription(options: CreateSubscriptionOptions): Promise<Subscription>;
420
+ getSubscription(subscriptionId: string): Promise<Subscription>;
421
+ cancelSubscription(subscriptionId: string, cancelAtPeriodEnd?: boolean): Promise<Subscription>;
422
+ getCustomerSubscriptions(customerId: string): Promise<Subscription[]>;
423
+ getPlans(activeOnly?: boolean): Promise<Plan[]>;
424
+ createPaymentIntent(options: {
425
+ amount: number;
426
+ currency: string;
427
+ customerId: string;
428
+ paymentMethod?: PaymentMethod;
429
+ metadata?: Record<string, unknown>;
430
+ }): Promise<{
431
+ clientSecret: string;
432
+ paymentIntentId: string;
433
+ }>;
434
+ getPaymentStats(options?: {
435
+ startDate?: string;
436
+ endDate?: string;
437
+ workspaceId?: string;
438
+ }): Promise<{
439
+ totalRevenue: number;
440
+ totalPayments: number;
441
+ successfulPayments: number;
442
+ failedPayments: number;
443
+ refundedAmount: number;
444
+ averagePaymentAmount: number;
445
+ }>;
446
+ }
447
+
448
+ type HeaderValue = string | string[] | undefined;
449
+ interface BootstrapConfig extends SDKConfig {
450
+ database?: DatabaseConfig;
451
+ healthCheck?: boolean;
452
+ healthCheckInterval?: number;
453
+ modules?: string[];
454
+ environment?: 'development' | 'staging' | 'production';
455
+ serviceName?: string;
456
+ serviceVersion?: string;
457
+ healthCheckPort?: number;
458
+ }
459
+ interface BootstrapResult {
460
+ success: boolean;
461
+ serviceName: string;
462
+ serviceVersion: string;
463
+ environment: string;
464
+ startedAt: string;
465
+ modules: string[];
466
+ databaseConnected: boolean;
467
+ healthCheckEnabled: boolean;
468
+ }
469
+ interface BootstrapHealthCheckResult {
470
+ healthy: boolean;
471
+ checks: {
472
+ database?: boolean;
473
+ graphql?: boolean;
474
+ memory?: {
475
+ used: number;
476
+ total: number;
477
+ percentage: number;
478
+ };
479
+ uptime?: number;
480
+ };
481
+ timestamp: string;
482
+ }
483
+ declare class BootstrapModule {
484
+ private config;
485
+ private startTime;
486
+ private healthCheckInterval?;
487
+ constructor(config: BootstrapConfig);
488
+ bootstrap(): Promise<BootstrapResult>;
489
+ private validateConfiguration;
490
+ private connectDatabase;
491
+ private loadModules;
492
+ private setupHealthChecks;
493
+ performHealthCheck(): Promise<BootstrapHealthCheckResult>;
494
+ private setupSignalHandlers;
495
+ private cleanup;
496
+ getInfo(): {
497
+ serviceName: string;
498
+ serviceVersion: string;
499
+ environment: string;
500
+ uptime: number;
501
+ startedAt: string;
502
+ };
503
+ setupDefaultContext(context: SDKContext): void;
504
+ createContextMiddleware(): (req: {
505
+ headers: Record<string, HeaderValue>;
506
+ user?: unknown;
507
+ }, _res: unknown, next: () => void) => Promise<void>;
508
+ private extractContextFromRequest;
509
+ loadSchema(schemaPath: string): Promise<boolean>;
510
+ onShutdown(callback: () => Promise<void> | void): void;
511
+ isReady(): Promise<boolean>;
512
+ getMetrics(): {
513
+ memory: NodeJS.MemoryUsage;
514
+ uptime: number;
515
+ cpu: NodeJS.CpuUsage;
516
+ };
517
+ }
518
+ declare function createBootstrap(config: BootstrapConfig): BootstrapModule;
519
+
520
+ interface TenantBackendClientConfig {
521
+ tenantBackendUrl: string;
522
+ workspacesBackendUrl?: string;
523
+ apiKey?: string;
524
+ }
525
+ declare class TenantBackendClient {
526
+ private graphqlClient;
527
+ private config;
528
+ readonly notifications: TenantNotificationsModule;
529
+ constructor(config: TenantBackendClientConfig);
530
+ setAuthToken(token: string): void;
531
+ query<T>(query: string, variables?: Record<string, unknown>): Promise<T>;
532
+ healthCheck(): Promise<boolean>;
533
+ getClient(): BurdenoffGraphQLClient;
534
+ getConfig(): TenantBackendClientConfig;
535
+ }
536
+ declare function createTenantBackendClient(config: TenantBackendClientConfig): TenantBackendClient;
537
+
538
+ declare class BurdenoffSDK {
539
+ private client;
540
+ private defaultContext;
541
+ private natsPublisher;
542
+ private natsInitPromise;
543
+ private natsConfig;
544
+ private initializationPromise;
545
+ private isShuttingDown;
546
+ readonly auth: AuthModule;
547
+ readonly notifications: NotificationsModule;
548
+ readonly tenantNotifications: TenantNotificationsModule;
549
+ readonly rbac: RBACModule;
550
+ readonly activity: ActivityModule;
551
+ readonly usage: UsageModule;
552
+ readonly tracker: TrackerModule;
553
+ readonly database: typeof DatabaseModule;
554
+ readonly events: EventsModule;
555
+ readonly graph: GraphModule;
556
+ readonly search: SearchModule;
557
+ readonly translation: TranslationModule;
558
+ readonly payments: PaymentsModule;
559
+ private _temporal;
560
+ private _temporalPromise;
561
+ private _temporalConfig;
562
+ getTemporalModule(): Promise<TemporalModule>;
563
+ private loadTemporalModule;
564
+ readonly logger: Logger;
565
+ readonly context: typeof ContextManager;
566
+ constructor(config: SDKConfig, defaultContext?: SDKContext);
567
+ private scheduleBackgroundInit;
568
+ setContext(context: SDKContext): void;
569
+ getContext(): SDKContext | undefined;
570
+ withContext<T>(context: SDKContext, fn: () => Promise<T>): Promise<T>;
571
+ private initializeAsync;
572
+ private initializeNats;
573
+ getNatsPublisher(): Promise<IEventPublisher>;
574
+ waitForReady(): Promise<void>;
575
+ isNatsHealthy(): Promise<NatsHealthStatus>;
576
+ isTemporalHealthy(): Promise<TemporalHealthStatus>;
577
+ getHealthStatus(): Promise<SDKHealthStatus>;
578
+ shutdown(options?: SDKShutdownOptions): Promise<void>;
579
+ static createBootstrap(config: Parameters<typeof createBootstrap>[0]): BootstrapModule;
580
+ }
581
+
582
+ declare function createSDK(config: SDKConfig, context?: SDKContext): BurdenoffSDK;
583
+
584
+ export { ActivityModule, AuthModule, BootstrapModule, BurdenoffGraphQLClient, BurdenoffSDK, ContextManager, DatabaseModule, EventsModule, type ExportProductTranslationsOptions, GraphModule, NatsHealthStatus, NotificationsModule, PaymentsModule, type ProductTranslationTree, type ProductTranslationsExportResult, RBACModule, SDKConfig, SDKContext, SDKHealthStatus, SDKShutdownOptions, SearchModule, TemporalHealthStatus, TemporalModule, TenantBackendClient, type TenantBackendClientConfig, TrackerModule, type TranslationExportFormat, TranslationModule, type UpsertProductTranslationsOptions, type UpsertProductTranslationsResult, UsageModule, createBootstrap, createSDK, createTenantBackendClient, BurdenoffSDK as default };