convex-saligpay 1.1.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.
Files changed (39) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +288 -0
  3. package/dist/client/index.d.ts +169 -0
  4. package/dist/client/index.d.ts.map +1 -0
  5. package/dist/client/index.js +222 -0
  6. package/dist/client/index.js.map +1 -0
  7. package/dist/component/_generated/component.d.ts +28 -0
  8. package/dist/component/_generated/component.d.ts.map +1 -0
  9. package/dist/component/_generated/component.js +2 -0
  10. package/dist/component/_generated/component.js.map +1 -0
  11. package/dist/component/_generated/server.d.ts +2 -0
  12. package/dist/component/_generated/server.d.ts.map +1 -0
  13. package/dist/component/_generated/server.js +2 -0
  14. package/dist/component/_generated/server.js.map +1 -0
  15. package/dist/component/convex.config.d.ts +3 -0
  16. package/dist/component/convex.config.d.ts.map +1 -0
  17. package/dist/component/convex.config.js +4 -0
  18. package/dist/component/convex.config.js.map +1 -0
  19. package/dist/component/lib.d.ts +170 -0
  20. package/dist/component/lib.d.ts.map +1 -0
  21. package/dist/component/lib.js +568 -0
  22. package/dist/component/lib.js.map +1 -0
  23. package/dist/component/schema.d.ts +131 -0
  24. package/dist/component/schema.d.ts.map +1 -0
  25. package/dist/component/schema.js +73 -0
  26. package/dist/component/schema.js.map +1 -0
  27. package/dist/index.d.ts +5 -0
  28. package/dist/index.d.ts.map +1 -0
  29. package/dist/index.js +5 -0
  30. package/dist/index.js.map +1 -0
  31. package/dist/test.d.ts +139 -0
  32. package/dist/test.d.ts.map +1 -0
  33. package/dist/test.js +5 -0
  34. package/dist/test.js.map +1 -0
  35. package/dist/types/index.d.ts +140 -0
  36. package/dist/types/index.d.ts.map +1 -0
  37. package/dist/types/index.js +2 -0
  38. package/dist/types/index.js.map +1 -0
  39. package/package.json +88 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 SaligPay
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,288 @@
1
+ # @convex/saligpay
2
+
3
+ Convex component for SaligPay payment integration. This package provides a self-contained Convex component with its own database tables and functions for integrating SaligPay payment processing.
4
+
5
+ ## Features
6
+
7
+ - 🔐 **OAuth Authentication** - Secure token-based authentication with automatic refresh
8
+ - 💳 **Checkout Sessions** - Create and manage payment checkout sessions
9
+ - 💰 **Payment Intents** - Handle payment intents with 3D Secure support
10
+ - 🎣 **Webhook Handling** - Receive and verify webhook events from SaligPay
11
+ - 🔒 **Type Safety** - Full TypeScript support with exported types
12
+ - 📦 **Isolated Data** - Component has its own database tables, isolated from your app
13
+
14
+ ## Installation
15
+
16
+ ```bash
17
+ npm install @convex/saligpay convex
18
+ ```
19
+
20
+ ## Quick Start
21
+
22
+ ### 1. Add the Component
23
+
24
+ In your app's `convex/convex.config.ts`:
25
+
26
+ ```typescript
27
+ import { defineApp } from "convex/server";
28
+ import saligpay from "@convex/saligpay/convex.config.js";
29
+
30
+ const app = defineApp();
31
+ app.use(saligpay);
32
+ // Or with a custom name:
33
+ // app.use(saligpay, { name: "payments" });
34
+
35
+ export default app;
36
+ ```
37
+
38
+ ### 2. Run Convex Dev
39
+
40
+ ```bash
41
+ npx convex dev
42
+ ```
43
+
44
+ This generates the component's API in `convex/_generated/api.js`.
45
+
46
+ ### 3. Use in Your Functions
47
+
48
+ ```typescript
49
+ import { action, mutation } from "./_generated/server";
50
+ import { components } from "./_generated/api.js";
51
+ import { SaligPayComponent } from "@convex/saligpay";
52
+
53
+ const saligpay = new SaligPayComponent(components.saligpay);
54
+
55
+ export const createPayment = mutation({
56
+ args: {
57
+ merchantId: v.string(),
58
+ amount: v.number(),
59
+ description: v.string(),
60
+ },
61
+ handler: async (ctx, args) => {
62
+ // Authenticate first
63
+ await ctx.runMutation(saligpay.auth.authenticate, {
64
+ merchantId: args.merchantId,
65
+ clientId: "your-client-id",
66
+ clientSecret: "your-client-secret",
67
+ env: "sandbox",
68
+ });
69
+
70
+ // Create checkout
71
+ const checkout = await ctx.runMutation(saligpay.checkout.create, {
72
+ merchantId: args.merchantId,
73
+ externalId: `order-${Date.now()}`,
74
+ amount: args.amount,
75
+ description: args.description,
76
+ webhookUrl: "https://yourapp.com/api/webhooks/saligpay",
77
+ returnUrl: "https://yourapp.com/payment/success",
78
+ });
79
+
80
+ return checkout.checkoutUrl;
81
+ },
82
+ });
83
+ ```
84
+
85
+ ### 4. Set Up Webhooks (Optional)
86
+
87
+ In your app's `convex/http.ts`:
88
+
89
+ ```typescript
90
+ import { httpRouter } from "convex/server";
91
+ import { components } from "./_generated/api.js";
92
+
93
+ const http = httpRouter();
94
+
95
+ http.route({
96
+ path: "/api/webhooks/saligpay",
97
+ method: "POST",
98
+ handler: async (ctx, request) => {
99
+ const body = await request.text();
100
+ const signature = request.headers.get("x-saligpay-signature") || "";
101
+ const timestamp = request.headers.get("x-saligpay-timestamp") || "";
102
+ const secret = request.headers.get("x-saligpay-webhook-secret") || "";
103
+
104
+ const result = await ctx.runMutation(
105
+ components.saligpay.lib.webhookActions.receiveWebhook,
106
+ {
107
+ payload: body,
108
+ signature,
109
+ timestamp,
110
+ signingSecret: secret,
111
+ },
112
+ );
113
+
114
+ return new Response(JSON.stringify(result), {
115
+ status: 200,
116
+ headers: { "Content-Type": "application/json" },
117
+ });
118
+ },
119
+ });
120
+
121
+ export default http;
122
+ ```
123
+
124
+ ## API Reference
125
+
126
+ ### Using the Component API Directly
127
+
128
+ ```typescript
129
+ import { components } from "./_generated/api.js";
130
+
131
+ // Queries
132
+ await ctx.runQuery(components.saligpay.lib.auth.getStoredTokens, { merchantId });
133
+ await ctx.runQuery(components.saligpay.lib.checkout.getSession, { externalId });
134
+ await ctx.runQuery(components.saligpay.lib.paymentIntent.getPaymentIntentStatus, { intentId });
135
+
136
+ // Mutations
137
+ await ctx.runMutation(components.saligpay.lib.authMutations.authenticate, { ... });
138
+ await ctx.runMutation(components.saligpay.lib.checkoutActions.createCheckout, { ... });
139
+ await ctx.runMutation(components.saligpay.lib.paymentIntentActions.createPaymentIntent, { ... });
140
+ ```
141
+
142
+ ### Using the Client Wrapper
143
+
144
+ ```typescript
145
+ import { SaligPayComponent, makeSaligPayComponent } from "@convex/saligpay";
146
+ import { components } from "./_generated/api.js";
147
+
148
+ const saligpay = makeSaligPayComponent(components.saligpay);
149
+ // or: const saligpay = new SaligPayComponent(components.saligpay);
150
+
151
+ // Auth
152
+ await ctx.runMutation(saligpay.auth.authenticate, { merchantId, clientId, clientSecret });
153
+ await ctx.runQuery(saligpay.auth.getStoredTokens, { merchantId });
154
+
155
+ // Checkout
156
+ await ctx.runMutation(saligpay.checkout.create, { merchantId, amount, ... });
157
+ await ctx.runQuery(saligpay.checkout.getSession, { externalId });
158
+
159
+ // Payment Intent
160
+ await ctx.runMutation(saligpay.paymentIntent.create, { merchantId, amount, ... });
161
+ await ctx.runQuery(saligpay.paymentIntent.getStatus, { intentId });
162
+
163
+ // Webhooks
164
+ await ctx.runMutation(saligpay.webhook.receive, { payload, signature, timestamp, signingSecret });
165
+ ```
166
+
167
+ ### Authentication
168
+
169
+ | Function | Type | Description |
170
+ | ----------------------------- | -------------- | ----------------------------------------- |
171
+ | `authenticate` | mutation | Get OAuth tokens using client credentials |
172
+ | `refreshToken` | mutation | Refresh expired access tokens |
173
+ | `getStoredTokens` | query | Retrieve stored tokens for a merchant |
174
+ | `getMerchantCredentials` | internal query | Get stored credentials (internal use) |
175
+ | `validateToken` | query | Check if tokens are valid |
176
+ | `loginAndRetrieveCredentials` | action | Full OAuth flow with email/password |
177
+ | `internalAuthentication` | action | Authenticate by user ID |
178
+
179
+ ### Checkout
180
+
181
+ | Function | Type | Description |
182
+ | ------------------ | -------- | --------------------------------------- |
183
+ | `createCheckout` | mutation | Create a new checkout session |
184
+ | `getSession` | query | Get checkout by externalId or sessionId |
185
+ | `getCheckoutByUrl` | query | Get checkout by session token |
186
+ | `listCheckouts` | query | List checkouts for a merchant |
187
+ | `expireSession` | mutation | Mark a session as expired |
188
+
189
+ ### Payment Intents
190
+
191
+ | Function | Type | Description |
192
+ | ------------------------ | -------- | --------------------------- |
193
+ | `createPaymentIntent` | mutation | Create a payment intent |
194
+ | `confirmPaymentIntent` | mutation | Confirm with payment method |
195
+ | `getPaymentIntentStatus` | query | Get current status |
196
+ | `listPaymentIntents` | query | List intents for a merchant |
197
+ | `cancelPaymentIntent` | mutation | Cancel an intent |
198
+
199
+ ### Webhooks
200
+
201
+ | Function | Type | Description |
202
+ | ------------------------------ | -------- | -------------------------- |
203
+ | `receiveWebhook` | mutation | Receive and verify webhook |
204
+ | `handleCheckoutCompleted` | mutation | Handle completed checkout |
205
+ | `handleCheckoutFailed` | mutation | Handle failed checkout |
206
+ | `handlePaymentIntentSucceeded` | mutation | Handle successful payment |
207
+ | `handleRefundCreated` | mutation | Handle refund creation |
208
+
209
+ ## Component Tables
210
+
211
+ The component creates these isolated tables:
212
+
213
+ - `saligpayTokens` - OAuth tokens per merchant
214
+ - `saligpayCredentials` - Merchant credentials (encrypted)
215
+ - `checkoutSessions` - Checkout session records
216
+ - `paymentIntents` - Payment intent records
217
+ - `webhookEvents` - Webhook event audit log
218
+
219
+ ## Type Exports
220
+
221
+ ```typescript
222
+ import type {
223
+ SaligPayConfig,
224
+ SaligPayAuthTokens,
225
+ CheckoutSession,
226
+ PaymentIntent,
227
+ SaligPayWebhookPayload,
228
+ StoredTokens,
229
+ MerchantCredentials,
230
+ CreateCheckoutOptions,
231
+ CreatePaymentIntentOptions,
232
+ } from "@convex/saligpay";
233
+ ```
234
+
235
+ ## Development
236
+
237
+ ### Building the Component
238
+
239
+ ```bash
240
+ npm run build
241
+ ```
242
+
243
+ This builds the component to `dist/` with all entry points needed for publishing.
244
+
245
+ ### Development with Example App
246
+
247
+ The `example/` folder contains a test app that uses the component. To develop:
248
+
249
+ ```bash
250
+ # 1. Build the component
251
+ npm run build
252
+
253
+ # 2. From the example app, run convex dev (requires Convex deployment)
254
+ cd example
255
+ npx convex dev
256
+ ```
257
+
258
+ Running `npx convex dev` in the example app will:
259
+
260
+ 1. Generate the component's `_generated` types
261
+ 2. Deploy the component to your Convex deployment
262
+ 3. Watch for changes
263
+
264
+ ### Workflow for Component Development
265
+
266
+ 1. Make changes to `src/convex/*.ts` files
267
+ 2. Run `npm run build` to rebuild
268
+ 3. In example app, `npx convex dev` picks up changes automatically
269
+
270
+ **Note:** The component's `_generated` folder contains stub types that allow building without a Convex deployment. When used in an actual app, Convex generates the real types.
271
+
272
+ ## Testing
273
+
274
+ When writing tests with `convex-test`, register the component:
275
+
276
+ ```typescript
277
+ import { convexTest } from "convex-test";
278
+ import saligpayTest from "@convex/saligpay/test";
279
+ import schema from "./convex/schema.js";
280
+ const modules = import.meta.glob("./convex/**/*.ts");
281
+
282
+ const t = convexTest(schema, modules);
283
+ saligpayTest.register(t, "saligpay");
284
+ ```
285
+
286
+ ## License
287
+
288
+ MIT © SaligPay
@@ -0,0 +1,169 @@
1
+ import type { Auth, GenericActionCtx, GenericDataModel } from "convex/server";
2
+ import type { ComponentApi } from "../component/_generated/component.js";
3
+ export declare function createCheckout(ctx: {
4
+ runMutation: GenericActionCtx<GenericDataModel>["runMutation"];
5
+ }, component: ComponentApi, args: {
6
+ merchantId: string;
7
+ externalId: string;
8
+ amount: number;
9
+ description: string;
10
+ webhookUrl?: string;
11
+ returnUrl?: string;
12
+ metadata?: Record<string, unknown>;
13
+ }): Promise<any>;
14
+ export declare function getSession(ctx: {
15
+ runQuery: GenericActionCtx<GenericDataModel>["runQuery"];
16
+ }, component: ComponentApi, args: {
17
+ externalId?: string;
18
+ sessionId?: string;
19
+ }): Promise<any>;
20
+ export declare function listCheckouts(ctx: {
21
+ runQuery: GenericActionCtx<GenericDataModel>["runQuery"];
22
+ }, component: ComponentApi, args: {
23
+ merchantId: string;
24
+ status?: string;
25
+ limit?: number;
26
+ }): Promise<any>;
27
+ export declare function createPaymentIntent(ctx: {
28
+ runMutation: GenericActionCtx<GenericDataModel>["runMutation"];
29
+ }, component: ComponentApi, args: {
30
+ merchantId: string;
31
+ amount: number;
32
+ description?: string;
33
+ externalId?: string;
34
+ webhookUrl?: string;
35
+ returnUrl?: string;
36
+ metadata?: Record<string, unknown>;
37
+ }): Promise<any>;
38
+ export declare function confirmPaymentIntent(ctx: {
39
+ runMutation: GenericActionCtx<GenericDataModel>["runMutation"];
40
+ }, component: ComponentApi, args: {
41
+ merchantId: string;
42
+ intentId: string;
43
+ paymentMethod: string;
44
+ }): Promise<any>;
45
+ export declare function getPaymentIntentStatus(ctx: {
46
+ runQuery: GenericActionCtx<GenericDataModel>["runQuery"];
47
+ }, component: ComponentApi, args: {
48
+ intentId: string;
49
+ }): Promise<any>;
50
+ export declare function listPaymentIntents(ctx: {
51
+ runQuery: GenericActionCtx<GenericDataModel>["runQuery"];
52
+ }, component: ComponentApi, args: {
53
+ merchantId: string;
54
+ status?: string;
55
+ limit?: number;
56
+ }): Promise<any>;
57
+ export declare function receiveWebhook(ctx: {
58
+ runMutation: GenericActionCtx<GenericDataModel>["runMutation"];
59
+ }, component: ComponentApi, args: {
60
+ payload: string;
61
+ signature: string;
62
+ timestamp: string;
63
+ signingSecret: string;
64
+ }): Promise<any>;
65
+ export declare function exposeApi(component: ComponentApi, options: {
66
+ auth: (ctx: {
67
+ auth: Auth;
68
+ }, operation: {
69
+ type: "read";
70
+ merchantId: string;
71
+ } | {
72
+ type: "write";
73
+ merchantId: string;
74
+ }) => Promise<string>;
75
+ }): {
76
+ authenticate: import("convex/server").RegisteredMutation<"public", {
77
+ clientId?: string | undefined;
78
+ clientSecret?: string | undefined;
79
+ env?: "sandbox" | "production" | undefined;
80
+ merchantId: string;
81
+ }, Promise<any>>;
82
+ getStoredTokens: import("convex/server").RegisteredQuery<"public", {
83
+ merchantId: string;
84
+ }, Promise<any>>;
85
+ validateToken: import("convex/server").RegisteredQuery<"public", {
86
+ merchantId: string;
87
+ }, Promise<any>>;
88
+ createCheckout: import("convex/server").RegisteredMutation<"public", {
89
+ webhookUrl?: string | undefined;
90
+ returnUrl?: string | undefined;
91
+ metadata?: Record<string, any> | undefined;
92
+ merchantId: string;
93
+ externalId: string;
94
+ amount: number;
95
+ description: string;
96
+ }, Promise<any>>;
97
+ getSession: import("convex/server").RegisteredQuery<"public", {
98
+ externalId?: string | undefined;
99
+ sessionId?: string | undefined;
100
+ }, Promise<any>>;
101
+ listCheckouts: import("convex/server").RegisteredQuery<"public", {
102
+ status?: string | undefined;
103
+ limit?: number | undefined;
104
+ merchantId: string;
105
+ }, Promise<any>>;
106
+ createPaymentIntent: import("convex/server").RegisteredMutation<"public", {
107
+ externalId?: string | undefined;
108
+ description?: string | undefined;
109
+ webhookUrl?: string | undefined;
110
+ returnUrl?: string | undefined;
111
+ metadata?: Record<string, any> | undefined;
112
+ merchantId: string;
113
+ amount: number;
114
+ }, Promise<any>>;
115
+ confirmPaymentIntent: import("convex/server").RegisteredMutation<"public", {
116
+ merchantId: string;
117
+ intentId: string;
118
+ paymentMethod: string;
119
+ }, Promise<any>>;
120
+ getPaymentIntentStatus: import("convex/server").RegisteredQuery<"public", {
121
+ intentId: string;
122
+ }, Promise<any>>;
123
+ listPaymentIntents: import("convex/server").RegisteredQuery<"public", {
124
+ status?: string | undefined;
125
+ limit?: number | undefined;
126
+ merchantId: string;
127
+ }, Promise<any>>;
128
+ receiveWebhook: import("convex/server").RegisteredMutation<"public", {
129
+ payload: string;
130
+ signature: string;
131
+ timestamp: string;
132
+ signingSecret: string;
133
+ }, Promise<any>>;
134
+ };
135
+ export declare class SaligPayComponent {
136
+ component: ComponentApi;
137
+ constructor(component: ComponentApi);
138
+ get auth(): {
139
+ authenticate: import("convex/server").FunctionReference<"mutation", "public">;
140
+ refreshToken: import("convex/server").FunctionReference<"mutation", "public">;
141
+ getStoredTokens: import("convex/server").FunctionReference<"query", "public">;
142
+ validateToken: import("convex/server").FunctionReference<"query", "public">;
143
+ loginAndRetrieveCredentials: import("convex/server").FunctionReference<"action", "public">;
144
+ internalAuthentication: import("convex/server").FunctionReference<"action", "public">;
145
+ };
146
+ get checkout(): {
147
+ create: import("convex/server").FunctionReference<"mutation", "public">;
148
+ getSession: import("convex/server").FunctionReference<"query", "public">;
149
+ getCheckoutByUrl: import("convex/server").FunctionReference<"query", "public">;
150
+ listCheckouts: import("convex/server").FunctionReference<"query", "public">;
151
+ expireSession: import("convex/server").FunctionReference<"mutation", "public">;
152
+ };
153
+ get paymentIntent(): {
154
+ create: import("convex/server").FunctionReference<"mutation", "public">;
155
+ confirm: import("convex/server").FunctionReference<"mutation", "public">;
156
+ getStatus: import("convex/server").FunctionReference<"query", "public">;
157
+ list: import("convex/server").FunctionReference<"query", "public">;
158
+ cancel: import("convex/server").FunctionReference<"mutation", "public">;
159
+ };
160
+ get webhook(): {
161
+ receive: import("convex/server").FunctionReference<"mutation", "public">;
162
+ handleCheckoutCompleted: import("convex/server").FunctionReference<"mutation", "public">;
163
+ handleCheckoutFailed: import("convex/server").FunctionReference<"mutation", "public">;
164
+ handlePaymentIntentSucceeded: import("convex/server").FunctionReference<"mutation", "public">;
165
+ handleRefundCreated: import("convex/server").FunctionReference<"mutation", "public">;
166
+ };
167
+ }
168
+ export declare function makeSaligPayComponent(component: ComponentApi): SaligPayComponent;
169
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAE9E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AAEzE,wBAAgB,cAAc,CAC1B,GAAG,EAAE;IAAE,WAAW,EAAE,gBAAgB,CAAC,gBAAgB,CAAC,CAAC,aAAa,CAAC,CAAA;CAAE,EACvE,SAAS,EAAE,YAAY,EACvB,IAAI,EAAE;IACF,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACtC,gBAGJ;AAED,wBAAgB,UAAU,CACtB,GAAG,EAAE;IAAE,QAAQ,EAAE,gBAAgB,CAAC,gBAAgB,CAAC,CAAC,UAAU,CAAC,CAAA;CAAE,EACjE,SAAS,EAAE,YAAY,EACvB,IAAI,EAAE;IAAE,UAAU,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,gBAGpD;AAED,wBAAgB,aAAa,CACzB,GAAG,EAAE;IAAE,QAAQ,EAAE,gBAAgB,CAAC,gBAAgB,CAAC,CAAC,UAAU,CAAC,CAAA;CAAE,EACjE,SAAS,EAAE,YAAY,EACvB,I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