@bates-solutions/squareup 1.6.0 → 1.7.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/README.md +16 -0
- package/dist/server/index.d.ts +1 -0
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js +2 -0
- package/dist/server/index.js.map +1 -1
- package/dist/server/middleware/lambda.d.ts +74 -0
- package/dist/server/middleware/lambda.d.ts.map +1 -0
- package/dist/server/middleware/lambda.js +115 -0
- package/dist/server/middleware/lambda.js.map +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -158,6 +158,22 @@ const orderId = getOrderId(event); // works on payment, order, and refund ev
|
|
|
158
158
|
const customerId = getCustomerId(event); // works on payment and customer events
|
|
159
159
|
```
|
|
160
160
|
|
|
161
|
+
### Webhook Handling (AWS Lambda)
|
|
162
|
+
|
|
163
|
+
```typescript
|
|
164
|
+
import { createLambdaWebhookHandler } from '@bates-solutions/squareup/server';
|
|
165
|
+
|
|
166
|
+
export const handler = createLambdaWebhookHandler({
|
|
167
|
+
signatureKey: process.env.SQUARE_WEBHOOK_SIGNATURE_KEY!,
|
|
168
|
+
handlers: {
|
|
169
|
+
'payment.completed': async (event, context) => {
|
|
170
|
+
// context.orderId, context.customerId auto-extracted
|
|
171
|
+
await processPayment(event.data.id, context.orderId!);
|
|
172
|
+
},
|
|
173
|
+
},
|
|
174
|
+
});
|
|
175
|
+
```
|
|
176
|
+
|
|
161
177
|
## Available Services
|
|
162
178
|
|
|
163
179
|
| Service | Description |
|
package/dist/server/index.d.ts
CHANGED
|
@@ -40,4 +40,5 @@ export type { WebhookEventType, PaymentEventType, RefundEventType, OrderEventTyp
|
|
|
40
40
|
export { SIGNATURE_HEADER, verifySignature, parseWebhookEvent, parseAndVerifyWebhook, processWebhookEvent, createWebhookProcessor, getPaymentId, getOrderId, getCustomerId, } from './webhook.js';
|
|
41
41
|
export { createExpressWebhookHandler, rawBodyMiddleware, type SquareWebhookRequest, type ExpressWebhookOptions, } from './middleware/express.js';
|
|
42
42
|
export { createNextWebhookHandler, createNextPagesWebhookHandler, parseNextWebhook, type WebhookResponse, } from './middleware/nextjs.js';
|
|
43
|
+
export { createLambdaWebhookHandler, type LambdaProxyEvent, type LambdaProxyResult, type LambdaWebhookConfig, type LambdaWebhookHandler, type LambdaWebhookHandlers, type WebhookEventContext, } from './middleware/lambda.js';
|
|
43
44
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAGH,YAAY,EACV,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,cAAc,EACd,iBAAiB,EACjB,qBAAqB,EACrB,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,kBAAkB,EAClB,aAAa,EACb,cAAc,EACd,YAAY,EACZ,cAAc,EACd,eAAe,EACf,aAAa,EACb,yBAAyB,EACzB,oBAAoB,EACpB,oBAAoB,EACpB,kBAAkB,EAClB,mBAAmB,EACnB,qBAAqB,EACrB,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,EAClB,oBAAoB,GACrB,MAAM,YAAY,CAAC;AAGpB,OAAO,EACL,gBAAgB,EAChB,eAAe,EACf,iBAAiB,EACjB,qBAAqB,EACrB,mBAAmB,EACnB,sBAAsB,EACtB,YAAY,EACZ,UAAU,EACV,aAAa,GACd,MAAM,cAAc,CAAC;AAGtB,OAAO,EACL,2BAA2B,EAC3B,iBAAiB,EACjB,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,GAC3B,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EACL,wBAAwB,EACxB,6BAA6B,EAC7B,gBAAgB,EAChB,KAAK,eAAe,GACrB,MAAM,wBAAwB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAGH,YAAY,EACV,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,cAAc,EACd,iBAAiB,EACjB,qBAAqB,EACrB,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,kBAAkB,EAClB,aAAa,EACb,cAAc,EACd,YAAY,EACZ,cAAc,EACd,eAAe,EACf,aAAa,EACb,yBAAyB,EACzB,oBAAoB,EACpB,oBAAoB,EACpB,kBAAkB,EAClB,mBAAmB,EACnB,qBAAqB,EACrB,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,EAClB,oBAAoB,GACrB,MAAM,YAAY,CAAC;AAGpB,OAAO,EACL,gBAAgB,EAChB,eAAe,EACf,iBAAiB,EACjB,qBAAqB,EACrB,mBAAmB,EACnB,sBAAsB,EACtB,YAAY,EACZ,UAAU,EACV,aAAa,GACd,MAAM,cAAc,CAAC;AAGtB,OAAO,EACL,2BAA2B,EAC3B,iBAAiB,EACjB,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,GAC3B,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EACL,wBAAwB,EACxB,6BAA6B,EAC7B,gBAAgB,EAChB,KAAK,eAAe,GACrB,MAAM,wBAAwB,CAAC;AAGhC,OAAO,EACL,0BAA0B,EAC1B,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,EAC1B,KAAK,mBAAmB,GACzB,MAAM,wBAAwB,CAAC"}
|
package/dist/server/index.js
CHANGED
|
@@ -42,4 +42,6 @@ export { SIGNATURE_HEADER, verifySignature, parseWebhookEvent, parseAndVerifyWeb
|
|
|
42
42
|
export { createExpressWebhookHandler, rawBodyMiddleware, } from './middleware/express.js';
|
|
43
43
|
// Next.js handlers
|
|
44
44
|
export { createNextWebhookHandler, createNextPagesWebhookHandler, parseNextWebhook, } from './middleware/nextjs.js';
|
|
45
|
+
// Lambda handler
|
|
46
|
+
export { createLambdaWebhookHandler, } from './middleware/lambda.js';
|
|
45
47
|
//# sourceMappingURL=index.js.map
|
package/dist/server/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAgCH,yBAAyB;AACzB,OAAO,EACL,gBAAgB,EAChB,eAAe,EACf,iBAAiB,EACjB,qBAAqB,EACrB,mBAAmB,EACnB,sBAAsB,EACtB,YAAY,EACZ,UAAU,EACV,aAAa,GACd,MAAM,cAAc,CAAC;AAEtB,qBAAqB;AACrB,OAAO,EACL,2BAA2B,EAC3B,iBAAiB,GAGlB,MAAM,yBAAyB,CAAC;AAEjC,mBAAmB;AACnB,OAAO,EACL,wBAAwB,EACxB,6BAA6B,EAC7B,gBAAgB,GAEjB,MAAM,wBAAwB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAgCH,yBAAyB;AACzB,OAAO,EACL,gBAAgB,EAChB,eAAe,EACf,iBAAiB,EACjB,qBAAqB,EACrB,mBAAmB,EACnB,sBAAsB,EACtB,YAAY,EACZ,UAAU,EACV,aAAa,GACd,MAAM,cAAc,CAAC;AAEtB,qBAAqB;AACrB,OAAO,EACL,2BAA2B,EAC3B,iBAAiB,GAGlB,MAAM,yBAAyB,CAAC;AAEjC,mBAAmB;AACnB,OAAO,EACL,wBAAwB,EACxB,6BAA6B,EAC7B,gBAAgB,GAEjB,MAAM,wBAAwB,CAAC;AAEhC,iBAAiB;AACjB,OAAO,EACL,0BAA0B,GAO3B,MAAM,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import type { WebhookEvent } from '../types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Minimal API Gateway proxy event shape (avoids aws-lambda dependency)
|
|
4
|
+
*/
|
|
5
|
+
export interface LambdaProxyEvent {
|
|
6
|
+
httpMethod: string;
|
|
7
|
+
headers?: Record<string, string | undefined> | null;
|
|
8
|
+
body: string | null;
|
|
9
|
+
isBase64Encoded?: boolean;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* API Gateway proxy result shape
|
|
13
|
+
*/
|
|
14
|
+
export interface LambdaProxyResult {
|
|
15
|
+
statusCode: number;
|
|
16
|
+
headers: Record<string, string>;
|
|
17
|
+
body: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Context passed to Lambda webhook handlers with auto-extracted entity IDs
|
|
21
|
+
*/
|
|
22
|
+
export interface WebhookEventContext {
|
|
23
|
+
paymentId?: string;
|
|
24
|
+
orderId?: string;
|
|
25
|
+
customerId?: string;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Handler function for Lambda webhook events
|
|
29
|
+
*/
|
|
30
|
+
export type LambdaWebhookHandler<T = unknown> = (event: WebhookEvent<T>, context: WebhookEventContext) => void | Promise<void>;
|
|
31
|
+
/**
|
|
32
|
+
* Map of event types to their Lambda handlers
|
|
33
|
+
*/
|
|
34
|
+
export type LambdaWebhookHandlers = {
|
|
35
|
+
[K in import('../types.js').WebhookEventType]?: LambdaWebhookHandler;
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* Configuration for Lambda webhook handling
|
|
39
|
+
*/
|
|
40
|
+
export interface LambdaWebhookConfig {
|
|
41
|
+
/** Square webhook signature key */
|
|
42
|
+
signatureKey: string;
|
|
43
|
+
/** Event handlers by type */
|
|
44
|
+
handlers: LambdaWebhookHandlers;
|
|
45
|
+
/** URL where webhooks are received (for signature verification) */
|
|
46
|
+
notificationUrl?: string;
|
|
47
|
+
/** Custom CORS headers (merged with defaults) */
|
|
48
|
+
corsHeaders?: Record<string, string>;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Create an AWS Lambda handler for Square webhooks
|
|
52
|
+
*
|
|
53
|
+
* Handles CORS preflight, signature verification, event parsing,
|
|
54
|
+
* routing to handlers, and entity ID extraction.
|
|
55
|
+
*
|
|
56
|
+
* @param config - Lambda webhook configuration
|
|
57
|
+
* @returns Lambda handler function
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* ```typescript
|
|
61
|
+
* import { createLambdaWebhookHandler } from '@bates-solutions/squareup/server';
|
|
62
|
+
*
|
|
63
|
+
* export const handler = createLambdaWebhookHandler({
|
|
64
|
+
* signatureKey: process.env.SQUARE_WEBHOOK_SIGNATURE_KEY!,
|
|
65
|
+
* handlers: {
|
|
66
|
+
* 'payment.completed': async (event, context) => {
|
|
67
|
+
* await processPayment(event.data.id, context.orderId);
|
|
68
|
+
* },
|
|
69
|
+
* },
|
|
70
|
+
* });
|
|
71
|
+
* ```
|
|
72
|
+
*/
|
|
73
|
+
export declare function createLambdaWebhookHandler(config: LambdaWebhookConfig): (proxyEvent: LambdaProxyEvent) => Promise<LambdaProxyResult>;
|
|
74
|
+
//# sourceMappingURL=lambda.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lambda.d.ts","sourceRoot":"","sources":["../../../src/server/middleware/lambda.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,GAAG,IAAI,CAAC;IACpD,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,MAAM,oBAAoB,CAAC,CAAC,GAAG,OAAO,IAAI,CAC9C,KAAK,EAAE,YAAY,CAAC,CAAC,CAAC,EACtB,OAAO,EAAE,mBAAmB,KACzB,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AAE1B;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG;KACjC,CAAC,IAAI,OAAO,aAAa,EAAE,gBAAgB,CAAC,CAAC,EAAE,oBAAoB;CACrE,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,mCAAmC;IACnC,YAAY,EAAE,MAAM,CAAC;IACrB,6BAA6B;IAC7B,QAAQ,EAAE,qBAAqB,CAAC;IAChC,mEAAmE;IACnE,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,iDAAiD;IACjD,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACtC;AAoBD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,mBAAmB,IAGtD,YAAY,gBAAgB,KAAG,OAAO,CAAC,iBAAiB,CAAC,CAqFxE"}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { verifySignature, parseWebhookEvent, getPaymentId, getOrderId, getCustomerId, SIGNATURE_HEADER, } from '../webhook.js';
|
|
2
|
+
const DEFAULT_CORS_HEADERS = {
|
|
3
|
+
'Access-Control-Allow-Origin': '*',
|
|
4
|
+
'Access-Control-Allow-Methods': 'POST, OPTIONS',
|
|
5
|
+
'Access-Control-Allow-Headers': 'Content-Type, ' + SIGNATURE_HEADER,
|
|
6
|
+
};
|
|
7
|
+
function normalizeHeaders(headers) {
|
|
8
|
+
const normalized = {};
|
|
9
|
+
for (const [key, value] of Object.entries(headers)) {
|
|
10
|
+
if (value !== undefined) {
|
|
11
|
+
normalized[key.toLowerCase()] = value;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
return normalized;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Create an AWS Lambda handler for Square webhooks
|
|
18
|
+
*
|
|
19
|
+
* Handles CORS preflight, signature verification, event parsing,
|
|
20
|
+
* routing to handlers, and entity ID extraction.
|
|
21
|
+
*
|
|
22
|
+
* @param config - Lambda webhook configuration
|
|
23
|
+
* @returns Lambda handler function
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```typescript
|
|
27
|
+
* import { createLambdaWebhookHandler } from '@bates-solutions/squareup/server';
|
|
28
|
+
*
|
|
29
|
+
* export const handler = createLambdaWebhookHandler({
|
|
30
|
+
* signatureKey: process.env.SQUARE_WEBHOOK_SIGNATURE_KEY!,
|
|
31
|
+
* handlers: {
|
|
32
|
+
* 'payment.completed': async (event, context) => {
|
|
33
|
+
* await processPayment(event.data.id, context.orderId);
|
|
34
|
+
* },
|
|
35
|
+
* },
|
|
36
|
+
* });
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
export function createLambdaWebhookHandler(config) {
|
|
40
|
+
const corsHeaders = { ...DEFAULT_CORS_HEADERS, ...config.corsHeaders };
|
|
41
|
+
return async (proxyEvent) => {
|
|
42
|
+
// Handle CORS preflight
|
|
43
|
+
if (proxyEvent.httpMethod === 'OPTIONS') {
|
|
44
|
+
return { statusCode: 204, headers: corsHeaders, body: '' };
|
|
45
|
+
}
|
|
46
|
+
const headers = normalizeHeaders(proxyEvent.headers ?? {});
|
|
47
|
+
const signature = headers[SIGNATURE_HEADER];
|
|
48
|
+
const rawBody = proxyEvent.isBase64Encoded && proxyEvent.body
|
|
49
|
+
? Buffer.from(proxyEvent.body, 'base64').toString('utf-8')
|
|
50
|
+
: proxyEvent.body;
|
|
51
|
+
if (!rawBody) {
|
|
52
|
+
return {
|
|
53
|
+
statusCode: 400,
|
|
54
|
+
headers: corsHeaders,
|
|
55
|
+
body: JSON.stringify({ error: 'Missing request body' }),
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
if (!signature) {
|
|
59
|
+
return {
|
|
60
|
+
statusCode: 401,
|
|
61
|
+
headers: corsHeaders,
|
|
62
|
+
body: JSON.stringify({ error: 'Missing signature header' }),
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
const verification = verifySignature(rawBody, signature, config.signatureKey, config.notificationUrl);
|
|
66
|
+
if (!verification.valid) {
|
|
67
|
+
return {
|
|
68
|
+
statusCode: 401,
|
|
69
|
+
headers: corsHeaders,
|
|
70
|
+
body: JSON.stringify({ error: verification.error }),
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
let event;
|
|
74
|
+
try {
|
|
75
|
+
event = parseWebhookEvent(rawBody);
|
|
76
|
+
}
|
|
77
|
+
catch (error) {
|
|
78
|
+
return {
|
|
79
|
+
statusCode: 400,
|
|
80
|
+
headers: corsHeaders,
|
|
81
|
+
body: JSON.stringify({
|
|
82
|
+
error: error instanceof Error ? error.message : 'Invalid webhook payload',
|
|
83
|
+
}),
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
try {
|
|
87
|
+
const context = {
|
|
88
|
+
paymentId: getPaymentId(event),
|
|
89
|
+
orderId: getOrderId(event),
|
|
90
|
+
customerId: getCustomerId(event),
|
|
91
|
+
};
|
|
92
|
+
const handler = config.handlers[event.type];
|
|
93
|
+
if (handler) {
|
|
94
|
+
await handler(event, context);
|
|
95
|
+
}
|
|
96
|
+
return {
|
|
97
|
+
statusCode: 200,
|
|
98
|
+
headers: corsHeaders,
|
|
99
|
+
body: JSON.stringify({ success: true, eventId: event.event_id, ...context }),
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
catch (error) {
|
|
103
|
+
// Return 200 on handler errors — Square retries on 5xx
|
|
104
|
+
return {
|
|
105
|
+
statusCode: 200,
|
|
106
|
+
headers: corsHeaders,
|
|
107
|
+
body: JSON.stringify({
|
|
108
|
+
success: false,
|
|
109
|
+
error: error instanceof Error ? error.message : 'Unknown error',
|
|
110
|
+
}),
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
//# sourceMappingURL=lambda.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lambda.js","sourceRoot":"","sources":["../../../src/server/middleware/lambda.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,iBAAiB,EACjB,YAAY,EACZ,UAAU,EACV,aAAa,EACb,gBAAgB,GACjB,MAAM,eAAe,CAAC;AA4DvB,MAAM,oBAAoB,GAA2B;IACnD,6BAA6B,EAAE,GAAG;IAClC,8BAA8B,EAAE,eAAe;IAC/C,8BAA8B,EAAE,gBAAgB,GAAG,gBAAgB;CACpE,CAAC;AAEF,SAAS,gBAAgB,CACvB,OAA2C;IAE3C,MAAM,UAAU,GAA2B,EAAE,CAAC;IAC9C,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;QACnD,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACxB,UAAU,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,GAAG,KAAK,CAAC;QACxC,CAAC;IACH,CAAC;IACD,OAAO,UAAU,CAAC;AACpB,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,UAAU,0BAA0B,CAAC,MAA2B;IACpE,MAAM,WAAW,GAAG,EAAE,GAAG,oBAAoB,EAAE,GAAG,MAAM,CAAC,WAAW,EAAE,CAAC;IAEvE,OAAO,K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