@drivemetadata-ai/sdk 0.1.1-beta.1
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/CHANGELOG.md +12 -0
- package/LICENSE +21 -0
- package/README.md +107 -0
- package/dist/angular/index.cjs +954 -0
- package/dist/angular/index.cjs.map +1 -0
- package/dist/angular/index.d.cts +26 -0
- package/dist/angular/index.d.ts +26 -0
- package/dist/angular/index.js +928 -0
- package/dist/angular/index.js.map +1 -0
- package/dist/browser/index.cjs +914 -0
- package/dist/browser/index.cjs.map +1 -0
- package/dist/browser/index.d.cts +84 -0
- package/dist/browser/index.d.ts +84 -0
- package/dist/browser/index.js +874 -0
- package/dist/browser/index.js.map +1 -0
- package/dist/next/index.cjs +971 -0
- package/dist/next/index.cjs.map +1 -0
- package/dist/next/index.d.cts +18 -0
- package/dist/next/index.d.ts +18 -0
- package/dist/next/index.js +928 -0
- package/dist/next/index.js.map +1 -0
- package/dist/node/index.cjs +239 -0
- package/dist/node/index.cjs.map +1 -0
- package/dist/node/index.d.cts +85 -0
- package/dist/node/index.d.ts +85 -0
- package/dist/node/index.js +209 -0
- package/dist/node/index.js.map +1 -0
- package/dist/react/index.cjs +999 -0
- package/dist/react/index.cjs.map +1 -0
- package/dist/react/index.d.cts +26 -0
- package/dist/react/index.d.ts +26 -0
- package/dist/react/index.js +952 -0
- package/dist/react/index.js.map +1 -0
- package/dist/types-BwtS0ZDu.d.cts +106 -0
- package/dist/types-BwtS0ZDu.d.ts +106 -0
- package/docs/angular-integration.md +106 -0
- package/docs/index.md +19 -0
- package/docs/migration-cdn-to-npm.md +99 -0
- package/docs/node-server-integration.md +138 -0
- package/docs/npm-browser-sdk.md +143 -0
- package/docs/react-next-integration.md +168 -0
- package/docs/security-privacy.md +128 -0
- package/package.json +100 -0
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
// src/node/errors.ts
|
|
2
|
+
var DmdServerSdkError = class extends Error {
|
|
3
|
+
constructor(message, cause) {
|
|
4
|
+
super(message);
|
|
5
|
+
this.cause = cause;
|
|
6
|
+
this.name = "DmdServerSdkError";
|
|
7
|
+
}
|
|
8
|
+
};
|
|
9
|
+
var DmdServerValidationError = class extends DmdServerSdkError {
|
|
10
|
+
constructor(message) {
|
|
11
|
+
super(message);
|
|
12
|
+
this.name = "DmdServerValidationError";
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
var DmdServerRequestError = class extends DmdServerSdkError {
|
|
16
|
+
constructor(message, status, cause) {
|
|
17
|
+
super(message, cause);
|
|
18
|
+
this.status = status;
|
|
19
|
+
this.name = "DmdServerRequestError";
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
// src/node/retry.ts
|
|
24
|
+
function isRetryableStatus(status) {
|
|
25
|
+
return status === 408 || status === 429 || status >= 500;
|
|
26
|
+
}
|
|
27
|
+
function getRetryDelayMs(attemptIndex, retry = {}) {
|
|
28
|
+
const minDelayMs = retry.minDelayMs ?? 250;
|
|
29
|
+
const maxDelayMs = retry.maxDelayMs ?? 2e3;
|
|
30
|
+
const exponentialDelay = minDelayMs * 2 ** attemptIndex;
|
|
31
|
+
return Math.min(exponentialDelay, maxDelayMs);
|
|
32
|
+
}
|
|
33
|
+
function getRetryAttempts(retry) {
|
|
34
|
+
return retry?.attempts ?? 0;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// src/node/validation.ts
|
|
38
|
+
function requireString(value, message) {
|
|
39
|
+
if (typeof value !== "string" || value.trim() === "") {
|
|
40
|
+
throw new DmdServerValidationError(message);
|
|
41
|
+
}
|
|
42
|
+
return value;
|
|
43
|
+
}
|
|
44
|
+
function validateServerConfig(config) {
|
|
45
|
+
requireString(config.writeKey, "DMD server SDK config writeKey is required");
|
|
46
|
+
}
|
|
47
|
+
function validateTrackPayload(payload) {
|
|
48
|
+
requireString(payload.event, "DMD server SDK track event is required");
|
|
49
|
+
if (!payload.userId && !payload.anonymousId) {
|
|
50
|
+
throw new DmdServerValidationError("DMD server SDK track requires userId or anonymousId");
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
function validateIdentifyPayload(payload) {
|
|
54
|
+
requireString(payload.userId, "DMD server SDK identify requires userId");
|
|
55
|
+
}
|
|
56
|
+
function validatePagePayload(payload) {
|
|
57
|
+
if (!payload.userId && !payload.anonymousId) {
|
|
58
|
+
throw new DmdServerValidationError("DMD server SDK page requires userId or anonymousId");
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
function validateAliasPayload(payload) {
|
|
62
|
+
const hasPreviousId = typeof payload.previousId === "string" && payload.previousId.trim() !== "";
|
|
63
|
+
const hasUserId = typeof payload.userId === "string" && payload.userId.trim() !== "";
|
|
64
|
+
if (!hasPreviousId || !hasUserId) {
|
|
65
|
+
throw new DmdServerValidationError("DMD server SDK alias requires previousId and userId");
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
function validateGroupPayload(payload) {
|
|
69
|
+
requireString(payload.groupId, "DMD server SDK group requires groupId");
|
|
70
|
+
if (!payload.userId && !payload.anonymousId) {
|
|
71
|
+
throw new DmdServerValidationError("DMD server SDK group requires userId or anonymousId");
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
function validateBatchPayload(items) {
|
|
75
|
+
if (!Array.isArray(items) || items.length === 0) {
|
|
76
|
+
throw new DmdServerValidationError("DMD server SDK batch requires at least one item");
|
|
77
|
+
}
|
|
78
|
+
for (const item of items) {
|
|
79
|
+
if (item.type === "track") validateTrackPayload(item.payload);
|
|
80
|
+
else if (item.type === "identify") validateIdentifyPayload(item.payload);
|
|
81
|
+
else if (item.type === "page") validatePagePayload(item.payload);
|
|
82
|
+
else if (item.type === "alias") validateAliasPayload(item.payload);
|
|
83
|
+
else if (item.type === "group") validateGroupPayload(item.payload);
|
|
84
|
+
else throw new DmdServerValidationError("DMD server SDK batch item has invalid type");
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
// src/node/client.ts
|
|
89
|
+
var DEFAULT_ENDPOINT = "https://sdk.drivemetadata.com/v2/data-collector";
|
|
90
|
+
function sleep(ms) {
|
|
91
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
92
|
+
}
|
|
93
|
+
function withTimestamp(payload) {
|
|
94
|
+
return {
|
|
95
|
+
...payload,
|
|
96
|
+
timestamp: payload.timestamp ?? (/* @__PURE__ */ new Date()).toISOString()
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
function withBatchItemTimestamp(item) {
|
|
100
|
+
if (item.type === "track") return { type: item.type, payload: withTimestamp(item.payload) };
|
|
101
|
+
if (item.type === "identify") return { type: item.type, payload: withTimestamp(item.payload) };
|
|
102
|
+
if (item.type === "page") return { type: item.type, payload: withTimestamp(item.payload) };
|
|
103
|
+
if (item.type === "alias") return { type: item.type, payload: withTimestamp(item.payload) };
|
|
104
|
+
return { type: item.type, payload: withTimestamp(item.payload) };
|
|
105
|
+
}
|
|
106
|
+
function createTimeoutController(timeoutMs) {
|
|
107
|
+
if (!timeoutMs) {
|
|
108
|
+
return { cleanup: () => void 0 };
|
|
109
|
+
}
|
|
110
|
+
const controller = new AbortController();
|
|
111
|
+
const timer = setTimeout(() => controller.abort(), timeoutMs);
|
|
112
|
+
return {
|
|
113
|
+
signal: controller.signal,
|
|
114
|
+
cleanup: () => clearTimeout(timer)
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
function createDmdServerClient(config) {
|
|
118
|
+
validateServerConfig(config);
|
|
119
|
+
const endpoint = config.endpoint ?? DEFAULT_ENDPOINT;
|
|
120
|
+
const fetchImpl = config.fetch ?? globalThis.fetch;
|
|
121
|
+
if (typeof fetchImpl !== "function") {
|
|
122
|
+
throw new Error("DMD server SDK requires fetch. Use Node.js 18+ or pass config.fetch.");
|
|
123
|
+
}
|
|
124
|
+
async function send(requestPayload) {
|
|
125
|
+
const attempts = getRetryAttempts(config.retry);
|
|
126
|
+
let lastError;
|
|
127
|
+
for (let attemptIndex = 0; attemptIndex <= attempts; attemptIndex += 1) {
|
|
128
|
+
try {
|
|
129
|
+
const requestInit = {
|
|
130
|
+
method: "POST",
|
|
131
|
+
headers: {
|
|
132
|
+
Authorization: `Bearer ${config.writeKey}`,
|
|
133
|
+
"Content-Type": "application/json"
|
|
134
|
+
},
|
|
135
|
+
body: JSON.stringify(requestPayload)
|
|
136
|
+
};
|
|
137
|
+
const timeout = createTimeoutController(config.timeoutMs);
|
|
138
|
+
if (timeout.signal !== void 0) {
|
|
139
|
+
requestInit.signal = timeout.signal;
|
|
140
|
+
}
|
|
141
|
+
const response = await fetchImpl(endpoint, requestInit).finally(timeout.cleanup);
|
|
142
|
+
if (response.ok) {
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
if (!isRetryableStatus(response.status) || attemptIndex === attempts) {
|
|
146
|
+
throw new DmdServerRequestError(
|
|
147
|
+
`DMD server SDK request failed with status ${response.status}`,
|
|
148
|
+
response.status
|
|
149
|
+
);
|
|
150
|
+
}
|
|
151
|
+
await sleep(getRetryDelayMs(attemptIndex, config.retry));
|
|
152
|
+
} catch (error) {
|
|
153
|
+
lastError = error;
|
|
154
|
+
if (error instanceof DmdServerRequestError || attemptIndex === attempts) {
|
|
155
|
+
throw error;
|
|
156
|
+
}
|
|
157
|
+
await sleep(getRetryDelayMs(attemptIndex, config.retry));
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
throw new DmdServerRequestError("DMD server SDK request failed", void 0, lastError);
|
|
161
|
+
}
|
|
162
|
+
function envelope(type, payload) {
|
|
163
|
+
return {
|
|
164
|
+
type,
|
|
165
|
+
payload,
|
|
166
|
+
sentAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
return {
|
|
170
|
+
async track(payload) {
|
|
171
|
+
validateTrackPayload(payload);
|
|
172
|
+
await send(envelope("track", withTimestamp(payload)));
|
|
173
|
+
},
|
|
174
|
+
async identify(payload) {
|
|
175
|
+
validateIdentifyPayload(payload);
|
|
176
|
+
await send(envelope("identify", withTimestamp(payload)));
|
|
177
|
+
},
|
|
178
|
+
async page(payload) {
|
|
179
|
+
validatePagePayload(payload);
|
|
180
|
+
await send(envelope("page", withTimestamp(payload)));
|
|
181
|
+
},
|
|
182
|
+
async alias(payload) {
|
|
183
|
+
validateAliasPayload(payload);
|
|
184
|
+
await send(envelope("alias", withTimestamp(payload)));
|
|
185
|
+
},
|
|
186
|
+
async group(payload) {
|
|
187
|
+
validateGroupPayload(payload);
|
|
188
|
+
await send(envelope("group", withTimestamp(payload)));
|
|
189
|
+
},
|
|
190
|
+
async batch(items) {
|
|
191
|
+
validateBatchPayload(items);
|
|
192
|
+
await send({
|
|
193
|
+
type: "batch",
|
|
194
|
+
batch: items.map(withBatchItemTimestamp),
|
|
195
|
+
sentAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
196
|
+
});
|
|
197
|
+
},
|
|
198
|
+
async flush() {
|
|
199
|
+
return Promise.resolve();
|
|
200
|
+
}
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
export {
|
|
204
|
+
DmdServerRequestError,
|
|
205
|
+
DmdServerSdkError,
|
|
206
|
+
DmdServerValidationError,
|
|
207
|
+
createDmdServerClient
|
|
208
|
+
};
|
|
209
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/node/errors.ts","../../src/node/retry.ts","../../src/node/validation.ts","../../src/node/client.ts"],"sourcesContent":["export class DmdServerSdkError extends Error {\n constructor(message: string, public readonly cause?: unknown) {\n super(message);\n this.name = 'DmdServerSdkError';\n }\n}\n\nexport class DmdServerValidationError extends DmdServerSdkError {\n constructor(message: string) {\n super(message);\n this.name = 'DmdServerValidationError';\n }\n}\n\nexport class DmdServerRequestError extends DmdServerSdkError {\n constructor(message: string, public readonly status?: number, cause?: unknown) {\n super(message, cause);\n this.name = 'DmdServerRequestError';\n }\n}\n","import type { DmdServerRetryConfig } from './types';\n\nexport function isRetryableStatus(status: number): boolean {\n return status === 408 || status === 429 || status >= 500;\n}\n\nexport function getRetryDelayMs(attemptIndex: number, retry: DmdServerRetryConfig = {}): number {\n const minDelayMs = retry.minDelayMs ?? 250;\n const maxDelayMs = retry.maxDelayMs ?? 2000;\n const exponentialDelay = minDelayMs * 2 ** attemptIndex;\n\n return Math.min(exponentialDelay, maxDelayMs);\n}\n\nexport function getRetryAttempts(retry: DmdServerRetryConfig | undefined): number {\n return retry?.attempts ?? 0;\n}\n","import { DmdServerValidationError } from './errors';\nimport type {\n DmdServerAliasPayload,\n DmdServerBatchItem,\n DmdServerConfig,\n DmdServerGroupPayload,\n DmdServerIdentifyPayload,\n DmdServerPagePayload,\n DmdServerTrackPayload\n} from './types';\n\nfunction requireString(value: string | undefined, message: string): string {\n if (typeof value !== 'string' || value.trim() === '') {\n throw new DmdServerValidationError(message);\n }\n\n return value;\n}\n\nexport function validateServerConfig(config: DmdServerConfig): void {\n requireString(config.writeKey, 'DMD server SDK config writeKey is required');\n}\n\nexport function validateTrackPayload(payload: DmdServerTrackPayload): void {\n requireString(payload.event, 'DMD server SDK track event is required');\n\n if (!payload.userId && !payload.anonymousId) {\n throw new DmdServerValidationError('DMD server SDK track requires userId or anonymousId');\n }\n}\n\nexport function validateIdentifyPayload(payload: DmdServerIdentifyPayload): void {\n requireString(payload.userId, 'DMD server SDK identify requires userId');\n}\n\nexport function validatePagePayload(payload: DmdServerPagePayload): void {\n if (!payload.userId && !payload.anonymousId) {\n throw new DmdServerValidationError('DMD server SDK page requires userId or anonymousId');\n }\n}\n\nexport function validateAliasPayload(payload: DmdServerAliasPayload): void {\n const hasPreviousId = typeof payload.previousId === 'string' && payload.previousId.trim() !== '';\n const hasUserId = typeof payload.userId === 'string' && payload.userId.trim() !== '';\n if (!hasPreviousId || !hasUserId) {\n throw new DmdServerValidationError('DMD server SDK alias requires previousId and userId');\n }\n}\n\nexport function validateGroupPayload(payload: DmdServerGroupPayload): void {\n requireString(payload.groupId, 'DMD server SDK group requires groupId');\n if (!payload.userId && !payload.anonymousId) {\n throw new DmdServerValidationError('DMD server SDK group requires userId or anonymousId');\n }\n}\n\nexport function validateBatchPayload(items: DmdServerBatchItem[]): void {\n if (!Array.isArray(items) || items.length === 0) {\n throw new DmdServerValidationError('DMD server SDK batch requires at least one item');\n }\n\n for (const item of items) {\n if (item.type === 'track') validateTrackPayload(item.payload);\n else if (item.type === 'identify') validateIdentifyPayload(item.payload);\n else if (item.type === 'page') validatePagePayload(item.payload);\n else if (item.type === 'alias') validateAliasPayload(item.payload);\n else if (item.type === 'group') validateGroupPayload(item.payload);\n else throw new DmdServerValidationError('DMD server SDK batch item has invalid type');\n }\n}\n","import { DmdServerRequestError } from './errors';\nimport { getRetryAttempts, getRetryDelayMs, isRetryableStatus } from './retry';\nimport type {\n DmdServerAliasPayload,\n DmdServerBatchItem,\n DmdServerClient,\n DmdServerConfig,\n DmdServerGroupPayload,\n DmdServerIdentifyPayload,\n DmdServerPagePayload,\n DmdServerRequestPayload,\n DmdServerSingleRequestPayload,\n DmdServerTrackPayload\n} from './types';\nimport {\n validateAliasPayload,\n validateBatchPayload,\n validateGroupPayload,\n validateIdentifyPayload,\n validatePagePayload,\n validateServerConfig,\n validateTrackPayload\n} from './validation';\n\nconst DEFAULT_ENDPOINT = 'https://sdk.drivemetadata.com/v2/data-collector';\n\nfunction sleep(ms: number): Promise<void> {\n return new Promise(resolve => setTimeout(resolve, ms));\n}\n\nfunction withTimestamp<T extends { timestamp?: string }>(payload: T): T {\n return {\n ...payload,\n timestamp: payload.timestamp ?? new Date().toISOString()\n };\n}\n\nfunction withBatchItemTimestamp(item: DmdServerBatchItem): DmdServerBatchItem {\n if (item.type === 'track') return { type: item.type, payload: withTimestamp(item.payload) };\n if (item.type === 'identify') return { type: item.type, payload: withTimestamp(item.payload) };\n if (item.type === 'page') return { type: item.type, payload: withTimestamp(item.payload) };\n if (item.type === 'alias') return { type: item.type, payload: withTimestamp(item.payload) };\n return { type: item.type, payload: withTimestamp(item.payload) };\n}\n\nfunction createTimeoutController(timeoutMs: number | undefined): { signal?: AbortSignal; cleanup: () => void } {\n if (!timeoutMs) {\n return { cleanup: () => undefined };\n }\n\n const controller = new AbortController();\n const timer = setTimeout(() => controller.abort(), timeoutMs);\n return {\n signal: controller.signal,\n cleanup: () => clearTimeout(timer)\n };\n}\n\nexport function createDmdServerClient(config: DmdServerConfig): DmdServerClient {\n validateServerConfig(config);\n\n const endpoint = config.endpoint ?? DEFAULT_ENDPOINT;\n const fetchImpl = config.fetch ?? globalThis.fetch;\n\n if (typeof fetchImpl !== 'function') {\n throw new Error('DMD server SDK requires fetch. Use Node.js 18+ or pass config.fetch.');\n }\n\n async function send(requestPayload: DmdServerRequestPayload): Promise<void> {\n const attempts = getRetryAttempts(config.retry);\n let lastError: unknown;\n\n for (let attemptIndex = 0; attemptIndex <= attempts; attemptIndex += 1) {\n try {\n const requestInit: RequestInit = {\n method: 'POST',\n headers: {\n Authorization: `Bearer ${config.writeKey}`,\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(requestPayload)\n };\n const timeout = createTimeoutController(config.timeoutMs);\n if (timeout.signal !== undefined) {\n requestInit.signal = timeout.signal;\n }\n\n const response = await fetchImpl(endpoint, requestInit).finally(timeout.cleanup);\n\n if (response.ok) {\n return;\n }\n\n if (!isRetryableStatus(response.status) || attemptIndex === attempts) {\n throw new DmdServerRequestError(\n `DMD server SDK request failed with status ${response.status}`,\n response.status\n );\n }\n\n await sleep(getRetryDelayMs(attemptIndex, config.retry));\n } catch (error) {\n lastError = error;\n\n if (error instanceof DmdServerRequestError || attemptIndex === attempts) {\n throw error;\n }\n\n await sleep(getRetryDelayMs(attemptIndex, config.retry));\n }\n }\n\n throw new DmdServerRequestError('DMD server SDK request failed', undefined, lastError);\n }\n\n function envelope(type: DmdServerSingleRequestPayload['type'], payload: DmdServerSingleRequestPayload['payload']) {\n return {\n type,\n payload,\n sentAt: new Date().toISOString()\n };\n }\n\n return {\n async track(payload: DmdServerTrackPayload) {\n validateTrackPayload(payload);\n await send(envelope('track', withTimestamp(payload)));\n },\n async identify(payload: DmdServerIdentifyPayload) {\n validateIdentifyPayload(payload);\n await send(envelope('identify', withTimestamp(payload)));\n },\n async page(payload: DmdServerPagePayload) {\n validatePagePayload(payload);\n await send(envelope('page', withTimestamp(payload)));\n },\n async alias(payload: DmdServerAliasPayload) {\n validateAliasPayload(payload);\n await send(envelope('alias', withTimestamp(payload)));\n },\n async group(payload: DmdServerGroupPayload) {\n validateGroupPayload(payload);\n await send(envelope('group', withTimestamp(payload)));\n },\n async batch(items: DmdServerBatchItem[]) {\n validateBatchPayload(items);\n await send({\n type: 'batch',\n batch: items.map(withBatchItemTimestamp),\n sentAt: new Date().toISOString()\n });\n },\n async flush() {\n return Promise.resolve();\n }\n };\n}\n"],"mappings":";AAAO,IAAM,oBAAN,cAAgC,MAAM;AAAA,EAC3C,YAAY,SAAiC,OAAiB;AAC5D,UAAM,OAAO;AAD8B;AAE3C,SAAK,OAAO;AAAA,EACd;AACF;AAEO,IAAM,2BAAN,cAAuC,kBAAkB;AAAA,EAC9D,YAAY,SAAiB;AAC3B,UAAM,OAAO;AACb,SAAK,OAAO;AAAA,EACd;AACF;AAEO,IAAM,wBAAN,cAAoC,kBAAkB;AAAA,EAC3D,YAAY,SAAiC,QAAiB,OAAiB;AAC7E,UAAM,SAAS,KAAK;AADuB;AAE3C,SAAK,OAAO;AAAA,EACd;AACF;;;ACjBO,SAAS,kBAAkB,QAAyB;AACzD,SAAO,WAAW,OAAO,WAAW,OAAO,UAAU;AACvD;AAEO,SAAS,gBAAgB,cAAsB,QAA8B,CAAC,GAAW;AAC9F,QAAM,aAAa,MAAM,cAAc;AACvC,QAAM,aAAa,MAAM,cAAc;AACvC,QAAM,mBAAmB,aAAa,KAAK;AAE3C,SAAO,KAAK,IAAI,kBAAkB,UAAU;AAC9C;AAEO,SAAS,iBAAiB,OAAiD;AAChF,SAAO,OAAO,YAAY;AAC5B;;;AC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