/** * Generated by orval v8.19.0 🍺 * Do not edit manually. * Webitel API * OpenAPI spec version: 24.04.0 */ import * as zod from 'zod'; /** * @summary Register device to receive PUSH notifications */ export const AccountRegisterDeviceBody = zod.object({ apn: zod.string().optional(), fcm: zod.string().optional(), secret: zod.string().optional(), web: zod .object({ endpoint: zod.string().optional(), key: zod .object({ auth: zod.string().optional(), p256Dh: zod.string().optional(), }) .optional(), }) .optional(), }); export const AccountRegisterDeviceResponse = zod.looseObject({}); /** * @summary Deletes a device by its token, stops sending PUSH-notifications to it. */ export const AccountUnregisterDeviceBody = zod.object({ apn: zod.string().optional(), fcm: zod.string().optional(), secret: zod.string().optional(), web: zod .object({ endpoint: zod.string().optional(), key: zod .object({ auth: zod.string().optional(), p256Dh: zod.string().optional(), }) .optional(), }) .optional(), }); export const AccountUnregisterDeviceResponse = zod.looseObject({}); /** * @summary Logout Device Request */ export const AccountLogoutResponse = zod.looseObject({}); /** * @summary Inspect current Authorization credentials */ export const AccountInspectResponse = zod.object({ appId: zod.string().optional(), contact: zod .object({ birthdate: zod .string() .optional() .describe( "OPTIONAL. End-User's birthday, represented as an ISO 8601:2004 [ISO8601‑2004] YYYY-MM-DD format.\nThe year MAY be 0000, indicating that it is omitted.\nTo represent only the year, YYYY format is allowed.", ), createdAt: zod .string() .optional() .describe( "Time the End-User's information was last updated.\nIts value is a JSON number representing the number of seconds from 1970-01-01T0:0:0Z as measured in UTC until the date/time.", ), deletedAt: zod.string().optional(), email: zod .string() .optional() .describe( "End-User's preferred e-mail address.\nIts value MUST conform to the RFC 5322 [RFC5322] addr-spec syntax.\nThe RP MUST NOT rely upon this value being unique, as discussed in Section 5.7.", ), emailVerified: zod .boolean() .optional() .describe( "True if the End-User's e-mail address has been verified; otherwise false.", ), familyName: zod .string() .optional() .describe( 'Surname(s) or last name(s) of the End-User.\nNote that in some cultures, people can have multiple family names or no family name;\nall can be present, with the names being separated by space characters.', ), gender: zod .string() .optional() .describe( "OPTIONAL. End-User's gender.\nValues defined by this specification are `female` and `male`.\nOther values MAY be used when neither of the defined values are applicable.", ), givenName: zod .string() .optional() .describe( 'Given name(s) or first name(s) of the End-User.\nNote that in some cultures, people can have multiple given names;\nall can be present, with the names being separated by space characters.', ), id: zod .string() .optional() .describe('[IM] Service (Provider) Account ID.'), iss: zod .string() .optional() .describe( 'REQUIRED. Issuer Identifier for the Issuer of the response.\nThe iss value is a case sensitive URL using the https scheme that contains scheme, host,\nand optionally, port number and path components and no query or fragment components.', ), locale: zod .string() .optional() .describe( "End-User's locale, represented as a BCP47 [RFC5646] language tag.\nThis is typically an ISO 639-1 Alpha-2 [ISO639‑1] language code in lowercase\nand an ISO 3166-1 Alpha-2 [ISO3166‑1] country code in uppercase,\nseparated by a dash. For example, `en-US` or `uk-UA`.", ), metadata: zod .looseObject({}) .optional() .describe("End-User's extra attributes (claims) metadata."), middleName: zod .string() .optional() .describe( 'Middle name(s) of the End-User.\nNote that in some cultures, people can have multiple middle names;\nall can be present, with the names being separated by space characters.\nAlso note that in some cultures, middle names are not used.', ), name: zod .string() .optional() .describe( "REQUIRED. End-User's full name in displayable form including all name parts,\npossibly including titles and suffixes, ordered according to the End-User's locale and preferences.", ), phoneNumber: zod .string() .optional() .describe( "End-User's preferred telephone number.\nE.164 is RECOMMENDED as the format of this Claim, for example, +1 (425) 555-1212 or +56 (2) 687 2400.\nIf the phone number contains an extension, it is RECOMMENDED that\nthe extension be represented using the RFC 3966 [RFC3966] extension syntax, for example, +1 (604) 555-1234;ext=5678.", ), phoneNumberVerified: zod .boolean() .optional() .describe( "True if the End-User's phone number has been verified; otherwise false.", ), picture: zod .string() .optional() .describe( "OPTIONAL. URL of the End-User's profile picture.\nThis URL MUST refer to an image file\n(for example, a PNG, JPEG, or GIF image file),\nrather than to a Web page containing an image.", ), profile: zod .string() .optional() .describe( "OPTIONAL. URL of the End-User's profile page.\nThe contents of this Web page SHOULD be about the End-User.\nNOTE: Issuer SP (IdP) related URL.", ), sub: zod .string() .optional() .describe( 'REQUIRED. Subject Identifier.\nA locally unique and never reassigned identifier within the Issuer for the End-User,\nwhich is intended to be consumed by the Client, e.g., 24400320 or AItOawmwtWwcT0k51BayewNvutrJUqsvl6qs7A4.\nIt MUST NOT exceed 255 ASCII characters in length.\nThe sub value is a case sensitive string.', ), type: zod.string().optional(), updatedAt: zod.string().optional(), username: zod.string().optional(), zoneinfo: zod .string() .optional() .describe( "OPTIONAL. String from zoneinfo [zoneinfo] time zone database representing the End-User's time zone.\nFor example, Europe/Kyiv or America/Los_Angeles.", ), }) .optional(), current: zod.boolean().optional(), date: zod.string().optional(), device: zod .object({ app: zod .object({ bot: zod.boolean().optional(), desktop: zod.boolean().optional(), device: zod.string().optional(), mobile: zod.boolean().optional(), name: zod.string().optional(), os: zod.string().optional(), osVersion: zod.string().optional(), string: zod.string().optional(), tablet: zod.boolean().optional(), version: zod.string().optional(), }) .optional(), ip: zod.string().optional(), push: zod.string().optional(), }) .optional(), name: zod.string().optional().describe('Session (device) display name.'), token: zod .object({ accessToken: zod .string() .optional() .describe( 'REQUIRED. The access token issued by the authorization server.', ), expiresIn: zod .number() .optional() .describe('RECOMMENDED. The lifetime in seconds of the access token.'), refreshToken: zod .string() .optional() .describe( 'OPTIONAL. The refresh token, which can be used to obtain\nnew access tokens using the same authorization grant.', ), scope: zod .array(zod.string()) .optional() .describe( 'OPTIONAL, if identical to the scope requested by the client;\notherwise, REQUIRED. The scope of the access token.', ), state: zod .string() .optional() .describe( 'REQUIRED if the "state" parameter was present in the client\nauthorization request. The exact value received from the client.', ), tokenType: zod .string() .optional() .describe( 'REQUIRED. The type of the token issued. Value is case insensitive.', ), }) .optional(), }); /** * @summary // Authorization Request. Part of OAuth flow rpc Auth(AuthRequest) returns (AuthResponse); */ export const AccountTokenBody = zod.object({ clientId: zod .string() .optional() .describe( 'The client identifier issued to the client during the registration process.\nREQUIRED, if the client is not authenticating with the authorization server.\nMay be transmitted in header: [X-Webitel-Client].', ), clientSecret: zod .string() .optional() .describe( 'REQUIRED. The client secret. The client MAY omit the\nparameter if the client secret is an empty string.\n\nIncluding the client credentials in the request-body using the two\nparameters is NOT RECOMMENDED and SHOULD be limited to clients unable\nto directly utilize the HTTP Basic authentication scheme (or other\npassword-based HTTP authentication schemes). The parameters can only\nbe transmitted in the request-body and MUST NOT be included in the\nrequest URI.\n\nKeep it a secret.', ), code: zod .string() .optional() .describe( 'Authorization code grant.\nREQUIRED. When grant_type is set to "authorization_code".', ), identity: zod .object({ birthdate: zod .string() .optional() .describe( "OPTIONAL. End-User's birthday, represented as an ISO 8601:2004 [ISO8601‑2004] YYYY-MM-DD format.\nThe year MAY be 0000, indicating that it is omitted.\nTo represent only the year, YYYY format is allowed.", ), email: zod .string() .optional() .describe( "End-User's preferred e-mail address.\nIts value MUST conform to the RFC 5322 [RFC5322] addr-spec syntax.\nThe RP MUST NOT rely upon this value being unique, as discussed in Section 5.7.", ), emailVerified: zod .boolean() .optional() .describe( "True if the End-User's e-mail address has been verified; otherwise false.", ), familyName: zod .string() .optional() .describe( 'Surname(s) or last name(s) of the End-User.\nNote that in some cultures, people can have multiple family names or no family name;\nall can be present, with the names being separated by space characters.', ), gender: zod .string() .optional() .describe( "OPTIONAL. End-User's gender.\nValues defined by this specification are `female` and `male`.\nOther values MAY be used when neither of the defined values are applicable.", ), givenName: zod .string() .optional() .describe( 'Given name(s) or first name(s) of the End-User.\nNote that in some cultures, people can have multiple given names;\nall can be present, with the names being separated by space characters.', ), iss: zod .string() .optional() .describe( 'REQUIRED. Issuer Identifier for the Issuer of the response.\nThe iss value is a case sensitive URL using the https scheme that contains scheme, host,\nand optionally, port number and path components and no query or fragment components.', ), locale: zod .string() .optional() .describe( "End-User's locale, represented as a BCP47 [RFC5646] language tag.\nThis is typically an ISO 639-1 Alpha-2 [ISO639‑1] language code in lowercase\nand an ISO 3166-1 Alpha-2 [ISO3166‑1] country code in uppercase,\nseparated by a dash. For example, `en-US` or `uk-UA`.", ), metadata: zod .looseObject({}) .optional() .describe("End-User's extra attributes (claims) metadata."), middleName: zod .string() .optional() .describe( 'Middle name(s) of the End-User.\nNote that in some cultures, people can have multiple middle names;\nall can be present, with the names being separated by space characters.\nAlso note that in some cultures, middle names are not used.', ), name: zod .string() .optional() .describe( "REQUIRED. End-User's full name in displayable form including all name parts,\npossibly including titles and suffixes, ordered according to the End-User's locale and preferences.", ), phoneNumber: zod .string() .optional() .describe( "End-User's preferred telephone number.\nE.164 is RECOMMENDED as the format of this Claim, for example, +1 (425) 555-1212 or +56 (2) 687 2400.\nIf the phone number contains an extension, it is RECOMMENDED that\nthe extension be represented using the RFC 3966 [RFC3966] extension syntax, for example, +1 (604) 555-1234;ext=5678.", ), phoneNumberVerified: zod .boolean() .optional() .describe( "True if the End-User's phone number has been verified; otherwise false.", ), picture: zod .string() .optional() .describe( "OPTIONAL. URL of the End-User's profile picture.\nThis URL MUST refer to an image file\n(for example, a PNG, JPEG, or GIF image file),\nrather than to a Web page containing an image.", ), profile: zod .string() .optional() .describe( "OPTIONAL. URL of the End-User's profile page.\nThe contents of this Web page SHOULD be about the End-User.\nNOTE: Issuer SP (IdP) related URL.", ), sub: zod .string() .optional() .describe( 'REQUIRED. Subject Identifier.\nA locally unique and never reassigned identifier within the Issuer for the End-User,\nwhich is intended to be consumed by the Client, e.g., 24400320 or AItOawmwtWwcT0k51BayewNvutrJUqsvl6qs7A4.\nIt MUST NOT exceed 255 ASCII characters in length.\nThe sub value is a case sensitive string.', ), zoneinfo: zod .string() .optional() .describe( "OPTIONAL. String from zoneinfo [zoneinfo] time zone database representing the End-User's time zone.\nFor example, Europe/Kyiv or America/Los_Angeles.", ), }) .optional() .describe( 'Identity of the end-User account association.\nREQUIRED. When grant_type is set to "identity".', ), refreshToken: zod .string() .optional() .describe( 'Refresh token string to obtain NEW access token.\nREQUIRED. When grant_type is set to "refresh_token".', ), scope: zod.array(zod.string()).optional(), state: zod.string().optional(), }); export const AccountTokenResponse = zod.object({ appId: zod.string().optional(), contact: zod .object({ birthdate: zod .string() .optional() .describe( "OPTIONAL. End-User's birthday, represented as an ISO 8601:2004 [ISO8601‑2004] YYYY-MM-DD format.\nThe year MAY be 0000, indicating that it is omitted.\nTo represent only the year, YYYY format is allowed.", ), createdAt: zod .string() .optional() .describe( "Time the End-User's information was last updated.\nIts value is a JSON number representing the number of seconds from 1970-01-01T0:0:0Z as measured in UTC until the date/time.", ), deletedAt: zod.string().optional(), email: zod .string() .optional() .describe( "End-User's preferred e-mail address.\nIts value MUST conform to the RFC 5322 [RFC5322] addr-spec syntax.\nThe RP MUST NOT rely upon this value being unique, as discussed in Section 5.7.", ), emailVerified: zod .boolean() .optional() .describe( "True if the End-User's e-mail address has been verified; otherwise false.", ), familyName: zod .string() .optional() .describe( 'Surname(s) or last name(s) of the End-User.\nNote that in some cultures, people can have multiple family names or no family name;\nall can be present, with the names being separated by space characters.', ), gender: zod .string() .optional() .describe( "OPTIONAL. End-User's gender.\nValues defined by this specification are `female` and `male`.\nOther values MAY be used when neither of the defined values are applicable.", ), givenName: zod .string() .optional() .describe( 'Given name(s) or first name(s) of the End-User.\nNote that in some cultures, people can have multiple given names;\nall can be present, with the names being separated by space characters.', ), id: zod .string() .optional() .describe('[IM] Service (Provider) Account ID.'), iss: zod .string() .optional() .describe( 'REQUIRED. Issuer Identifier for the Issuer of the response.\nThe iss value is a case sensitive URL using the https scheme that contains scheme, host,\nand optionally, port number and path components and no query or fragment components.', ), locale: zod .string() .optional() .describe( "End-User's locale, represented as a BCP47 [RFC5646] language tag.\nThis is typically an ISO 639-1 Alpha-2 [ISO639‑1] language code in lowercase\nand an ISO 3166-1 Alpha-2 [ISO3166‑1] country code in uppercase,\nseparated by a dash. For example, `en-US` or `uk-UA`.", ), metadata: zod .looseObject({}) .optional() .describe("End-User's extra attributes (claims) metadata."), middleName: zod .string() .optional() .describe( 'Middle name(s) of the End-User.\nNote that in some cultures, people can have multiple middle names;\nall can be present, with the names being separated by space characters.\nAlso note that in some cultures, middle names are not used.', ), name: zod .string() .optional() .describe( "REQUIRED. End-User's full name in displayable form including all name parts,\npossibly including titles and suffixes, ordered according to the End-User's locale and preferences.", ), phoneNumber: zod .string() .optional() .describe( "End-User's preferred telephone number.\nE.164 is RECOMMENDED as the format of this Claim, for example, +1 (425) 555-1212 or +56 (2) 687 2400.\nIf the phone number contains an extension, it is RECOMMENDED that\nthe extension be represented using the RFC 3966 [RFC3966] extension syntax, for example, +1 (604) 555-1234;ext=5678.", ), phoneNumberVerified: zod .boolean() .optional() .describe( "True if the End-User's phone number has been verified; otherwise false.", ), picture: zod .string() .optional() .describe( "OPTIONAL. URL of the End-User's profile picture.\nThis URL MUST refer to an image file\n(for example, a PNG, JPEG, or GIF image file),\nrather than to a Web page containing an image.", ), profile: zod .string() .optional() .describe( "OPTIONAL. URL of the End-User's profile page.\nThe contents of this Web page SHOULD be about the End-User.\nNOTE: Issuer SP (IdP) related URL.", ), sub: zod .string() .optional() .describe( 'REQUIRED. Subject Identifier.\nA locally unique and never reassigned identifier within the Issuer for the End-User,\nwhich is intended to be consumed by the Client, e.g., 24400320 or AItOawmwtWwcT0k51BayewNvutrJUqsvl6qs7A4.\nIt MUST NOT exceed 255 ASCII characters in length.\nThe sub value is a case sensitive string.', ), type: zod.string().optional(), updatedAt: zod.string().optional(), username: zod.string().optional(), zoneinfo: zod .string() .optional() .describe( "OPTIONAL. String from zoneinfo [zoneinfo] time zone database representing the End-User's time zone.\nFor example, Europe/Kyiv or America/Los_Angeles.", ), }) .optional(), current: zod.boolean().optional(), date: zod.string().optional(), device: zod .object({ app: zod .object({ bot: zod.boolean().optional(), desktop: zod.boolean().optional(), device: zod.string().optional(), mobile: zod.boolean().optional(), name: zod.string().optional(), os: zod.string().optional(), osVersion: zod.string().optional(), string: zod.string().optional(), tablet: zod.boolean().optional(), version: zod.string().optional(), }) .optional(), ip: zod.string().optional(), push: zod.string().optional(), }) .optional(), name: zod.string().optional().describe('Session (device) display name.'), token: zod .object({ accessToken: zod .string() .optional() .describe( 'REQUIRED. The access token issued by the authorization server.', ), expiresIn: zod .number() .optional() .describe('RECOMMENDED. The lifetime in seconds of the access token.'), refreshToken: zod .string() .optional() .describe( 'OPTIONAL. The refresh token, which can be used to obtain\nnew access tokens using the same authorization grant.', ), scope: zod .array(zod.string()) .optional() .describe( 'OPTIONAL, if identical to the scope requested by the client;\notherwise, REQUIRED. The scope of the access token.', ), state: zod .string() .optional() .describe( 'REQUIRED if the "state" parameter was present in the client\nauthorization request. The exact value received from the client.', ), tokenType: zod .string() .optional() .describe( 'REQUIRED. The type of the token issued. Value is case insensitive.', ), }) .optional(), });