@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.
- package/README.md +173 -0
- package/configs/eslint/index.js +492 -0
- package/configs/tsconfig/tsconfig.json +53 -0
- package/dist/EventQueueFactory-6NMSGECR.js +8 -0
- package/dist/EventQueueFactory-6NMSGECR.js.map +1 -0
- package/dist/auth/index.d.ts +66 -0
- package/dist/auth/index.js +8 -0
- package/dist/auth/index.js.map +1 -0
- package/dist/cache/index.d.ts +2 -0
- package/dist/cache/index.js +6 -0
- package/dist/cache/index.js.map +1 -0
- package/dist/captcha/index.d.ts +1 -0
- package/dist/captcha/index.js +4 -0
- package/dist/captcha/index.js.map +1 -0
- package/dist/chunk-2HANKZZM.js +245 -0
- package/dist/chunk-2HANKZZM.js.map +1 -0
- package/dist/chunk-2SD5L2F2.js +816 -0
- package/dist/chunk-2SD5L2F2.js.map +1 -0
- package/dist/chunk-3O2RQOPV.js +1068 -0
- package/dist/chunk-3O2RQOPV.js.map +1 -0
- package/dist/chunk-4B43DZIS.js +560 -0
- package/dist/chunk-4B43DZIS.js.map +1 -0
- package/dist/chunk-4XAEES25.js +2444 -0
- package/dist/chunk-4XAEES25.js.map +1 -0
- package/dist/chunk-4XGGWW36.js +1405 -0
- package/dist/chunk-4XGGWW36.js.map +1 -0
- package/dist/chunk-5LXDPGDH.js +245 -0
- package/dist/chunk-5LXDPGDH.js.map +1 -0
- package/dist/chunk-AI7L22ZJ.js +472 -0
- package/dist/chunk-AI7L22ZJ.js.map +1 -0
- package/dist/chunk-CBZNP6RF.js +286 -0
- package/dist/chunk-CBZNP6RF.js.map +1 -0
- package/dist/chunk-ELLX3K54.js +613 -0
- package/dist/chunk-ELLX3K54.js.map +1 -0
- package/dist/chunk-F5XEAGHQ.js +1875 -0
- package/dist/chunk-F5XEAGHQ.js.map +1 -0
- package/dist/chunk-FNZEQOJY.js +628 -0
- package/dist/chunk-FNZEQOJY.js.map +1 -0
- package/dist/chunk-GTEMQXCA.js +516 -0
- package/dist/chunk-GTEMQXCA.js.map +1 -0
- package/dist/chunk-HIWTWIGQ.js +226 -0
- package/dist/chunk-HIWTWIGQ.js.map +1 -0
- package/dist/chunk-IYE2NTRX.js +764 -0
- package/dist/chunk-IYE2NTRX.js.map +1 -0
- package/dist/chunk-J26YGR2U.js +1484 -0
- package/dist/chunk-J26YGR2U.js.map +1 -0
- package/dist/chunk-JG2FTZPI.js +509 -0
- package/dist/chunk-JG2FTZPI.js.map +1 -0
- package/dist/chunk-JVBTNSPG.js +1551 -0
- package/dist/chunk-JVBTNSPG.js.map +1 -0
- package/dist/chunk-L7ZMN2FJ.js +12 -0
- package/dist/chunk-L7ZMN2FJ.js.map +1 -0
- package/dist/chunk-M5IMU3US.js +473 -0
- package/dist/chunk-M5IMU3US.js.map +1 -0
- package/dist/chunk-MLW2HPS5.js +1267 -0
- package/dist/chunk-MLW2HPS5.js.map +1 -0
- package/dist/chunk-MNCGUYLJ.js +269 -0
- package/dist/chunk-MNCGUYLJ.js.map +1 -0
- package/dist/chunk-MOCUBSTW.js +373 -0
- package/dist/chunk-MOCUBSTW.js.map +1 -0
- package/dist/chunk-NGMEI42S.js +103 -0
- package/dist/chunk-NGMEI42S.js.map +1 -0
- package/dist/chunk-NUB5GQTU.js +270 -0
- package/dist/chunk-NUB5GQTU.js.map +1 -0
- package/dist/chunk-OVSYMNCI.js +145 -0
- package/dist/chunk-OVSYMNCI.js.map +1 -0
- package/dist/chunk-QLVKMWFA.js +94 -0
- package/dist/chunk-QLVKMWFA.js.map +1 -0
- package/dist/chunk-SAG6ZYWQ.js +89 -0
- package/dist/chunk-SAG6ZYWQ.js.map +1 -0
- package/dist/chunk-SAK2JCA7.js +198 -0
- package/dist/chunk-SAK2JCA7.js.map +1 -0
- package/dist/chunk-SBS4S2PJ.js +100 -0
- package/dist/chunk-SBS4S2PJ.js.map +1 -0
- package/dist/chunk-SNEOLWXT.js +148 -0
- package/dist/chunk-SNEOLWXT.js.map +1 -0
- package/dist/chunk-TKBD2ONF.js +564 -0
- package/dist/chunk-TKBD2ONF.js.map +1 -0
- package/dist/chunk-UBXFIIAW.js +127 -0
- package/dist/chunk-UBXFIIAW.js.map +1 -0
- package/dist/chunk-VI4VSNTI.js +57 -0
- package/dist/chunk-VI4VSNTI.js.map +1 -0
- package/dist/chunk-VWCN5PMD.js +268 -0
- package/dist/chunk-VWCN5PMD.js.map +1 -0
- package/dist/chunk-XC2YD6CF.js +913 -0
- package/dist/chunk-XC2YD6CF.js.map +1 -0
- package/dist/chunk-XE4OXN2W.js +10 -0
- package/dist/chunk-XE4OXN2W.js.map +1 -0
- package/dist/chunk-YMZEUTD2.js +110 -0
- package/dist/chunk-YMZEUTD2.js.map +1 -0
- package/dist/chunk-Z4IRLBWO.js +758 -0
- package/dist/chunk-Z4IRLBWO.js.map +1 -0
- package/dist/client/internal-client.d.ts +7 -0
- package/dist/client/internal-client.js +5 -0
- package/dist/client/internal-client.js.map +1 -0
- package/dist/client-CSjIrYKS.d.ts +77 -0
- package/dist/config-UKE2E3BW.js +4 -0
- package/dist/config-UKE2E3BW.js.map +1 -0
- package/dist/crypto/index.d.ts +1 -0
- package/dist/crypto/index.js +4 -0
- package/dist/crypto/index.js.map +1 -0
- package/dist/database/index.d.ts +117 -0
- package/dist/database/index.js +7 -0
- package/dist/database/index.js.map +1 -0
- package/dist/dataloader/index.d.ts +1 -0
- package/dist/dataloader/index.js +4 -0
- package/dist/dataloader/index.js.map +1 -0
- package/dist/esm-K6H7EIWK.js +1450 -0
- package/dist/esm-K6H7EIWK.js.map +1 -0
- package/dist/event-queue/index.d.ts +6 -0
- package/dist/event-queue/index.js +10 -0
- package/dist/event-queue/index.js.map +1 -0
- package/dist/export/index.d.ts +2 -0
- package/dist/export/index.js +9 -0
- package/dist/export/index.js.map +1 -0
- package/dist/feature-flags/index.d.ts +1 -0
- package/dist/feature-flags/index.js +4 -0
- package/dist/feature-flags/index.js.map +1 -0
- package/dist/gateway/index.d.ts +4 -0
- package/dist/gateway/index.js +8 -0
- package/dist/gateway/index.js.map +1 -0
- package/dist/gateway/security/index.d.ts +2 -0
- package/dist/gateway/security/index.js +5 -0
- package/dist/gateway/security/index.js.map +1 -0
- package/dist/graph/index.d.ts +9 -0
- package/dist/graph/index.js +13 -0
- package/dist/graph/index.js.map +1 -0
- package/dist/graph-emitter-Bk0FqD53.d.ts +47 -0
- package/dist/graphql/index.d.ts +2 -0
- package/dist/graphql/index.js +7 -0
- package/dist/graphql/index.js.map +1 -0
- package/dist/graphql/services/index.d.ts +24 -0
- package/dist/graphql/services/index.js +5 -0
- package/dist/graphql/services/index.js.map +1 -0
- package/dist/graphql-BAVrUgBF.d.ts +22 -0
- package/dist/i18n/index.d.ts +2 -0
- package/dist/i18n/index.js +5 -0
- package/dist/i18n/index.js.map +1 -0
- package/dist/i18n-DA6IPnYy.d.ts +101 -0
- package/dist/index-4gKQKZ2B.d.ts +71 -0
- package/dist/index-B18rrFru.d.ts +42 -0
- package/dist/index-B70b5mYS.d.ts +33 -0
- package/dist/index-BMq3lFjj.d.ts +247 -0
- package/dist/index-BODgvRtL.d.ts +316 -0
- package/dist/index-BS2idbnr.d.ts +874 -0
- package/dist/index-BV3G48cH.d.ts +124 -0
- package/dist/index-CHbVw5M7.d.ts +73 -0
- package/dist/index-Cq_xNjcv.d.ts +602 -0
- package/dist/index-CrQgidpx.d.ts +77 -0
- package/dist/index-CyVEg86m.d.ts +309 -0
- package/dist/index-DOcBnmMe.d.ts +166 -0
- package/dist/index-DSOpj8DI.d.ts +17 -0
- package/dist/index-DW9q22GH.d.ts +75 -0
- package/dist/index-DlFDFyWD.d.ts +55 -0
- package/dist/index-DoK0bjhH.d.ts +607 -0
- package/dist/index-Dtf6FBaD.d.ts +199 -0
- package/dist/index-KVWGHMbS.d.ts +415 -0
- package/dist/index-PaojfSdd.d.ts +71 -0
- package/dist/index-RU_M5c74.d.ts +163 -0
- package/dist/index-UhkH2eaB.d.ts +192 -0
- package/dist/index-e_18DzAg.d.ts +18 -0
- package/dist/index-jOuh_TKn.d.ts +59 -0
- package/dist/index.d.ts +584 -0
- package/dist/index.js +2626 -0
- package/dist/index.js.map +1 -0
- package/dist/init/index.d.ts +2 -0
- package/dist/init/index.js +12 -0
- package/dist/init/index.js.map +1 -0
- package/dist/instrumentation/index.d.ts +3 -0
- package/dist/instrumentation/index.js +5 -0
- package/dist/instrumentation/index.js.map +1 -0
- package/dist/layer/index.d.ts +2 -0
- package/dist/layer/index.js +6 -0
- package/dist/layer/index.js.map +1 -0
- package/dist/layer-DDip18KY.d.ts +67 -0
- package/dist/logger/index.d.ts +2 -0
- package/dist/logger/index.js +4 -0
- package/dist/logger/index.js.map +1 -0
- package/dist/middleware/index.d.ts +3 -0
- package/dist/middleware/index.js +5 -0
- package/dist/middleware/index.js.map +1 -0
- package/dist/notifications/index.d.ts +4 -0
- package/dist/notifications/index.js +7 -0
- package/dist/notifications/index.js.map +1 -0
- package/dist/observability/index.d.ts +3 -0
- package/dist/observability/index.js +5 -0
- package/dist/observability/index.js.map +1 -0
- package/dist/pino-logger-RYLGXPHZ.js +5 -0
- package/dist/pino-logger-RYLGXPHZ.js.map +1 -0
- package/dist/prisma/generator/index.d.ts +1 -0
- package/dist/prisma/generator/index.js +228 -0
- package/dist/prisma/generator/index.js.map +1 -0
- package/dist/prisma/index.d.ts +5 -0
- package/dist/prisma/index.js +12 -0
- package/dist/prisma/index.js.map +1 -0
- package/dist/prisma-extension-krXnYnrN.d.ts +30 -0
- package/dist/rbac/index.d.ts +116 -0
- package/dist/rbac/index.js +7 -0
- package/dist/rbac/index.js.map +1 -0
- package/dist/sdk-THO3IWEE.js +136 -0
- package/dist/sdk-THO3IWEE.js.map +1 -0
- package/dist/server/index.d.ts +359 -0
- package/dist/server/index.js +884 -0
- package/dist/server/index.js.map +1 -0
- package/dist/telemetry/index.d.ts +83 -0
- package/dist/telemetry/index.js +209 -0
- package/dist/telemetry/index.js.map +1 -0
- package/dist/temporal/index.d.ts +148 -0
- package/dist/temporal/index.js +6 -0
- package/dist/temporal/index.js.map +1 -0
- package/dist/tracker/index.d.ts +5 -0
- package/dist/tracker/index.js +9 -0
- package/dist/tracker/index.js.map +1 -0
- package/dist/types-Bo2wkjSP.d.ts +35 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +4 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/workspace-guard-LHBNK4TG.js +5 -0
- package/dist/workspace-guard-LHBNK4TG.js.map +1 -0
- package/package.json +241 -0
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
import { P as PrismaClientBase, b as PrismaClientWrapper, c as PrismaClientConfig, a as PrismaClientConstructorOptions, D as DatabaseReturnType, d as DatabaseHealth, C as ConnectionState, e as PrismaEvent, f as PrismaLogDefinition, g as PrismaLogEvent, h as PrismaLogLevel, i as PrismaQueryEvent, j as PrismaTransactionOptions, k as configurePrismaLogging, l as createConnectionPool, m as createPrismaAdapter, n as createPrismaClient } from './client-CSjIrYKS.js';
|
|
2
|
+
import { G as GraphEventEmitter } from './prisma-extension-krXnYnrN.js';
|
|
3
|
+
|
|
4
|
+
interface WorkspaceContext {
|
|
5
|
+
workspaceId?: string;
|
|
6
|
+
tenantId?: string;
|
|
7
|
+
actorId?: string;
|
|
8
|
+
actorType?: string;
|
|
9
|
+
organizationId?: string;
|
|
10
|
+
projectId?: string;
|
|
11
|
+
appId?: string;
|
|
12
|
+
onBehalfOf?: string;
|
|
13
|
+
}
|
|
14
|
+
declare function setWorkspaceContext(context: WorkspaceContext): void;
|
|
15
|
+
declare function getWorkspaceContext(): WorkspaceContext | undefined;
|
|
16
|
+
declare function withWorkspaceContext<T>(context: WorkspaceContext, fn: () => Promise<T>): Promise<T>;
|
|
17
|
+
declare function withWorkspaceContextSync<T>(context: WorkspaceContext, fn: () => T): T;
|
|
18
|
+
interface WorkspaceExtensionConfig {
|
|
19
|
+
enabled?: boolean;
|
|
20
|
+
enableReadIsolation?: boolean;
|
|
21
|
+
enableDeleteIsolation?: boolean;
|
|
22
|
+
enableUpdateWhereIsolation?: boolean;
|
|
23
|
+
populateContextJson?: boolean;
|
|
24
|
+
populateCreatedBy?: boolean;
|
|
25
|
+
populateUpdatedBy?: boolean;
|
|
26
|
+
populateTenantId?: boolean;
|
|
27
|
+
excludeModels?: string[];
|
|
28
|
+
excludeModelsFromReadIsolation?: string[];
|
|
29
|
+
strictMode?: boolean;
|
|
30
|
+
allowedUnguardedOperations?: string[];
|
|
31
|
+
debug?: boolean;
|
|
32
|
+
}
|
|
33
|
+
declare function injectWhereWorkspaceId(where: Record<string, unknown> | undefined, wsCtx?: WorkspaceContext): Record<string, unknown> | undefined;
|
|
34
|
+
declare function addWorkspaceExtension<T>(baseClient: T, config?: WorkspaceExtensionConfig): T;
|
|
35
|
+
|
|
36
|
+
interface DatabaseClientConfig extends PrismaClientConfig {
|
|
37
|
+
productName: string;
|
|
38
|
+
enableGraphExtension?: boolean;
|
|
39
|
+
graphEventEmitter?: GraphEventEmitter;
|
|
40
|
+
enableWorkspaceExtension?: boolean;
|
|
41
|
+
workspaceExtensionConfig?: WorkspaceExtensionConfig;
|
|
42
|
+
registerShutdownHandlers?: boolean;
|
|
43
|
+
}
|
|
44
|
+
interface DatabaseClient<T extends PrismaClientBase> {
|
|
45
|
+
db: T & {
|
|
46
|
+
client: T;
|
|
47
|
+
};
|
|
48
|
+
wrapper: PrismaClientWrapper<T>;
|
|
49
|
+
connect: (retries?: number, delay?: number) => Promise<void>;
|
|
50
|
+
disconnect: () => Promise<void>;
|
|
51
|
+
}
|
|
52
|
+
declare function createDatabaseClient<T extends PrismaClientBase>(PrismaClientConstructor: new (options: PrismaClientConstructorOptions) => T, config: DatabaseClientConfig): DatabaseClient<T>;
|
|
53
|
+
declare function createDatabaseClientFromEnv<T extends PrismaClientBase>(PrismaClientConstructor: new (options: PrismaClientConstructorOptions) => T, productName: string, overrides?: Partial<DatabaseClientConfig>): DatabaseClient<T>;
|
|
54
|
+
|
|
55
|
+
declare function initializeDatabase<T extends PrismaClientBase>(PrismaClientConstructor: new (options: PrismaClientConstructorOptions) => T, productName: string, config?: Partial<DatabaseClientConfig>): DatabaseClient<T>;
|
|
56
|
+
declare function initializeDatabaseWithConfig<T extends PrismaClientBase>(PrismaClientConstructor: new (options: PrismaClientConstructorOptions) => T, config: DatabaseClientConfig): DatabaseClient<T>;
|
|
57
|
+
declare function getDb<T extends PrismaClientBase = PrismaClientBase>(): DatabaseReturnType<T>;
|
|
58
|
+
declare function getDatabaseManager<T extends PrismaClientBase = PrismaClientBase>(): DatabaseClient<T>;
|
|
59
|
+
declare function isDatabaseInitialized(): boolean;
|
|
60
|
+
declare function getDatabaseProductName(): string | null;
|
|
61
|
+
declare function resetDatabaseManager(): Promise<void>;
|
|
62
|
+
|
|
63
|
+
declare function checkDatabaseHealth<T extends PrismaClientBase>(client: T): Promise<DatabaseHealth>;
|
|
64
|
+
declare function testConnection<T extends PrismaClientBase>(client: T): Promise<boolean>;
|
|
65
|
+
declare function getDatabaseVersion<T extends PrismaClientBase>(client: T): Promise<string | null>;
|
|
66
|
+
declare function getDatabaseStats<T extends PrismaClientBase>(client: T): Promise<{
|
|
67
|
+
health: DatabaseHealth;
|
|
68
|
+
version: string | null;
|
|
69
|
+
timestamp: Date;
|
|
70
|
+
}>;
|
|
71
|
+
|
|
72
|
+
interface FieldExtractionOptions {
|
|
73
|
+
excludeFields?: string[];
|
|
74
|
+
includeRelations?: boolean;
|
|
75
|
+
customFilter?: (field: {
|
|
76
|
+
name: string;
|
|
77
|
+
type: string;
|
|
78
|
+
isRelation: boolean;
|
|
79
|
+
}) => boolean;
|
|
80
|
+
}
|
|
81
|
+
interface FieldExtractionResult {
|
|
82
|
+
fields: string[];
|
|
83
|
+
metadata: {
|
|
84
|
+
totalFields: number;
|
|
85
|
+
excludedCount: number;
|
|
86
|
+
excludedFields: string[];
|
|
87
|
+
relationFields: number;
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
type ModelFieldsMap = Record<string, {
|
|
91
|
+
fields: string[];
|
|
92
|
+
relations: string[];
|
|
93
|
+
}>;
|
|
94
|
+
declare function loadGeneratedFields(generatedFieldsPath: string): ModelFieldsMap;
|
|
95
|
+
declare function extractFieldsFromModel(modelName: string, modelFieldsMap: ModelFieldsMap, options?: FieldExtractionOptions): FieldExtractionResult;
|
|
96
|
+
declare function getModelFields(modelName: string, modelFieldsMap: ModelFieldsMap, includeRelations?: boolean): string[];
|
|
97
|
+
declare function hasModel(modelName: string, modelFieldsMap: ModelFieldsMap): boolean;
|
|
98
|
+
declare function getAllModelNames(modelFieldsMap: ModelFieldsMap): string[];
|
|
99
|
+
|
|
100
|
+
interface ContextFilterInput {
|
|
101
|
+
workspaceId?: string | null;
|
|
102
|
+
userId?: string | null;
|
|
103
|
+
projectId?: string | null;
|
|
104
|
+
appId?: string | null;
|
|
105
|
+
productId?: string | null;
|
|
106
|
+
organizationId?: string | null;
|
|
107
|
+
}
|
|
108
|
+
interface OperationContext extends ContextFilterInput {
|
|
109
|
+
custom?: Record<string, unknown> | null;
|
|
110
|
+
}
|
|
111
|
+
type PrismaJsonFilter = Record<string, unknown>;
|
|
112
|
+
type JsonValue = string | number | boolean | null | {
|
|
113
|
+
[key: string]: JsonValue;
|
|
114
|
+
} | JsonValue[];
|
|
115
|
+
type InputJsonValue = string | number | boolean | {
|
|
116
|
+
[key: string]: InputJsonValue;
|
|
117
|
+
} | InputJsonValue[];
|
|
118
|
+
declare function buildContextWhereClause(contextFilter: ContextFilterInput | null | undefined): PrismaJsonFilter | undefined;
|
|
119
|
+
declare function buildContextWhereConditions(contextFilter: ContextFilterInput | null | undefined): Array<{
|
|
120
|
+
context: PrismaJsonFilter;
|
|
121
|
+
}>;
|
|
122
|
+
declare function toContextJson(contextInput: OperationContext | null | undefined): InputJsonValue | undefined;
|
|
123
|
+
declare function mergeContext(existingContext: JsonValue | null | undefined, newContext: OperationContext | null | undefined): InputJsonValue | undefined;
|
|
124
|
+
declare function parseContext(contextJson: JsonValue | null | undefined): OperationContext | null;
|
|
125
|
+
declare function contextMatches(context: OperationContext | null | undefined, filter: ContextFilterInput): boolean;
|
|
126
|
+
declare function createContextFromSDK(sdkContext: {
|
|
127
|
+
workspaceId?: string;
|
|
128
|
+
userId?: string;
|
|
129
|
+
projectId?: string;
|
|
130
|
+
appId?: string;
|
|
131
|
+
productId?: string;
|
|
132
|
+
organizationId?: string;
|
|
133
|
+
}): OperationContext;
|
|
134
|
+
|
|
135
|
+
declare const index_ConnectionState: typeof ConnectionState;
|
|
136
|
+
type index_ContextFilterInput = ContextFilterInput;
|
|
137
|
+
type index_DatabaseClient<T extends PrismaClientBase> = DatabaseClient<T>;
|
|
138
|
+
type index_DatabaseClientConfig = DatabaseClientConfig;
|
|
139
|
+
declare const index_DatabaseHealth: typeof DatabaseHealth;
|
|
140
|
+
declare const index_DatabaseReturnType: typeof DatabaseReturnType;
|
|
141
|
+
type index_FieldExtractionOptions = FieldExtractionOptions;
|
|
142
|
+
type index_FieldExtractionResult = FieldExtractionResult;
|
|
143
|
+
type index_InputJsonValue = InputJsonValue;
|
|
144
|
+
type index_JsonValue = JsonValue;
|
|
145
|
+
type index_ModelFieldsMap = ModelFieldsMap;
|
|
146
|
+
type index_OperationContext = OperationContext;
|
|
147
|
+
declare const index_PrismaClientBase: typeof PrismaClientBase;
|
|
148
|
+
declare const index_PrismaClientConfig: typeof PrismaClientConfig;
|
|
149
|
+
declare const index_PrismaClientConstructorOptions: typeof PrismaClientConstructorOptions;
|
|
150
|
+
declare const index_PrismaClientWrapper: typeof PrismaClientWrapper;
|
|
151
|
+
declare const index_PrismaEvent: typeof PrismaEvent;
|
|
152
|
+
type index_PrismaJsonFilter = PrismaJsonFilter;
|
|
153
|
+
declare const index_PrismaLogDefinition: typeof PrismaLogDefinition;
|
|
154
|
+
declare const index_PrismaLogEvent: typeof PrismaLogEvent;
|
|
155
|
+
declare const index_PrismaLogLevel: typeof PrismaLogLevel;
|
|
156
|
+
declare const index_PrismaQueryEvent: typeof PrismaQueryEvent;
|
|
157
|
+
declare const index_PrismaTransactionOptions: typeof PrismaTransactionOptions;
|
|
158
|
+
type index_WorkspaceContext = WorkspaceContext;
|
|
159
|
+
type index_WorkspaceExtensionConfig = WorkspaceExtensionConfig;
|
|
160
|
+
declare const index_addWorkspaceExtension: typeof addWorkspaceExtension;
|
|
161
|
+
declare const index_buildContextWhereClause: typeof buildContextWhereClause;
|
|
162
|
+
declare const index_buildContextWhereConditions: typeof buildContextWhereConditions;
|
|
163
|
+
declare const index_checkDatabaseHealth: typeof checkDatabaseHealth;
|
|
164
|
+
declare const index_configurePrismaLogging: typeof configurePrismaLogging;
|
|
165
|
+
declare const index_contextMatches: typeof contextMatches;
|
|
166
|
+
declare const index_createConnectionPool: typeof createConnectionPool;
|
|
167
|
+
declare const index_createContextFromSDK: typeof createContextFromSDK;
|
|
168
|
+
declare const index_createDatabaseClient: typeof createDatabaseClient;
|
|
169
|
+
declare const index_createDatabaseClientFromEnv: typeof createDatabaseClientFromEnv;
|
|
170
|
+
declare const index_createPrismaAdapter: typeof createPrismaAdapter;
|
|
171
|
+
declare const index_createPrismaClient: typeof createPrismaClient;
|
|
172
|
+
declare const index_extractFieldsFromModel: typeof extractFieldsFromModel;
|
|
173
|
+
declare const index_getAllModelNames: typeof getAllModelNames;
|
|
174
|
+
declare const index_getDatabaseManager: typeof getDatabaseManager;
|
|
175
|
+
declare const index_getDatabaseProductName: typeof getDatabaseProductName;
|
|
176
|
+
declare const index_getDatabaseStats: typeof getDatabaseStats;
|
|
177
|
+
declare const index_getDatabaseVersion: typeof getDatabaseVersion;
|
|
178
|
+
declare const index_getDb: typeof getDb;
|
|
179
|
+
declare const index_getModelFields: typeof getModelFields;
|
|
180
|
+
declare const index_getWorkspaceContext: typeof getWorkspaceContext;
|
|
181
|
+
declare const index_hasModel: typeof hasModel;
|
|
182
|
+
declare const index_initializeDatabase: typeof initializeDatabase;
|
|
183
|
+
declare const index_initializeDatabaseWithConfig: typeof initializeDatabaseWithConfig;
|
|
184
|
+
declare const index_injectWhereWorkspaceId: typeof injectWhereWorkspaceId;
|
|
185
|
+
declare const index_isDatabaseInitialized: typeof isDatabaseInitialized;
|
|
186
|
+
declare const index_loadGeneratedFields: typeof loadGeneratedFields;
|
|
187
|
+
declare const index_mergeContext: typeof mergeContext;
|
|
188
|
+
declare const index_parseContext: typeof parseContext;
|
|
189
|
+
declare const index_resetDatabaseManager: typeof resetDatabaseManager;
|
|
190
|
+
declare const index_setWorkspaceContext: typeof setWorkspaceContext;
|
|
191
|
+
declare const index_testConnection: typeof testConnection;
|
|
192
|
+
declare const index_toContextJson: typeof toContextJson;
|
|
193
|
+
declare const index_withWorkspaceContext: typeof withWorkspaceContext;
|
|
194
|
+
declare const index_withWorkspaceContextSync: typeof withWorkspaceContextSync;
|
|
195
|
+
declare namespace index {
|
|
196
|
+
export { index_ConnectionState as ConnectionState, type index_ContextFilterInput as ContextFilterInput, type index_DatabaseClient as DatabaseClient, type index_DatabaseClientConfig as DatabaseClientConfig, index_DatabaseHealth as DatabaseHealth, index_DatabaseReturnType as DatabaseReturnType, type index_FieldExtractionOptions as FieldExtractionOptions, type index_FieldExtractionResult as FieldExtractionResult, type index_InputJsonValue as InputJsonValue, type index_JsonValue as JsonValue, type index_ModelFieldsMap as ModelFieldsMap, type index_OperationContext as OperationContext, index_PrismaClientBase as PrismaClientBase, index_PrismaClientConfig as PrismaClientConfig, index_PrismaClientConstructorOptions as PrismaClientConstructorOptions, index_PrismaClientWrapper as PrismaClientWrapper, index_PrismaEvent as PrismaEvent, type index_PrismaJsonFilter as PrismaJsonFilter, index_PrismaLogDefinition as PrismaLogDefinition, index_PrismaLogEvent as PrismaLogEvent, index_PrismaLogLevel as PrismaLogLevel, index_PrismaQueryEvent as PrismaQueryEvent, index_PrismaTransactionOptions as PrismaTransactionOptions, type index_WorkspaceContext as WorkspaceContext, type index_WorkspaceExtensionConfig as WorkspaceExtensionConfig, index_addWorkspaceExtension as addWorkspaceExtension, index_buildContextWhereClause as buildContextWhereClause, index_buildContextWhereConditions as buildContextWhereConditions, index_checkDatabaseHealth as checkDatabaseHealth, index_configurePrismaLogging as configurePrismaLogging, index_contextMatches as contextMatches, index_createConnectionPool as createConnectionPool, index_createContextFromSDK as createContextFromSDK, index_createDatabaseClient as createDatabaseClient, index_createDatabaseClientFromEnv as createDatabaseClientFromEnv, index_createPrismaAdapter as createPrismaAdapter, index_createPrismaClient as createPrismaClient, index_extractFieldsFromModel as extractFieldsFromModel, index_getAllModelNames as getAllModelNames, index_getDatabaseManager as getDatabaseManager, index_getDatabaseProductName as getDatabaseProductName, index_getDatabaseStats as getDatabaseStats, index_getDatabaseVersion as getDatabaseVersion, index_getDb as getDb, index_getModelFields as getModelFields, index_getWorkspaceContext as getWorkspaceContext, index_hasModel as hasModel, index_initializeDatabase as initializeDatabase, index_initializeDatabaseWithConfig as initializeDatabaseWithConfig, index_injectWhereWorkspaceId as injectWhereWorkspaceId, index_isDatabaseInitialized as isDatabaseInitialized, index_loadGeneratedFields as loadGeneratedFields, index_mergeContext as mergeContext, index_parseContext as parseContext, index_resetDatabaseManager as resetDatabaseManager, index_setWorkspaceContext as setWorkspaceContext, index_testConnection as testConnection, index_toContextJson as toContextJson, index_withWorkspaceContext as withWorkspaceContext, index_withWorkspaceContextSync as withWorkspaceContextSync };
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
export { loadGeneratedFields as A, mergeContext as B, type ContextFilterInput as C, type DatabaseClient as D, parseContext as E, type FieldExtractionOptions as F, resetDatabaseManager as G, setWorkspaceContext as H, type InputJsonValue as I, type JsonValue as J, testConnection as K, toContextJson as L, type ModelFieldsMap as M, withWorkspaceContext as N, type OperationContext as O, type PrismaJsonFilter as P, withWorkspaceContextSync as Q, type WorkspaceContext as W, type DatabaseClientConfig as a, type FieldExtractionResult as b, type WorkspaceExtensionConfig as c, addWorkspaceExtension as d, buildContextWhereClause as e, buildContextWhereConditions as f, checkDatabaseHealth as g, contextMatches as h, index as i, createContextFromSDK as j, createDatabaseClient as k, createDatabaseClientFromEnv as l, extractFieldsFromModel as m, getAllModelNames as n, getDatabaseManager as o, getDatabaseProductName as p, getDatabaseStats as q, getDatabaseVersion as r, getDb as s, getModelFields as t, getWorkspaceContext as u, hasModel as v, initializeDatabase as w, initializeDatabaseWithConfig as x, injectWhereWorkspaceId as y, isDatabaseInitialized as z };
|
|
@@ -0,0 +1,415 @@
|
|
|
1
|
+
import { B as BurdenoffGraphQLClient } from './graphql-BAVrUgBF.js';
|
|
2
|
+
import { S as SDKContext } from './index-CHbVw5M7.js';
|
|
3
|
+
import { N as NotificationType } from './index-CyVEg86m.js';
|
|
4
|
+
|
|
5
|
+
declare enum ActivityType {
|
|
6
|
+
CREATE = "create",
|
|
7
|
+
READ = "read",
|
|
8
|
+
UPDATE = "update",
|
|
9
|
+
DELETE = "delete",
|
|
10
|
+
LOGIN = "login",
|
|
11
|
+
LOGOUT = "logout",
|
|
12
|
+
EXPORT = "export",
|
|
13
|
+
IMPORT = "import",
|
|
14
|
+
SHARE = "share",
|
|
15
|
+
DOWNLOAD = "download",
|
|
16
|
+
UPLOAD = "upload",
|
|
17
|
+
EXECUTE = "execute",
|
|
18
|
+
APPROVE = "approve",
|
|
19
|
+
REJECT = "reject",
|
|
20
|
+
CUSTOM = "custom"
|
|
21
|
+
}
|
|
22
|
+
declare enum ActivityStatus {
|
|
23
|
+
SUCCESS = "success",
|
|
24
|
+
FAILURE = "failure",
|
|
25
|
+
PENDING = "pending",
|
|
26
|
+
WARNING = "warning"
|
|
27
|
+
}
|
|
28
|
+
declare enum ActivitySeverity {
|
|
29
|
+
LOW = "low",
|
|
30
|
+
MEDIUM = "medium",
|
|
31
|
+
HIGH = "high",
|
|
32
|
+
CRITICAL = "critical"
|
|
33
|
+
}
|
|
34
|
+
interface LogActivityOptions {
|
|
35
|
+
userId: string;
|
|
36
|
+
activityType: ActivityType;
|
|
37
|
+
resourceType: string;
|
|
38
|
+
resourceId?: string;
|
|
39
|
+
action: string;
|
|
40
|
+
status: ActivityStatus;
|
|
41
|
+
workspaceId?: string;
|
|
42
|
+
organizationId?: string;
|
|
43
|
+
projectId?: string;
|
|
44
|
+
ipAddress?: string;
|
|
45
|
+
userAgent?: string;
|
|
46
|
+
metadata?: Record<string, unknown>;
|
|
47
|
+
severity?: ActivitySeverity;
|
|
48
|
+
errorMessage?: string;
|
|
49
|
+
duration?: number;
|
|
50
|
+
}
|
|
51
|
+
interface Activity {
|
|
52
|
+
id: string;
|
|
53
|
+
userId: string;
|
|
54
|
+
activityType: ActivityType;
|
|
55
|
+
resourceType: string;
|
|
56
|
+
resourceId?: string;
|
|
57
|
+
action: string;
|
|
58
|
+
status: ActivityStatus;
|
|
59
|
+
workspaceId?: string;
|
|
60
|
+
organizationId?: string;
|
|
61
|
+
projectId?: string;
|
|
62
|
+
ipAddress?: string;
|
|
63
|
+
userAgent?: string;
|
|
64
|
+
metadata?: Record<string, unknown>;
|
|
65
|
+
severity: ActivitySeverity;
|
|
66
|
+
errorMessage?: string;
|
|
67
|
+
duration?: number;
|
|
68
|
+
createdAt: string;
|
|
69
|
+
}
|
|
70
|
+
interface GetActivitiesOptions {
|
|
71
|
+
userId?: string;
|
|
72
|
+
workspaceId?: string;
|
|
73
|
+
organizationId?: string;
|
|
74
|
+
projectId?: string;
|
|
75
|
+
activityType?: ActivityType;
|
|
76
|
+
resourceType?: string;
|
|
77
|
+
resourceId?: string;
|
|
78
|
+
status?: ActivityStatus;
|
|
79
|
+
severity?: ActivitySeverity;
|
|
80
|
+
startDate?: string;
|
|
81
|
+
endDate?: string;
|
|
82
|
+
search?: string;
|
|
83
|
+
limit?: number;
|
|
84
|
+
offset?: number;
|
|
85
|
+
sortBy?: 'createdAt' | 'duration' | 'severity';
|
|
86
|
+
sortOrder?: 'asc' | 'desc';
|
|
87
|
+
}
|
|
88
|
+
interface ActivityStats {
|
|
89
|
+
totalActivities: number;
|
|
90
|
+
successCount: number;
|
|
91
|
+
failureCount: number;
|
|
92
|
+
pendingCount: number;
|
|
93
|
+
warningCount: number;
|
|
94
|
+
averageDuration?: number;
|
|
95
|
+
activitiesByType: Record<string, number>;
|
|
96
|
+
activitiesBySeverity: Record<string, number>;
|
|
97
|
+
topUsers: Array<{
|
|
98
|
+
userId: string;
|
|
99
|
+
count: number;
|
|
100
|
+
}>;
|
|
101
|
+
topResources: Array<{
|
|
102
|
+
resourceType: string;
|
|
103
|
+
count: number;
|
|
104
|
+
}>;
|
|
105
|
+
}
|
|
106
|
+
declare class ActivityModule {
|
|
107
|
+
private client;
|
|
108
|
+
private context;
|
|
109
|
+
constructor(client: BurdenoffGraphQLClient, context: SDKContext);
|
|
110
|
+
log(options: LogActivityOptions): Promise<Activity>;
|
|
111
|
+
logSuccess(userId: string, action: string, resourceType: string, resourceId?: string, metadata?: Record<string, unknown>): Promise<Activity>;
|
|
112
|
+
logFailure(userId: string, action: string, resourceType: string, errorMessage: string, resourceId?: string, metadata?: Record<string, unknown>): Promise<Activity>;
|
|
113
|
+
getActivities(options: GetActivitiesOptions): Promise<{
|
|
114
|
+
activities: Activity[];
|
|
115
|
+
total: number;
|
|
116
|
+
}>;
|
|
117
|
+
getActivity(activityId: string): Promise<Activity>;
|
|
118
|
+
getStats(options: Omit<GetActivitiesOptions, 'limit' | 'offset'>): Promise<ActivityStats>;
|
|
119
|
+
cleanup(olderThanDays: number, workspaceId?: string): Promise<number>;
|
|
120
|
+
private inferActivityType;
|
|
121
|
+
exportToCSV(options: GetActivitiesOptions): Promise<string>;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
declare enum UsageMetricType {
|
|
125
|
+
API_CALLS = "api_calls",
|
|
126
|
+
STORAGE = "storage",
|
|
127
|
+
BANDWIDTH = "bandwidth",
|
|
128
|
+
USERS = "users",
|
|
129
|
+
PROJECTS = "projects",
|
|
130
|
+
WORKSPACES = "workspaces",
|
|
131
|
+
RECORDS = "records",
|
|
132
|
+
COMPUTE_TIME = "compute_time",
|
|
133
|
+
TRANSACTIONS = "transactions",
|
|
134
|
+
CUSTOM = "custom"
|
|
135
|
+
}
|
|
136
|
+
declare enum QuotaPeriod {
|
|
137
|
+
DAILY = "daily",
|
|
138
|
+
WEEKLY = "weekly",
|
|
139
|
+
MONTHLY = "monthly",
|
|
140
|
+
YEARLY = "yearly",
|
|
141
|
+
LIFETIME = "lifetime"
|
|
142
|
+
}
|
|
143
|
+
type UsageEntityType = 'user' | 'workspace' | 'organization';
|
|
144
|
+
interface TrackUsageOptions {
|
|
145
|
+
entityId: string;
|
|
146
|
+
entityType: UsageEntityType;
|
|
147
|
+
metricType: UsageMetricType;
|
|
148
|
+
amount: number;
|
|
149
|
+
resourceId?: string;
|
|
150
|
+
metadata?: Record<string, unknown>;
|
|
151
|
+
workspaceId?: string;
|
|
152
|
+
organizationId?: string;
|
|
153
|
+
}
|
|
154
|
+
interface CheckQuotaOptions {
|
|
155
|
+
entityId: string;
|
|
156
|
+
entityType: UsageEntityType;
|
|
157
|
+
metricType: UsageMetricType;
|
|
158
|
+
requestedAmount: number;
|
|
159
|
+
workspaceId?: string;
|
|
160
|
+
organizationId?: string;
|
|
161
|
+
}
|
|
162
|
+
interface QuotaCheckResult {
|
|
163
|
+
allowed: boolean;
|
|
164
|
+
currentUsage: number;
|
|
165
|
+
quotaLimit: number;
|
|
166
|
+
remainingQuota: number;
|
|
167
|
+
resetAt?: string;
|
|
168
|
+
period: QuotaPeriod;
|
|
169
|
+
reason?: string;
|
|
170
|
+
}
|
|
171
|
+
interface UsageRecord {
|
|
172
|
+
id: string;
|
|
173
|
+
entityId: string;
|
|
174
|
+
entityType: UsageEntityType;
|
|
175
|
+
metricType: UsageMetricType;
|
|
176
|
+
amount: number;
|
|
177
|
+
resourceId?: string;
|
|
178
|
+
metadata?: Record<string, unknown>;
|
|
179
|
+
workspaceId?: string;
|
|
180
|
+
organizationId?: string;
|
|
181
|
+
recordedAt: string;
|
|
182
|
+
}
|
|
183
|
+
interface UsageSummary {
|
|
184
|
+
entityId: string;
|
|
185
|
+
entityType: string;
|
|
186
|
+
metricType: UsageMetricType;
|
|
187
|
+
totalUsage: number;
|
|
188
|
+
period: QuotaPeriod;
|
|
189
|
+
periodStart: string;
|
|
190
|
+
periodEnd: string;
|
|
191
|
+
quotaLimit?: number;
|
|
192
|
+
utilizationPercentage?: number;
|
|
193
|
+
}
|
|
194
|
+
interface SetQuotaOptions {
|
|
195
|
+
entityId: string;
|
|
196
|
+
entityType: UsageEntityType;
|
|
197
|
+
metricType: UsageMetricType;
|
|
198
|
+
limit: number;
|
|
199
|
+
period: QuotaPeriod;
|
|
200
|
+
workspaceId?: string;
|
|
201
|
+
organizationId?: string;
|
|
202
|
+
}
|
|
203
|
+
interface Quota {
|
|
204
|
+
id: string;
|
|
205
|
+
entityId: string;
|
|
206
|
+
entityType: string;
|
|
207
|
+
metricType: UsageMetricType;
|
|
208
|
+
limit: number;
|
|
209
|
+
period: QuotaPeriod;
|
|
210
|
+
currentUsage: number;
|
|
211
|
+
resetAt: string;
|
|
212
|
+
createdAt: string;
|
|
213
|
+
updatedAt: string;
|
|
214
|
+
}
|
|
215
|
+
interface GetUsageOptions {
|
|
216
|
+
entityId: string;
|
|
217
|
+
entityType: UsageEntityType;
|
|
218
|
+
metricType?: UsageMetricType;
|
|
219
|
+
startDate?: string;
|
|
220
|
+
endDate?: string;
|
|
221
|
+
workspaceId?: string;
|
|
222
|
+
organizationId?: string;
|
|
223
|
+
limit?: number;
|
|
224
|
+
offset?: number;
|
|
225
|
+
}
|
|
226
|
+
declare class UsageModule {
|
|
227
|
+
private client;
|
|
228
|
+
private context;
|
|
229
|
+
constructor(client: BurdenoffGraphQLClient, context: SDKContext);
|
|
230
|
+
track(options: TrackUsageOptions): Promise<UsageRecord>;
|
|
231
|
+
checkQuota(options: CheckQuotaOptions): Promise<QuotaCheckResult>;
|
|
232
|
+
requireQuota(options: CheckQuotaOptions): Promise<void>;
|
|
233
|
+
trackAndCheck(options: TrackUsageOptions): Promise<{
|
|
234
|
+
usage: UsageRecord;
|
|
235
|
+
quotaCheck: QuotaCheckResult;
|
|
236
|
+
}>;
|
|
237
|
+
getUsage(options: GetUsageOptions): Promise<{
|
|
238
|
+
records: UsageRecord[];
|
|
239
|
+
total: number;
|
|
240
|
+
}>;
|
|
241
|
+
getSummary(entityId: string, entityType: UsageEntityType, metricType: UsageMetricType, period: QuotaPeriod): Promise<UsageSummary>;
|
|
242
|
+
setQuota(options: SetQuotaOptions): Promise<Quota>;
|
|
243
|
+
getQuota(entityId: string, entityType: UsageEntityType, metricType: UsageMetricType): Promise<Quota | null>;
|
|
244
|
+
getQuotas(entityId: string, entityType: UsageEntityType): Promise<Quota[]>;
|
|
245
|
+
resetQuota(entityId: string, entityType: UsageEntityType, metricType: UsageMetricType): Promise<boolean>;
|
|
246
|
+
deleteQuota(entityId: string, entityType: UsageEntityType, metricType: UsageMetricType): Promise<boolean>;
|
|
247
|
+
trackBulk(records: TrackUsageOptions[]): Promise<UsageRecord[]>;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
interface TrackingEvent {
|
|
251
|
+
eventType: string;
|
|
252
|
+
entityType: string;
|
|
253
|
+
entityId: string;
|
|
254
|
+
userId?: string;
|
|
255
|
+
workspaceId?: string;
|
|
256
|
+
metadata?: Record<string, unknown>;
|
|
257
|
+
timestamp?: Date;
|
|
258
|
+
}
|
|
259
|
+
interface RbacCheckOptions {
|
|
260
|
+
action?: string;
|
|
261
|
+
resourceType?: string;
|
|
262
|
+
resourceId?: string;
|
|
263
|
+
workspaceId?: string;
|
|
264
|
+
skipRbacCheck?: boolean;
|
|
265
|
+
options?: {
|
|
266
|
+
allowOwnerAccess?: boolean;
|
|
267
|
+
allowWorkspaceAdmin?: boolean;
|
|
268
|
+
scope?: string;
|
|
269
|
+
};
|
|
270
|
+
}
|
|
271
|
+
interface UsageTrackingOptions {
|
|
272
|
+
billingAccountId?: string;
|
|
273
|
+
addUsage?: boolean;
|
|
274
|
+
description?: string;
|
|
275
|
+
tags?: Record<string, unknown>;
|
|
276
|
+
quotaName?: string;
|
|
277
|
+
value?: number;
|
|
278
|
+
}
|
|
279
|
+
interface ActivityTrackingOptions {
|
|
280
|
+
activityType?: string;
|
|
281
|
+
description?: string;
|
|
282
|
+
metadata?: Record<string, unknown>;
|
|
283
|
+
workspaceId?: string;
|
|
284
|
+
teamId?: string;
|
|
285
|
+
groupId?: string;
|
|
286
|
+
projectId?: string;
|
|
287
|
+
targetUserId?: string;
|
|
288
|
+
resourceType?: string;
|
|
289
|
+
resourceId?: string;
|
|
290
|
+
enabled?: boolean;
|
|
291
|
+
}
|
|
292
|
+
interface UnifiedTrackingOptions {
|
|
293
|
+
operationName?: string;
|
|
294
|
+
userId?: string;
|
|
295
|
+
context?: unknown;
|
|
296
|
+
rbacCheck?: RbacCheckOptions;
|
|
297
|
+
activityOptions?: ActivityTrackingOptions;
|
|
298
|
+
usageOptions?: UsageTrackingOptions & {
|
|
299
|
+
enabled?: boolean;
|
|
300
|
+
};
|
|
301
|
+
success?: boolean;
|
|
302
|
+
errorMessage?: string;
|
|
303
|
+
productId?: string;
|
|
304
|
+
action?: string;
|
|
305
|
+
resourceType?: string;
|
|
306
|
+
resourceId?: string;
|
|
307
|
+
workspaceId?: string;
|
|
308
|
+
tenantId?: string;
|
|
309
|
+
}
|
|
310
|
+
declare class UnifiedTrackerStub {
|
|
311
|
+
private static instance;
|
|
312
|
+
static getInstance(): UnifiedTrackerStub;
|
|
313
|
+
track(event: TrackingEvent): Promise<void>;
|
|
314
|
+
trackBatch(events: TrackingEvent[]): Promise<void>;
|
|
315
|
+
}
|
|
316
|
+
declare const trackerStub: UnifiedTrackerStub;
|
|
317
|
+
declare function trackOperation(options: UnifiedTrackingOptions): Promise<boolean>;
|
|
318
|
+
type ProductTracker = {
|
|
319
|
+
track: (operationName: string, additionalOptions?: Partial<UnifiedTrackingOptions>) => Promise<boolean>;
|
|
320
|
+
freeUp: (operationName: string, additionalOptions?: Partial<UnifiedTrackingOptions>) => Promise<boolean>;
|
|
321
|
+
trackActivityOnly: (operationName: string, additionalOptions?: Partial<UnifiedTrackingOptions>) => Promise<boolean>;
|
|
322
|
+
trackUsageOnly: (operationName: string, additionalOptions?: Partial<UnifiedTrackingOptions>) => Promise<boolean>;
|
|
323
|
+
trackCustom: (operationName: string, additionalOptions: Partial<UnifiedTrackingOptions>) => Promise<boolean>;
|
|
324
|
+
productId: string;
|
|
325
|
+
userId: string;
|
|
326
|
+
billingAccountId: string | undefined;
|
|
327
|
+
defaultContext: Partial<UnifiedTrackingOptions> | undefined;
|
|
328
|
+
};
|
|
329
|
+
declare function createProductTracker(productId: string, userId: string, billingAccountId?: string, defaultContext?: Partial<UnifiedTrackingOptions>): ProductTracker;
|
|
330
|
+
declare const UNIFIED_TRACKER_CONSTANTS: {
|
|
331
|
+
readonly DEFAULT_PRODUCT_ID: "module";
|
|
332
|
+
readonly OPERATIONS: {};
|
|
333
|
+
readonly PRODUCTS: {};
|
|
334
|
+
};
|
|
335
|
+
|
|
336
|
+
interface TrackOptions {
|
|
337
|
+
userId: string;
|
|
338
|
+
action: string;
|
|
339
|
+
resourceType: string;
|
|
340
|
+
resourceId?: string;
|
|
341
|
+
workspaceId?: string;
|
|
342
|
+
organizationId?: string;
|
|
343
|
+
projectId?: string;
|
|
344
|
+
rbac?: {
|
|
345
|
+
enabled?: boolean;
|
|
346
|
+
permissionAction?: string;
|
|
347
|
+
};
|
|
348
|
+
activity?: {
|
|
349
|
+
enabled?: boolean;
|
|
350
|
+
activityType?: ActivityType;
|
|
351
|
+
metadata?: Record<string, unknown>;
|
|
352
|
+
ipAddress?: string;
|
|
353
|
+
userAgent?: string;
|
|
354
|
+
severity?: ActivitySeverity;
|
|
355
|
+
};
|
|
356
|
+
usage?: {
|
|
357
|
+
enabled?: boolean;
|
|
358
|
+
metricType: UsageMetricType;
|
|
359
|
+
amount?: number;
|
|
360
|
+
checkQuota?: boolean;
|
|
361
|
+
entityType?: 'user' | 'workspace' | 'organization';
|
|
362
|
+
};
|
|
363
|
+
notification?: {
|
|
364
|
+
onSuccess?: {
|
|
365
|
+
title: string;
|
|
366
|
+
message: string;
|
|
367
|
+
type?: NotificationType;
|
|
368
|
+
additionalUserIds?: string[];
|
|
369
|
+
};
|
|
370
|
+
onFailure?: {
|
|
371
|
+
title: string;
|
|
372
|
+
message: string;
|
|
373
|
+
type?: NotificationType;
|
|
374
|
+
additionalUserIds?: string[];
|
|
375
|
+
};
|
|
376
|
+
};
|
|
377
|
+
}
|
|
378
|
+
interface TrackResult {
|
|
379
|
+
success: boolean;
|
|
380
|
+
permissionGranted: boolean;
|
|
381
|
+
quotaAvailable?: boolean;
|
|
382
|
+
quotaRemaining?: number;
|
|
383
|
+
activityId?: string;
|
|
384
|
+
usageRecordId?: string;
|
|
385
|
+
notificationIds?: string[];
|
|
386
|
+
error?: {
|
|
387
|
+
type: 'permission' | 'quota' | 'validation' | 'unknown';
|
|
388
|
+
message: string;
|
|
389
|
+
details?: Record<string, unknown>;
|
|
390
|
+
};
|
|
391
|
+
duration: number;
|
|
392
|
+
}
|
|
393
|
+
declare class TrackerModule {
|
|
394
|
+
private context;
|
|
395
|
+
private rbac;
|
|
396
|
+
private activity;
|
|
397
|
+
private usage;
|
|
398
|
+
private notifications;
|
|
399
|
+
constructor(client: BurdenoffGraphQLClient, context?: SDKContext);
|
|
400
|
+
track(options: TrackOptions): Promise<TrackResult>;
|
|
401
|
+
trackOrThrow(options: TrackOptions): Promise<TrackResult>;
|
|
402
|
+
trackSimple(userId: string, action: string, resourceType: string, resourceId?: string, metricType?: UsageMetricType): Promise<boolean>;
|
|
403
|
+
private validateOptions;
|
|
404
|
+
private checkPermission;
|
|
405
|
+
private checkQuota;
|
|
406
|
+
private trackUsage;
|
|
407
|
+
private logSuccessActivity;
|
|
408
|
+
private logFailedActivity;
|
|
409
|
+
private sendSuccessNotification;
|
|
410
|
+
private sendFailureNotification;
|
|
411
|
+
private inferActivityType;
|
|
412
|
+
trackBatch(operations: TrackOptions[]): Promise<TrackResult[]>;
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
export { ActivityModule as A, type ProductTracker as P, type RbacCheckOptions as R, TrackerModule as T, UsageModule as U, type ActivityTrackingOptions as a, type TrackOptions as b, type TrackResult as c, type TrackingEvent as d, UNIFIED_TRACKER_CONSTANTS as e, UnifiedTrackerStub as f, type UnifiedTrackingOptions as g, UsageMetricType as h, type UsageTrackingOptions as i, createProductTracker as j, trackerStub as k, trackOperation as t };
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
declare function isValidEmail(email: string): boolean;
|
|
2
|
+
declare function isValidUrl(url: string): boolean;
|
|
3
|
+
declare function isValidRegexPattern(pattern: string): boolean;
|
|
4
|
+
declare function compileValidatedPattern(pattern: string): RegExp | null;
|
|
5
|
+
declare function isValidPhone(phone: string): boolean;
|
|
6
|
+
declare function isValidUUID(uuid: string): boolean;
|
|
7
|
+
declare function isValidIPv4(ip: string): boolean;
|
|
8
|
+
declare function isValidSlug(slug: string): boolean;
|
|
9
|
+
declare function isValidHexColor(color: string): boolean;
|
|
10
|
+
declare function isValidBase64(str: string): boolean;
|
|
11
|
+
declare function isValidJSON(str: string): boolean;
|
|
12
|
+
declare function isNumberInRange(value: number, min: number | null, max: number | null): boolean;
|
|
13
|
+
declare function isStringLengthValid(value: string, min: number | null, max: number | null): boolean;
|
|
14
|
+
|
|
15
|
+
declare function retry<T>(fn: () => Promise<T>, options: {
|
|
16
|
+
maxAttempts: number;
|
|
17
|
+
initialDelay: number;
|
|
18
|
+
maxDelay: number;
|
|
19
|
+
backoffMultiplier: number;
|
|
20
|
+
}): Promise<T>;
|
|
21
|
+
declare function sleep(ms: number): Promise<void>;
|
|
22
|
+
declare function deepMerge<T extends Record<string, unknown>>(target: T, source: Partial<T>): T;
|
|
23
|
+
declare function generateUUID(): string;
|
|
24
|
+
declare function sanitizeForLog(data: Record<string, unknown>): Record<string, unknown>;
|
|
25
|
+
declare function debounce<T extends (...args: unknown[]) => unknown>(fn: T, delay: number): (...args: Parameters<T>) => void;
|
|
26
|
+
declare function throttle<T extends (...args: unknown[]) => unknown>(fn: T, delay: number): (...args: Parameters<T>) => void;
|
|
27
|
+
declare function parseJWT(token: string): Record<string, unknown> | null;
|
|
28
|
+
declare function isTokenExpired(token: string): boolean;
|
|
29
|
+
declare function formatBytes(bytes: number, decimals?: number): string;
|
|
30
|
+
|
|
31
|
+
declare function truncate(str: string, maxLength: number): string;
|
|
32
|
+
declare function chunk<T>(array: T[], size: number): T[][];
|
|
33
|
+
declare function unique<T>(array: T[]): T[];
|
|
34
|
+
declare function groupBy<T>(array: T[], key: keyof T): Record<string, T[]>;
|
|
35
|
+
declare function pick<T extends Record<string, unknown>, K extends keyof T>(obj: T, keys: K[]): Pick<T, K>;
|
|
36
|
+
declare function omit<T extends Record<string, unknown>, K extends keyof T>(obj: T, keys: K[]): Omit<T, K>;
|
|
37
|
+
|
|
38
|
+
declare const index_chunk: typeof chunk;
|
|
39
|
+
declare const index_compileValidatedPattern: typeof compileValidatedPattern;
|
|
40
|
+
declare const index_debounce: typeof debounce;
|
|
41
|
+
declare const index_deepMerge: typeof deepMerge;
|
|
42
|
+
declare const index_formatBytes: typeof formatBytes;
|
|
43
|
+
declare const index_generateUUID: typeof generateUUID;
|
|
44
|
+
declare const index_groupBy: typeof groupBy;
|
|
45
|
+
declare const index_isNumberInRange: typeof isNumberInRange;
|
|
46
|
+
declare const index_isStringLengthValid: typeof isStringLengthValid;
|
|
47
|
+
declare const index_isTokenExpired: typeof isTokenExpired;
|
|
48
|
+
declare const index_isValidBase64: typeof isValidBase64;
|
|
49
|
+
declare const index_isValidEmail: typeof isValidEmail;
|
|
50
|
+
declare const index_isValidHexColor: typeof isValidHexColor;
|
|
51
|
+
declare const index_isValidIPv4: typeof isValidIPv4;
|
|
52
|
+
declare const index_isValidJSON: typeof isValidJSON;
|
|
53
|
+
declare const index_isValidPhone: typeof isValidPhone;
|
|
54
|
+
declare const index_isValidRegexPattern: typeof isValidRegexPattern;
|
|
55
|
+
declare const index_isValidSlug: typeof isValidSlug;
|
|
56
|
+
declare const index_isValidUUID: typeof isValidUUID;
|
|
57
|
+
declare const index_isValidUrl: typeof isValidUrl;
|
|
58
|
+
declare const index_omit: typeof omit;
|
|
59
|
+
declare const index_parseJWT: typeof parseJWT;
|
|
60
|
+
declare const index_pick: typeof pick;
|
|
61
|
+
declare const index_retry: typeof retry;
|
|
62
|
+
declare const index_sanitizeForLog: typeof sanitizeForLog;
|
|
63
|
+
declare const index_sleep: typeof sleep;
|
|
64
|
+
declare const index_throttle: typeof throttle;
|
|
65
|
+
declare const index_truncate: typeof truncate;
|
|
66
|
+
declare const index_unique: typeof unique;
|
|
67
|
+
declare namespace index {
|
|
68
|
+
export { index_chunk as chunk, index_compileValidatedPattern as compileValidatedPattern, index_debounce as debounce, index_deepMerge as deepMerge, index_formatBytes as formatBytes, index_generateUUID as generateUUID, index_groupBy as groupBy, index_isNumberInRange as isNumberInRange, index_isStringLengthValid as isStringLengthValid, index_isTokenExpired as isTokenExpired, index_isValidBase64 as isValidBase64, index_isValidEmail as isValidEmail, index_isValidHexColor as isValidHexColor, index_isValidIPv4 as isValidIPv4, index_isValidJSON as isValidJSON, index_isValidPhone as isValidPhone, index_isValidRegexPattern as isValidRegexPattern, index_isValidSlug as isValidSlug, index_isValidUUID as isValidUUID, index_isValidUrl as isValidUrl, index_omit as omit, index_parseJWT as parseJWT, index_pick as pick, index_retry as retry, index_sanitizeForLog as sanitizeForLog, index_sleep as sleep, index_throttle as throttle, index_truncate as truncate, index_unique as unique };
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export { sleep as A, throttle as B, truncate as C, unique as D, compileValidatedPattern as a, deepMerge as b, chunk as c, debounce as d, groupBy as e, formatBytes as f, generateUUID as g, isNumberInRange as h, index as i, isStringLengthValid as j, isTokenExpired as k, isValidBase64 as l, isValidEmail as m, isValidHexColor as n, isValidIPv4 as o, isValidJSON as p, isValidPhone as q, isValidRegexPattern as r, isValidSlug as s, isValidUUID as t, isValidUrl as u, omit as v, parseJWT as w, pick as x, retry as y, sanitizeForLog as z };
|