Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions build/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export * from './src/ai/stream';
export * from './src/auth/tokensPair';
export * from './src/auth/oauth';
export * from './src/base/businessOperation/businessOperation';
export * from './src/billing/planProlongrationPayload';
export * from './src/base/event/affectedUser';
Expand Down Expand Up @@ -34,6 +35,7 @@ export * from './src/dbScheme/workspace';
export * from './src/dbScheme/bankCard';
export * from './src/dbScheme/sso';
export * from './src/dbScheme/projectEventGroupingPattern';
export * from './src/dbScheme/oauthClient';
export * from './src/notifications/createProjectNotifications';
export * from './src/notifications/receiveTypes';
export * from './src/notifications/updateProjectNotifications';
Expand Down
2 changes: 2 additions & 0 deletions build/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
Object.defineProperty(exports, "__esModule", { value: true });
__exportStar(require("./src/ai/stream"), exports);
__exportStar(require("./src/auth/tokensPair"), exports);
__exportStar(require("./src/auth/oauth"), exports);
__exportStar(require("./src/base/businessOperation/businessOperation"), exports);
__exportStar(require("./src/billing/planProlongrationPayload"), exports);
__exportStar(require("./src/base/event/affectedUser"), exports);
Expand Down Expand Up @@ -50,6 +51,7 @@ __exportStar(require("./src/dbScheme/workspace"), exports);
__exportStar(require("./src/dbScheme/bankCard"), exports);
__exportStar(require("./src/dbScheme/sso"), exports);
__exportStar(require("./src/dbScheme/projectEventGroupingPattern"), exports);
__exportStar(require("./src/dbScheme/oauthClient"), exports);
__exportStar(require("./src/notifications/createProjectNotifications"), exports);
__exportStar(require("./src/notifications/receiveTypes"), exports);
__exportStar(require("./src/notifications/updateProjectNotifications"), exports);
Expand Down
96 changes: 96 additions & 0 deletions build/src/auth/OAuth.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
/**
* Possible {@link https://datatracker.ietf.org/doc/html/draft-ietf-oauth-v2-1-17#section-3.2.4 | OAuth error codes}
*/
export declare enum OAuthErrorCode {
/**
* The request is missing a required parameter, includes an unsupported parameter value
* (other than grant type), repeats a parameter, includes multiple credentials, utilizes
* more than one mechanism for authenticating the client, contains a code_verifier
* although no code_challenge was sent in the authorization request, or is otherwise malformed
*/
invalidRequest = "invalid_request",
/**
* Client authentication failed (e.g., unknown client, no client authentication included,
* or unsupported authentication method).
*/
invalidClient = "invalid_client",
/**
* The provided authorization grant (e.g., authorization code, resource owner credentials)
* or refresh token is invalid, expired, revoked, does not match the redirect URI used in
* the authorization request, or was issued to another client.
*/
invalidGrant = "invalid_grant",
/**
* The authenticated client is not authorized to use this authorization grant type
*/
unauthorizedClient = "unauthorized_client",
/**
* The authorization grant type is not supported by the authorization server
*/
unsupportedGrantType = "unsupported_grant_type",
/**
* requested scope is invalid, unknown, malformed, or exceeds the scope granted by the resource owner
*/
invalidScope = "invalid_scope"
}
/**
* Authorization request
*/
export interface OAuthRequest {
/**
* Client Identifier
*/
client_id: string;
/**
* Indicates the URL to return the user to after authorization is complete
*/
redirect_uri: string;
/**
* Opaque value used by the client to maintain state between the request and callback
*/
state?: string;
/**
* Base64-URL-encoded string of the SHA256 hash of the code verifier
*/
code_challenge: string;
/**
* The code challenge transformation method
*/
code_challenge_method: 'S256';
/**
* Target service or resource to which access is being requested.
* MUST be an absolute URI
*/
resource?: string;
/**
* Additional access requested by the application
*/
scope?: string;
/**
* URL string that references a logo for the client
*/
logoUrl?: string;
}
/**
* Authorization response
*/
export interface OAuthResponse {
/**
* Indicates the URL to return the user to after authorization is complete.
* Populated with additional parameters
*/
redirect_uri: string;
}
/**
* Authorization error
*/
export interface OAuthError {
/**
* Error code
*/
error: OAuthErrorCode;
/**
* Optional text providing additional information
*/
error_description?: string;
}
4 changes: 4 additions & 0 deletions build/src/auth/OAuth.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
;
;
31 changes: 31 additions & 0 deletions build/src/auth/mcp/authorizationEndpoint.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/**
* MCP Authorization Endpoint request body interface
*/
export interface AuthorizationEndpointRequest {
/**
* MCP Client Identifier
*/
client_id: string;
/**
* Indicates the URL to return the user to after authorization is complete
*/
redirect_uri: string;
/**
* Opaque value used by the client to maintain state between the request and callback
*/
state: string;
/**
* Base64-URL-encoded string of the SHA256 hash of the code verifier
*/
code_challenge: string;
}
/**
* MCP Authorization Endpoint response body interface
*/
export interface AuthorizationEndpointResponse {
/**
* Indicates the URL to return the user to after authorization is complete.
* Populated with additional parameters
*/
redirect_uri: string;
}
4 changes: 4 additions & 0 deletions build/src/auth/mcp/authorizationEndpoint.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
;
;
96 changes: 96 additions & 0 deletions build/src/auth/oauth.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
/**
* Possible {@link https://datatracker.ietf.org/doc/html/draft-ietf-oauth-v2-1-17#section-3.2.4 | OAuth error codes}
*/
export declare enum OAuthErrorCode {
/**
* The request is missing a required parameter, includes an unsupported parameter value
* (other than grant type), repeats a parameter, includes multiple credentials, utilizes
* more than one mechanism for authenticating the client, contains a code_verifier
* although no code_challenge was sent in the authorization request, or is otherwise malformed
*/
invalidRequest = "invalid_request",
/**
* Client authentication failed (e.g., unknown client, no client authentication included,
* or unsupported authentication method).
*/
invalidClient = "invalid_client",
/**
* The provided authorization grant (e.g., authorization code, resource owner credentials)
* or refresh token is invalid, expired, revoked, does not match the redirect URI used in
* the authorization request, or was issued to another client.
*/
invalidGrant = "invalid_grant",
/**
* The authenticated client is not authorized to use this authorization grant type
*/
unauthorizedClient = "unauthorized_client",
/**
* The authorization grant type is not supported by the authorization server
*/
unsupportedGrantType = "unsupported_grant_type",
/**
* requested scope is invalid, unknown, malformed, or exceeds the scope granted by the resource owner
*/
invalidScope = "invalid_scope"
}
/**
* Authorization request
*/
export interface OAuthRequest {
/**
* Client Identifier
*/
client_id: string;
/**
* Indicates the URL to return the user to after authorization is complete
*/
redirect_uri: string;
/**
* Opaque value used by the client to maintain state between the request and callback
*/
state?: string;
/**
* Base64-URL-encoded string of the SHA256 hash of the code verifier
*/
code_challenge: string;
/**
* The code challenge transformation method
*/
code_challenge_method: 'S256';
/**
* Target service or resource to which access is being requested.
* MUST be an absolute URI
*/
resource?: string;
/**
* Additional access requested by the application
*/
scope?: string;
/**
* URL string that references a logo for the client
*/
logoUrl?: string;
}
/**
* Authorization response
*/
export interface OAuthResponse {
/**
* Indicates the URL to return the user to after authorization is complete.
* Populated with additional parameters
*/
redirect_uri: string;
}
/**
* Authorization error
*/
export interface OAuthError {
/**
* Error code
*/
error: OAuthErrorCode;
/**
* Optional text providing additional information
*/
error_description?: string;
}
4 changes: 4 additions & 0 deletions build/src/auth/oauth.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
;
;
46 changes: 46 additions & 0 deletions build/src/dbScheme/oauthClient.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import type { ObjectId, Timestamp } from 'bson';
/**
* Permissions granted to token
*/
export type TokenPermissions = 'read' | 'write';
/**
* Database representation of active to oauth client
*/
export interface OAuthClientDBScheme {
/**
* External client identifier
*/
_id: ObjectId;
/**
* Token owner id
*/
userId: string;
/**
* User agent id
*/
clientId: string;
/**
* Unique JSON Web Token Identifier
*/
jti: string;
/**
* What client is allowed to do
*/
permissions: TokenPermissions[];
/**
* Label set by user
*/
lable: string;
/**
* Last time the client interacted with hawk api
*/
lastUsedAt: Timestamp | null;
/**
* Usage count
*/
requestCount: number;
/**
* Creation date
*/
createdAt: Timestamp;
}
2 changes: 2 additions & 0 deletions build/src/dbScheme/oauthClient.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
46 changes: 46 additions & 0 deletions build/src/dbScheme/thirdparty.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import type { ObjectId, Timestamp } from 'bson';
/**
* Permissions granted to token
*/
export type TokenPermissions = 'read' | 'write';
/**
* Database representation of active to third-party clients
*/
export interface ThirdpartyDBScheme {
/**
* External token identifier
*/
_id: ObjectId;
/**
* Token owner id
*/
userId: string;
/**
* Unique JSON Web Token Identifier
*/
jti: string;
/**
* Last characters of the token, used to tell tokens apart in user settings
*/
preview: string;
/**
* What token can be used for
*/
permissions: TokenPermissions[];
/**
* Label set by user
*/
lable: string;
/**
* Last time token was used
*/
lastUsedAt: Timestamp | null;
/**
* Usage count
*/
requestCount: number;
/**
* Creation date
*/
createdAt: Timestamp;
}
2 changes: 2 additions & 0 deletions build/src/dbScheme/thirdparty.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
2 changes: 2 additions & 0 deletions index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
export * from './src/ai/stream';

export * from './src/auth/tokensPair';
export * from './src/auth/oauth';

export * from './src/base/businessOperation/businessOperation';

Expand Down Expand Up @@ -40,6 +41,7 @@ export * from './src/dbScheme/workspace';
export * from './src/dbScheme/bankCard';
export * from './src/dbScheme/sso';
export * from './src/dbScheme/projectEventGroupingPattern';
export * from './src/dbScheme/oauthClient';

export * from './src/notifications/createProjectNotifications';
export * from './src/notifications/receiveTypes';
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hawk.so/types",
"version": "0.9.0",
"version": "0.9.1",
"description": "TypeScript definitions for Hawk",
"types": "build/index.d.ts",
"main": "build/index.js",
Expand Down
Loading