Skip to content

Commit

Permalink
New spec, new code
Browse files Browse the repository at this point in the history
  • Loading branch information
tylerlong committed Jul 1, 2024
1 parent 7125c4f commit ffbd951
Show file tree
Hide file tree
Showing 85 changed files with 2,401 additions and 1,354 deletions.
5 changes: 5 additions & 0 deletions packages/core/src/definitions/AccountPhoneNumberInfo.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import type ContactCenterProvider from './ContactCenterProvider';
import type AccountPhoneNumberInfoExtension from './AccountPhoneNumberInfoExtension';

interface AccountPhoneNumberInfo {
Expand Down Expand Up @@ -53,6 +54,10 @@ interface AccountPhoneNumberInfo {
*/
byocNumber?: boolean;

/**
*/
contactCenterProvider?: ContactCenterProvider;

/**
* Status of a phone number. If the value is 'Normal', the phone number is ready to be used. Otherwise, it is an external number not yet ported to RingCentral
* Required
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/definitions/ActivePermissionResource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ interface ActivePermissionResource {

/**
*/
scope?: (
scopes?: (
| 'Account'
| 'AllExtensions'
| 'Federation'
Expand Down
7 changes: 6 additions & 1 deletion packages/core/src/definitions/AssignPhoneNumberRequest.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type AssignPhoneNumberRequestExtension from './AssignPhoneNumberRequestExtension';
import type ContactCenterProvider from './ContactCenterProvider';

interface AssignPhoneNumberRequest {
/**
Expand All @@ -10,7 +11,7 @@ interface AssignPhoneNumberRequest {
* Target usage type of phone number (only listed values are supported)
* Required
*/
usageType?: 'MainCompanyNumber' | 'CompanyNumber' | 'DirectNumber' | 'PhoneLine';
usageType?: 'MainCompanyNumber' | 'CompanyNumber' | 'DirectNumber' | 'PhoneLine' | 'ContactCenterNumber';

/**
*/
Expand All @@ -19,6 +20,10 @@ interface AssignPhoneNumberRequest {
/**
*/
costCenterId?: string;

/**
*/
contactCenterProvider?: ContactCenterProvider;
}

export default AssignPhoneNumberRequest;
34 changes: 34 additions & 0 deletions packages/core/src/definitions/AuthCodeTokenRequest.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/**
* Token endpoint request parameters used in the "Authorization Code" and "Authorization code with PKCE" flows
* with the `authorization_code` grant type
*
*/
interface AuthCodeTokenRequest {
/**
* Grant type
*/
grant_type?: 'authorization_code';

/**
* For `authorization_code` grant type only. User's authorization code
* Required
*/
code?: string;

/**
* For `authorization_code` grant type only. This is a callback URI which determines where the response
* is sent. The value of this parameter must exactly match one of
* the URIs you have provided for your app upon registration
* Format: uri
*/
redirect_uri?: string;

/**
* For `authorization_code` grant type only.
* The code verifier as defined by the PKCE specification -
* [RFC-7636 "Proof Key for Code Exchange by OAuth Public Clients"](https://datatracker.ietf.org/doc/html/rfc7636)
*/
code_verifier?: string;
}

export default AuthCodeTokenRequest;
107 changes: 107 additions & 0 deletions packages/core/src/definitions/AuthorizeParameters.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
/**
* Query parameters for operation authorize
*/
interface AuthorizeParameters {
/**
* The registered identifier of a client application
* Example: AZwEVwGEcfGet2PCouA7K6
*/
client_id?: string;

/**
* Determines authorization flow type. The only supported value is `code` which corresponds to OAuth 2.0 "Authorization Code Flow"
*/
response_type?: 'code';

/**
* This is the URI where the Authorization Server redirects the User Agent to at the end of the authorization flow.
* The value of this parameter must exactly match one of the URIs registered for this client application.
* This parameter is required if there are more than one redirect URIs registered for the app.
* Format: uri
*/
redirect_uri?: string;

/**
* An opaque value used by the client to maintain state between the request and callback.
* The authorization server includes this value when redirecting the User Agent back
* to the client. The parameter SHOULD be used for preventing cross-site request forgery attacks.
*/
state?: string;

/**
* The list of space separated application permissions (OAuth scopes)
*/
scope?: string;

/**
* Specifies how the Authorization Server displays the authentication and consent user interface pages to the End-User.
* Default: page
*/
display?: 'page' | 'popup' | 'touch' | 'mobile';

/**
* Space-delimited, case-sensitive list of ASCII string values that specifies whether the Authorization Server prompts the End-User for
* re-authentication and consent. The defined values are:
*
* - `login` - RingCentral native login form,
* - `sso` - Single Sign-On login form,
* - `consent` - form to show the requested scope and prompt user for consent.
*
* Either `login` or `sso` (or both) must be specified. The default
* value is `login sso`
* Default: login sso
*/
prompt?: string;

/**
* End-User's preferred languages and scripts for the user interface, represented as a space-separated list of
* [RFC-5646](https://datatracker.ietf.org/doc/html/rfc5646) language tag values, ordered by preference.
*
* If this parameter is provided, its value overrides 'Accept-Language' header value and 'localeId' parameter value (if any)
* Example: en-US
*/
ui_locales?: string;

/**
* DEPRECATED: `ui_locales` parameter should be used instead
* Example: en-US
*/
localeId?: string;

/**
* The code challenge value as defined by the PKCE specification -
* [RFC-7636 "Proof Key for Code Exchange by OAuth Public Clients"](https://datatracker.ietf.org/doc/html/rfc7636)
*/
code_challenge?: string;

/**
* The code challenge method as defined by the PKCE specification -
* [RFC-7636 "Proof Key for Code Exchange by OAuth Public Clients"](https://datatracker.ietf.org/doc/html/rfc7636)
* Default: plain
*/
code_challenge_method?: 'plain' | 'S256';

/**
* String value used to associate a Client session with an ID Token, and to mitigate replay attacks. The value is passed through unmodified from the Authentication Request to the ID Token.
*/
nonce?: string;

/**
* Login form user interface options (space-separated). By default, the UI options that are registered for this client application will be used
*/
ui_options?: string;

/**
* Hint to the Authorization Server about the login identifier the End-User might use to log in.
*/
login_hint?: string;

/**
* RingCentral Brand identifier. If it is not provided in the request,
* server will try to determine brand from the client application profile.
* Example: 1210
*/
brand_id?: string;
}

export default AuthorizeParameters;
83 changes: 39 additions & 44 deletions packages/core/src/definitions/AuthorizeRequest.ts
Original file line number Diff line number Diff line change
@@ -1,54 +1,50 @@
interface AuthorizeRequest {
/**
* Determines authorization flow:
* - **code** - Authorization Code,
* - **token** - Implicit
* Determines authorization flow type. The only supported value is `code` which corresponds to OAuth 2.0 "Authorization Code Flow"
* Required
*/
response_type?: 'code' | 'token';
response_type?: 'code';

/**
* This is a callback URI which determines where the response
* is sent. The value of this parameter must exactly match one of
* the URIs you have provided for your app upon registration
* Required
* This is the URI where the Authorization Server redirects the User Agent to at the end of the authorization flow.
* The value of this parameter must exactly match one of the URIs registered for this client application.
* This parameter is required if there are more than one redirect URIs registered for the app.
* Format: uri
*/
redirect_uri?: string;

/**
* Identifier (key) of a client application
* The registered identifier of a client application
* Required
* Example: AZwEVwGEcfGet2PCouA7K6
*/
client_id?: string;

/**
* Client state. Returned to the client at the end of the flow
* An opaque value used by the client to maintain state between the request and callback.
* The authorization server includes this value when redirecting the User Agent back
* to the client. The parameter SHOULD be used for preventing cross-site request forgery attacks.
*/
state?: string;

/**
* Brand identifier. If it is not provided in request,
* server will try to determine brand from client app profile. The
* default value is `1210` - RingCentral US brand ID
* Default: 1210
* The list of requested OAuth scopes (space separated)
*/
brand_id?: string;
scope?: string;

/**
* Style of login form. The default value is 'page'. The
* 'popup' and 'touch' values are featured for mobile applications
* Specifies how the Authorization Server displays the authentication and consent user interface pages to the End-User.
* Default: page
*/
display?: 'page' | 'popup' | 'touch' | 'mobile';

/**
* Specifies which login form will be displayed. Space-separated
* set of the following values:
* Space-delimited, case-sensitive list of ASCII string values that specifies whether the Authorization Server prompts the End-User for
* re-authentication and consent. The defined values are:
*
* - **login** - RingCentral native login form,
* - **sso** - Single Sign-On login form,
* - **consent** - form to show the requested scope and prompt user for consent.
* - `login` - RingCentral native login form,
* - `sso` - Single Sign-On login form,
* - `consent` - form to show the requested scope and prompt user for consent.
*
* Either `login` or `sso` (or both) must be specified. The default
* value is `login sso`
Expand All @@ -57,53 +53,52 @@ interface AuthorizeRequest {
prompt?: string;

/**
* Locale code of a language. Overwrites 'Accept-Language' header value.
* End-User's preferred languages and scripts for the user interface, represented as a space-separated list of
* [RFC-5646](https://datatracker.ietf.org/doc/html/rfc5646) language tag values, ordered by preference.
*
* DEPRECATED: `ui_locales` parameter should be used instead
* Example: en-US
*/
localeId?: string;

/**
* Locale code of a language. Overwrites 'Accept-Language' header value and 'localeId' parameter value
* If this parameter is provided, its value overrides 'Accept-Language' header value and 'localeId' parameter value (if any)
* Example: en-US
*/
ui_locales?: string;

/**
* User interface options (space-separated)
*/
ui_options?: string;

/**
* OAuth scope
* The code challenge value as defined by the PKCE specification -
* [RFC-7636 "Proof Key for Code Exchange by OAuth Public Clients"](https://datatracker.ietf.org/doc/html/rfc7636)
*/
scope?: string;
code_challenge?: string;

/**
* The code challenge method as defined by the PKCE specification -
* [RFC-7636 "Proof Key for Code Exchange by OAuth Public Clients"](https://datatracker.ietf.org/doc/html/rfc7636)
* Default: plain
*/
accept_language?: string;
code_challenge_method?: 'plain' | 'S256';

/**
* String value used to associate a Client session with an ID Token, and to mitigate replay attacks. The value is passed through unmodified from the Authentication Request to the ID Token.
*/
request?: string;
nonce?: string;

/**
* Format: uri
* Login form user interface options (space-separated). By default, the UI options that are registered for this client application will be used
*/
request_uri?: string;
ui_options?: string;

/**
* Hint to the Authorization Server about the login identifier the End-User might use to log in.
*/
nonce?: string;
login_hint?: string;

/**
* RingCentral Brand identifier. If it is not provided in the request,
* server will try to determine brand from the client application profile.
* Example: 1210
*/
code_challenge?: string;
brand_id?: string;

/**
*/
code_challenge_method?: 'plain' | 'S256';
accept_language?: string;
}

export default AuthorizeRequest;
1 change: 0 additions & 1 deletion packages/core/src/definitions/BaseCallLogRecord.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ interface BaseCallLogRecord {
/**
* The type of call transport. 'PSTN' indicates that a call leg was initiated
* from the PSTN network provider; 'VoIP' - from an RC phone.
* Required
*/
transport?: 'PSTN' | 'VoIP';

Expand Down
Loading

0 comments on commit ffbd951

Please sign in to comment.