import * as P from './Presentation'; import * as R from './Resource'; import { ApiError, ApiErrorResponse, ApiResponse } from './Api'; export type Strings = { en: { [key: string]: string; }; }; export type ReviewStatus = 'draft' | 'approved'; export type PreviewOrientation = 'horizontal' | 'vertical'; export type PreviewResolution = 'HD' | 'FullHD' | 'UltraHD' | 'EightK'; export type ApplicationVersionResponse = { id: string; description: string; application_id: string; name: string; thumbnail_url: string; icon_url: string; source_url: string; presentation_properties: P.PresentationProperty[]; major_version: number; minor_version: number; patch_version: number; preview_orientation: PreviewOrientation; preview_resolution: PreviewResolution; strings: Strings; has_dynamic_thumbnails: boolean; configurable_duration: boolean; default_duration: number; review_status: ReviewStatus; embedded_url_format: string; created_at: string; updated_at: string; helper_link_text: string; helper_link_url: string; scopes?: string[]; }; export type ApplicationResponse = { id: string; application_category: ApplicationCategoryResponse | null; application_category_id: number | null; current_deployment_id: string | null; current_app_version: ApplicationVersionResponse; is_deprecated: boolean; is_marketplace: boolean; resource: R.ResourceResponse; name: string; website_url: string | null; }; export type ApplicationVersion = { id: string; name: string; description: string; thumbnailUrl: string; iconUrl: string; sourceUrl: string; applicationId: string; presentationProperties: P.PresentationProperty[]; majorVersion: number; minorVersion: number; patchVersion: number; previewOrientation: PreviewOrientation; previewResolution: PreviewResolution; strings: Strings; dynamicThumbnails: boolean; configurableDuration: boolean; defaultDuration: number; embeddedUrlFormat: string; reviewStatus: ReviewStatus; createdAt: string; updatedAt: string; helperLinkText: string; helperLinkUrl: string; scopes?: string[]; }; export type Application = { id: string; applicationCategoryId: number | null; applicationCategory: ApplicationCategory | null; currentDeploymentId: string | null; currentAppVersion: ApplicationVersion; isDeprecated: boolean; isMarketplace: boolean; resource: R.Resource; name: string; websiteUrl: string | null; }; export type GetApplicationsRequest = undefined; export type GetApplicationsResponse = ApplicationResponse[]; // v2 types export interface ApplicationV2Response { id: string; name: string; description: string; is_deprecated: boolean; is_publicly_available: boolean; resource_id: string; r: { resource: R.ResourceV2Response; }; } export interface ApplicationV2 { id: string; name: string; description: string; isDeprecated: boolean; isPubliclyAvailable: boolean; resourceId: string; r: { resource: R.ResourceV2; }; } export interface ApplicationVersionV2Response { id: string; application_id: string; name: string; description: string; source_url: string | null; embedded_url_format: string | null; configurable_duration: boolean; presentation_properties: P.PresentationProperty[]; icon_url: string; thumbnail_url: string; has_dynamic_thumbnails: boolean; strings: Strings; version: string; default_duration: number; review_status: ReviewStatus; created_at: string; updated_at: string; } export interface CreateApplicationRequest { name?: string; } export type CreateApplicationResponse = ApplicationResponse; export interface CreateApplicationVersion { name: string; majorVersion: number; minorVersion: number; patchVersion: number; description: string; iconUrl?: string; thumbnailUrl?: string; embeddedUrlFormat: string; configurableDuration: boolean; defaultDuration?: number; presentationProperties: P.PresentationProperty[]; previewOrientation: PreviewOrientation; previewResolution: PreviewResolution; strings: Strings; hasDynamicThumbnails: boolean; helperLinkText: string; helperLinkUrl: string; scopes?: string[]; } export interface CreateApplicationVersionRequest { name: string; major_version: number; minor_version: number; patch_version: number; description: string; icon_url?: string; thumbnail_url?: string; embedded_url_format: string | null; configurable_duration: boolean; presentation_properties: P.PresentationProperty[]; preview_orientation: PreviewOrientation; preview_resolution: PreviewResolution; strings: Strings; default_duration?: number; has_dynamic_thumbnails: boolean; helper_link_text: string; helper_link_url: string; scopes?: string[]; } export type CreateApplicationVersionResponse = ApplicationVersionResponse; export interface UpdateApplication { currentDeploymentId: string; } export interface UpdateApplicationRequest { current_deployment_id: string; } export type UpdateApplicationResponse = ApplicationResponse; export type GetApplicationVersionsRequest = undefined; export type GetApplicationVersionsResponse = ApplicationVersionResponse[]; export type ApplicationCategory = { createdAt: string; id: string; name: string; updatedAt: string; }; export type ApplicationCategoryResponse = { created_at: string; id: string; name: string; updated_at: string; }; export interface SendMarketPlaceInquiryRequest { app: string; name?: string; subject?: string; } export type SendMarketPlaceInquiryResponse = SendMarketPlaceInquiryRequest; export interface PurchasedSubscriptionDetailsResponse { quantity: number; term: number; billing_term: string; start_date: string; transaction_id: string; } export interface PurchasedSubscriptionDetails { quantity: number; term: number; billingTerm: string; startDate: string; transactionId: string; } export interface ProductListDetailsResponse { term: string; reach_out_to_sales: boolean; purchased_subscription_details: PurchasedSubscriptionDetailsResponse[]; purchased_asset_details: PurchasedSubscriptionDetailsResponse[]; product_subscription_type: string; product_name: string; product_line: string; product_id: string; product_family: string; product_default_quantity: number; product_code: string; product_app_plan: string; net_price: number; marketplace_quantity_editable: boolean; manual_enablement_required: boolean; is_quantity_required: boolean; client_facing_pricing: string; client_facing_plan_description: string; business_use_case: string; } export interface ProductListDetails { term: string; reachOutToSales: boolean; purchasedSubscriptionDetails: PurchasedSubscriptionDetails[]; purchasedAssetDetails: PurchasedSubscriptionDetails[]; productSubscriptionType: string; productName: string; productLine: string; productId: string; productFamily: string; productDefaultQuantity: number; productCode: string; productAppPlan: string; netPrice: number; marketplaceQuantityEditable: boolean; manualEnablementRequired: boolean; isQuantityRequired: boolean; clientFacingPricing: string; clientFacingPlanDescription: string; businessUseCase: string; } export type GetProductList = ApiResponse< { grantScope: string; productList: ProductListDetails[]; }[] >; export type GetProductListResponse = ApiResponse< { grant_scope: string; product_list: ProductListDetailsResponse[]; }[] >; export interface GetProductListRequest { grant_scope: string; } export type GetProductListError = ApiError; export type GetProductListErrorResponse = ApiErrorResponse; export type GetEXLicenses = GetProductList; export type GetEXLicensesRequest = undefined; export type GetExLicensesResponse = GetProductListResponse; export interface PurchaseProductRequest { product_id: string; quantity: number; billing_frequency: 'Monthly' | 'Annual'; payment_method_id: string; } export type PurchaseProductResponse = ApiResponse<{ quote_id: string; opp_id: string; message: string; }>; export type PurchaseProduct = ApiResponse<{ quoteId: string; oppId: string; message: string; }>;