moc-oauth-client 1.0.2 → 1.0.3
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.d.ts +3 -6
- package/dist/index.js +4 -7
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -9,9 +9,6 @@ interface OAuthError {
|
|
|
9
9
|
error: {
|
|
10
10
|
code: string;
|
|
11
11
|
message: string;
|
|
12
|
-
timestamp: string;
|
|
13
|
-
path: string;
|
|
14
|
-
requestId: string;
|
|
15
12
|
};
|
|
16
13
|
}
|
|
17
14
|
interface AuthorizeResponse {
|
|
@@ -29,11 +26,11 @@ interface CurrentUser {
|
|
|
29
26
|
}
|
|
30
27
|
|
|
31
28
|
/**
|
|
32
|
-
*
|
|
29
|
+
* MOCOAuthClient is a client library for interacting with the Moc OAuth API.
|
|
33
30
|
* It provides methods for authorizing clients, validating tokens, refreshing tokens,
|
|
34
31
|
* and retrieving the current user's information.
|
|
35
32
|
*/
|
|
36
|
-
declare class
|
|
33
|
+
declare class MOCOAuthClient {
|
|
37
34
|
/**
|
|
38
35
|
* Authorize a client using the OAuth API.
|
|
39
36
|
* @returns A promise resolving to an object containing the response data.
|
|
@@ -69,4 +66,4 @@ declare class MocOAuthClient {
|
|
|
69
66
|
refreshToken(refreshToken: string): Promise<OAuthSuccess<ValidateTokenResponse>>;
|
|
70
67
|
}
|
|
71
68
|
|
|
72
|
-
export { type AuthorizeResponse, type CurrentUser,
|
|
69
|
+
export { type AuthorizeResponse, type CurrentUser, MOCOAuthClient, type OAuthError, type OAuthSuccess, type ValidateTokenResponse };
|
package/dist/index.js
CHANGED
|
@@ -30,7 +30,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
30
30
|
// src/index.ts
|
|
31
31
|
var index_exports = {};
|
|
32
32
|
__export(index_exports, {
|
|
33
|
-
|
|
33
|
+
MOCOAuthClient: () => MOCOAuthClient
|
|
34
34
|
});
|
|
35
35
|
module.exports = __toCommonJS(index_exports);
|
|
36
36
|
|
|
@@ -69,10 +69,7 @@ function handleError(error) {
|
|
|
69
69
|
success: false,
|
|
70
70
|
error: {
|
|
71
71
|
code: "UNKNOWN_ERROR",
|
|
72
|
-
message: err.message
|
|
73
|
-
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
74
|
-
path: "",
|
|
75
|
-
requestId: ""
|
|
72
|
+
message: err.message
|
|
76
73
|
}
|
|
77
74
|
};
|
|
78
75
|
}
|
|
@@ -86,7 +83,7 @@ var API_ENDPOINTS = {
|
|
|
86
83
|
};
|
|
87
84
|
|
|
88
85
|
// src/client.ts
|
|
89
|
-
var
|
|
86
|
+
var MOCOAuthClient = class {
|
|
90
87
|
/**
|
|
91
88
|
* Authorize a client using the OAuth API.
|
|
92
89
|
* @returns A promise resolving to an object containing the response data.
|
|
@@ -163,5 +160,5 @@ var MocOAuthClient = class {
|
|
|
163
160
|
};
|
|
164
161
|
// Annotate the CommonJS export names for ESM import in node:
|
|
165
162
|
0 && (module.exports = {
|
|
166
|
-
|
|
163
|
+
MOCOAuthClient
|
|
167
164
|
});
|