@keytd/manat 0.2.0 → 0.2.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/dist/index.cjs CHANGED
@@ -28,6 +28,7 @@ __export(index_exports, {
28
28
  Manat: () => Manat,
29
29
  ManatError: () => ManatError,
30
30
  PayriffProvider: () => PayriffProvider,
31
+ VERSION: () => VERSION,
31
32
  YigimProvider: () => YigimProvider,
32
33
  azericard: () => azericard,
33
34
  azn: () => azn,
@@ -159,6 +160,10 @@ function assertUrl(value, field) {
159
160
  }
160
161
  }
161
162
 
163
+ // src/version.ts
164
+ var VERSION = "0.2.1";
165
+ var USER_AGENT = `keytd-manat/${VERSION} (node; +https://github.com/KeyTechAndDesign/manat)`;
166
+
162
167
  // src/http.ts
163
168
  var HttpClient = class {
164
169
  constructor(provider, options = {}) {
@@ -172,7 +177,7 @@ var HttpClient = class {
172
177
  fetchImpl;
173
178
  timeoutMs;
174
179
  async send(request) {
175
- const headers = { ...request.headers };
180
+ const headers = { "user-agent": USER_AGENT, ...request.headers };
176
181
  let body;
177
182
  if (request.body instanceof URLSearchParams) {
178
183
  body = request.body.toString();
@@ -1344,6 +1349,7 @@ function pickBody3(body, key) {
1344
1349
  Manat,
1345
1350
  ManatError,
1346
1351
  PayriffProvider,
1352
+ VERSION,
1347
1353
  YigimProvider,
1348
1354
  azericard,
1349
1355
  azn,
package/dist/index.d.cts CHANGED
@@ -118,6 +118,8 @@ declare class Manat {
118
118
  private call;
119
119
  }
120
120
 
121
+ declare const VERSION = "0.2.1";
122
+
121
123
  type ManatErrorCode = 'invalid_request' | 'invalid_signature' | 'provider_error' | 'network_error' | 'unsupported_operation';
122
124
  declare class ManatError extends Error {
123
125
  readonly code: ManatErrorCode;
@@ -348,4 +350,4 @@ declare class YigimProvider implements PaymentProvider {
348
350
  }
349
351
  declare function yigim(config: YigimConfig, options?: HttpOptions): YigimProvider;
350
352
 
351
- export { AZERICARD_MAC_FIELDS, type AzericardConfig, type AzericardMessage, AzericardProvider, type Capability, type CreatePaymentRequest, type CreatePaymentResult, type Currency, type EpointConfig, EpointProvider, type FetchLike, type GoldenPayConfig, GoldenPayProvider, type HttpOptions, type IncomingCallback, type KapitalBankConfig, KapitalBankProvider, type Language, Manat, ManatError, type ManatErrorCode, type Money, type NextAction, type PaymentAction, type PaymentEvent, type PaymentProvider, type PaymentState, type PaymentStatus, type PayriffConfig, PayriffProvider, type RefundRequest, type RefundResult, type YigimConfig, YigimProvider, azericard, azn, epoint, fromDecimal, goldenPay, isManatError, kapitalBank, payriff, toDecimalString, yigim };
353
+ export { AZERICARD_MAC_FIELDS, type AzericardConfig, type AzericardMessage, AzericardProvider, type Capability, type CreatePaymentRequest, type CreatePaymentResult, type Currency, type EpointConfig, EpointProvider, type FetchLike, type GoldenPayConfig, GoldenPayProvider, type HttpOptions, type IncomingCallback, type KapitalBankConfig, KapitalBankProvider, type Language, Manat, ManatError, type ManatErrorCode, type Money, type NextAction, type PaymentAction, type PaymentEvent, type PaymentProvider, type PaymentState, type PaymentStatus, type PayriffConfig, PayriffProvider, type RefundRequest, type RefundResult, VERSION, type YigimConfig, YigimProvider, azericard, azn, epoint, fromDecimal, goldenPay, isManatError, kapitalBank, payriff, toDecimalString, yigim };
package/dist/index.d.ts CHANGED
@@ -118,6 +118,8 @@ declare class Manat {
118
118
  private call;
119
119
  }
120
120
 
121
+ declare const VERSION = "0.2.1";
122
+
121
123
  type ManatErrorCode = 'invalid_request' | 'invalid_signature' | 'provider_error' | 'network_error' | 'unsupported_operation';
122
124
  declare class ManatError extends Error {
123
125
  readonly code: ManatErrorCode;
@@ -348,4 +350,4 @@ declare class YigimProvider implements PaymentProvider {
348
350
  }
349
351
  declare function yigim(config: YigimConfig, options?: HttpOptions): YigimProvider;
350
352
 
351
- export { AZERICARD_MAC_FIELDS, type AzericardConfig, type AzericardMessage, AzericardProvider, type Capability, type CreatePaymentRequest, type CreatePaymentResult, type Currency, type EpointConfig, EpointProvider, type FetchLike, type GoldenPayConfig, GoldenPayProvider, type HttpOptions, type IncomingCallback, type KapitalBankConfig, KapitalBankProvider, type Language, Manat, ManatError, type ManatErrorCode, type Money, type NextAction, type PaymentAction, type PaymentEvent, type PaymentProvider, type PaymentState, type PaymentStatus, type PayriffConfig, PayriffProvider, type RefundRequest, type RefundResult, type YigimConfig, YigimProvider, azericard, azn, epoint, fromDecimal, goldenPay, isManatError, kapitalBank, payriff, toDecimalString, yigim };
353
+ export { AZERICARD_MAC_FIELDS, type AzericardConfig, type AzericardMessage, AzericardProvider, type Capability, type CreatePaymentRequest, type CreatePaymentResult, type Currency, type EpointConfig, EpointProvider, type FetchLike, type GoldenPayConfig, GoldenPayProvider, type HttpOptions, type IncomingCallback, type KapitalBankConfig, KapitalBankProvider, type Language, Manat, ManatError, type ManatErrorCode, type Money, type NextAction, type PaymentAction, type PaymentEvent, type PaymentProvider, type PaymentState, type PaymentStatus, type PayriffConfig, PayriffProvider, type RefundRequest, type RefundResult, VERSION, type YigimConfig, YigimProvider, azericard, azn, epoint, fromDecimal, goldenPay, isManatError, kapitalBank, payriff, toDecimalString, yigim };
package/dist/index.js CHANGED
@@ -115,6 +115,10 @@ function assertUrl(value, field) {
115
115
  }
116
116
  }
117
117
 
118
+ // src/version.ts
119
+ var VERSION = "0.2.1";
120
+ var USER_AGENT = `keytd-manat/${VERSION} (node; +https://github.com/KeyTechAndDesign/manat)`;
121
+
118
122
  // src/http.ts
119
123
  var HttpClient = class {
120
124
  constructor(provider, options = {}) {
@@ -128,7 +132,7 @@ var HttpClient = class {
128
132
  fetchImpl;
129
133
  timeoutMs;
130
134
  async send(request) {
131
- const headers = { ...request.headers };
135
+ const headers = { "user-agent": USER_AGENT, ...request.headers };
132
136
  let body;
133
137
  if (request.body instanceof URLSearchParams) {
134
138
  body = request.body.toString();
@@ -1299,6 +1303,7 @@ export {
1299
1303
  Manat,
1300
1304
  ManatError,
1301
1305
  PayriffProvider,
1306
+ VERSION,
1302
1307
  YigimProvider,
1303
1308
  azericard,
1304
1309
  azn,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@keytd/manat",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "One API for Azerbaijani online payment providers.",
5
5
  "license": "MIT",
6
6
  "author": "KeyTD <info@keytd.com>",