@momorail/client 0.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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Momorail contributors
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.
@@ -0,0 +1,485 @@
1
+ import { Client } from 'openapi-fetch';
2
+
3
+ /**
4
+ * This file was auto-generated by openapi-typescript.
5
+ * Do not make direct changes to the file.
6
+ */
7
+ interface paths {
8
+ "/healthz": {
9
+ parameters: {
10
+ query?: never;
11
+ header?: never;
12
+ path?: never;
13
+ cookie?: never;
14
+ };
15
+ /** Liveness probe */
16
+ get: operations["getHealth"];
17
+ put?: never;
18
+ post?: never;
19
+ delete?: never;
20
+ options?: never;
21
+ head?: never;
22
+ patch?: never;
23
+ trace?: never;
24
+ };
25
+ "/v1/capabilities": {
26
+ parameters: {
27
+ query?: never;
28
+ header?: never;
29
+ path?: never;
30
+ cookie?: never;
31
+ };
32
+ /** Capabilities of the mounted provider(s) */
33
+ get: operations["listCapabilities"];
34
+ put?: never;
35
+ post?: never;
36
+ delete?: never;
37
+ options?: never;
38
+ head?: never;
39
+ patch?: never;
40
+ trace?: never;
41
+ };
42
+ "/v1/collections": {
43
+ parameters: {
44
+ query?: never;
45
+ header?: never;
46
+ path?: never;
47
+ cookie?: never;
48
+ };
49
+ get?: never;
50
+ put?: never;
51
+ /** Request a payment from a customer */
52
+ post: operations["createCollection"];
53
+ delete?: never;
54
+ options?: never;
55
+ head?: never;
56
+ patch?: never;
57
+ trace?: never;
58
+ };
59
+ "/v1/disbursements": {
60
+ parameters: {
61
+ query?: never;
62
+ header?: never;
63
+ path?: never;
64
+ cookie?: never;
65
+ };
66
+ get?: never;
67
+ put?: never;
68
+ /** Send a payment to a recipient */
69
+ post: operations["createDisbursement"];
70
+ delete?: never;
71
+ options?: never;
72
+ head?: never;
73
+ patch?: never;
74
+ trace?: never;
75
+ };
76
+ "/v1/transactions/{reference}": {
77
+ parameters: {
78
+ query?: never;
79
+ header?: never;
80
+ path?: never;
81
+ cookie?: never;
82
+ };
83
+ /** Get a transaction by caller reference */
84
+ get: operations["getTransaction"];
85
+ put?: never;
86
+ post?: never;
87
+ delete?: never;
88
+ options?: never;
89
+ head?: never;
90
+ patch?: never;
91
+ trace?: never;
92
+ };
93
+ "/v1/webhooks/{provider}": {
94
+ parameters: {
95
+ query?: never;
96
+ header?: never;
97
+ path?: never;
98
+ cookie?: never;
99
+ };
100
+ get?: never;
101
+ put?: never;
102
+ /**
103
+ * Receive a provider callback
104
+ * @description The gateway verifies the provider's signature over the raw body, then returns the normalised event. Authenticated by that signature, not by the gateway API key.
105
+ */
106
+ post: operations["receiveWebhook"];
107
+ delete?: never;
108
+ options?: never;
109
+ head?: never;
110
+ patch?: never;
111
+ trace?: never;
112
+ };
113
+ }
114
+ interface components {
115
+ schemas: {
116
+ /** @enum {string} */
117
+ Currency: "XOF" | "XAF" | "GHS" | "NGN";
118
+ /** @description Operator id scoped by country, e.g. `orange_ci`. */
119
+ Operator: string;
120
+ /** @enum {string} */
121
+ TransactionStatus: "pending" | "processing" | "succeeded" | "failed" | "cancelled" | "expired" | "unknown";
122
+ /** @enum {string} */
123
+ FailureReason: "insufficient_funds" | "invalid_number" | "user_declined" | "timeout" | "provider_error" | "limit_exceeded" | "duplicate_reference" | "other";
124
+ Money: {
125
+ /** @description Integer amount; a whole franc for XOF/XAF, the minor unit otherwise. */
126
+ amount: number;
127
+ currency: components["schemas"]["Currency"];
128
+ };
129
+ Party: {
130
+ /** @description E.164 phone number. */
131
+ phone: string;
132
+ operator?: components["schemas"]["Operator"];
133
+ firstName?: string;
134
+ lastName?: string;
135
+ /** Format: email */
136
+ email?: string;
137
+ };
138
+ CollectionRequest: {
139
+ amount: components["schemas"]["Money"];
140
+ customer: components["schemas"]["Party"];
141
+ reference: string;
142
+ description?: string;
143
+ /** Format: uri */
144
+ callbackUrl?: string;
145
+ /** Format: uri */
146
+ returnUrl?: string;
147
+ /** Format: uri */
148
+ cancelUrl?: string;
149
+ metadata?: {
150
+ [key: string]: string;
151
+ };
152
+ };
153
+ DisbursementRequest: {
154
+ amount: components["schemas"]["Money"];
155
+ recipient: components["schemas"]["Party"];
156
+ reference: string;
157
+ description?: string;
158
+ /** Format: uri */
159
+ callbackUrl?: string;
160
+ metadata?: {
161
+ [key: string]: string;
162
+ };
163
+ };
164
+ Transaction: {
165
+ provider: string;
166
+ id: string;
167
+ reference: string;
168
+ /** @enum {string} */
169
+ type: "collection" | "disbursement";
170
+ status: components["schemas"]["TransactionStatus"];
171
+ amount: components["schemas"]["Money"];
172
+ fees?: components["schemas"]["Money"];
173
+ operator?: components["schemas"]["Operator"];
174
+ customer?: components["schemas"]["Party"];
175
+ /**
176
+ * Format: uri
177
+ * @description Present when the customer must be redirected to a hosted page.
178
+ */
179
+ checkoutUrl?: string;
180
+ failureReason?: components["schemas"]["FailureReason"];
181
+ /** @description The untouched provider payload. */
182
+ providerRaw: unknown;
183
+ /** Format: date-time */
184
+ createdAt: string;
185
+ /** Format: date-time */
186
+ updatedAt: string;
187
+ };
188
+ WebhookEvent: {
189
+ /** @enum {string} */
190
+ type: "transaction.succeeded" | "transaction.failed" | "transaction.pending" | "transaction.cancelled" | "transaction.expired" | "unknown";
191
+ transaction: components["schemas"]["Transaction"];
192
+ /** @description The untouched provider payload. */
193
+ providerRaw: unknown;
194
+ };
195
+ Capabilities: {
196
+ provider: string;
197
+ collection: boolean;
198
+ disbursement: boolean;
199
+ lookupByReference: boolean;
200
+ hostedCheckout: boolean;
201
+ operators: components["schemas"]["Operator"][];
202
+ currencies: components["schemas"]["Currency"][];
203
+ };
204
+ Error: {
205
+ error: {
206
+ code: string;
207
+ message: string;
208
+ provider?: string;
209
+ retryable: boolean;
210
+ };
211
+ };
212
+ };
213
+ responses: {
214
+ /** @description A transaction snapshot. */
215
+ TransactionResponse: {
216
+ headers: {
217
+ [name: string]: unknown;
218
+ };
219
+ content: {
220
+ "application/json": components["schemas"]["Transaction"];
221
+ };
222
+ };
223
+ /** @description The request failed validation. */
224
+ BadRequest: {
225
+ headers: {
226
+ [name: string]: unknown;
227
+ };
228
+ content: {
229
+ "application/json": components["schemas"]["Error"];
230
+ };
231
+ };
232
+ /** @description Missing or invalid gateway API key. */
233
+ Unauthorized: {
234
+ headers: {
235
+ [name: string]: unknown;
236
+ };
237
+ content: {
238
+ "application/json": components["schemas"]["Error"];
239
+ };
240
+ };
241
+ /** @description No such transaction or provider. */
242
+ NotFound: {
243
+ headers: {
244
+ [name: string]: unknown;
245
+ };
246
+ content: {
247
+ "application/json": components["schemas"]["Error"];
248
+ };
249
+ };
250
+ /** @description The upstream provider throttled the request; retry later. */
251
+ RateLimited: {
252
+ headers: {
253
+ [name: string]: unknown;
254
+ };
255
+ content: {
256
+ "application/json": components["schemas"]["Error"];
257
+ };
258
+ };
259
+ /** @description The upstream provider returned an error. */
260
+ ProviderError: {
261
+ headers: {
262
+ [name: string]: unknown;
263
+ };
264
+ content: {
265
+ "application/json": components["schemas"]["Error"];
266
+ };
267
+ };
268
+ /** @description The upstream provider is unreachable or down. */
269
+ ProviderUnavailable: {
270
+ headers: {
271
+ [name: string]: unknown;
272
+ };
273
+ content: {
274
+ "application/json": components["schemas"]["Error"];
275
+ };
276
+ };
277
+ /** @description Unexpected gateway error. */
278
+ InternalError: {
279
+ headers: {
280
+ [name: string]: unknown;
281
+ };
282
+ content: {
283
+ "application/json": components["schemas"]["Error"];
284
+ };
285
+ };
286
+ };
287
+ parameters: never;
288
+ requestBodies: never;
289
+ headers: never;
290
+ pathItems: never;
291
+ }
292
+ interface operations {
293
+ getHealth: {
294
+ parameters: {
295
+ query?: never;
296
+ header?: never;
297
+ path?: never;
298
+ cookie?: never;
299
+ };
300
+ requestBody?: never;
301
+ responses: {
302
+ /** @description The gateway is up. */
303
+ 200: {
304
+ headers: {
305
+ [name: string]: unknown;
306
+ };
307
+ content: {
308
+ "application/json": {
309
+ /** @constant */
310
+ status: "ok";
311
+ };
312
+ };
313
+ };
314
+ 500: components["responses"]["InternalError"];
315
+ };
316
+ };
317
+ listCapabilities: {
318
+ parameters: {
319
+ query?: never;
320
+ header?: never;
321
+ path?: never;
322
+ cookie?: never;
323
+ };
324
+ requestBody?: never;
325
+ responses: {
326
+ /** @description One entry per configured provider. */
327
+ 200: {
328
+ headers: {
329
+ [name: string]: unknown;
330
+ };
331
+ content: {
332
+ "application/json": components["schemas"]["Capabilities"][];
333
+ };
334
+ };
335
+ 401: components["responses"]["Unauthorized"];
336
+ 500: components["responses"]["InternalError"];
337
+ };
338
+ };
339
+ createCollection: {
340
+ parameters: {
341
+ query?: never;
342
+ header?: never;
343
+ path?: never;
344
+ cookie?: never;
345
+ };
346
+ requestBody: {
347
+ content: {
348
+ "application/json": components["schemas"]["CollectionRequest"];
349
+ };
350
+ };
351
+ responses: {
352
+ 201: components["responses"]["TransactionResponse"];
353
+ 400: components["responses"]["BadRequest"];
354
+ 401: components["responses"]["Unauthorized"];
355
+ 429: components["responses"]["RateLimited"];
356
+ 502: components["responses"]["ProviderError"];
357
+ 503: components["responses"]["ProviderUnavailable"];
358
+ };
359
+ };
360
+ createDisbursement: {
361
+ parameters: {
362
+ query?: never;
363
+ header?: never;
364
+ path?: never;
365
+ cookie?: never;
366
+ };
367
+ requestBody: {
368
+ content: {
369
+ "application/json": components["schemas"]["DisbursementRequest"];
370
+ };
371
+ };
372
+ responses: {
373
+ 201: components["responses"]["TransactionResponse"];
374
+ 400: components["responses"]["BadRequest"];
375
+ 401: components["responses"]["Unauthorized"];
376
+ 429: components["responses"]["RateLimited"];
377
+ /** @description The mounted provider does not support disbursement. */
378
+ 501: {
379
+ headers: {
380
+ [name: string]: unknown;
381
+ };
382
+ content: {
383
+ "application/json": components["schemas"]["Error"];
384
+ };
385
+ };
386
+ 502: components["responses"]["ProviderError"];
387
+ 503: components["responses"]["ProviderUnavailable"];
388
+ };
389
+ };
390
+ getTransaction: {
391
+ parameters: {
392
+ query?: never;
393
+ header?: never;
394
+ path: {
395
+ /** @description The caller-supplied reference used when the transaction was created. */
396
+ reference: string;
397
+ };
398
+ cookie?: never;
399
+ };
400
+ requestBody?: never;
401
+ responses: {
402
+ 200: components["responses"]["TransactionResponse"];
403
+ 400: components["responses"]["BadRequest"];
404
+ 401: components["responses"]["Unauthorized"];
405
+ 404: components["responses"]["NotFound"];
406
+ 502: components["responses"]["ProviderError"];
407
+ 503: components["responses"]["ProviderUnavailable"];
408
+ };
409
+ };
410
+ receiveWebhook: {
411
+ parameters: {
412
+ query?: never;
413
+ header?: never;
414
+ path: {
415
+ /** @description Adapter id, e.g. `cinetpay`. */
416
+ provider: string;
417
+ };
418
+ cookie?: never;
419
+ };
420
+ requestBody: {
421
+ content: {
422
+ "application/json": {
423
+ [key: string]: unknown;
424
+ };
425
+ "application/x-www-form-urlencoded": {
426
+ [key: string]: unknown;
427
+ };
428
+ };
429
+ };
430
+ responses: {
431
+ /** @description The verified, normalised event. */
432
+ 200: {
433
+ headers: {
434
+ [name: string]: unknown;
435
+ };
436
+ content: {
437
+ "application/json": components["schemas"]["WebhookEvent"];
438
+ };
439
+ };
440
+ 400: components["responses"]["BadRequest"];
441
+ 404: components["responses"]["NotFound"];
442
+ 500: components["responses"]["InternalError"];
443
+ };
444
+ };
445
+ }
446
+
447
+ type Schemas = components['schemas'];
448
+ type Transaction = Schemas['Transaction'];
449
+ type CollectionRequest = Schemas['CollectionRequest'];
450
+ type DisbursementRequest = Schemas['DisbursementRequest'];
451
+ type WebhookEvent = Schemas['WebhookEvent'];
452
+ type Capabilities = Schemas['Capabilities'];
453
+ type GatewayErrorBody = Schemas['Error'];
454
+ interface MomorailClientOptions {
455
+ /** Base URL of the running gateway, e.g. `http://localhost:8080`. */
456
+ baseUrl: string;
457
+ /** The gateway's static API key. */
458
+ apiKey: string;
459
+ /** Override the fetch implementation (tests, proxies). */
460
+ fetch?: typeof fetch;
461
+ }
462
+ type MomorailHttpClient = Client<paths>;
463
+ /** A raw `openapi-fetch` client typed against the gateway spec. */
464
+ declare function createMomorailClient(options: MomorailClientOptions): MomorailHttpClient;
465
+ /** Thrown when the gateway returns a non-2xx response. */
466
+ declare class MomorailGatewayError extends Error {
467
+ readonly status: number;
468
+ readonly code: string;
469
+ readonly provider: string | undefined;
470
+ readonly retryable: boolean;
471
+ constructor(status: number, body: GatewayErrorBody | undefined);
472
+ }
473
+ /** Ergonomic wrapper with one method per gateway operation. */
474
+ declare class Momorail {
475
+ #private;
476
+ constructor(options: MomorailClientOptions);
477
+ /** The underlying typed `openapi-fetch` client, for calls this wrapper doesn't cover. */
478
+ get http(): MomorailHttpClient;
479
+ createCollection(body: CollectionRequest): Promise<Transaction>;
480
+ createDisbursement(body: DisbursementRequest): Promise<Transaction>;
481
+ getTransaction(reference: string): Promise<Transaction>;
482
+ capabilities(): Promise<Capabilities[]>;
483
+ }
484
+
485
+ export { type Capabilities, type CollectionRequest, type DisbursementRequest, type GatewayErrorBody, Momorail, type MomorailClientOptions, MomorailGatewayError, type MomorailHttpClient, type Transaction, type WebhookEvent, type components, createMomorailClient, type operations, type paths };
package/dist/index.js ADDED
@@ -0,0 +1,62 @@
1
+ // src/index.ts
2
+ import createClient from "openapi-fetch";
3
+ function createMomorailClient(options) {
4
+ return createClient({
5
+ baseUrl: options.baseUrl.replace(/\/$/, ""),
6
+ headers: { Authorization: `Bearer ${options.apiKey}` },
7
+ ...options.fetch ? { fetch: options.fetch } : {}
8
+ });
9
+ }
10
+ var MomorailGatewayError = class extends Error {
11
+ status;
12
+ code;
13
+ provider;
14
+ retryable;
15
+ constructor(status, body) {
16
+ const detail = body?.error;
17
+ super(detail?.message ?? `Gateway responded ${status}`);
18
+ this.name = "MomorailGatewayError";
19
+ this.status = status;
20
+ this.code = detail?.code ?? "gateway_error";
21
+ this.provider = detail?.provider;
22
+ this.retryable = detail?.retryable ?? false;
23
+ }
24
+ };
25
+ var Momorail = class {
26
+ #http;
27
+ constructor(options) {
28
+ this.#http = createMomorailClient(options);
29
+ }
30
+ /** The underlying typed `openapi-fetch` client, for calls this wrapper doesn't cover. */
31
+ get http() {
32
+ return this.#http;
33
+ }
34
+ async createCollection(body) {
35
+ const { data, error, response } = await this.#http.POST("/v1/collections", { body });
36
+ if (error || !data) throw new MomorailGatewayError(response.status, error);
37
+ return data;
38
+ }
39
+ async createDisbursement(body) {
40
+ const { data, error, response } = await this.#http.POST("/v1/disbursements", { body });
41
+ if (error || !data) throw new MomorailGatewayError(response.status, error);
42
+ return data;
43
+ }
44
+ async getTransaction(reference) {
45
+ const { data, error, response } = await this.#http.GET("/v1/transactions/{reference}", {
46
+ params: { path: { reference } }
47
+ });
48
+ if (error || !data) throw new MomorailGatewayError(response.status, error);
49
+ return data;
50
+ }
51
+ async capabilities() {
52
+ const { data, error, response } = await this.#http.GET("/v1/capabilities");
53
+ if (error || !data) throw new MomorailGatewayError(response.status, error);
54
+ return data;
55
+ }
56
+ };
57
+ export {
58
+ Momorail,
59
+ MomorailGatewayError,
60
+ createMomorailClient
61
+ };
62
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["import createClient, { type Client } from 'openapi-fetch';\nimport type { components, paths } from './schema.js';\n\nexport type { components, operations, paths } from './schema.js';\n\ntype Schemas = components['schemas'];\nexport type Transaction = Schemas['Transaction'];\nexport type CollectionRequest = Schemas['CollectionRequest'];\nexport type DisbursementRequest = Schemas['DisbursementRequest'];\nexport type WebhookEvent = Schemas['WebhookEvent'];\nexport type Capabilities = Schemas['Capabilities'];\nexport type GatewayErrorBody = Schemas['Error'];\n\nexport interface MomorailClientOptions {\n /** Base URL of the running gateway, e.g. `http://localhost:8080`. */\n baseUrl: string;\n /** The gateway's static API key. */\n apiKey: string;\n /** Override the fetch implementation (tests, proxies). */\n fetch?: typeof fetch;\n}\n\nexport type MomorailHttpClient = Client<paths>;\n\n/** A raw `openapi-fetch` client typed against the gateway spec. */\nexport function createMomorailClient(options: MomorailClientOptions): MomorailHttpClient {\n return createClient<paths>({\n baseUrl: options.baseUrl.replace(/\\/$/, ''),\n headers: { Authorization: `Bearer ${options.apiKey}` },\n ...(options.fetch ? { fetch: options.fetch } : {}),\n });\n}\n\n/** Thrown when the gateway returns a non-2xx response. */\nexport class MomorailGatewayError extends Error {\n readonly status: number;\n readonly code: string;\n readonly provider: string | undefined;\n readonly retryable: boolean;\n\n constructor(status: number, body: GatewayErrorBody | undefined) {\n const detail = body?.error;\n super(detail?.message ?? `Gateway responded ${status}`);\n this.name = 'MomorailGatewayError';\n this.status = status;\n this.code = detail?.code ?? 'gateway_error';\n this.provider = detail?.provider;\n this.retryable = detail?.retryable ?? false;\n }\n}\n\n/** Ergonomic wrapper with one method per gateway operation. */\nexport class Momorail {\n readonly #http: MomorailHttpClient;\n\n constructor(options: MomorailClientOptions) {\n this.#http = createMomorailClient(options);\n }\n\n /** The underlying typed `openapi-fetch` client, for calls this wrapper doesn't cover. */\n get http(): MomorailHttpClient {\n return this.#http;\n }\n\n async createCollection(body: CollectionRequest): Promise<Transaction> {\n const { data, error, response } = await this.#http.POST('/v1/collections', { body });\n if (error || !data) throw new MomorailGatewayError(response.status, error as GatewayErrorBody);\n return data;\n }\n\n async createDisbursement(body: DisbursementRequest): Promise<Transaction> {\n const { data, error, response } = await this.#http.POST('/v1/disbursements', { body });\n if (error || !data) throw new MomorailGatewayError(response.status, error as GatewayErrorBody);\n return data;\n }\n\n async getTransaction(reference: string): Promise<Transaction> {\n const { data, error, response } = await this.#http.GET('/v1/transactions/{reference}', {\n params: { path: { reference } },\n });\n if (error || !data) throw new MomorailGatewayError(response.status, error as GatewayErrorBody);\n return data;\n }\n\n async capabilities(): Promise<Capabilities[]> {\n const { data, error, response } = await this.#http.GET('/v1/capabilities');\n if (error || !data) throw new MomorailGatewayError(response.status, error as GatewayErrorBody);\n return data;\n }\n}\n"],"mappings":";AAAA,OAAO,kBAAmC;AAyBnC,SAAS,qBAAqB,SAAoD;AACvF,SAAO,aAAoB;AAAA,IACzB,SAAS,QAAQ,QAAQ,QAAQ,OAAO,EAAE;AAAA,IAC1C,SAAS,EAAE,eAAe,UAAU,QAAQ,MAAM,GAAG;AAAA,IACrD,GAAI,QAAQ,QAAQ,EAAE,OAAO,QAAQ,MAAM,IAAI,CAAC;AAAA,EAClD,CAAC;AACH;AAGO,IAAM,uBAAN,cAAmC,MAAM;AAAA,EACrC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAET,YAAY,QAAgB,MAAoC;AAC9D,UAAM,SAAS,MAAM;AACrB,UAAM,QAAQ,WAAW,qBAAqB,MAAM,EAAE;AACtD,SAAK,OAAO;AACZ,SAAK,SAAS;AACd,SAAK,OAAO,QAAQ,QAAQ;AAC5B,SAAK,WAAW,QAAQ;AACxB,SAAK,YAAY,QAAQ,aAAa;AAAA,EACxC;AACF;AAGO,IAAM,WAAN,MAAe;AAAA,EACX;AAAA,EAET,YAAY,SAAgC;AAC1C,SAAK,QAAQ,qBAAqB,OAAO;AAAA,EAC3C;AAAA;AAAA,EAGA,IAAI,OAA2B;AAC7B,WAAO,KAAK;AAAA,EACd;AAAA,EAEA,MAAM,iBAAiB,MAA+C;AACpE,UAAM,EAAE,MAAM,OAAO,SAAS,IAAI,MAAM,KAAK,MAAM,KAAK,mBAAmB,EAAE,KAAK,CAAC;AACnF,QAAI,SAAS,CAAC,KAAM,OAAM,IAAI,qBAAqB,SAAS,QAAQ,KAAyB;AAC7F,WAAO;AAAA,EACT;AAAA,EAEA,MAAM,mBAAmB,MAAiD;AACxE,UAAM,EAAE,MAAM,OAAO,SAAS,IAAI,MAAM,KAAK,MAAM,KAAK,qBAAqB,EAAE,KAAK,CAAC;AACrF,QAAI,SAAS,CAAC,KAAM,OAAM,IAAI,qBAAqB,SAAS,QAAQ,KAAyB;AAC7F,WAAO;AAAA,EACT;AAAA,EAEA,MAAM,eAAe,WAAyC;AAC5D,UAAM,EAAE,MAAM,OAAO,SAAS,IAAI,MAAM,KAAK,MAAM,IAAI,gCAAgC;AAAA,MACrF,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE;AAAA,IAChC,CAAC;AACD,QAAI,SAAS,CAAC,KAAM,OAAM,IAAI,qBAAqB,SAAS,QAAQ,KAAyB;AAC7F,WAAO;AAAA,EACT;AAAA,EAEA,MAAM,eAAwC;AAC5C,UAAM,EAAE,MAAM,OAAO,SAAS,IAAI,MAAM,KAAK,MAAM,IAAI,kBAAkB;AACzE,QAAI,SAAS,CAAC,KAAM,OAAM,IAAI,qBAAqB,SAAS,QAAQ,KAAyB;AAC7F,WAAO;AAAA,EACT;AACF;","names":[]}
package/package.json ADDED
@@ -0,0 +1,60 @@
1
+ {
2
+ "name": "@momorail/client",
3
+ "version": "0.1.0",
4
+ "type": "module",
5
+ "description": "Typed TypeScript client for the Momorail gateway, generated from its OpenAPI spec",
6
+ "keywords": [
7
+ "mobile-money",
8
+ "payments",
9
+ "west-africa",
10
+ "africa",
11
+ "orange-money",
12
+ "mtn-momo",
13
+ "wave",
14
+ "xof",
15
+ "byo-keys",
16
+ "typescript",
17
+ "client"
18
+ ],
19
+ "license": "MIT",
20
+ "author": "Boukymen <boukymen@gmail.com>",
21
+ "repository": {
22
+ "type": "git",
23
+ "url": "git+https://github.com/Boukymen/momorail.git",
24
+ "directory": "packages/client"
25
+ },
26
+ "homepage": "https://github.com/Boukymen/momorail/tree/main/packages/client#readme",
27
+ "bugs": "https://github.com/Boukymen/momorail/issues",
28
+ "main": "./dist/index.js",
29
+ "types": "./dist/index.d.ts",
30
+ "exports": {
31
+ ".": {
32
+ "types": "./dist/index.d.ts",
33
+ "import": "./dist/index.js"
34
+ }
35
+ },
36
+ "files": [
37
+ "dist"
38
+ ],
39
+ "publishConfig": {
40
+ "access": "public"
41
+ },
42
+ "dependencies": {
43
+ "openapi-fetch": "^0.13.5"
44
+ },
45
+ "devDependencies": {
46
+ "openapi-typescript": "^7.5.0",
47
+ "tsup": "^8.3.5",
48
+ "typescript": "^5.7.2",
49
+ "vitest": "^2.1.8",
50
+ "@momorail/mock": "0.1.0",
51
+ "@momorail/gateway": "0.1.0",
52
+ "@momorail/core": "0.1.0"
53
+ },
54
+ "scripts": {
55
+ "generate": "openapi-typescript ../../openapi/gateway.yaml --output src/schema.ts",
56
+ "build": "tsup",
57
+ "typecheck": "tsc --noEmit",
58
+ "test": "vitest run"
59
+ }
60
+ }