@runbandit/sdk 3.1.3 → 3.4.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/dist/chunk-BG5L4PBC.js +319 -0
- package/dist/chunk-BG5L4PBC.js.map +1 -0
- package/dist/decision-cookie-CNIp56yQ.d.ts +503 -0
- package/dist/index.d.ts +85 -468
- package/dist/index.js +414 -250
- package/dist/index.js.map +1 -1
- package/dist/server.d.ts +48 -0
- package/dist/server.js +195 -0
- package/dist/server.js.map +1 -0
- package/package.json +5 -1
package/dist/server.d.ts
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { a as CompanySnapshot } from './decision-cookie-CNIp56yQ.js';
|
|
2
|
+
export { c as CookieDecision, d as CookieDecisions, D as DECISIONS_COOKIE, b as SnapshotExperiment, S as SnapshotTreatment, V as VISITOR_COOKIE, p as parseDecisions, r as readCookie, s as serializeDecisions } from './decision-cookie-CNIp56yQ.js';
|
|
3
|
+
|
|
4
|
+
interface BanditServerConfig {
|
|
5
|
+
apiUrl: string;
|
|
6
|
+
publishableKey: string;
|
|
7
|
+
origin?: string;
|
|
8
|
+
fetchImpl?: typeof fetch;
|
|
9
|
+
now?: () => number;
|
|
10
|
+
random?: () => number;
|
|
11
|
+
coldStartTimeoutMs?: number;
|
|
12
|
+
cookieDomain?: string;
|
|
13
|
+
secureCookies?: boolean;
|
|
14
|
+
}
|
|
15
|
+
interface ServerAssignment {
|
|
16
|
+
experimentId: string;
|
|
17
|
+
treatmentId: string;
|
|
18
|
+
clientAssignmentId: string;
|
|
19
|
+
config: unknown;
|
|
20
|
+
funnelId?: string;
|
|
21
|
+
}
|
|
22
|
+
interface ServerDecisions {
|
|
23
|
+
visitorId: string;
|
|
24
|
+
isNewVisitor: boolean;
|
|
25
|
+
assignments: Record<string, ServerAssignment | null>;
|
|
26
|
+
setCookies: string[];
|
|
27
|
+
flush(): Promise<void>;
|
|
28
|
+
}
|
|
29
|
+
declare const DEFAULT_COLD_START_TIMEOUT_MS = 300;
|
|
30
|
+
declare class BanditServer {
|
|
31
|
+
private readonly config;
|
|
32
|
+
private readonly base;
|
|
33
|
+
private readonly fetchImpl;
|
|
34
|
+
private readonly now;
|
|
35
|
+
private readonly random;
|
|
36
|
+
private current;
|
|
37
|
+
private refreshing;
|
|
38
|
+
constructor(config: BanditServerConfig);
|
|
39
|
+
snapshot(): Promise<CompanySnapshot | null>;
|
|
40
|
+
decide(cookieHeader: string | null | undefined, experiments: string[]): Promise<ServerDecisions>;
|
|
41
|
+
private isStale;
|
|
42
|
+
private refresh;
|
|
43
|
+
private fetchSnapshot;
|
|
44
|
+
private report;
|
|
45
|
+
private headers;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export { BanditServer, type BanditServerConfig, CompanySnapshot, DEFAULT_COLD_START_TIMEOUT_MS, type ServerAssignment, type ServerDecisions };
|
package/dist/server.js
ADDED
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DECISIONS_COOKIE,
|
|
3
|
+
VISITOR_COOKIE,
|
|
4
|
+
VISITOR_COOKIE_MAX_AGE_SECONDS,
|
|
5
|
+
decisionsMaxAgeSeconds,
|
|
6
|
+
generateId,
|
|
7
|
+
parseDecisions,
|
|
8
|
+
pickTreatment,
|
|
9
|
+
readCookie,
|
|
10
|
+
serializeCookie,
|
|
11
|
+
serializeDecisions
|
|
12
|
+
} from "./chunk-BG5L4PBC.js";
|
|
13
|
+
|
|
14
|
+
// src/server.ts
|
|
15
|
+
var DEFAULT_COLD_START_TIMEOUT_MS = 300;
|
|
16
|
+
var MIN_REFRESH_SECONDS = 5;
|
|
17
|
+
var DEFAULT_ASSIGNMENT_TTL_SECONDS = 86400;
|
|
18
|
+
function apiBase(apiUrl) {
|
|
19
|
+
const trimmed = apiUrl.replace(/\/$/, "");
|
|
20
|
+
return trimmed.endsWith("/api") ? trimmed : `${trimmed}/api`;
|
|
21
|
+
}
|
|
22
|
+
function randomToken(random) {
|
|
23
|
+
const chars = "abcdefghijklmnopqrstuvwxyz0123456789";
|
|
24
|
+
let id = "";
|
|
25
|
+
for (let i = 0; i < 24; i++) id += chars.charAt(Math.floor(random() * chars.length));
|
|
26
|
+
return id;
|
|
27
|
+
}
|
|
28
|
+
function findExperiment(snapshot, idOrName) {
|
|
29
|
+
const byId = snapshot.experiments[idOrName];
|
|
30
|
+
if (byId) return [idOrName, byId];
|
|
31
|
+
for (const [id, experiment] of Object.entries(snapshot.experiments)) {
|
|
32
|
+
if (experiment.name === idOrName) return [id, experiment];
|
|
33
|
+
}
|
|
34
|
+
return null;
|
|
35
|
+
}
|
|
36
|
+
var BanditServer = class {
|
|
37
|
+
config;
|
|
38
|
+
base;
|
|
39
|
+
fetchImpl;
|
|
40
|
+
now;
|
|
41
|
+
random;
|
|
42
|
+
current = null;
|
|
43
|
+
refreshing = null;
|
|
44
|
+
constructor(config) {
|
|
45
|
+
this.config = config;
|
|
46
|
+
this.base = apiBase(config.apiUrl);
|
|
47
|
+
this.fetchImpl = config.fetchImpl ?? ((...args) => fetch(...args));
|
|
48
|
+
this.now = config.now ?? (() => Date.now());
|
|
49
|
+
this.random = config.random ?? Math.random;
|
|
50
|
+
}
|
|
51
|
+
async snapshot() {
|
|
52
|
+
if (this.current && !this.isStale(this.current)) return this.current;
|
|
53
|
+
const refresh = this.refresh();
|
|
54
|
+
if (this.current) return this.current;
|
|
55
|
+
const timeoutMs = this.config.coldStartTimeoutMs ?? DEFAULT_COLD_START_TIMEOUT_MS;
|
|
56
|
+
return Promise.race([
|
|
57
|
+
refresh,
|
|
58
|
+
new Promise((resolve) => setTimeout(() => resolve(null), timeoutMs))
|
|
59
|
+
]);
|
|
60
|
+
}
|
|
61
|
+
async decide(cookieHeader, experiments) {
|
|
62
|
+
const now = this.now();
|
|
63
|
+
const existingVisitor = readCookie(cookieHeader, VISITOR_COOKIE);
|
|
64
|
+
const visitorId = existingVisitor ?? generateId();
|
|
65
|
+
const decisions = parseDecisions(readCookie(cookieHeader, DECISIONS_COOKIE), now);
|
|
66
|
+
const snapshot = await this.snapshot();
|
|
67
|
+
const reports = [];
|
|
68
|
+
const sessionId = visitorId;
|
|
69
|
+
const assignments = {};
|
|
70
|
+
let decisionsChanged = false;
|
|
71
|
+
for (const requested of experiments) {
|
|
72
|
+
const found = snapshot ? findExperiment(snapshot, requested) : null;
|
|
73
|
+
if (!found) {
|
|
74
|
+
assignments[requested] = null;
|
|
75
|
+
continue;
|
|
76
|
+
}
|
|
77
|
+
const [experimentId, experiment] = found;
|
|
78
|
+
const held = decisions[experimentId];
|
|
79
|
+
const heldTreatment = held && experiment.treatments.find((t) => t.id === held.treatmentId);
|
|
80
|
+
if (held && heldTreatment) {
|
|
81
|
+
assignments[requested] = {
|
|
82
|
+
experimentId,
|
|
83
|
+
treatmentId: heldTreatment.id,
|
|
84
|
+
clientAssignmentId: held.clientAssignmentId,
|
|
85
|
+
config: heldTreatment.config,
|
|
86
|
+
...experiment.funnelId ? { funnelId: experiment.funnelId } : {}
|
|
87
|
+
};
|
|
88
|
+
continue;
|
|
89
|
+
}
|
|
90
|
+
if (experiment.mode !== "snapshot") {
|
|
91
|
+
assignments[requested] = null;
|
|
92
|
+
continue;
|
|
93
|
+
}
|
|
94
|
+
const treatment = pickTreatment(
|
|
95
|
+
experiment.treatments.filter((t) => t.pct > 0),
|
|
96
|
+
this.random()
|
|
97
|
+
);
|
|
98
|
+
if (!treatment) {
|
|
99
|
+
assignments[requested] = null;
|
|
100
|
+
continue;
|
|
101
|
+
}
|
|
102
|
+
const clientAssignmentId = randomToken(this.random);
|
|
103
|
+
const ttlSeconds = experiment.assignmentTtl ?? DEFAULT_ASSIGNMENT_TTL_SECONDS;
|
|
104
|
+
decisions[experimentId] = {
|
|
105
|
+
experimentId,
|
|
106
|
+
treatmentId: treatment.id,
|
|
107
|
+
clientAssignmentId,
|
|
108
|
+
expiresAt: now + ttlSeconds * 1e3
|
|
109
|
+
};
|
|
110
|
+
decisionsChanged = true;
|
|
111
|
+
reports.push({ clientAssignmentId, experimentId, treatmentId: treatment.id, userId: visitorId, sessionId });
|
|
112
|
+
assignments[requested] = {
|
|
113
|
+
experimentId,
|
|
114
|
+
treatmentId: treatment.id,
|
|
115
|
+
clientAssignmentId,
|
|
116
|
+
config: treatment.config,
|
|
117
|
+
...experiment.funnelId ? { funnelId: experiment.funnelId } : {}
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
const setCookies = [];
|
|
121
|
+
const attributes = { domain: this.config.cookieDomain, secure: this.config.secureCookies };
|
|
122
|
+
if (!existingVisitor) {
|
|
123
|
+
setCookies.push(
|
|
124
|
+
serializeCookie(VISITOR_COOKIE, visitorId, { ...attributes, maxAgeSeconds: VISITOR_COOKIE_MAX_AGE_SECONDS })
|
|
125
|
+
);
|
|
126
|
+
}
|
|
127
|
+
if (decisionsChanged) {
|
|
128
|
+
setCookies.push(
|
|
129
|
+
serializeCookie(DECISIONS_COOKIE, serializeDecisions(decisions), {
|
|
130
|
+
...attributes,
|
|
131
|
+
maxAgeSeconds: decisionsMaxAgeSeconds(decisions, now)
|
|
132
|
+
})
|
|
133
|
+
);
|
|
134
|
+
}
|
|
135
|
+
return {
|
|
136
|
+
visitorId,
|
|
137
|
+
isNewVisitor: !existingVisitor,
|
|
138
|
+
assignments,
|
|
139
|
+
setCookies,
|
|
140
|
+
flush: () => this.report(reports)
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
isStale(snapshot) {
|
|
144
|
+
const ttlMs = Math.max(snapshot.ttl, MIN_REFRESH_SECONDS) * 1e3;
|
|
145
|
+
return this.now() - snapshot.generatedAt > ttlMs;
|
|
146
|
+
}
|
|
147
|
+
refresh() {
|
|
148
|
+
if (this.refreshing) return this.refreshing;
|
|
149
|
+
this.refreshing = this.fetchSnapshot().finally(() => {
|
|
150
|
+
this.refreshing = null;
|
|
151
|
+
});
|
|
152
|
+
return this.refreshing;
|
|
153
|
+
}
|
|
154
|
+
async fetchSnapshot() {
|
|
155
|
+
try {
|
|
156
|
+
const response = await this.fetchImpl(`${this.base}/snapshot`, {
|
|
157
|
+
headers: this.headers()
|
|
158
|
+
});
|
|
159
|
+
if (!response.ok) return this.current;
|
|
160
|
+
const snapshot = await response.json();
|
|
161
|
+
this.current = { ...snapshot, generatedAt: this.now() };
|
|
162
|
+
return this.current;
|
|
163
|
+
} catch {
|
|
164
|
+
return this.current;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
async report(reports) {
|
|
168
|
+
if (reports.length === 0) return;
|
|
169
|
+
try {
|
|
170
|
+
await this.fetchImpl(`${this.base}/assignments/report`, {
|
|
171
|
+
method: "POST",
|
|
172
|
+
headers: { ...this.headers(), "content-type": "application/json" },
|
|
173
|
+
body: JSON.stringify({ reports })
|
|
174
|
+
});
|
|
175
|
+
} catch {
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
headers() {
|
|
180
|
+
return {
|
|
181
|
+
"x-api-key": this.config.publishableKey,
|
|
182
|
+
...this.config.origin ? { origin: this.config.origin } : {}
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
};
|
|
186
|
+
export {
|
|
187
|
+
BanditServer,
|
|
188
|
+
DECISIONS_COOKIE,
|
|
189
|
+
DEFAULT_COLD_START_TIMEOUT_MS,
|
|
190
|
+
VISITOR_COOKIE,
|
|
191
|
+
parseDecisions,
|
|
192
|
+
readCookie,
|
|
193
|
+
serializeDecisions
|
|
194
|
+
};
|
|
195
|
+
//# sourceMappingURL=server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/server.ts"],"sourcesContent":["import type { CompanySnapshot, SnapshotExperiment } from '@runbandit/shared';\nimport { pickTreatment } from './snapshot-cache.js';\nimport { generateId } from './session.js';\nimport {\n DECISIONS_COOKIE,\n VISITOR_COOKIE,\n VISITOR_COOKIE_MAX_AGE_SECONDS,\n decisionsMaxAgeSeconds,\n parseDecisions,\n readCookie,\n serializeCookie,\n serializeDecisions,\n type CookieDecisions,\n} from './decision-cookie.js';\n\nexport {\n DECISIONS_COOKIE,\n VISITOR_COOKIE,\n parseDecisions,\n readCookie,\n serializeDecisions,\n} from './decision-cookie.js';\nexport type { CookieDecision, CookieDecisions } from './decision-cookie.js';\nexport type { CompanySnapshot, SnapshotExperiment, SnapshotTreatment } from '@runbandit/shared';\n\nexport interface BanditServerConfig {\n apiUrl: string;\n publishableKey: string;\n origin?: string;\n fetchImpl?: typeof fetch;\n now?: () => number;\n random?: () => number;\n coldStartTimeoutMs?: number;\n cookieDomain?: string;\n secureCookies?: boolean;\n}\n\nexport interface ServerAssignment {\n experimentId: string;\n treatmentId: string;\n clientAssignmentId: string;\n config: unknown;\n funnelId?: string;\n}\n\nexport interface ServerDecisions {\n visitorId: string;\n isNewVisitor: boolean;\n assignments: Record<string, ServerAssignment | null>;\n setCookies: string[];\n flush(): Promise<void>;\n}\n\ninterface PendingReport {\n clientAssignmentId: string;\n experimentId: string;\n treatmentId: string;\n userId: string;\n sessionId: string;\n}\n\nexport const DEFAULT_COLD_START_TIMEOUT_MS = 300;\nconst MIN_REFRESH_SECONDS = 5;\nconst DEFAULT_ASSIGNMENT_TTL_SECONDS = 86400;\n\nfunction apiBase(apiUrl: string): string {\n const trimmed = apiUrl.replace(/\\/$/, '');\n return trimmed.endsWith('/api') ? trimmed : `${trimmed}/api`;\n}\n\nfunction randomToken(random: () => number): string {\n const chars = 'abcdefghijklmnopqrstuvwxyz0123456789';\n let id = '';\n for (let i = 0; i < 24; i++) id += chars.charAt(Math.floor(random() * chars.length));\n return id;\n}\n\nfunction findExperiment(\n snapshot: CompanySnapshot,\n idOrName: string\n): [string, SnapshotExperiment] | null {\n const byId = snapshot.experiments[idOrName];\n if (byId) return [idOrName, byId];\n for (const [id, experiment] of Object.entries(snapshot.experiments)) {\n if (experiment.name === idOrName) return [id, experiment];\n }\n return null;\n}\n\nexport class BanditServer {\n private readonly config: BanditServerConfig;\n private readonly base: string;\n private readonly fetchImpl: typeof fetch;\n private readonly now: () => number;\n private readonly random: () => number;\n private current: CompanySnapshot | null = null;\n private refreshing: Promise<CompanySnapshot | null> | null = null;\n\n constructor(config: BanditServerConfig) {\n this.config = config;\n this.base = apiBase(config.apiUrl);\n this.fetchImpl = config.fetchImpl ?? ((...args) => fetch(...args));\n this.now = config.now ?? (() => Date.now());\n this.random = config.random ?? Math.random;\n }\n\n async snapshot(): Promise<CompanySnapshot | null> {\n if (this.current && !this.isStale(this.current)) return this.current;\n const refresh = this.refresh();\n if (this.current) return this.current;\n const timeoutMs = this.config.coldStartTimeoutMs ?? DEFAULT_COLD_START_TIMEOUT_MS;\n return Promise.race([\n refresh,\n new Promise<null>((resolve) => setTimeout(() => resolve(null), timeoutMs)),\n ]);\n }\n\n async decide(cookieHeader: string | null | undefined, experiments: string[]): Promise<ServerDecisions> {\n const now = this.now();\n const existingVisitor = readCookie(cookieHeader, VISITOR_COOKIE);\n const visitorId = existingVisitor ?? generateId();\n const decisions = parseDecisions(readCookie(cookieHeader, DECISIONS_COOKIE), now);\n const snapshot = await this.snapshot();\n const reports: PendingReport[] = [];\n const sessionId = visitorId;\n const assignments: Record<string, ServerAssignment | null> = {};\n let decisionsChanged = false;\n\n for (const requested of experiments) {\n const found = snapshot ? findExperiment(snapshot, requested) : null;\n if (!found) {\n assignments[requested] = null;\n continue;\n }\n const [experimentId, experiment] = found;\n const held = decisions[experimentId];\n const heldTreatment = held && experiment.treatments.find((t) => t.id === held.treatmentId);\n if (held && heldTreatment) {\n assignments[requested] = {\n experimentId,\n treatmentId: heldTreatment.id,\n clientAssignmentId: held.clientAssignmentId,\n config: heldTreatment.config,\n ...(experiment.funnelId ? { funnelId: experiment.funnelId } : {}),\n };\n continue;\n }\n if (experiment.mode !== 'snapshot') {\n assignments[requested] = null;\n continue;\n }\n const treatment = pickTreatment(\n experiment.treatments.filter((t) => t.pct > 0),\n this.random()\n );\n if (!treatment) {\n assignments[requested] = null;\n continue;\n }\n const clientAssignmentId = randomToken(this.random);\n const ttlSeconds = experiment.assignmentTtl ?? DEFAULT_ASSIGNMENT_TTL_SECONDS;\n decisions[experimentId] = {\n experimentId,\n treatmentId: treatment.id,\n clientAssignmentId,\n expiresAt: now + ttlSeconds * 1000,\n };\n decisionsChanged = true;\n reports.push({ clientAssignmentId, experimentId, treatmentId: treatment.id, userId: visitorId, sessionId });\n assignments[requested] = {\n experimentId,\n treatmentId: treatment.id,\n clientAssignmentId,\n config: treatment.config,\n ...(experiment.funnelId ? { funnelId: experiment.funnelId } : {}),\n };\n }\n\n const setCookies: string[] = [];\n const attributes = { domain: this.config.cookieDomain, secure: this.config.secureCookies };\n if (!existingVisitor) {\n setCookies.push(\n serializeCookie(VISITOR_COOKIE, visitorId, { ...attributes, maxAgeSeconds: VISITOR_COOKIE_MAX_AGE_SECONDS })\n );\n }\n if (decisionsChanged) {\n setCookies.push(\n serializeCookie(DECISIONS_COOKIE, serializeDecisions(decisions as CookieDecisions), {\n ...attributes,\n maxAgeSeconds: decisionsMaxAgeSeconds(decisions, now),\n })\n );\n }\n\n return {\n visitorId,\n isNewVisitor: !existingVisitor,\n assignments,\n setCookies,\n flush: () => this.report(reports),\n };\n }\n\n private isStale(snapshot: CompanySnapshot): boolean {\n const ttlMs = Math.max(snapshot.ttl, MIN_REFRESH_SECONDS) * 1000;\n return this.now() - snapshot.generatedAt > ttlMs;\n }\n\n private refresh(): Promise<CompanySnapshot | null> {\n if (this.refreshing) return this.refreshing;\n this.refreshing = this.fetchSnapshot().finally(() => {\n this.refreshing = null;\n });\n return this.refreshing;\n }\n\n private async fetchSnapshot(): Promise<CompanySnapshot | null> {\n try {\n const response = await this.fetchImpl(`${this.base}/snapshot`, {\n headers: this.headers(),\n });\n if (!response.ok) return this.current;\n const snapshot = (await response.json()) as CompanySnapshot;\n this.current = { ...snapshot, generatedAt: this.now() };\n return this.current;\n } catch {\n return this.current;\n }\n }\n\n private async report(reports: PendingReport[]): Promise<void> {\n if (reports.length === 0) return;\n try {\n await this.fetchImpl(`${this.base}/assignments/report`, {\n method: 'POST',\n headers: { ...this.headers(), 'content-type': 'application/json' },\n body: JSON.stringify({ reports }),\n });\n } catch {\n return;\n }\n }\n\n private headers(): Record<string, string> {\n return {\n 'x-api-key': this.config.publishableKey,\n ...(this.config.origin ? { origin: this.config.origin } : {}),\n };\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AA6DO,IAAM,gCAAgC;AAC7C,IAAM,sBAAsB;AAC5B,IAAM,iCAAiC;AAEvC,SAAS,QAAQ,QAAwB;AACvC,QAAM,UAAU,OAAO,QAAQ,OAAO,EAAE;AACxC,SAAO,QAAQ,SAAS,MAAM,IAAI,UAAU,GAAG,OAAO;AACxD;AAEA,SAAS,YAAY,QAA8B;AACjD,QAAM,QAAQ;AACd,MAAI,KAAK;AACT,WAAS,IAAI,GAAG,IAAI,IAAI,IAAK,OAAM,MAAM,OAAO,KAAK,MAAM,OAAO,IAAI,MAAM,MAAM,CAAC;AACnF,SAAO;AACT;AAEA,SAAS,eACP,UACA,UACqC;AACrC,QAAM,OAAO,SAAS,YAAY,QAAQ;AAC1C,MAAI,KAAM,QAAO,CAAC,UAAU,IAAI;AAChC,aAAW,CAAC,IAAI,UAAU,KAAK,OAAO,QAAQ,SAAS,WAAW,GAAG;AACnE,QAAI,WAAW,SAAS,SAAU,QAAO,CAAC,IAAI,UAAU;AAAA,EAC1D;AACA,SAAO;AACT;AAEO,IAAM,eAAN,MAAmB;AAAA,EACP;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACT,UAAkC;AAAA,EAClC,aAAqD;AAAA,EAE7D,YAAY,QAA4B;AACtC,SAAK,SAAS;AACd,SAAK,OAAO,QAAQ,OAAO,MAAM;AACjC,SAAK,YAAY,OAAO,cAAc,IAAI,SAAS,MAAM,GAAG,IAAI;AAChE,SAAK,MAAM,OAAO,QAAQ,MAAM,KAAK,IAAI;AACzC,SAAK,SAAS,OAAO,UAAU,KAAK;AAAA,EACtC;AAAA,EAEA,M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/sdk",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.4.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -8,6 +8,10 @@
|
|
|
8
8
|
".": {
|
|
9
9
|
"types": "./dist/index.d.ts",
|
|
10
10
|
"import": "./dist/index.js"
|
|
11
|
+
},
|
|
12
|
+
"./server": {
|
|
13
|
+
"types": "./dist/server.d.ts",
|
|
14
|
+
"import": "./dist/server.js"
|
|
11
15
|
}
|
|
12
16
|
},
|
|
13
17
|
"files": [
|