@uveysservetoglu/kobil-core 1.0.0 → 2.0.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/README.md +30 -2
- package/dist/credentials.d.ts +23 -2
- package/dist/credentials.d.ts.map +1 -1
- package/dist/credentials.js +47 -6
- package/dist/credentials.js.map +1 -1
- package/dist/endpoints.d.ts +25 -0
- package/dist/endpoints.d.ts.map +1 -0
- package/dist/endpoints.js +43 -0
- package/dist/endpoints.js.map +1 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -10,12 +10,40 @@ You normally don't use this directly — the module packages depend on it. It pr
|
|
|
10
10
|
- **`KobilError`** — base error all module errors extend (`statusCode`, `responseBody`).
|
|
11
11
|
- **`KobilServiceClient`** — HTTP base for typed clients (bearer + send + error wrapping,
|
|
12
12
|
JSON / arbitrary-body / binary-download helpers).
|
|
13
|
-
- **`credentialsFromEnv`** —
|
|
14
|
-
|
|
13
|
+
- **`credentialsFromEnv`** — builds credentials from the environment (below).
|
|
14
|
+
- **Endpoint helpers** — `tokenEndpointFor`, `authorizationEndpointFor`, `mpowerUserEndpoint`,
|
|
15
|
+
`mpowerMediaDownloadEndpoint`, `paymentTransactionEndpoint`: the fixed paths each service sits at
|
|
16
|
+
under its base URL, so the environment names a base and the SDK builds the rest.
|
|
15
17
|
|
|
16
18
|
Works from both TypeScript and JavaScript (ships compiled JS + `.d.ts`). Requires Node 18+
|
|
17
19
|
(global `fetch`).
|
|
18
20
|
|
|
21
|
+
## Environment
|
|
22
|
+
|
|
23
|
+
These are the names the SuperApp emulator publishes at `/__superapp/control/env`, so an app
|
|
24
|
+
configured for the emulator needs no separate mapping — only the values change between the emulator
|
|
25
|
+
and production.
|
|
26
|
+
|
|
27
|
+
| Variable | Used by | Meaning |
|
|
28
|
+
|---|---|---|
|
|
29
|
+
| `OIDC_ISSUER` | all | Realm issuer URL. The token and authorization endpoints are derived from it. |
|
|
30
|
+
| `OIDC_CLIENT_ID` | all | MiniApp client id (also the default `serviceUuid`). |
|
|
31
|
+
| `OIDC_CLIENT_SECRET` | all | MiniApp client secret. |
|
|
32
|
+
| `OIDC_TOKEN_AUTH_MODE` | all | `post` (default) or `basic`. |
|
|
33
|
+
| `MPOWER_BASE` | chat, sign | mPower origin. The per-user and media paths are derived from it. |
|
|
34
|
+
| `MPOWER_TENANT` | chat, sign | Tenant/realm substituted for `{TENANT}`. |
|
|
35
|
+
| `PAYMENT_BASE` | payment | Payment origin. The transaction path is derived from it. |
|
|
36
|
+
| `PAYMENT_MERCHANT_ID` | payment | Merchant **client id** — payment authenticates as its own client. |
|
|
37
|
+
| `PAYMENT_MERCHANT_SECRET` | payment | Merchant client secret. |
|
|
38
|
+
| `PAYMENT_TENANT_ID` | payment | Payment tenant — a different tenant from mPower's. |
|
|
39
|
+
| `PAYMENT_MERCHANT_NAME` | payment | Merchant name shown to the payer. |
|
|
40
|
+
|
|
41
|
+
Endpoints are derived rather than configured because the issuer is the one fact a deployment
|
|
42
|
+
actually has: the previous scheme asked for a full token URL here and a second one in the auth
|
|
43
|
+
module, which is the same server described twice under two names. `OIDC_TOKEN_ENDPOINT` and
|
|
44
|
+
`OIDC_AUTHORIZATION_ENDPOINT` remain as explicit overrides for deployments whose paths are not the
|
|
45
|
+
standard ones.
|
|
46
|
+
|
|
19
47
|
## License
|
|
20
48
|
|
|
21
49
|
MIT
|
package/dist/credentials.d.ts
CHANGED
|
@@ -15,9 +15,30 @@ export interface KobilCredentials {
|
|
|
15
15
|
/** Safety margin (seconds) subtracted from token lifetime before refresh. Default: 20. */
|
|
16
16
|
tokenExpirySkewSeconds?: number;
|
|
17
17
|
}
|
|
18
|
+
/** The OAuth2 token endpoint of an OIDC issuer. */
|
|
19
|
+
export declare function tokenEndpointFor(issuer: string): string;
|
|
20
|
+
/** The authorization endpoint of an OIDC issuer — where a person is sent to log in. */
|
|
21
|
+
export declare function authorizationEndpointFor(issuer: string): string;
|
|
18
22
|
/**
|
|
19
|
-
* Builds credentials from
|
|
20
|
-
*
|
|
23
|
+
* Builds credentials from the environment, with optional overrides (undefined/empty override values
|
|
24
|
+
* are ignored, so the environment still supplies those).
|
|
25
|
+
*
|
|
26
|
+
* | Variable | Meaning |
|
|
27
|
+
* |---|---|
|
|
28
|
+
* | `OIDC_ISSUER` | Realm issuer URL. The token endpoint is derived from it. |
|
|
29
|
+
* | `OIDC_CLIENT_ID` | Client id. |
|
|
30
|
+
* | `OIDC_CLIENT_SECRET` | Client secret. |
|
|
31
|
+
* | `OIDC_TOKEN_AUTH_MODE` | `post` (default) or `basic`. |
|
|
32
|
+
* | `OIDC_TOKEN_ENDPOINT` | Full token URL. Only needed when it is not at the standard path. |
|
|
33
|
+
*
|
|
34
|
+
* These are the names the SuperApp emulator publishes at `/__superapp/control/env`, so an app
|
|
35
|
+
* configured for the emulator needs no separate mapping — and the values are the only thing that
|
|
36
|
+
* changes between the emulator and production.
|
|
37
|
+
*
|
|
38
|
+
* The endpoint is derived rather than configured because the issuer is the one fact a deployment
|
|
39
|
+
* actually has: the previous scheme asked for `KOBIL_TOKEN_ENDPOINT` here and `OTOKEN_URL` in the auth
|
|
40
|
+
* module, which is the same server described twice under two names, and they could disagree.
|
|
41
|
+
* `OIDC_TOKEN_ENDPOINT` remains for deployments whose paths are not Keycloak's standard ones.
|
|
21
42
|
*/
|
|
22
43
|
export declare function credentialsFromEnv(overrides?: Partial<KobilCredentials>): KobilCredentials;
|
|
23
44
|
//# sourceMappingURL=credentials.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credentials.d.ts","sourceRoot":"","sources":["../src/credentials.ts"],"names":[],"mappings":"AAAA,yEAAyE;AACzE,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,OAAO,CAAC;AAE7C;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,uEAAuE;IACvE,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,8FAA8F;IAC9F,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,0FAA0F;IAC1F,sBAAsB,CAAC,EAAE,MAAM,CAAC;CACjC;AAED
|
|
1
|
+
{"version":3,"file":"credentials.d.ts","sourceRoot":"","sources":["../src/credentials.ts"],"names":[],"mappings":"AAAA,yEAAyE;AACzE,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,OAAO,CAAC;AAE7C;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,uEAAuE;IACvE,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,8FAA8F;IAC9F,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,0FAA0F;IAC1F,sBAAsB,CAAC,EAAE,MAAM,CAAC;CACjC;AAkBD,mDAAmD;AACnD,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAEvD;AAED,uFAAuF;AACvF,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAE/D;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,GAAE,OAAO,CAAC,gBAAgB,CAAM,GAAG,gBAAgB,CAc9F"}
|
package/dist/credentials.js
CHANGED
|
@@ -1,16 +1,57 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.tokenEndpointFor = tokenEndpointFor;
|
|
4
|
+
exports.authorizationEndpointFor = authorizationEndpointFor;
|
|
3
5
|
exports.credentialsFromEnv = credentialsFromEnv;
|
|
4
6
|
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
+
* Keycloak's standard endpoint paths under a realm issuer.
|
|
8
|
+
*
|
|
9
|
+
* The identity provider is Keycloak in every deployment these modules target, and it publishes both
|
|
10
|
+
* endpoints at fixed paths under the realm's issuer URL. Naming the issuer once is therefore enough —
|
|
11
|
+
* see {@link credentialsFromEnv}.
|
|
12
|
+
*/
|
|
13
|
+
const TOKEN_PATH = "/protocol/openid-connect/token";
|
|
14
|
+
const AUTHORIZE_PATH = "/protocol/openid-connect/auth";
|
|
15
|
+
/** `{issuer}{path}`, tolerating a trailing slash on the issuer. */
|
|
16
|
+
function underIssuer(issuer, path) {
|
|
17
|
+
const base = (issuer ?? "").trim().replace(/\/+$/, "");
|
|
18
|
+
return base === "" ? "" : `${base}${path}`;
|
|
19
|
+
}
|
|
20
|
+
/** The OAuth2 token endpoint of an OIDC issuer. */
|
|
21
|
+
function tokenEndpointFor(issuer) {
|
|
22
|
+
return underIssuer(issuer, TOKEN_PATH);
|
|
23
|
+
}
|
|
24
|
+
/** The authorization endpoint of an OIDC issuer — where a person is sent to log in. */
|
|
25
|
+
function authorizationEndpointFor(issuer) {
|
|
26
|
+
return underIssuer(issuer, AUTHORIZE_PATH);
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Builds credentials from the environment, with optional overrides (undefined/empty override values
|
|
30
|
+
* are ignored, so the environment still supplies those).
|
|
31
|
+
*
|
|
32
|
+
* | Variable | Meaning |
|
|
33
|
+
* |---|---|
|
|
34
|
+
* | `OIDC_ISSUER` | Realm issuer URL. The token endpoint is derived from it. |
|
|
35
|
+
* | `OIDC_CLIENT_ID` | Client id. |
|
|
36
|
+
* | `OIDC_CLIENT_SECRET` | Client secret. |
|
|
37
|
+
* | `OIDC_TOKEN_AUTH_MODE` | `post` (default) or `basic`. |
|
|
38
|
+
* | `OIDC_TOKEN_ENDPOINT` | Full token URL. Only needed when it is not at the standard path. |
|
|
39
|
+
*
|
|
40
|
+
* These are the names the SuperApp emulator publishes at `/__superapp/control/env`, so an app
|
|
41
|
+
* configured for the emulator needs no separate mapping — and the values are the only thing that
|
|
42
|
+
* changes between the emulator and production.
|
|
43
|
+
*
|
|
44
|
+
* The endpoint is derived rather than configured because the issuer is the one fact a deployment
|
|
45
|
+
* actually has: the previous scheme asked for `KOBIL_TOKEN_ENDPOINT` here and `OTOKEN_URL` in the auth
|
|
46
|
+
* module, which is the same server described twice under two names, and they could disagree.
|
|
47
|
+
* `OIDC_TOKEN_ENDPOINT` remains for deployments whose paths are not Keycloak's standard ones.
|
|
7
48
|
*/
|
|
8
49
|
function credentialsFromEnv(overrides = {}) {
|
|
9
|
-
const mode = process.env.
|
|
50
|
+
const mode = process.env.OIDC_TOKEN_AUTH_MODE?.toLowerCase();
|
|
10
51
|
const base = {
|
|
11
|
-
tokenEndpoint: process.env.
|
|
12
|
-
clientId: process.env.
|
|
13
|
-
clientSecret: process.env.
|
|
52
|
+
tokenEndpoint: process.env.OIDC_TOKEN_ENDPOINT || tokenEndpointFor(process.env.OIDC_ISSUER ?? ""),
|
|
53
|
+
clientId: process.env.OIDC_CLIENT_ID ?? "",
|
|
54
|
+
clientSecret: process.env.OIDC_CLIENT_SECRET ?? "",
|
|
14
55
|
tokenAuthMode: mode === "basic" || mode === "client_secret_basic" ? "basic" : "post",
|
|
15
56
|
};
|
|
16
57
|
for (const [key, value] of Object.entries(overrides)) {
|
package/dist/credentials.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credentials.js","sourceRoot":"","sources":["../src/credentials.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"credentials.js","sourceRoot":"","sources":["../src/credentials.ts"],"names":[],"mappings":";;AAoCA,4CAEC;AAGD,4DAEC;AAuBD,gDAcC;AA7DD;;;;;;GAMG;AACH,MAAM,UAAU,GAAG,gCAAgC,CAAC;AACpD,MAAM,cAAc,GAAG,+BAA+B,CAAC;AAEvD,mEAAmE;AACnE,SAAS,WAAW,CAAC,MAA0B,EAAE,IAAY;IAC3D,MAAM,IAAI,GAAG,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IACvD,OAAO,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,IAAI,GAAG,IAAI,EAAE,CAAC;AAC7C,CAAC;AAED,mDAAmD;AACnD,SAAgB,gBAAgB,CAAC,MAAc;IAC7C,OAAO,WAAW,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;AACzC,CAAC;AAED,uFAAuF;AACvF,SAAgB,wBAAwB,CAAC,MAAc;IACrD,OAAO,WAAW,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;AAC7C,CAAC;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,SAAgB,kBAAkB,CAAC,YAAuC,EAAE;IAC1E,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,oBAAoB,EAAE,WAAW,EAAE,CAAC;IAC7D,MAAM,IAAI,GAAqB;QAC7B,aAAa,EAAE,OAAO,CAAC,GAAG,CAAC,mBAAmB,IAAI,gBAAgB,CAAC,OAAO,CAAC,GAAG,CAAC,WAAW,IAAI,EAAE,CAAC;QACjG,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,cAAc,IAAI,EAAE;QAC1C,YAAY,EAAE,OAAO,CAAC,GAAG,CAAC,kBAAkB,IAAI,EAAE;QAClD,aAAa,EAAE,IAAI,KAAK,OAAO,IAAI,IAAI,KAAK,qBAAqB,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM;KACrF,CAAC;IACF,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,SAAS,CAAwC,EAAE,CAAC;QAC5F,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,EAAE,EAAE,CAAC;YACvC,IAA2C,CAAC,GAAa,CAAC,GAAG,KAAK,CAAC;QACtE,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where each service sits under its base URL.
|
|
3
|
+
*
|
|
4
|
+
* A deployment gives you two origins — one for mPower (chat and signing, on the identity host) and one
|
|
5
|
+
* for payment — and the paths beneath them are fixed. So the environment names a base and these build
|
|
6
|
+
* the rest, which is why `MPOWER_BASE` and `PAYMENT_BASE` are enough to configure every module.
|
|
7
|
+
*
|
|
8
|
+
* The SuperApp emulator mounts the same paths under its own origin on purpose, so the only thing that
|
|
9
|
+
* changes between the emulator and production is the base.
|
|
10
|
+
*
|
|
11
|
+
* `{TENANT}`, `{USER_ID}` and `{MEDIA_ID}` are left in place: each client substitutes them per call.
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* The per-user mPower endpoint, which both chat and signing hang off — chat appends `/message` or
|
|
15
|
+
* `/media`, signing appends `/signature`.
|
|
16
|
+
*/
|
|
17
|
+
export declare function mpowerUserEndpoint(mpowerBase: string | undefined): string;
|
|
18
|
+
/** Where an attachment's bytes are fetched from, by media id. */
|
|
19
|
+
export declare function mpowerMediaDownloadEndpoint(mpowerBase: string | undefined): string;
|
|
20
|
+
/**
|
|
21
|
+
* The transaction endpoint; `/postauth`, `/status`, `/void` and `/refund` are derived from it by the
|
|
22
|
+
* payment client.
|
|
23
|
+
*/
|
|
24
|
+
export declare function paymentTransactionEndpoint(paymentBase: string | undefined): string;
|
|
25
|
+
//# sourceMappingURL=endpoints.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"endpoints.d.ts","sourceRoot":"","sources":["../src/endpoints.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAOH;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAGzE;AAED,iEAAiE;AACjE,wBAAgB,2BAA2B,CAAC,UAAU,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAGlF;AAED;;;GAGG;AACH,wBAAgB,0BAA0B,CAAC,WAAW,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAGlF"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Where each service sits under its base URL.
|
|
4
|
+
*
|
|
5
|
+
* A deployment gives you two origins — one for mPower (chat and signing, on the identity host) and one
|
|
6
|
+
* for payment — and the paths beneath them are fixed. So the environment names a base and these build
|
|
7
|
+
* the rest, which is why `MPOWER_BASE` and `PAYMENT_BASE` are enough to configure every module.
|
|
8
|
+
*
|
|
9
|
+
* The SuperApp emulator mounts the same paths under its own origin on purpose, so the only thing that
|
|
10
|
+
* changes between the emulator and production is the base.
|
|
11
|
+
*
|
|
12
|
+
* `{TENANT}`, `{USER_ID}` and `{MEDIA_ID}` are left in place: each client substitutes them per call.
|
|
13
|
+
*/
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.mpowerUserEndpoint = mpowerUserEndpoint;
|
|
16
|
+
exports.mpowerMediaDownloadEndpoint = mpowerMediaDownloadEndpoint;
|
|
17
|
+
exports.paymentTransactionEndpoint = paymentTransactionEndpoint;
|
|
18
|
+
/** `{base}` with any trailing slashes removed; empty stays empty. */
|
|
19
|
+
function origin(base) {
|
|
20
|
+
return (base ?? "").trim().replace(/\/+$/, "");
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* The per-user mPower endpoint, which both chat and signing hang off — chat appends `/message` or
|
|
24
|
+
* `/media`, signing appends `/signature`.
|
|
25
|
+
*/
|
|
26
|
+
function mpowerUserEndpoint(mpowerBase) {
|
|
27
|
+
const base = origin(mpowerBase);
|
|
28
|
+
return base === "" ? "" : `${base}/auth/realms/{TENANT}/mpower/v1/users/{USER_ID}`;
|
|
29
|
+
}
|
|
30
|
+
/** Where an attachment's bytes are fetched from, by media id. */
|
|
31
|
+
function mpowerMediaDownloadEndpoint(mpowerBase) {
|
|
32
|
+
const base = origin(mpowerBase);
|
|
33
|
+
return base === "" ? "" : `${base}/v1/mpower/tenants/{TENANT}/media/{MEDIA_ID}/download`;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* The transaction endpoint; `/postauth`, `/status`, `/void` and `/refund` are derived from it by the
|
|
37
|
+
* payment client.
|
|
38
|
+
*/
|
|
39
|
+
function paymentTransactionEndpoint(paymentBase) {
|
|
40
|
+
const base = origin(paymentBase);
|
|
41
|
+
return base === "" ? "" : `${base}/mpay-merchant/create/transaction`;
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=endpoints.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"endpoints.js","sourceRoot":"","sources":["../src/endpoints.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG;;AAWH,gDAGC;AAGD,kEAGC;AAMD,gEAGC;AA3BD,qEAAqE;AACrE,SAAS,MAAM,CAAC,IAAwB;IACtC,OAAO,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AACjD,CAAC;AAED;;;GAGG;AACH,SAAgB,kBAAkB,CAAC,UAA8B;IAC/D,MAAM,IAAI,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC;IAChC,OAAO,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,IAAI,iDAAiD,CAAC;AACrF,CAAC;AAED,iEAAiE;AACjE,SAAgB,2BAA2B,CAAC,UAA8B;IACxE,MAAM,IAAI,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC;IAChC,OAAO,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,IAAI,uDAAuD,CAAC;AAC3F,CAAC;AAED;;;GAGG;AACH,SAAgB,0BAA0B,CAAC,WAA+B;IACxE,MAAM,IAAI,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC;IACjC,OAAO,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,IAAI,mCAAmC,CAAC;AACvE,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
export { KobilError } from "./error";
|
|
2
2
|
export type { KobilErrorOptions } from "./error";
|
|
3
|
-
export { credentialsFromEnv } from "./credentials";
|
|
3
|
+
export { authorizationEndpointFor, credentialsFromEnv, tokenEndpointFor } from "./credentials";
|
|
4
4
|
export type { KobilCredentials, TokenAuthMode } from "./credentials";
|
|
5
|
+
export { mpowerMediaDownloadEndpoint, mpowerUserEndpoint, paymentTransactionEndpoint, } from "./endpoints";
|
|
5
6
|
export { DefaultTokenProvider } from "./token-provider";
|
|
6
7
|
export type { TokenProvider } from "./token-provider";
|
|
7
8
|
export { KobilServiceClient } from "./service-client";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,YAAY,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,YAAY,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AACjD,OAAO,EAAE,wBAAwB,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAC/F,YAAY,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACrE,OAAO,EACL,2BAA2B,EAC3B,kBAAkB,EAClB,0BAA0B,GAC3B,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACxD,YAAY,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.KobilServiceClient = exports.DefaultTokenProvider = exports.credentialsFromEnv = exports.KobilError = void 0;
|
|
3
|
+
exports.KobilServiceClient = exports.DefaultTokenProvider = exports.paymentTransactionEndpoint = exports.mpowerUserEndpoint = exports.mpowerMediaDownloadEndpoint = exports.tokenEndpointFor = exports.credentialsFromEnv = exports.authorizationEndpointFor = exports.KobilError = void 0;
|
|
4
4
|
var error_1 = require("./error");
|
|
5
5
|
Object.defineProperty(exports, "KobilError", { enumerable: true, get: function () { return error_1.KobilError; } });
|
|
6
6
|
var credentials_1 = require("./credentials");
|
|
7
|
+
Object.defineProperty(exports, "authorizationEndpointFor", { enumerable: true, get: function () { return credentials_1.authorizationEndpointFor; } });
|
|
7
8
|
Object.defineProperty(exports, "credentialsFromEnv", { enumerable: true, get: function () { return credentials_1.credentialsFromEnv; } });
|
|
9
|
+
Object.defineProperty(exports, "tokenEndpointFor", { enumerable: true, get: function () { return credentials_1.tokenEndpointFor; } });
|
|
10
|
+
var endpoints_1 = require("./endpoints");
|
|
11
|
+
Object.defineProperty(exports, "mpowerMediaDownloadEndpoint", { enumerable: true, get: function () { return endpoints_1.mpowerMediaDownloadEndpoint; } });
|
|
12
|
+
Object.defineProperty(exports, "mpowerUserEndpoint", { enumerable: true, get: function () { return endpoints_1.mpowerUserEndpoint; } });
|
|
13
|
+
Object.defineProperty(exports, "paymentTransactionEndpoint", { enumerable: true, get: function () { return endpoints_1.paymentTransactionEndpoint; } });
|
|
8
14
|
var token_provider_1 = require("./token-provider");
|
|
9
15
|
Object.defineProperty(exports, "DefaultTokenProvider", { enumerable: true, get: function () { return token_provider_1.DefaultTokenProvider; } });
|
|
10
16
|
var service_client_1 = require("./service-client");
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,iCAAqC;AAA5B,mGAAA,UAAU,OAAA;AAEnB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,iCAAqC;AAA5B,mGAAA,UAAU,OAAA;AAEnB,6CAA+F;AAAtF,uHAAA,wBAAwB,OAAA;AAAE,iHAAA,kBAAkB,OAAA;AAAE,+GAAA,gBAAgB,OAAA;AAEvE,yCAIqB;AAHnB,wHAAA,2BAA2B,OAAA;AAC3B,+GAAA,kBAAkB,OAAA;AAClB,uHAAA,0BAA0B,OAAA;AAE5B,mDAAwD;AAA/C,sHAAA,oBAAoB,OAAA;AAE7B,mDAAsD;AAA7C,oHAAA,kBAAkB,OAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uveysservetoglu/kobil-core",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "Shared foundation for the KOBIL SDK family: OAuth token acquisition/caching (post & basic), a common error type, and an HTTP base for typed clients.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.js",
|