@uniforge/testing 0.1.0-alpha.2
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/auth/index.d.cts +177 -0
- package/dist/auth/index.d.ts +177 -0
- package/dist/auth/index.js +459 -0
- package/dist/auth/index.js.map +1 -0
- package/dist/auth/index.mjs +418 -0
- package/dist/auth/index.mjs.map +1 -0
- package/dist/billing/index.d.cts +27 -0
- package/dist/billing/index.d.ts +27 -0
- package/dist/billing/index.js +208 -0
- package/dist/billing/index.js.map +1 -0
- package/dist/billing/index.mjs +178 -0
- package/dist/billing/index.mjs.map +1 -0
- package/dist/database/index.d.cts +399 -0
- package/dist/database/index.d.ts +399 -0
- package/dist/database/index.js +19054 -0
- package/dist/database/index.js.map +1 -0
- package/dist/database/index.mjs +19046 -0
- package/dist/database/index.mjs.map +1 -0
- package/dist/graphql/index.d.cts +23 -0
- package/dist/graphql/index.d.ts +23 -0
- package/dist/graphql/index.js +18511 -0
- package/dist/graphql/index.js.map +1 -0
- package/dist/graphql/index.mjs +18505 -0
- package/dist/graphql/index.mjs.map +1 -0
- package/dist/index.d.cts +10 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +31 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +6 -0
- package/dist/index.mjs.map +1 -0
- package/dist/multi-store/index.d.cts +66 -0
- package/dist/multi-store/index.d.ts +66 -0
- package/dist/multi-store/index.js +319 -0
- package/dist/multi-store/index.js.map +1 -0
- package/dist/multi-store/index.mjs +287 -0
- package/dist/multi-store/index.mjs.map +1 -0
- package/dist/multi-tenant/index.d.cts +15 -0
- package/dist/multi-tenant/index.d.ts +15 -0
- package/dist/multi-tenant/index.js +87 -0
- package/dist/multi-tenant/index.js.map +1 -0
- package/dist/multi-tenant/index.mjs +57 -0
- package/dist/multi-tenant/index.mjs.map +1 -0
- package/dist/performance/index.d.cts +60 -0
- package/dist/performance/index.d.ts +60 -0
- package/dist/performance/index.js +280 -0
- package/dist/performance/index.js.map +1 -0
- package/dist/performance/index.mjs +246 -0
- package/dist/performance/index.mjs.map +1 -0
- package/dist/platform/index.d.cts +71 -0
- package/dist/platform/index.d.ts +71 -0
- package/dist/platform/index.js +435 -0
- package/dist/platform/index.js.map +1 -0
- package/dist/platform/index.mjs +396 -0
- package/dist/platform/index.mjs.map +1 -0
- package/dist/rbac/index.d.cts +21 -0
- package/dist/rbac/index.d.ts +21 -0
- package/dist/rbac/index.js +178 -0
- package/dist/rbac/index.js.map +1 -0
- package/dist/rbac/index.mjs +150 -0
- package/dist/rbac/index.mjs.map +1 -0
- package/dist/security/index.d.cts +73 -0
- package/dist/security/index.d.ts +73 -0
- package/dist/security/index.js +246 -0
- package/dist/security/index.js.map +1 -0
- package/dist/security/index.mjs +211 -0
- package/dist/security/index.mjs.map +1 -0
- package/dist/shopify-api/index.d.cts +139 -0
- package/dist/shopify-api/index.d.ts +139 -0
- package/dist/shopify-api/index.js +469 -0
- package/dist/shopify-api/index.js.map +1 -0
- package/dist/shopify-api/index.mjs +439 -0
- package/dist/shopify-api/index.mjs.map +1 -0
- package/dist/shopify-compliance/index.d.cts +85 -0
- package/dist/shopify-compliance/index.d.ts +85 -0
- package/dist/shopify-compliance/index.js +287 -0
- package/dist/shopify-compliance/index.js.map +1 -0
- package/dist/shopify-compliance/index.mjs +259 -0
- package/dist/shopify-compliance/index.mjs.map +1 -0
- package/dist/webhooks/index.d.cts +127 -0
- package/dist/webhooks/index.d.ts +127 -0
- package/dist/webhooks/index.js +18934 -0
- package/dist/webhooks/index.js.map +1 -0
- package/dist/webhooks/index.mjs +18916 -0
- package/dist/webhooks/index.mjs.map +1 -0
- package/package.json +112 -0
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { PlatformProvider, PlatformCapabilities, Money, Product, ProductVariant, ProductImage, Order, OrderLineItem, Customer, PlatformRegistry, PlatformId, ProductService, ListOptions, PaginatedResult, CreateProductInput, UpdateProductInput, OrderService, CustomerService, CreateCustomerInput, UpdateCustomerInput } from '@uniforge/platform-core/platform';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Test data factories for platform types.
|
|
5
|
+
*
|
|
6
|
+
* Each factory provides sensible defaults that can be overridden.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
declare function createTestMoney(overrides?: Partial<Money>): Money;
|
|
10
|
+
declare function createTestCapabilities(overrides?: Partial<PlatformCapabilities>): PlatformCapabilities;
|
|
11
|
+
declare function createTestPlatformProvider(overrides?: Partial<PlatformProvider>): PlatformProvider;
|
|
12
|
+
declare function createTestProductImage(overrides?: Partial<ProductImage>): ProductImage;
|
|
13
|
+
declare function createTestProductVariant(overrides?: Partial<ProductVariant>): ProductVariant;
|
|
14
|
+
declare function createTestProduct(overrides?: Partial<Product>): Product;
|
|
15
|
+
declare function createTestOrderLineItem(overrides?: Partial<OrderLineItem>): OrderLineItem;
|
|
16
|
+
declare function createTestOrder(overrides?: Partial<Order>): Order;
|
|
17
|
+
declare function createTestCustomer(overrides?: Partial<Customer>): Customer;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Mock PlatformRegistry for unit testing.
|
|
21
|
+
*
|
|
22
|
+
* In-memory implementation of the PlatformRegistry interface
|
|
23
|
+
* with a _reset() method for test isolation.
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
declare class MockPlatformRegistry implements PlatformRegistry {
|
|
27
|
+
private providers;
|
|
28
|
+
register(provider: PlatformProvider): void;
|
|
29
|
+
get(platformId: PlatformId): PlatformProvider | undefined;
|
|
30
|
+
has(platformId: PlatformId): boolean;
|
|
31
|
+
list(): PlatformId[];
|
|
32
|
+
getAll(): PlatformProvider[];
|
|
33
|
+
_reset(): void;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Mock commerce services for unit testing.
|
|
38
|
+
*
|
|
39
|
+
* In-memory implementations of ProductService, OrderService,
|
|
40
|
+
* and CustomerService with helpers for seeding test data.
|
|
41
|
+
*/
|
|
42
|
+
|
|
43
|
+
declare class MockProductService implements ProductService {
|
|
44
|
+
private products;
|
|
45
|
+
_addProduct(product: Product): void;
|
|
46
|
+
_reset(): void;
|
|
47
|
+
getProduct(id: string): Promise<Product | null>;
|
|
48
|
+
listProducts(options?: ListOptions): Promise<PaginatedResult<Product>>;
|
|
49
|
+
createProduct(input: CreateProductInput): Promise<Product>;
|
|
50
|
+
updateProduct(id: string, input: UpdateProductInput): Promise<Product>;
|
|
51
|
+
deleteProduct(id: string): Promise<void>;
|
|
52
|
+
}
|
|
53
|
+
declare class MockOrderService implements OrderService {
|
|
54
|
+
private orders;
|
|
55
|
+
_addOrder(order: Order): void;
|
|
56
|
+
_reset(): void;
|
|
57
|
+
getOrder(id: string): Promise<Order | null>;
|
|
58
|
+
listOrders(options?: ListOptions): Promise<PaginatedResult<Order>>;
|
|
59
|
+
}
|
|
60
|
+
declare class MockCustomerService implements CustomerService {
|
|
61
|
+
private customers;
|
|
62
|
+
_addCustomer(customer: Customer): void;
|
|
63
|
+
_reset(): void;
|
|
64
|
+
getCustomer(id: string): Promise<Customer | null>;
|
|
65
|
+
listCustomers(options?: ListOptions): Promise<PaginatedResult<Customer>>;
|
|
66
|
+
createCustomer(input: CreateCustomerInput): Promise<Customer>;
|
|
67
|
+
updateCustomer(id: string, input: UpdateCustomerInput): Promise<Customer>;
|
|
68
|
+
deleteCustomer(id: string): Promise<void>;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export { MockCustomerService, MockOrderService, MockPlatformRegistry, MockProductService, createTestCapabilities, createTestCustomer, createTestMoney, createTestOrder, createTestOrderLineItem, createTestPlatformProvider, createTestProduct, createTestProductImage, createTestProductVariant };
|
|
@@ -0,0 +1,435 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/platform/index.ts
|
|
21
|
+
var platform_exports = {};
|
|
22
|
+
__export(platform_exports, {
|
|
23
|
+
MockCustomerService: () => MockCustomerService,
|
|
24
|
+
MockOrderService: () => MockOrderService,
|
|
25
|
+
MockPlatformRegistry: () => MockPlatformRegistry,
|
|
26
|
+
MockProductService: () => MockProductService,
|
|
27
|
+
createTestCapabilities: () => createTestCapabilities,
|
|
28
|
+
createTestCustomer: () => createTestCustomer,
|
|
29
|
+
createTestMoney: () => createTestMoney,
|
|
30
|
+
createTestOrder: () => createTestOrder,
|
|
31
|
+
createTestOrderLineItem: () => createTestOrderLineItem,
|
|
32
|
+
createTestPlatformProvider: () => createTestPlatformProvider,
|
|
33
|
+
createTestProduct: () => createTestProduct,
|
|
34
|
+
createTestProductImage: () => createTestProductImage,
|
|
35
|
+
createTestProductVariant: () => createTestProductVariant
|
|
36
|
+
});
|
|
37
|
+
module.exports = __toCommonJS(platform_exports);
|
|
38
|
+
|
|
39
|
+
// src/platform/factories.ts
|
|
40
|
+
var import_platform = require("@uniforge/platform-core/platform");
|
|
41
|
+
function createTestMoney(overrides) {
|
|
42
|
+
const defaults = {
|
|
43
|
+
amount: "10.00",
|
|
44
|
+
currencyCode: "USD"
|
|
45
|
+
};
|
|
46
|
+
return { ...defaults, ...overrides };
|
|
47
|
+
}
|
|
48
|
+
function createTestCapabilities(overrides) {
|
|
49
|
+
return {
|
|
50
|
+
auth: { ...import_platform.DEFAULT_CAPABILITIES.auth, ...overrides?.auth },
|
|
51
|
+
billing: { ...import_platform.DEFAULT_CAPABILITIES.billing, ...overrides?.billing },
|
|
52
|
+
webhooks: { ...import_platform.DEFAULT_CAPABILITIES.webhooks, ...overrides?.webhooks },
|
|
53
|
+
graphql: { ...import_platform.DEFAULT_CAPABILITIES.graphql, ...overrides?.graphql },
|
|
54
|
+
rbac: overrides?.rbac ?? import_platform.DEFAULT_CAPABILITIES.rbac,
|
|
55
|
+
multiStore: overrides?.multiStore ?? import_platform.DEFAULT_CAPABILITIES.multiStore,
|
|
56
|
+
commerce: { ...import_platform.DEFAULT_CAPABILITIES.commerce, ...overrides?.commerce }
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
function createTestPlatformProvider(overrides) {
|
|
60
|
+
const caps = overrides?.getCapabilities?.() ?? import_platform.DEFAULT_CAPABILITIES;
|
|
61
|
+
return {
|
|
62
|
+
id: "test-platform",
|
|
63
|
+
name: "Test Platform",
|
|
64
|
+
version: "1.0.0",
|
|
65
|
+
description: "Test platform for testing",
|
|
66
|
+
getCapabilities: () => caps,
|
|
67
|
+
validateConfig: () => ({ valid: true, errors: [] }),
|
|
68
|
+
supportsAuth: () => caps.auth.oauth || caps.auth.tokenExchange || caps.auth.apiKeys,
|
|
69
|
+
supportsBilling: () => caps.billing.subscriptions || caps.billing.oneTimeCharges || caps.billing.usageBased,
|
|
70
|
+
supportsWebhooks: () => caps.webhooks.supported,
|
|
71
|
+
supportsGraphQL: () => caps.graphql.supported,
|
|
72
|
+
supportsRBAC: () => caps.rbac,
|
|
73
|
+
supportsMultiStore: () => caps.multiStore,
|
|
74
|
+
supportsCommerce: () => caps.commerce.products || caps.commerce.orders || caps.commerce.customers,
|
|
75
|
+
...overrides
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
function createTestProductImage(overrides) {
|
|
79
|
+
const defaults = {
|
|
80
|
+
id: `img-${Date.now()}`,
|
|
81
|
+
src: "https://example.com/image.png",
|
|
82
|
+
altText: "Test image",
|
|
83
|
+
position: 1
|
|
84
|
+
};
|
|
85
|
+
return { ...defaults, ...overrides };
|
|
86
|
+
}
|
|
87
|
+
function createTestProductVariant(overrides) {
|
|
88
|
+
const defaults = {
|
|
89
|
+
id: `var-${Date.now()}`,
|
|
90
|
+
platformId: `plat-var-${Date.now()}`,
|
|
91
|
+
title: "Default",
|
|
92
|
+
sku: "TEST-SKU-001",
|
|
93
|
+
price: createTestMoney(),
|
|
94
|
+
inventoryQuantity: 100,
|
|
95
|
+
metadata: {}
|
|
96
|
+
};
|
|
97
|
+
return { ...defaults, ...overrides };
|
|
98
|
+
}
|
|
99
|
+
function createTestProduct(overrides) {
|
|
100
|
+
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
101
|
+
const defaults = {
|
|
102
|
+
id: `prod-${Date.now()}`,
|
|
103
|
+
platformId: `plat-prod-${Date.now()}`,
|
|
104
|
+
title: "Test Product",
|
|
105
|
+
description: "A test product for unit testing",
|
|
106
|
+
handle: "test-product",
|
|
107
|
+
vendor: "Test Vendor",
|
|
108
|
+
productType: "Test Type",
|
|
109
|
+
status: "active",
|
|
110
|
+
tags: ["test"],
|
|
111
|
+
variants: [createTestProductVariant()],
|
|
112
|
+
images: [createTestProductImage()],
|
|
113
|
+
metadata: {},
|
|
114
|
+
createdAt: now,
|
|
115
|
+
updatedAt: now
|
|
116
|
+
};
|
|
117
|
+
return { ...defaults, ...overrides };
|
|
118
|
+
}
|
|
119
|
+
function createTestOrderLineItem(overrides) {
|
|
120
|
+
const defaults = {
|
|
121
|
+
id: `li-${Date.now()}`,
|
|
122
|
+
title: "Test Line Item",
|
|
123
|
+
quantity: 1,
|
|
124
|
+
price: createTestMoney(),
|
|
125
|
+
sku: "TEST-SKU-001"
|
|
126
|
+
};
|
|
127
|
+
return { ...defaults, ...overrides };
|
|
128
|
+
}
|
|
129
|
+
function createTestOrder(overrides) {
|
|
130
|
+
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
131
|
+
const defaults = {
|
|
132
|
+
id: `order-${Date.now()}`,
|
|
133
|
+
platformId: `plat-order-${Date.now()}`,
|
|
134
|
+
orderNumber: "1001",
|
|
135
|
+
status: "open",
|
|
136
|
+
fulfillmentStatus: "unfulfilled",
|
|
137
|
+
financialStatus: "paid",
|
|
138
|
+
lineItems: [createTestOrderLineItem()],
|
|
139
|
+
totalPrice: createTestMoney({ amount: "25.00" }),
|
|
140
|
+
subtotalPrice: createTestMoney({ amount: "22.00" }),
|
|
141
|
+
totalTax: createTestMoney({ amount: "3.00" }),
|
|
142
|
+
customerEmail: "customer@example.com",
|
|
143
|
+
metadata: {},
|
|
144
|
+
createdAt: now,
|
|
145
|
+
updatedAt: now
|
|
146
|
+
};
|
|
147
|
+
return { ...defaults, ...overrides };
|
|
148
|
+
}
|
|
149
|
+
function createTestCustomer(overrides) {
|
|
150
|
+
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
151
|
+
const defaults = {
|
|
152
|
+
id: `cust-${Date.now()}`,
|
|
153
|
+
platformId: `plat-cust-${Date.now()}`,
|
|
154
|
+
email: "customer@example.com",
|
|
155
|
+
firstName: "Jane",
|
|
156
|
+
lastName: "Doe",
|
|
157
|
+
phone: "+1234567890",
|
|
158
|
+
ordersCount: 5,
|
|
159
|
+
totalSpent: createTestMoney({ amount: "250.00" }),
|
|
160
|
+
tags: ["vip"],
|
|
161
|
+
metadata: {},
|
|
162
|
+
createdAt: now,
|
|
163
|
+
updatedAt: now
|
|
164
|
+
};
|
|
165
|
+
return { ...defaults, ...overrides };
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
// src/platform/mock-registry.ts
|
|
169
|
+
var MockPlatformRegistry = class {
|
|
170
|
+
providers = /* @__PURE__ */ new Map();
|
|
171
|
+
register(provider) {
|
|
172
|
+
this.providers.set(provider.id, provider);
|
|
173
|
+
}
|
|
174
|
+
get(platformId) {
|
|
175
|
+
return this.providers.get(platformId);
|
|
176
|
+
}
|
|
177
|
+
has(platformId) {
|
|
178
|
+
return this.providers.has(platformId);
|
|
179
|
+
}
|
|
180
|
+
list() {
|
|
181
|
+
return Array.from(this.providers.keys());
|
|
182
|
+
}
|
|
183
|
+
getAll() {
|
|
184
|
+
return Array.from(this.providers.values());
|
|
185
|
+
}
|
|
186
|
+
_reset() {
|
|
187
|
+
this.providers.clear();
|
|
188
|
+
}
|
|
189
|
+
};
|
|
190
|
+
|
|
191
|
+
// src/platform/mock-commerce.ts
|
|
192
|
+
var MockProductService = class {
|
|
193
|
+
products = /* @__PURE__ */ new Map();
|
|
194
|
+
_addProduct(product) {
|
|
195
|
+
this.products.set(product.id, product);
|
|
196
|
+
}
|
|
197
|
+
_reset() {
|
|
198
|
+
this.products.clear();
|
|
199
|
+
}
|
|
200
|
+
async getProduct(id) {
|
|
201
|
+
return this.products.get(id) ?? null;
|
|
202
|
+
}
|
|
203
|
+
async listProducts(options) {
|
|
204
|
+
const all = Array.from(this.products.values());
|
|
205
|
+
const limit = options?.limit ?? 50;
|
|
206
|
+
const cursorIndex = options?.cursor ? all.findIndex((p) => p.id === options.cursor) + 1 : 0;
|
|
207
|
+
const items = all.slice(cursorIndex, cursorIndex + limit);
|
|
208
|
+
const hasNextPage = cursorIndex + limit < all.length;
|
|
209
|
+
const result = {
|
|
210
|
+
items,
|
|
211
|
+
hasNextPage,
|
|
212
|
+
hasPreviousPage: cursorIndex > 0
|
|
213
|
+
};
|
|
214
|
+
const lastItem = items[items.length - 1];
|
|
215
|
+
if (lastItem && (hasNextPage || cursorIndex > 0)) {
|
|
216
|
+
result.cursor = lastItem.id;
|
|
217
|
+
}
|
|
218
|
+
result.totalCount = all.length;
|
|
219
|
+
return result;
|
|
220
|
+
}
|
|
221
|
+
async createProduct(input) {
|
|
222
|
+
const id = `prod-${Date.now()}-${Math.random().toString(36).slice(2)}`;
|
|
223
|
+
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
224
|
+
const product = createTestProduct({
|
|
225
|
+
id,
|
|
226
|
+
platformId: id,
|
|
227
|
+
title: input.title,
|
|
228
|
+
handle: input.title.toLowerCase().replace(/\s+/g, "-"),
|
|
229
|
+
createdAt: now,
|
|
230
|
+
updatedAt: now,
|
|
231
|
+
variants: [],
|
|
232
|
+
images: []
|
|
233
|
+
});
|
|
234
|
+
if (input.description !== void 0) {
|
|
235
|
+
product.description = input.description;
|
|
236
|
+
}
|
|
237
|
+
if (input.vendor !== void 0) {
|
|
238
|
+
product.vendor = input.vendor;
|
|
239
|
+
}
|
|
240
|
+
if (input.productType !== void 0) {
|
|
241
|
+
product.productType = input.productType;
|
|
242
|
+
}
|
|
243
|
+
if (input.status !== void 0) {
|
|
244
|
+
product.status = input.status;
|
|
245
|
+
}
|
|
246
|
+
if (input.tags !== void 0) {
|
|
247
|
+
product.tags = input.tags;
|
|
248
|
+
}
|
|
249
|
+
if (input.metadata !== void 0) {
|
|
250
|
+
product.metadata = input.metadata;
|
|
251
|
+
}
|
|
252
|
+
this.products.set(product.id, product);
|
|
253
|
+
return product;
|
|
254
|
+
}
|
|
255
|
+
async updateProduct(id, input) {
|
|
256
|
+
const existing = this.products.get(id);
|
|
257
|
+
if (!existing) {
|
|
258
|
+
throw new Error(`Product not found: ${id}`);
|
|
259
|
+
}
|
|
260
|
+
const updated = {
|
|
261
|
+
...existing,
|
|
262
|
+
updatedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
263
|
+
};
|
|
264
|
+
if (input.title !== void 0) {
|
|
265
|
+
updated.title = input.title;
|
|
266
|
+
}
|
|
267
|
+
if (input.description !== void 0) {
|
|
268
|
+
updated.description = input.description;
|
|
269
|
+
}
|
|
270
|
+
if (input.vendor !== void 0) {
|
|
271
|
+
updated.vendor = input.vendor;
|
|
272
|
+
}
|
|
273
|
+
if (input.productType !== void 0) {
|
|
274
|
+
updated.productType = input.productType;
|
|
275
|
+
}
|
|
276
|
+
if (input.status !== void 0) {
|
|
277
|
+
updated.status = input.status;
|
|
278
|
+
}
|
|
279
|
+
if (input.tags !== void 0) {
|
|
280
|
+
updated.tags = input.tags;
|
|
281
|
+
}
|
|
282
|
+
if (input.metadata !== void 0) {
|
|
283
|
+
updated.metadata = input.metadata;
|
|
284
|
+
}
|
|
285
|
+
this.products.set(id, updated);
|
|
286
|
+
return updated;
|
|
287
|
+
}
|
|
288
|
+
async deleteProduct(id) {
|
|
289
|
+
if (!this.products.has(id)) {
|
|
290
|
+
throw new Error(`Product not found: ${id}`);
|
|
291
|
+
}
|
|
292
|
+
this.products.delete(id);
|
|
293
|
+
}
|
|
294
|
+
};
|
|
295
|
+
var MockOrderService = class {
|
|
296
|
+
orders = /* @__PURE__ */ new Map();
|
|
297
|
+
_addOrder(order) {
|
|
298
|
+
this.orders.set(order.id, order);
|
|
299
|
+
}
|
|
300
|
+
_reset() {
|
|
301
|
+
this.orders.clear();
|
|
302
|
+
}
|
|
303
|
+
async getOrder(id) {
|
|
304
|
+
return this.orders.get(id) ?? null;
|
|
305
|
+
}
|
|
306
|
+
async listOrders(options) {
|
|
307
|
+
const all = Array.from(this.orders.values());
|
|
308
|
+
const limit = options?.limit ?? 50;
|
|
309
|
+
const cursorIndex = options?.cursor ? all.findIndex((o) => o.id === options.cursor) + 1 : 0;
|
|
310
|
+
const items = all.slice(cursorIndex, cursorIndex + limit);
|
|
311
|
+
const hasNextPage = cursorIndex + limit < all.length;
|
|
312
|
+
const result = {
|
|
313
|
+
items,
|
|
314
|
+
hasNextPage,
|
|
315
|
+
hasPreviousPage: cursorIndex > 0
|
|
316
|
+
};
|
|
317
|
+
const lastOrderItem = items[items.length - 1];
|
|
318
|
+
if (lastOrderItem && hasNextPage) {
|
|
319
|
+
result.cursor = lastOrderItem.id;
|
|
320
|
+
}
|
|
321
|
+
result.totalCount = all.length;
|
|
322
|
+
return result;
|
|
323
|
+
}
|
|
324
|
+
};
|
|
325
|
+
var MockCustomerService = class {
|
|
326
|
+
customers = /* @__PURE__ */ new Map();
|
|
327
|
+
_addCustomer(customer) {
|
|
328
|
+
this.customers.set(customer.id, customer);
|
|
329
|
+
}
|
|
330
|
+
_reset() {
|
|
331
|
+
this.customers.clear();
|
|
332
|
+
}
|
|
333
|
+
async getCustomer(id) {
|
|
334
|
+
return this.customers.get(id) ?? null;
|
|
335
|
+
}
|
|
336
|
+
async listCustomers(options) {
|
|
337
|
+
const all = Array.from(this.customers.values());
|
|
338
|
+
const limit = options?.limit ?? 50;
|
|
339
|
+
const cursorIndex = options?.cursor ? all.findIndex((c) => c.id === options.cursor) + 1 : 0;
|
|
340
|
+
const items = all.slice(cursorIndex, cursorIndex + limit);
|
|
341
|
+
const hasNextPage = cursorIndex + limit < all.length;
|
|
342
|
+
const result = {
|
|
343
|
+
items,
|
|
344
|
+
hasNextPage,
|
|
345
|
+
hasPreviousPage: cursorIndex > 0
|
|
346
|
+
};
|
|
347
|
+
const lastCustItem = items[items.length - 1];
|
|
348
|
+
if (lastCustItem && hasNextPage) {
|
|
349
|
+
result.cursor = lastCustItem.id;
|
|
350
|
+
}
|
|
351
|
+
result.totalCount = all.length;
|
|
352
|
+
return result;
|
|
353
|
+
}
|
|
354
|
+
async createCustomer(input) {
|
|
355
|
+
const id = `cust-${Date.now()}-${Math.random().toString(36).slice(2)}`;
|
|
356
|
+
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
357
|
+
const customer = createTestCustomer({
|
|
358
|
+
id,
|
|
359
|
+
platformId: id,
|
|
360
|
+
email: input.email,
|
|
361
|
+
createdAt: now,
|
|
362
|
+
updatedAt: now
|
|
363
|
+
});
|
|
364
|
+
if (input.firstName !== void 0) {
|
|
365
|
+
customer.firstName = input.firstName;
|
|
366
|
+
}
|
|
367
|
+
if (input.lastName !== void 0) {
|
|
368
|
+
customer.lastName = input.lastName;
|
|
369
|
+
}
|
|
370
|
+
if (input.phone !== void 0) {
|
|
371
|
+
customer.phone = input.phone;
|
|
372
|
+
}
|
|
373
|
+
if (input.tags !== void 0) {
|
|
374
|
+
customer.tags = input.tags;
|
|
375
|
+
}
|
|
376
|
+
if (input.metadata !== void 0) {
|
|
377
|
+
customer.metadata = input.metadata;
|
|
378
|
+
}
|
|
379
|
+
this.customers.set(customer.id, customer);
|
|
380
|
+
return customer;
|
|
381
|
+
}
|
|
382
|
+
async updateCustomer(id, input) {
|
|
383
|
+
const existing = this.customers.get(id);
|
|
384
|
+
if (!existing) {
|
|
385
|
+
throw new Error(`Customer not found: ${id}`);
|
|
386
|
+
}
|
|
387
|
+
const updated = {
|
|
388
|
+
...existing,
|
|
389
|
+
updatedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
390
|
+
};
|
|
391
|
+
if (input.email !== void 0) {
|
|
392
|
+
updated.email = input.email;
|
|
393
|
+
}
|
|
394
|
+
if (input.firstName !== void 0) {
|
|
395
|
+
updated.firstName = input.firstName;
|
|
396
|
+
}
|
|
397
|
+
if (input.lastName !== void 0) {
|
|
398
|
+
updated.lastName = input.lastName;
|
|
399
|
+
}
|
|
400
|
+
if (input.phone !== void 0) {
|
|
401
|
+
updated.phone = input.phone;
|
|
402
|
+
}
|
|
403
|
+
if (input.tags !== void 0) {
|
|
404
|
+
updated.tags = input.tags;
|
|
405
|
+
}
|
|
406
|
+
if (input.metadata !== void 0) {
|
|
407
|
+
updated.metadata = input.metadata;
|
|
408
|
+
}
|
|
409
|
+
this.customers.set(id, updated);
|
|
410
|
+
return updated;
|
|
411
|
+
}
|
|
412
|
+
async deleteCustomer(id) {
|
|
413
|
+
if (!this.customers.has(id)) {
|
|
414
|
+
throw new Error(`Customer not found: ${id}`);
|
|
415
|
+
}
|
|
416
|
+
this.customers.delete(id);
|
|
417
|
+
}
|
|
418
|
+
};
|
|
419
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
420
|
+
0 && (module.exports = {
|
|
421
|
+
MockCustomerService,
|
|
422
|
+
MockOrderService,
|
|
423
|
+
MockPlatformRegistry,
|
|
424
|
+
MockProductService,
|
|
425
|
+
createTestCapabilities,
|
|
426
|
+
createTestCustomer,
|
|
427
|
+
createTestMoney,
|
|
428
|
+
createTestOrder,
|
|
429
|
+
createTestOrderLineItem,
|
|
430
|
+
createTestPlatformProvider,
|
|
431
|
+
createTestProduct,
|
|
432
|
+
createTestProductImage,
|
|
433
|
+
createTestProductVariant
|
|
434
|
+
});
|
|
435
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/platform/index.ts","../../src/platform/factories.ts","../../src/platform/mock-registry.ts","../../src/platform/mock-commerce.ts"],"sourcesContent":["/**\n * @uniforge/testing - Platform\n *\n * Mock platform services, registry, and test data factories\n * for platform abstraction testing.\n */\n\nexport {\n createTestPlatformProvider,\n createTestCapabilities,\n createTestMoney,\n createTestProduct,\n createTestProductVariant,\n createTestProductImage,\n createTestOrder,\n createTestOrderLineItem,\n createTestCustomer,\n} from './factories';\nexport { MockPlatformRegistry } from './mock-registry';\nexport {\n MockProductService,\n MockOrderService,\n MockCustomerService,\n} from './mock-commerce';\n","/**\n * Test data factories for platform types.\n *\n * Each factory provides sensible defaults that can be overridden.\n */\n\nimport { DEFAULT_CAPABILITIES } from '@uniforge/platform-core/platform';\nimport type {\n PlatformProvider,\n PlatformCapabilities,\n Product,\n ProductVariant,\n ProductImage,\n Order,\n OrderLineItem,\n Customer,\n Money,\n} from '@uniforge/platform-core/platform';\n\nexport function createTestMoney(overrides?: Partial<Money>): Money {\n const defaults: Money = {\n amount: '10.00',\n currencyCode: 'USD',\n };\n return { ...defaults, ...overrides };\n}\n\nexport function createTestCapabilities(\n overrides?: Partial<PlatformCapabilities>,\n): PlatformCapabilities {\n return {\n auth: { ...DEFAULT_CAPABILITIES.auth, ...overrides?.auth },\n billing: { ...DEFAULT_CAPABILITIES.billing, ...overrides?.billing },\n webhooks: { ...DEFAULT_CAPABILITIES.webhooks, ...overrides?.webhooks },\n graphql: { ...DEFAULT_CAPABILITIES.graphql, ...overrides?.graphql },\n rbac: overrides?.rbac ?? DEFAULT_CAPABILITIES.rbac,\n multiStore: overrides?.multiStore ?? DEFAULT_CAPABILITIES.multiStore,\n commerce: { ...DEFAULT_CAPABILITIES.commerce, ...overrides?.commerce },\n };\n}\n\nexport function createTestPlatformProvider(\n overrides?: Partial<PlatformProvider>,\n): PlatformProvider {\n const caps = overrides?.getCapabilities?.() ?? DEFAULT_CAPABILITIES;\n return {\n id: 'test-platform',\n name: 'Test Platform',\n version: '1.0.0',\n description: 'Test platform for testing',\n getCapabilities: () => caps,\n validateConfig: () => ({ valid: true, errors: [] }),\n supportsAuth: () =>\n caps.auth.oauth || caps.auth.tokenExchange || caps.auth.apiKeys,\n supportsBilling: () =>\n caps.billing.subscriptions ||\n caps.billing.oneTimeCharges ||\n caps.billing.usageBased,\n supportsWebhooks: () => caps.webhooks.supported,\n supportsGraphQL: () => caps.graphql.supported,\n supportsRBAC: () => caps.rbac,\n supportsMultiStore: () => caps.multiStore,\n supportsCommerce: () =>\n caps.commerce.products ||\n caps.commerce.orders ||\n caps.commerce.customers,\n ...overrides,\n };\n}\n\nexport function createTestProductImage(\n overrides?: Partial<ProductImage>,\n): ProductImage {\n const defaults: ProductImage = {\n id: `img-${Date.now()}`,\n src: 'https://example.com/image.png',\n altText: 'Test image',\n position: 1,\n };\n return { ...defaults, ...overrides };\n}\n\nexport function createTestProductVariant(\n overrides?: Partial<ProductVariant>,\n): ProductVariant {\n const defaults: ProductVariant = {\n id: `var-${Date.now()}`,\n platformId: `plat-var-${Date.now()}`,\n title: 'Default',\n sku: 'TEST-SKU-001',\n price: createTestMoney(),\n inventoryQuantity: 100,\n metadata: {},\n };\n return { ...defaults, ...overrides };\n}\n\nexport function createTestProduct(overrides?: Partial<Product>): Product {\n const now = new Date().toISOString();\n const defaults: Product = {\n id: `prod-${Date.now()}`,\n platformId: `plat-prod-${Date.now()}`,\n title: 'Test Product',\n description: 'A test product for unit testing',\n handle: 'test-product',\n vendor: 'Test Vendor',\n productType: 'Test Type',\n status: 'active',\n tags: ['test'],\n variants: [createTestProductVariant()],\n images: [createTestProductImage()],\n metadata: {},\n createdAt: now,\n updatedAt: now,\n };\n return { ...defaults, ...overrides };\n}\n\nexport function createTestOrderLineItem(\n overrides?: Partial<OrderLineItem>,\n): OrderLineItem {\n const defaults: OrderLineItem = {\n id: `li-${Date.now()}`,\n title: 'Test Line Item',\n quantity: 1,\n price: createTestMoney(),\n sku: 'TEST-SKU-001',\n };\n return { ...defaults, ...overrides };\n}\n\nexport function createTestOrder(overrides?: Partial<Order>): Order {\n const now = new Date().toISOString();\n const defaults: Order = {\n id: `order-${Date.now()}`,\n platformId: `plat-order-${Date.now()}`,\n orderNumber: '1001',\n status: 'open',\n fulfillmentStatus: 'unfulfilled',\n financialStatus: 'paid',\n lineItems: [createTestOrderLineItem()],\n totalPrice: createTestMoney({ amount: '25.00' }),\n subtotalPrice: createTestMoney({ amount: '22.00' }),\n totalTax: createTestMoney({ amount: '3.00' }),\n customerEmail: 'customer@example.com',\n metadata: {},\n createdAt: now,\n updatedAt: now,\n };\n return { ...defaults, ...overrides };\n}\n\nexport function createTestCustomer(overrides?: Partial<Customer>): Customer {\n const now = new Date().toISOString();\n const defaults: Customer = {\n id: `cust-${Date.now()}`,\n platformId: `plat-cust-${Date.now()}`,\n email: 'customer@example.com',\n firstName: 'Jane',\n lastName: 'Doe',\n phone: '+1234567890',\n ordersCount: 5,\n totalSpent: createTestMoney({ amount: '250.00' }),\n tags: ['vip'],\n metadata: {},\n createdAt: now,\n updatedAt: now,\n };\n return { ...defaults, ...overrides };\n}\n","/**\n * Mock PlatformRegistry for unit testing.\n *\n * In-memory implementation of the PlatformRegistry interface\n * with a _reset() method for test isolation.\n */\n\nimport type {\n PlatformRegistry,\n PlatformProvider,\n PlatformId,\n} from '@uniforge/platform-core/platform';\n\nexport class MockPlatformRegistry implements PlatformRegistry {\n private providers = new Map<PlatformId, PlatformProvider>();\n\n register(provider: PlatformProvider): void {\n this.providers.set(provider.id, provider);\n }\n\n get(platformId: PlatformId): PlatformProvider | undefined {\n return this.providers.get(platformId);\n }\n\n has(platformId: PlatformId): boolean {\n return this.providers.has(platformId);\n }\n\n list(): PlatformId[] {\n return Array.from(this.providers.keys());\n }\n\n getAll(): PlatformProvider[] {\n return Array.from(this.providers.values());\n }\n\n _reset(): void {\n this.providers.clear();\n }\n}\n","/**\n * Mock commerce services for unit testing.\n *\n * In-memory implementations of ProductService, OrderService,\n * and CustomerService with helpers for seeding test data.\n */\n\nimport type {\n ProductService,\n OrderService,\n CustomerService,\n Product,\n Order,\n Customer,\n PaginatedResult,\n ListOptions,\n CreateProductInput,\n UpdateProductInput,\n CreateCustomerInput,\n UpdateCustomerInput,\n} from '@uniforge/platform-core/platform';\n\nimport { createTestProduct, createTestCustomer } from './factories';\n\n// ── MockProductService ──\n\nexport class MockProductService implements ProductService {\n private products = new Map<string, Product>();\n\n _addProduct(product: Product): void {\n this.products.set(product.id, product);\n }\n\n _reset(): void {\n this.products.clear();\n }\n\n async getProduct(id: string): Promise<Product | null> {\n return this.products.get(id) ?? null;\n }\n\n async listProducts(options?: ListOptions): Promise<PaginatedResult<Product>> {\n const all = Array.from(this.products.values());\n const limit = options?.limit ?? 50;\n const cursorIndex = options?.cursor\n ? all.findIndex((p) => p.id === options.cursor) + 1\n : 0;\n const items = all.slice(cursorIndex, cursorIndex + limit);\n const hasNextPage = cursorIndex + limit < all.length;\n const result: PaginatedResult<Product> = {\n items,\n hasNextPage,\n hasPreviousPage: cursorIndex > 0,\n };\n const lastItem = items[items.length - 1];\n if (lastItem && (hasNextPage || cursorIndex > 0)) {\n result.cursor = lastItem.id;\n }\n result.totalCount = all.length;\n return result;\n }\n\n async createProduct(input: CreateProductInput): Promise<Product> {\n const id = `prod-${Date.now()}-${Math.random().toString(36).slice(2)}`;\n const now = new Date().toISOString();\n const product = createTestProduct({\n id,\n platformId: id,\n title: input.title,\n handle: input.title.toLowerCase().replace(/\\s+/g, '-'),\n createdAt: now,\n updatedAt: now,\n variants: [],\n images: [],\n });\n if (input.description !== undefined) {\n product.description = input.description;\n }\n if (input.vendor !== undefined) {\n product.vendor = input.vendor;\n }\n if (input.productType !== undefined) {\n product.productType = input.productType;\n }\n if (input.status !== undefined) {\n product.status = input.status;\n }\n if (input.tags !== undefined) {\n product.tags = input.tags;\n }\n if (input.metadata !== undefined) {\n product.metadata = input.metadata;\n }\n this.products.set(product.id, product);\n return product;\n }\n\n async updateProduct(\n id: string,\n input: UpdateProductInput,\n ): Promise<Product> {\n const existing = this.products.get(id);\n if (!existing) {\n throw new Error(`Product not found: ${id}`);\n }\n const updated: Product = {\n ...existing,\n updatedAt: new Date().toISOString(),\n };\n if (input.title !== undefined) {\n updated.title = input.title;\n }\n if (input.description !== undefined) {\n updated.description = input.description;\n }\n if (input.vendor !== undefined) {\n updated.vendor = input.vendor;\n }\n if (input.productType !== undefined) {\n updated.productType = input.productType;\n }\n if (input.status !== undefined) {\n updated.status = input.status;\n }\n if (input.tags !== undefined) {\n updated.tags = input.tags;\n }\n if (input.metadata !== undefined) {\n updated.metadata = input.metadata;\n }\n this.products.set(id, updated);\n return updated;\n }\n\n async deleteProduct(id: string): Promise<void> {\n if (!this.products.has(id)) {\n throw new Error(`Product not found: ${id}`);\n }\n this.products.delete(id);\n }\n}\n\n// ── MockOrderService ──\n\nexport class MockOrderService implements OrderService {\n private orders = new Map<string, Order>();\n\n _addOrder(order: Order): void {\n this.orders.set(order.id, order);\n }\n\n _reset(): void {\n this.orders.clear();\n }\n\n async getOrder(id: string): Promise<Order | null> {\n return this.orders.get(id) ?? null;\n }\n\n async listOrders(options?: ListOptions): Promise<PaginatedResult<Order>> {\n const all = Array.from(this.orders.values());\n const limit = options?.limit ?? 50;\n const cursorIndex = options?.cursor\n ? all.findIndex((o) => o.id === options.cursor) + 1\n : 0;\n const items = all.slice(cursorIndex, cursorIndex + limit);\n const hasNextPage = cursorIndex + limit < all.length;\n const result: PaginatedResult<Order> = {\n items,\n hasNextPage,\n hasPreviousPage: cursorIndex > 0,\n };\n const lastOrderItem = items[items.length - 1];\n if (lastOrderItem && hasNextPage) {\n result.cursor = lastOrderItem.id;\n }\n result.totalCount = all.length;\n return result;\n }\n}\n\n// ── MockCustomerService ──\n\nexport class MockCustomerService implements CustomerService {\n private customers = new Map<string, Customer>();\n\n _addCustomer(customer: Customer): void {\n this.customers.set(customer.id, customer);\n }\n\n _reset(): void {\n this.customers.clear();\n }\n\n async getCustomer(id: string): Promise<Customer | null> {\n return this.customers.get(id) ?? null;\n }\n\n async listCustomers(\n options?: ListOptions,\n ): Promise<PaginatedResult<Customer>> {\n const all = Array.from(this.customers.values());\n const limit = options?.limit ?? 50;\n const cursorIndex = options?.cursor\n ? all.findIndex((c) => c.id === options.cursor) + 1\n : 0;\n const items = all.slice(cursorIndex, cursorIndex + limit);\n const hasNextPage = cursorIndex + limit < all.length;\n const result: PaginatedResult<Customer> = {\n items,\n hasNextPage,\n hasPreviousPage: cursorIndex > 0,\n };\n const lastCustItem = items[items.length - 1];\n if (lastCustItem && hasNextPage) {\n result.cursor = lastCustItem.id;\n }\n result.totalCount = all.length;\n return result;\n }\n\n async createCustomer(input: CreateCustomerInput): Promise<Customer> {\n const id = `cust-${Date.now()}-${Math.random().toString(36).slice(2)}`;\n const now = new Date().toISOString();\n const customer = createTestCustomer({\n id,\n platformId: id,\n email: input.email,\n createdAt: now,\n updatedAt: now,\n });\n if (input.firstName !== undefined) {\n customer.firstName = input.firstName;\n }\n if (input.lastName !== undefined) {\n customer.lastName = input.lastName;\n }\n if (input.phone !== undefined) {\n customer.phone = input.phone;\n }\n if (input.tags !== undefined) {\n customer.tags = input.tags;\n }\n if (input.metadata !== undefined) {\n customer.metadata = input.metadata;\n }\n this.customers.set(customer.id, customer);\n return customer;\n }\n\n async updateCustomer(\n id: string,\n input: UpdateCustomerInput,\n ): Promise<Customer> {\n const existing = this.customers.get(id);\n if (!existing) {\n throw new Error(`Customer not found: ${id}`);\n }\n const updated: Customer = {\n ...existing,\n updatedAt: new Date().toISOString(),\n };\n if (input.email !== undefined) {\n updated.email = input.email;\n }\n if (input.firstName !== undefined) {\n updated.firstName = input.firstName;\n }\n if (input.lastName !== undefined) {\n updated.lastName = input.lastName;\n }\n if (input.phone !== undefined) {\n updated.phone = input.phone;\n }\n if (input.tags !== undefined) {\n updated.tags = input.tags;\n }\n if (input.metadata !== undefined) {\n updated.metadata = input.metadata;\n }\n this.customers.set(id, updated);\n return updated;\n }\n\n async deleteCustomer(id: string): Promise<void> {\n if (!this.customers.has(id)) {\n throw new Error(`Customer not found: ${id}`);\n }\n this.customers.delete(id);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACMA,sBAAqC;AAa9B,SAAS,gBAAgB,WAAmC;AACjE,QAAM,WAAkB;AAAA,IACtB,QAAQ;AAAA,IACR,cAAc;AAAA,EAChB;AACA,SAAO,EAAE,GAAG,UAAU,GAAG,UAAU;AACrC;AAEO,SAAS,uBACd,WACsB;AACtB,SAAO;AAAA,IACL,MAAM,EAAE,GAAG,qCAAqB,MAAM,GAAG,WAAW,KAAK;AAAA,IACzD,SAAS,EAAE,GAAG,qCAAqB,SAAS,GAAG,WAAW,QAAQ;AAAA,IAClE,UAAU,EAAE,GAAG,qCAAqB,UAAU,GAAG,WAAW,SAAS;AAAA,IACrE,SAAS,EAAE,GAAG,qCAAqB,SAAS,GAAG,WAAW,QAAQ;AAAA,IAClE,MAAM,WAAW,QAAQ,qCAAqB;AAAA,IAC9C,YAAY,WAAW,cAAc,qCAAqB;AAAA,IAC1D,UAAU,EAAE,GAAG,qCAAqB,UAAU,GAAG,WAAW,SAAS;AAAA,EACvE;AACF;AAEO,SAAS,2BACd,WACkB;AAClB,QAAM,OAAO,WAAW,kBAAk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