import { SdPlatformModelFileType } from "../commons/SdPlatformModelCommons"; import { SdPlatformPolicyCommonAliasesModel, SdPlatformPolicyPermissionsModel } from "../commons/SdPlatformPolicyCommons"; import { SdPlatformModelVisibility } from "../commons/SdPlatformVisibility"; import { SdPlatformResponseBackendSystem } from "./SdPlatformResponseBackendSystem"; import { SdPlatformResponseDomain } from "./SdPlatformResponseDomain"; import { SdPlatformResponseImagePublic } from "./SdPlatformResponseImage"; import { SdPlatformResponseOrganizationPublic } from "./SdPlatformResponseOrganization"; import { SdPlatformResponsePolicyPermissions } from "./SdPlatformResponsePolicy"; import { SdPlatformResponseTag } from "./SdPlatformResponseTag"; import { SdPlatformResponseUserMinimal } from "./SdPlatformResponseUser"; import { SdPlatformResponseSavedStatePublic } from "./SdPlatformResponseSavedState"; import { SdPlatformResponseFeatureValues } from "./SdPlatformResponseFeatures"; /** Level of trust into a model. */ export declare enum SdPlatformModelTrustlevel { UNDEFINED = "", /** No trust into the model. */ NONE = "none", /** Full trust into the model. */ FULL = "full" } /** * Platform Backend model status. */ export declare enum SdPlatformModelStatus { /** before model upload */ Start = "start", /** model uploaded successfully */ Waiting = "waiting", /** model has been confirmed, settings not stored yet */ Confirmed = "confirmed", /** model has been confirmed, settings already stored */ Done = "done", /** model checking has been suspended, ShapeDiver admin input required */ Pending = "pending", /** model has been denied */ Denied = "denied", /** upload of model failed */ ErrorUpload = "error_upload", Error = "error" } /** * A ticket (API key for accessing a model on a geometry backend system). */ interface Ticket { /** The ticket. */ readonly ticket?: string; } /** * Reasons for a model getting denied. */ declare enum SdPlatformModelDenyReason { Unknown = "unknown", /** unsupported plug-in */ Plugin = "plugin", /** denied script */ Script = "script", /** timeout in phase "computation" of model checking (solver took more than max_comp_time but less than 2x max_comp_time) */ Timeout = "timeout", /** model does not have outputs */ NoOutputs = "no_outputs", /** size of outputs exceeds limit */ Size = "size", /** technical limit of outputs */ OutputLimits = "output_limits", /** model does not output geometry for default parameter values */ NoDefaultGeometry = "no_default_geometry", /** timeout in phase "computation" of model checking (solver took more than 2x max_comp_time) */ TimeoutSmall = "timeout_small", /** catchall worker timeout during model checking */ ComputationFailed = "computation_failed", /** workers could not process check request (typically due to workload) */ NotProcessed = "not_processed", /** unsupported component */ Component = "component", /** denied encrypted cluster */ EncryptedCluster = "encrypted_cluster", /** usage of scripts not allowed */ ScriptsNotAllowed = "scripts_not_allowed", /** script check pending */ ScriptsPending = "scripts_pending", /** timeout in phase "analysis" of model checking */ AnalysisTimeout = "analysis_timeout", /** timeout in phase "loading" of model checking */ LoadingTimeout = "loading_timeout", /** timeout in phase "preparation" of model checking */ PreparationTimeout = "preparation_timeout", /** timeout in phase "collect results" of model checking (solver and collection took more than max_charge_time but less than 2x max_charge_time) */ CollectTimeout = "collect_timeout", /** timeout in phase "collect results" of model checking (solver and collection took more than 2x max_charge_time) */ CollectTimeoutSmall = "collect_timeout_small", /** the model requires at least Rhino 8 */ RequiresRhino8 = "requires_rhino_8", /** the Grasshopper version of the model is unknown */ UnknownGrasshopperVersion = "unknown_grasshopper_version", /** a general technical limit has been reached when checking the model */ TechnicalLimit = "technical_limit", /** a plugin used by the model requires a subscription */ PluginSubscriptionRequired = "plugin_subscription_required" } /** * Parsed geometry backend message. */ interface BackendMessage { /** A concise explanation of the issue. */ readonly display_message: string; /** An additional message which contains tips on how to solve the issue.. */ readonly user_message?: string; /** * The time in milliseconds used by the model(as reported inside the original unparsed message). * Used only for message type TIMEOUT and TIMEOUT_SMALL. */ readonly used_time?: number; /** * The max computation time in milliseconds allowed for the model (as reported inside the original unparsed message). * Used only for message type TIMEOUT and TIMEOUT_SMALL. */ readonly max_time?: number; /** * The maximum size allowed for the model (as reported inside the original unparsed message). * Used only for message type SIZE. */ readonly max_size?: number; /** A string representation of the message type. */ readonly deny_reason: SdPlatformModelDenyReason; /** The original unparsed message as provided by the geometry backend, constant prefix included. */ readonly original_unparsed: string; } /** * Computation related settings of the model on the geometry backend. */ interface ModelBackendSettingsCompute { /** Should the model be denied in case it contains scripts? */ readonly deny_scripts?: boolean; /** File type of the model. */ readonly ftype: SdPlatformModelFileType; /** Should the model be warmed up? */ readonly initial_warmup?: boolean; /** Maximum allowed computation time in milliseconds. */ readonly max_comp_time?: number; /** Maximum size of exported assets in bytes. */ readonly max_export_size?: number; /** Maximum time for the model to be idle before it will be unloaded. */ readonly max_idle_minutes?: number; /** Maximum allowed size of the model file in bytes. */ readonly max_model_size?: number; /** Maximum size of output assets in bytes */ readonly max_output_size?: number; /** Maximum time (milliseconds) computation requests for the model should wait before a new instance of the model is loaded (load balancing). */ readonly max_wait_time?: number; /** Mininum number of loaded models (load balancing). */ readonly num_loaded_min?: number; /** Maximum number of parallel computations for the model. */ readonly num_loaded_max?: number; /** Minimum number of preloaded models (load balancing). */ readonly num_preloaded_min?: number; /** Limits the number of sessions that can be created by a specific IP address in one hour. */ readonly session_rate_limit?: number; /** Trust in the model. */ readonly trust?: SdPlatformModelTrustlevel; /** * Maximum number of bytes allowed for a single texture. */ readonly max_texture_size?: number; } /** * Ticket authentication related settings of the model on the geometry backend. */ interface ModelBackendSettingsTicket { /** Whether public access to the model is allowed. This deactivates checking of accessdomains. */ readonly pub?: boolean; /** Allowed domains for embedding of the model. */ readonly accessdomains?: Array; /** Whether backend access to the model is allowed. */ readonly backendaccess?: boolean; } /** * Token authentication related settings of the model on the geometry backend. */ interface ModelBackendSettingsToken { /** Allowed authorization groups. */ readonly auth_group: Array; /** Is embedding of the model limited to iframes? */ readonly require_iframe: boolean; /** Does any access to the model require an access token (JWT)? */ readonly require_token: boolean; } /** * Model-specific settings on the geometry backend. */ interface ModelBackendSettingsModel { /** Use CDN */ readonly use_cdn: boolean; /** Is CDN supported? */ readonly cdn_supported: boolean; } /** * Settings of the model on the geometry backend. */ interface ModelBackendSettings { /** Computation related settings of the model on the geometry backend. */ readonly compute?: ModelBackendSettingsCompute; /** Ticket authentication related settings of the model on the geometry backend. */ readonly ticket?: ModelBackendSettingsTicket; /** Token authentication related settings of the model on the geometry backend. */ readonly token?: ModelBackendSettingsToken; /** Model-specific settings on the geometry backend. */ readonly model?: ModelBackendSettingsModel; } /** * Properties of the model on the geometry backend. */ interface ModelBackendProperties { /** Status of the model on the geometry backend. */ readonly stat: string; /** Message by the geometry backend. This is used for reporting the reason for models being denied. */ readonly msg?: BackendMessage; /** Settings of the model on the geometry backend */ readonly settings: ModelBackendSettings; } /** * Information about bookmark status. */ interface Bookmark { /** True if the model is bookmarked. */ readonly bookmarked: boolean; } /** * Decrypted ticket. */ interface DecryptedTicket { /** guid (geometry backend id) of the model. */ readonly model_id: string; /** * List of domains (origins) this ticket should be limited to; may be empty. */ readonly accessdomains: Array; /** * Should this ticket provide access to model authoring (allows to change configuration)? */ readonly author: boolean; /** Should this ticket allow public access (ignore the ticket's accessdomains property)? */ readonly pub: boolean; /** Type of ticket, '' or 'backend' */ readonly type: string; /** The timestamp until which the ticket should be valid (format YYYYMMDDhhmmss). */ readonly until: string; /** Does this ticket identify the model via its secondary ID (model property id2)? */ readonly use_id2: boolean; } /** * Ticket decryption result. */ export interface SdPlatformResponseDecryptTicketResult { /** Platform model information. */ readonly model: SdPlatformResponseModelBase; /** Data of the decrypted ticket. */ readonly ticket: DecryptedTicket; } /** * Model settings. */ export interface SdPlatformModelSettings { parameters_commit?: boolean; parameters_disable?: boolean; hide_data_outputs?: boolean; hide_data_outputs_iframe?: boolean; hide_exports?: boolean; hide_exports_iframe?: boolean; hide_saved_states?: boolean; hide_saved_states_iframe?: boolean; hide_attribute_visualization?: boolean; hide_attribute_visualization_iframe?: boolean; hide_desktop_clients?: boolean; hide_json_menu?: boolean; hide_json_menu_iframe?: boolean; } /** * Organization-specific model settings. */ export interface SdPlatformModelOrganizationSettings { /** Organization-specific confirmation flag, can be used by organization-specific App Builder implementations */ confirmed?: boolean; } /** * List of blocking reasons. */ export interface SdPlatformModelBlockingReasons { backend_permission?: boolean; credit_limit?: boolean; owner?: boolean; plugin_permission?: boolean; } /** * Features granted to an owner. */ export interface SdPlatformModelFeatures { readonly features?: Pick; } /** * Model - minimal access level. */ export interface SdPlatformResponseModelBase { /** Platform backend model id - the unique id of the model on the platform backend. */ readonly id: string; /** Title of the model. */ readonly title?: string; /** Unique URL identifier of the model, used for (public) links to the model (e.g. shapediver.com/app/m/{slug}). */ readonly slug: string; /** Description of the model. */ readonly description?: string; /** URL to a thumbnail of the model. */ readonly thumbnail_url: string; } /** * Model - public access level - this is the information available for public or shared models. */ export interface SdPlatformResponseModelPublic extends SdPlatformResponsePolicyPermissions, SdPlatformResponseModelBase { /** Decoration of the model, optionally embeddable property. */ readonly decoration?: Array; /** Owner of the model, optionally embeddable property. */ readonly user?: SdPlatformResponseUserMinimal; /** Tags of the model, optionally embeddable property. */ readonly tags?: Array; /** Geometry backend system of the model, optionally embeddable property. */ readonly backend_system?: SdPlatformResponseBackendSystem; /** List of blocking reasons. */ readonly blocking_reasons?: SdPlatformModelBlockingReasons; /** Bookmarking information, optionally embeddable property. */ readonly bookmark?: Bookmark; /** Ticket for geometry backend access (embedding ticket), optionally embeddable property. */ readonly ticket?: Ticket; /** Visibility of the model, might be limited by the visibility of the owner or the owner's organization (if any). */ readonly visibility?: SdPlatformModelVisibility; /** Nominal visibility of the model, not limited by the visibility of the owner. */ readonly visibility_nominal: SdPlatformModelVisibility; /** Geometry backend model id. */ readonly guid?: string; /** Is this a featured model? */ readonly featured: boolean; /** Organization of the model (if any), optionally embeddable property. */ readonly organization?: SdPlatformResponseOrganizationPublic; /** The geometry backend access token. Can be requested by embedding 'token_view', 'token_export' or 'token_owner' in Get request. */ readonly access_token?: string; /** Does model allow to be used as part of webhook ? */ readonly allow_webhook: boolean; /** Model settings */ readonly settings: SdPlatformModelSettings; /** Organization model settings */ readonly organization_settings: SdPlatformModelOrganizationSettings; /** The previous model id */ readonly prev_id?: string; /** Has successor flag */ readonly has_successor?: boolean; /** Owner features */ readonly owner_features?: SdPlatformModelFeatures; /** Date of creation, epoch timestamp. */ readonly created_at: number; } /** * Model - owner access level - this is the information available for model owners. */ export interface SdPlatformResponseModelOwner extends SdPlatformResponseModelPublic { /** * One of: * - start * - waiting * - confirmed * - done * - pending * - denied * - error_upload * - error */ readonly status: SdPlatformModelStatus; /** Date of last update, epoch timestamp */ readonly updated_at: number; /** Properties of the model on its geometry backend system, optionally embeddable property. */ readonly backend_properties?: ModelBackendProperties; /** Ticket for geometry backend access, optionally embeddable property. */ readonly backend_ticket?: Ticket; /** Ticket for geometry backend access with ownership access rights, optionally embeddable property. */ readonly author_ticket?: Ticket; /** Model-specific domains from which the model may be accessed (embedded from a browser), optionally embeddable property. */ readonly accessdomains?: Array; /** Comment on the model. */ readonly comment?: string; /** Account-specific domains from which the model may be accessed (embedded from a browser), optionally embeddable property. */ readonly global_accessdomains?: Array; /** Shall account-specific domains be used for this model? */ readonly use_global_accessdomains?: boolean; /** Unique obfuscated URL identifier of the model, used for private links to the model (e.g. shapediver.com/app/m/{slug}). */ readonly link_sharing_slug?: string; /** Should backend access to the geometry backend be allowed for this model? */ readonly backend_access: boolean; /** Should usage of a JWT be required for accessing this model on the geometry backend? */ readonly require_token: boolean; /** The document id */ readonly document_id: string; /** Allow direct embedding */ readonly allow_direct_embedding: boolean; } /** * Model - admin access level. */ export interface SdPlatformResponseModelAdmin extends SdPlatformResponseModelOwner { /** Date of deletion, epoch timestamp */ readonly deleted_at?: number; } /** * The iframe data, used for embedding a model in iframe. */ export interface SdPlatformResponseIFrameData { readonly token: string; readonly model_view_url: string; readonly ticket: string; readonly model: SdPlatformResponseModelPublic & { saved_states?: SdPlatformResponseSavedStatePublic[]; }; } /** * Result of swapping slugs between two models. */ export interface SdPlatformResponseModelSwapSlug { readonly model_a: SdPlatformResponseModelPublic; readonly model_b: SdPlatformResponseModelPublic; } /** * Model - any access level */ export type SdPlatformResponseModelAny = SdPlatformResponseModelAdmin | SdPlatformResponseModelOwner | SdPlatformResponseModelPublic; export {}; //# sourceMappingURL=SdPlatformResponseModel.d.ts.map