@mainmoneyapp/js-core 0.0.0-stage → 0.1.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 MainMoney SARL
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 CHANGED
@@ -1,3 +1,5 @@
1
- # Temporary Holding Version
1
+ # @mainmoneyapp/js-core
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Framework-agnostic session, money helpers, i18n, and types for the MainMoney
4
+ frontend SDK. Requires a backend SDK on the merchant server. See the
5
+ [root README](../../README.md).
@@ -0,0 +1,201 @@
1
+ /** Merchant-backend path convention for the JS/TS frontend SDK. */
2
+ type MerchantPaths = {
3
+ countries: string;
4
+ providers: string;
5
+ matchProvider: string;
6
+ amountLimits: string;
7
+ feesSimulate: string;
8
+ checkoutPreferences: string;
9
+ deposits: string;
10
+ validatePayment: string;
11
+ payouts: string;
12
+ };
13
+ declare const DEFAULT_PATHS: MerchantPaths;
14
+ declare function joinUrl(base: string, path: string): string;
15
+
16
+ /** Shared checkout types. Amounts are decimal strings; never mix currencies. */
17
+ type OperationType = "deposit" | "payout";
18
+ type CheckoutLocale = "en" | "fr";
19
+ type CheckoutTheme = {
20
+ primary: string;
21
+ secondary: string;
22
+ accent: string;
23
+ background: string;
24
+ };
25
+ declare const DEFAULT_THEME: CheckoutTheme;
26
+ type Country = {
27
+ code: string;
28
+ name: string;
29
+ iso3_code?: string;
30
+ phone_code?: string;
31
+ /** Absolute flag image URL; null when none is uploaded. */
32
+ flag?: string | null;
33
+ };
34
+ type Provider = {
35
+ code: string;
36
+ name: string;
37
+ entity_type: string;
38
+ country_code: string;
39
+ currency_code: string;
40
+ accepted_currencies?: string[];
41
+ /** Absolute provider logo URL; null when none is uploaded. */
42
+ logo?: string | null;
43
+ is_active?: boolean;
44
+ };
45
+ type AmountLimit = {
46
+ financial_entity_code: string;
47
+ operation_type: string | null;
48
+ currency: string;
49
+ amount_min: string | null;
50
+ amount_max: string | null;
51
+ };
52
+ type FeeSimulation = {
53
+ provider_code: string;
54
+ operation_type: string;
55
+ amount: string;
56
+ currency: string;
57
+ provider_fee: string;
58
+ our_fee: string;
59
+ merchant_additional_fee: string;
60
+ promotion_discount: string;
61
+ total_merchant_fee: string;
62
+ net_amount: string;
63
+ /** Checkout fee box: merchant_receives + processing_fee = total_to_pay when MERCHANT bears fees. */
64
+ fee_bearer?: FeeBearer;
65
+ merchant_receives?: string;
66
+ processing_fee?: string;
67
+ total_to_pay?: string;
68
+ /** Fee plan: platform fees are computed on `base_amount` (= amount + merchant fee on deposits). */
69
+ merchant_fee?: string;
70
+ base_amount?: string;
71
+ charged_fees?: string;
72
+ provider_fee_declarative?: boolean;
73
+ /** What the provider processes: the customer's payment (deposit) or the recipient's amount (payout). */
74
+ provider_amount?: string;
75
+ /** Deposit: credited after fees. Payout: debited (negative). */
76
+ merchant_wallet_effect?: string;
77
+ };
78
+ type FeeBearer = "MERCHANT" | "CUSTOMER";
79
+ type PaymentMethod = "mobile_money" | "card" | "mainmoney";
80
+ type PartnerFee = {
81
+ amount: string;
82
+ currency: string;
83
+ label?: string;
84
+ };
85
+ type StatusPayload = {
86
+ status: string;
87
+ transaction_id?: string;
88
+ internal_reference?: string;
89
+ external_reference?: string;
90
+ merchant_reference?: string;
91
+ provider_reference?: string;
92
+ message?: string;
93
+ status_reason?: string;
94
+ amount?: string;
95
+ currency?: string;
96
+ provider_code?: string;
97
+ status_updated?: boolean;
98
+ data?: Record<string, unknown>;
99
+ [key: string]: unknown;
100
+ };
101
+ type DepositRequest = {
102
+ provider_code: string;
103
+ reference: string;
104
+ amount: string;
105
+ currency: string;
106
+ customer_phone: string;
107
+ customer_name?: string;
108
+ callback_url?: string;
109
+ metadata?: Record<string, unknown>;
110
+ };
111
+ type PayoutRequest = {
112
+ provider_code: string;
113
+ reference: string;
114
+ amount: string;
115
+ currency: string;
116
+ destination_account: string;
117
+ metadata?: Record<string, unknown>;
118
+ };
119
+ declare function isMobileMoney(provider: Provider | undefined): boolean;
120
+ declare function isPhoneIdentifier(provider: Provider | undefined): boolean;
121
+ declare function extractCustomerName(payload: Record<string, unknown>): string | null;
122
+ declare function isTerminalStatus(status: string): boolean;
123
+
124
+ /** Browser session: merchant backend URL, optional client token, path overrides. */
125
+
126
+ type CreateSessionOptions = {
127
+ merchantBackendUrl: string;
128
+ clientToken?: string;
129
+ paths?: Partial<MerchantPaths>;
130
+ fetch?: typeof fetch;
131
+ timeoutMs?: number;
132
+ locale?: CheckoutLocale;
133
+ messages?: Record<string, string>;
134
+ theme?: Partial<CheckoutTheme>;
135
+ };
136
+ type Session = {
137
+ merchantBackendUrl: string;
138
+ clientToken?: string;
139
+ paths: MerchantPaths;
140
+ fetch: typeof fetch;
141
+ timeoutMs: number;
142
+ locale: CheckoutLocale;
143
+ messages: Record<string, string>;
144
+ theme: CheckoutTheme;
145
+ };
146
+ declare function createSession(options: CreateSessionOptions): Session;
147
+
148
+ /** Exceptions raised by the MainMoney JS/TS frontend SDK. */
149
+ declare class FrontendSdkException extends Error {
150
+ constructor(message: string);
151
+ }
152
+ declare class ConfigurationException extends FrontendSdkException {
153
+ constructor(message: string);
154
+ }
155
+ declare class CurrencyMismatchException extends FrontendSdkException {
156
+ constructor(message?: string);
157
+ }
158
+ declare class MerchantBackendException extends FrontendSdkException {
159
+ readonly statusCode: number;
160
+ readonly errors: Record<string, unknown>;
161
+ readonly responseBody: unknown;
162
+ constructor(message: string, statusCode: number, errors?: Record<string, unknown>, responseBody?: unknown);
163
+ }
164
+
165
+ /** Same-currency decimal string helpers. Never mix currencies. */
166
+ type Money = {
167
+ amount: string;
168
+ currency: string;
169
+ };
170
+ declare function assertSameCurrency(left: Money, right: Money): void;
171
+ declare function addMoney(left: Money, right: Money): Money;
172
+ declare function addDecimalStrings(left: string, right: string): string;
173
+
174
+ /** Tiny event bus. Do not log secrets or poll headers. */
175
+ type Listener<T> = (payload: T) => void;
176
+ declare class Emitter {
177
+ private readonly listeners;
178
+ on<T>(event: string, listener: Listener<T>): () => void;
179
+ off<T>(event: string, listener: Listener<T>): void;
180
+ emit<T>(event: string, payload: T): void;
181
+ }
182
+
183
+ /** Checkout copy. Merchants may override keys via `messages`. */
184
+
185
+ type MessageCatalog = Record<string, string>;
186
+ declare const EN: MessageCatalog;
187
+ declare const FR: MessageCatalog;
188
+ declare function createTranslator(locale: CheckoutLocale, overrides?: Partial<MessageCatalog>): (key: string, vars?: Record<string, string>) => string;
189
+
190
+ /** Apply checkout theme as CSS variables on an element. */
191
+
192
+ declare function themeFromPreferences(payload: Record<string, unknown>): CheckoutTheme;
193
+ declare function applyTheme(element: {
194
+ style: {
195
+ setProperty: (name: string, value: string) => void;
196
+ };
197
+ }, theme: CheckoutTheme): void;
198
+
199
+ declare const VERSION = "0.1.1";
200
+
201
+ export { type AmountLimit, type CheckoutLocale, type CheckoutTheme, ConfigurationException, type Country, type CreateSessionOptions, CurrencyMismatchException, DEFAULT_PATHS, DEFAULT_THEME, type DepositRequest, EN, Emitter, FR, type FeeBearer, type FeeSimulation, FrontendSdkException, type Listener, MerchantBackendException, type MerchantPaths, type MessageCatalog, type Money, type OperationType, type PartnerFee, type PaymentMethod, type PayoutRequest, type Provider, type Session, type StatusPayload, VERSION, addDecimalStrings, addMoney, applyTheme, assertSameCurrency, createSession, createTranslator, extractCustomerName, isMobileMoney, isPhoneIdentifier, isTerminalStatus, joinUrl, themeFromPreferences };
package/dist/index.js ADDED
@@ -0,0 +1,326 @@
1
+ // src/errors.ts
2
+ var FrontendSdkException = class extends Error {
3
+ constructor(message) {
4
+ super(message);
5
+ this.name = "FrontendSdkException";
6
+ }
7
+ };
8
+ var ConfigurationException = class extends FrontendSdkException {
9
+ constructor(message) {
10
+ super(message);
11
+ this.name = "ConfigurationException";
12
+ }
13
+ };
14
+ var CurrencyMismatchException = class extends FrontendSdkException {
15
+ constructor(message = "Cannot mix monetary amounts across currencies") {
16
+ super(message);
17
+ this.name = "CurrencyMismatchException";
18
+ }
19
+ };
20
+ var MerchantBackendException = class extends FrontendSdkException {
21
+ statusCode;
22
+ errors;
23
+ responseBody;
24
+ constructor(message, statusCode, errors = {}, responseBody = null) {
25
+ super(message);
26
+ this.name = "MerchantBackendException";
27
+ this.statusCode = statusCode;
28
+ this.errors = errors;
29
+ this.responseBody = responseBody;
30
+ }
31
+ };
32
+
33
+ // src/paths.ts
34
+ var DEFAULT_PATHS = {
35
+ countries: "/countries",
36
+ providers: "/providers",
37
+ matchProvider: "/match-provider",
38
+ amountLimits: "/amount-limits",
39
+ feesSimulate: "/fees/simulate",
40
+ checkoutPreferences: "/checkout-preferences",
41
+ deposits: "/deposits",
42
+ validatePayment: "/deposits/validate",
43
+ payouts: "/payouts"
44
+ };
45
+ function joinUrl(base, path) {
46
+ const prefix = base.replace(/\/+$/, "");
47
+ const suffix = path.startsWith("http://") || path.startsWith("https://") ? path : path.replace(/^\/+/, "/");
48
+ if (suffix.startsWith("http://") || suffix.startsWith("https://")) {
49
+ return suffix;
50
+ }
51
+ return `${prefix}${suffix.startsWith("/") ? suffix : `/${suffix}`}`;
52
+ }
53
+
54
+ // src/types.ts
55
+ var DEFAULT_THEME = {
56
+ primary: "#ff3366",
57
+ secondary: "#5f5e5e",
58
+ accent: "#b90040",
59
+ background: "#f8f9fb"
60
+ };
61
+ function isMobileMoney(provider) {
62
+ if (provider === void 0) {
63
+ return false;
64
+ }
65
+ return provider.entity_type === "MOBILE_MONEY";
66
+ }
67
+ function isPhoneIdentifier(provider) {
68
+ return isMobileMoney(provider);
69
+ }
70
+ function extractCustomerName(payload) {
71
+ const lookup = payload.lookup_data;
72
+ if (isPlainObject(lookup) && typeof lookup.name === "string" && lookup.name.trim() !== "") {
73
+ return lookup.name.trim();
74
+ }
75
+ if (typeof payload.name === "string" && payload.name.trim() !== "") {
76
+ return payload.name.trim();
77
+ }
78
+ return null;
79
+ }
80
+ function isTerminalStatus(status) {
81
+ const normalized = status.toUpperCase();
82
+ return normalized === "SUCCESS" || normalized === "FAILED" || normalized === "CANCELLED" || normalized === "CANCELED" || normalized === "EXPIRED";
83
+ }
84
+ function isPlainObject(value) {
85
+ return value !== null && typeof value === "object" && !Array.isArray(value);
86
+ }
87
+
88
+ // src/session.ts
89
+ function createSession(options) {
90
+ const merchantBackendUrl = options.merchantBackendUrl?.trim() ?? "";
91
+ if (merchantBackendUrl === "") {
92
+ throw new ConfigurationException("merchantBackendUrl is required");
93
+ }
94
+ return {
95
+ merchantBackendUrl,
96
+ clientToken: options.clientToken,
97
+ paths: { ...DEFAULT_PATHS, ...options.paths },
98
+ fetch: options.fetch ?? globalThis.fetch.bind(globalThis),
99
+ timeoutMs: options.timeoutMs ?? 3e4,
100
+ locale: options.locale ?? "en",
101
+ messages: options.messages ?? {},
102
+ theme: { ...DEFAULT_THEME, ...options.theme }
103
+ };
104
+ }
105
+
106
+ // src/money.ts
107
+ function assertSameCurrency(left, right) {
108
+ if (left.currency !== right.currency) {
109
+ throw new CurrencyMismatchException(
110
+ `Cannot combine ${left.currency} with ${right.currency}`
111
+ );
112
+ }
113
+ }
114
+ function addMoney(left, right) {
115
+ assertSameCurrency(left, right);
116
+ return { amount: addDecimalStrings(left.amount, right.amount), currency: left.currency };
117
+ }
118
+ function addDecimalStrings(left, right) {
119
+ const [leftWhole, leftFrac = ""] = splitDecimal(left);
120
+ const [rightWhole, rightFrac = ""] = splitDecimal(right);
121
+ const scale = Math.max(leftFrac.length, rightFrac.length);
122
+ const leftValue = BigInt(leftWhole + leftFrac.padEnd(scale, "0"));
123
+ const rightValue = BigInt(rightWhole + rightFrac.padEnd(scale, "0"));
124
+ const sum = leftValue + rightValue;
125
+ const sign = sum < 0n ? "-" : "";
126
+ const digits = (sum < 0n ? -sum : sum).toString().padStart(scale + 1, "0");
127
+ if (scale === 0) {
128
+ return `${sign}${digits}`;
129
+ }
130
+ return `${sign}${digits.slice(0, -scale)}.${digits.slice(-scale)}`;
131
+ }
132
+ function splitDecimal(value) {
133
+ const trimmed = value.trim();
134
+ const negative = trimmed.startsWith("-");
135
+ const unsigned = negative ? trimmed.slice(1) : trimmed;
136
+ const [whole, frac = ""] = unsigned.split(".");
137
+ const normalizedWhole = `${negative ? "-" : ""}${whole === "" ? "0" : whole}`;
138
+ return [normalizedWhole, frac.replace(/[^0-9]/g, "")];
139
+ }
140
+
141
+ // src/events.ts
142
+ var Emitter = class {
143
+ listeners = /* @__PURE__ */ new Map();
144
+ on(event, listener) {
145
+ let bucket = this.listeners.get(event);
146
+ if (bucket === void 0) {
147
+ bucket = /* @__PURE__ */ new Set();
148
+ this.listeners.set(event, bucket);
149
+ }
150
+ bucket.add(listener);
151
+ return () => this.off(event, listener);
152
+ }
153
+ off(event, listener) {
154
+ this.listeners.get(event)?.delete(listener);
155
+ }
156
+ emit(event, payload) {
157
+ const bucket = this.listeners.get(event);
158
+ if (bucket === void 0) {
159
+ return;
160
+ }
161
+ for (const listener of bucket) {
162
+ listener(payload);
163
+ }
164
+ }
165
+ };
166
+
167
+ // src/i18n.ts
168
+ var EN = {
169
+ country: "Country",
170
+ selectCountry: "Select a country",
171
+ provider: "Provider",
172
+ selectProvider: "Select a provider",
173
+ phone: "Phone number",
174
+ account: "Account number",
175
+ customerName: "Customer name",
176
+ amount: "Amount",
177
+ currency: "Currency",
178
+ fees: "Fees",
179
+ partnerFee: "Partner fee",
180
+ total: "Total",
181
+ netAmount: "Net amount",
182
+ overview: "Overview",
183
+ confirm: "Confirm",
184
+ back: "Back",
185
+ next: "Next",
186
+ ongoing: "Transaction ongoing",
187
+ success: "Payment succeeded",
188
+ failed: "Payment failed",
189
+ confirming: "Confirming payment",
190
+ polling: "Waiting for confirmation",
191
+ limits: "Amount must be between {min} and {max}",
192
+ required: "This field is required",
193
+ balanceRejected: "Balance validation failed",
194
+ highlighted: "Matched provider",
195
+ formTitle: "Complete your payment",
196
+ formSubtitle: "Enter your details below. Your payment is encrypted and processed securely.",
197
+ tabCard: "Card",
198
+ tabMobileMoney: "Mobile money",
199
+ tabMainMoney: "MainMoney",
200
+ emailLabel: "Email for receipt (optional)",
201
+ emailPlaceholder: "you@example.com",
202
+ emailHint: "We'll send a payment receipt to this address when your payment succeeds.",
203
+ phoneHint: "Enter the local number without the country code.",
204
+ merchantReceives: "Merchant receives",
205
+ processingFee: "Processing fee",
206
+ youPay: "You pay",
207
+ pay: "Pay",
208
+ language: "Language",
209
+ poweredBy: "Powered by",
210
+ rights: "All rights reserved.",
211
+ privacy: "Privacy Policy",
212
+ terms: "Terms of Service",
213
+ security: "Security",
214
+ help: "Help Center",
215
+ cardSoon: "Card payments are coming soon.",
216
+ mainmoneySoon: "Pay by scanning a QR code with the MainMoney app. Coming soon.",
217
+ noProviders: "No mobile money provider is available for this country."
218
+ };
219
+ var FR = {
220
+ country: "Pays",
221
+ selectCountry: "S\xE9lectionnez un pays",
222
+ provider: "Fournisseur",
223
+ selectProvider: "S\xE9lectionnez un fournisseur",
224
+ phone: "Num\xE9ro de t\xE9l\xE9phone",
225
+ account: "Num\xE9ro de compte",
226
+ customerName: "Nom du client",
227
+ amount: "Montant",
228
+ currency: "Devise",
229
+ fees: "Frais",
230
+ partnerFee: "Frais partenaire",
231
+ total: "Total",
232
+ netAmount: "Montant net",
233
+ overview: "R\xE9capitulatif",
234
+ confirm: "Confirmer",
235
+ back: "Retour",
236
+ next: "Suivant",
237
+ ongoing: "Transaction en cours",
238
+ success: "Paiement r\xE9ussi",
239
+ failed: "Paiement \xE9chou\xE9",
240
+ confirming: "Confirmation du paiement",
241
+ polling: "En attente de confirmation",
242
+ limits: "Le montant doit \xEAtre compris entre {min} et {max}",
243
+ required: "Ce champ est obligatoire",
244
+ balanceRejected: "Validation du solde \xE9chou\xE9e",
245
+ highlighted: "Fournisseur correspondant",
246
+ formTitle: "Finalisez votre paiement",
247
+ formSubtitle: "Saisissez vos informations ci-dessous. Votre paiement est chiffr\xE9 et trait\xE9 de mani\xE8re s\xE9curis\xE9e.",
248
+ tabCard: "Carte",
249
+ tabMobileMoney: "Mobile money",
250
+ tabMainMoney: "MainMoney",
251
+ emailLabel: "E-mail pour le re\xE7u (facultatif)",
252
+ emailPlaceholder: "vous@exemple.com",
253
+ emailHint: "Nous enverrons un re\xE7u \xE0 cette adresse lorsque votre paiement aura r\xE9ussi.",
254
+ phoneHint: "Saisissez le num\xE9ro local sans l'indicatif du pays.",
255
+ merchantReceives: "Le marchand re\xE7oit",
256
+ processingFee: "Frais de traitement",
257
+ youPay: "Vous payez",
258
+ pay: "Payer",
259
+ language: "Langue",
260
+ poweredBy: "Propuls\xE9 par",
261
+ rights: "Tous droits r\xE9serv\xE9s.",
262
+ privacy: "Politique de confidentialit\xE9",
263
+ terms: "Conditions d'utilisation",
264
+ security: "S\xE9curit\xE9",
265
+ help: "Centre d'aide",
266
+ cardSoon: "Le paiement par carte sera bient\xF4t disponible.",
267
+ mainmoneySoon: "Payez en scannant un code QR avec l'application MainMoney. Bient\xF4t disponible.",
268
+ noProviders: "Aucun op\xE9rateur mobile money n'est disponible pour ce pays."
269
+ };
270
+ var CATALOGS = { en: EN, fr: FR };
271
+ function createTranslator(locale, overrides = {}) {
272
+ const catalog = { ...CATALOGS[locale], ...overrides };
273
+ return (key, vars = {}) => {
274
+ let text = catalog[key] ?? key;
275
+ for (const [name, value] of Object.entries(vars)) {
276
+ text = text.replaceAll(`{${name}}`, value);
277
+ }
278
+ return text;
279
+ };
280
+ }
281
+
282
+ // src/theme.ts
283
+ function themeFromPreferences(payload) {
284
+ return {
285
+ primary: stringOr(payload.primary_color, DEFAULT_THEME.primary),
286
+ secondary: stringOr(payload.secondary_color, DEFAULT_THEME.secondary),
287
+ accent: stringOr(payload.accent_color, DEFAULT_THEME.accent),
288
+ background: stringOr(payload.background_color, DEFAULT_THEME.background)
289
+ };
290
+ }
291
+ function applyTheme(element, theme) {
292
+ element.style.setProperty("--mm-color-primary", theme.primary);
293
+ element.style.setProperty("--mm-color-secondary", theme.secondary);
294
+ element.style.setProperty("--mm-color-accent", theme.accent);
295
+ element.style.setProperty("--mm-color-background", theme.background);
296
+ }
297
+ function stringOr(value, fallback) {
298
+ return typeof value === "string" && value !== "" ? value : fallback;
299
+ }
300
+
301
+ // src/index.ts
302
+ var VERSION = "0.1.1";
303
+ export {
304
+ ConfigurationException,
305
+ CurrencyMismatchException,
306
+ DEFAULT_PATHS,
307
+ DEFAULT_THEME,
308
+ EN,
309
+ Emitter,
310
+ FR,
311
+ FrontendSdkException,
312
+ MerchantBackendException,
313
+ VERSION,
314
+ addDecimalStrings,
315
+ addMoney,
316
+ applyTheme,
317
+ assertSameCurrency,
318
+ createSession,
319
+ createTranslator,
320
+ extractCustomerName,
321
+ isMobileMoney,
322
+ isPhoneIdentifier,
323
+ isTerminalStatus,
324
+ joinUrl,
325
+ themeFromPreferences
326
+ };
package/package.json CHANGED
@@ -1,6 +1,34 @@
1
1
  {
2
2
  "name": "@mainmoneyapp/js-core",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.1",
4
+ "description": "Framework-agnostic core for the MainMoney JS/TS frontend SDK",
5
+ "type": "module",
6
+ "license": "MIT",
7
+ "author": "MainMoney SARL",
8
+ "homepage": "https://github.com/MainMoney-Inc/mm_aggr_js_sdk",
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git+https://github.com/MainMoney-Inc/mm_aggr_js_sdk.git",
12
+ "directory": "packages/core"
13
+ },
14
+ "bugs": {
15
+ "url": "https://github.com/MainMoney-Inc/mm_aggr_js_sdk/issues"
16
+ },
17
+ "keywords": ["mainmoney", "checkout", "payments"],
18
+ "main": "./dist/index.js",
19
+ "types": "./dist/index.d.ts",
20
+ "exports": {
21
+ ".": {
22
+ "types": "./dist/index.d.ts",
23
+ "import": "./dist/index.js"
24
+ }
25
+ },
26
+ "files": ["dist", "LICENSE", "README.md"],
27
+ "publishConfig": {
28
+ "access": "public"
29
+ },
30
+ "scripts": {
31
+ "build": "tsup src/index.ts --format esm --dts --clean",
32
+ "typecheck": "tsc --noEmit -p tsconfig.json"
33
+ }
34
+ }