Aller au contenu

Offline

Description of the offline field

interface OfflineState {
    fileToPull: {
        fileId: string
        fileName: string
        downloadUrl: string
        layers: string[]
    } | undefined
    fileToPush: {
        fileId: string
        downloadUrl: string
    } | undefined
    fileToRemove : string[]
    apiIsReady: boolean
}

fileToPull

Updated by: UI

Notify the Player that it needs to pull the file with the given information.

Data model

fileToPull: {
    fileId: string
    fileName: string
    downloadUrl: string
    layers: string[]
} | undefined

Examples

Notify the Player to pull a file

{
  "offline":{
    ...
    "fileToPull":{
      "fileId": "61f8f80d5d3c8d000b021eaf",
      "fileName": "cube.fbx",
      "downloadUrl": "https://smartshape.io.test/file/download/private/cube.fbx/cube.fbx.scene",
      "layers": []
    }
    ...
  }
}

fileToPush

Updated by: UI

Notify the Player that it needs to push the file with the given information.

Data model

fileToPush: {
    fileId: string
    downloadUrl: string
} | undefined

Examples

Notify the Player to push a file

{
  "offline":{
    ...
    "fileToPush":{
      "fileId": "61f8f80d5d3c8d000b021eaf",
      "downloadUrl": "https://smartshape.io.test/file/download/private/cube.fbx/cube.fbx.scene",
    }
    ...
  }
}

fileToRemove

Updated by: UI

Notify the Player that it needs to remove the files with the given IDs.

Data model

fileToRemove: string[] | undefined

Examples

Notify the Player to remove a file

{
  "offline":{
    ...
    "fileToRemove":["61f8f80d5d3c8d000b021eaf"]
    ...
  }
}

apiIsReady

Updated by: Player

Notify the UI that the offline-api is ready.

Data model

apiIsReady: boolean

Operations done by the Player

The Player sets the field to true when the offline-api is ready:

{
  "offline":{
    ...
    "apiIsReady":true
    ...
  }
}

November 24, 2022 March 8, 2022