Skip to content

Commit b37f857

Browse files
authored
Merge pull request #49 from WideChat/master-catchup-86bdb41
[Upstream Catchup] Merge RC:master to master
2 parents e65e12f + 5862933 commit b37f857

446 files changed

Lines changed: 4542 additions & 2216 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

definition/livechat/IVisitor.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ export interface IVisitor {
99
department?: string;
1010
phone?: Array<IVisitorPhone>;
1111
visitorEmails?: Array<IVisitorEmail>;
12+
status?: string;
1213
customFields?: {
1314
[key: string]: any;
1415
};

definition/livechat/IVisitor.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

definition/oauth2/IOAuth2.d.ts

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
import { IConfigurationExtend, IHttp, IModify, IPersistence, IRead } from '../accessors';
2+
import { IUser } from '../users/IUser';
3+
/**
4+
* Authorization data as provided after
5+
* token exchange
6+
*/
7+
export interface IAuthData {
8+
/**
9+
* Access token from application
10+
*/
11+
token: string;
12+
/**
13+
* The token's expiration time in seconds
14+
*/
15+
expiresAt: number;
16+
/**
17+
* Scope(s) authorized by the user.
18+
*
19+
* Format can change depending on provider, but usually
20+
* when there are more than one scope, they are separated
21+
* by a white-space caracter
22+
*/
23+
scope: string;
24+
/**
25+
* A token that can be used to request a new access token
26+
* when the current one has expired.
27+
*
28+
* Not all providers have a refresh token.
29+
*/
30+
refreshToken?: string;
31+
}
32+
/**
33+
* Options passed to the OAuth2Client object during instantiation.
34+
* Describes URLs of the authorization service and optional behavior
35+
* for when user responds to the authorization prompt
36+
*/
37+
export interface IOAuth2ClientOptions {
38+
/**
39+
* Alias for the client. This is used to identify the client's resources.
40+
* It is used to avoid overwriting other clients' settings or endpoints
41+
* when there are multiple.
42+
*/
43+
alias: string;
44+
/**
45+
* URI to request an access token from
46+
*/
47+
accessTokenUri: string;
48+
/**
49+
* URI to redirect user for them to authorize access
50+
* by the application
51+
*/
52+
authUri: string;
53+
/**
54+
* URI to request a refreshed access token for user
55+
*/
56+
refreshTokenUri: string;
57+
/**
58+
* URI to revoke an access token for the user
59+
*/
60+
revokeTokenUri: string;
61+
/**
62+
* Default scopes to be used when requesting access
63+
*/
64+
defaultScopes?: Array<string>;
65+
/**
66+
* A function that will be executed when the auth
67+
* service redirects the user back to our endpoint.
68+
*/
69+
authorizationCallback?: (token: IAuthData | undefined, user: IUser, read: IRead, modify: IModify, http: IHttp, persis: IPersistence) => Promise<{
70+
responseContent?: string;
71+
} | undefined>;
72+
}
73+
export interface IOAuth2Client {
74+
/**
75+
* This method will set all necessary configuration for the client
76+
*
77+
* Please note that you will need to provide the i18n strings for the
78+
* settings created. For instance, if you're connecting to Github APIs
79+
* and your `alias = 'github'`, you will need to provide the following
80+
* translations:
81+
*
82+
* ```
83+
* {
84+
* "github-oauth-client-id": "Client ID to connect to Github",
85+
* "github-oauth-clientsecret": "Client secret to connect to Github"
86+
* }
87+
* ```
88+
*
89+
* @param configuration - Configuration extend to set all settings and API endpoints
90+
*/
91+
setup(configuration: IConfigurationExtend): Promise<void>;
92+
/**
93+
* Returns the authorization URL to which the user must
94+
* be redirected to in order to authorize access by the
95+
* application
96+
*
97+
* @param user - User to authenticate
98+
* @param scopes - Scopes that your app needs access to
99+
*/
100+
getUserAuthorizationUrl(user: IUser, scopes?: Array<string>): Promise<URL>;
101+
/**
102+
* Gets the token information for a specific user, if available.
103+
*
104+
* @param user
105+
*/
106+
getAccessTokenForUser(user: IUser): Promise<IAuthData | undefined>;
107+
/**
108+
* Refreshes the user's access token
109+
*
110+
* @param user The user whose token will be refreshed
111+
* @param persis Persistence object dependency
112+
*/
113+
refreshUserAccessToken(user: IUser, persis: IPersistence): Promise<IAuthData | undefined>;
114+
/**
115+
* Revokes user's access token in the service provider
116+
*
117+
* @param user The user whose token will be revoked
118+
* @param persis Persistence object dependency
119+
*/
120+
revokeUserAccessToken(user: IUser, persis: IPersistence): Promise<boolean>;
121+
}

definition/oauth2/IOAuth2.js

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

definition/oauth2/IOAuth2.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

definition/oauth2/OAuth2.d.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { OAuth2Client } from '../../server/oauth2/OAuth2Client';
2+
import { App } from '../App';
3+
import { IOAuth2ClientOptions } from './IOAuth2';
4+
/**
5+
* Placeholder factory for OAuth2Client in case
6+
* we need to pass internal stuff to it.
7+
*
8+
* @param app App that will connect via OAuth2
9+
* @param options Options for the OAuth2Client
10+
* @returns OAuth2Client instance
11+
*/
12+
export declare function createOAuth2Client(app: App, options: IOAuth2ClientOptions): OAuth2Client;

definition/oauth2/OAuth2.js

Lines changed: 18 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

definition/oauth2/OAuth2.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

definition/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@rocket.chat/apps-ts-definition",
3-
"version": "1.30.0",
3+
"version": "1.31.0",
44
"description": "Contains the TypeScript definitions for the Rocket.Chat Applications.",
55
"main": "index.js",
66
"typings": "index",

docs/assets/js/search.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)