Custom modules
Verband Deutscher Dental Software (VDDS-media 1.4)
/// Filepath abstraction for VDDS
#[derive(Debug, Deserialize, Clone)]
pub struct FileDescriptor {
pub entity: String,
#[serde(rename = "type")]
pub entity_type: String,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(rename = "relPath")]
pub rel_path: Option<Vec<String>>,
#[serde(rename = "fileName")]
pub file_name: String,
}#[derive(Debug, Clone, Deserialize)]
pub enum VddsCmd {
import,
export,
view,
}#[derive(Debug, Serialize, Deserialize, Clone, Validate)]
pub struct VddsExecutable {
#[validate(length(min = 1, max = 256))]
#[serde(rename = "entity")]
pub entity: String,
#[validate(length(min = 1, max = 256))]
#[serde(rename = "type")]
pub entity_type: String,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(rename = "relPath")]
pub rel_path: Option<Vec<String>>,
#[serde(rename = "cmd")]
pub cmd: String, //import, export, view
#[serde(rename = "argFilePathQuotesDisable")]
pub arg_file_path_quotes_disable: Option<bool>,
}export interface AbstractVdds {
import(body: VddsImportRequest): Promise<VddsResponse>;
export(body: VddsExportRequest): Promise<VddsResponse>;
view(body: VddsViewRequest): Promise<VddsResponse>;
}
// Models
export interface VddsImportRequest {
exec: ExecDescriptor,
file: FileDescriptor
}
export interface VddsExportRequest {
exec: ExecDescriptor,
file: FileDescriptor
}
export interface VddsViewRequest {
exec: ExecDescriptor,
args: Array<String>
}
export interface ExecDescriptor {
entity: String,
type: String,
relPath?: Array<String>
argFilePathQuotesDisable?: boolean,
}
export interface FileDescriptor {
entity: String,
type: String,
relPath?: Array<String>
fileName: String
}
export class VddsResponse extends T1CResponse {
constructor(public success: boolean){
super(success, null);
}
} T1CSdk.T1CClient.initialize(config).then(res => {
client = res;
}, err => {
console.error(error)
});var vdds = client.vdds();let body = {
exec: {
entity: "Crossuite",
type: "vdds",
relPath: ["build"],
},
file: {
entity: "Crossuite",
type: "vdds",
relPath: ["files"],
fileName: "somefile.txt"
}
};
vdds.import(body).then(res => {
// handle response
}).catch(error => {
// handle error
});let body = {
exec: {
entity: "Crossuite",
type: "vdds",
relPath: ["build"],
},
file: {
entity: "Crossuite",
type: "vdds",
relPath: ["files"],
fileName: "somefile.txt"
}
};
vdds.export(body).then(res => {
// handle response
}).catch(error => {
// handle error
});let body = {
exec: {
entity: "Crossuite",
type: "vdds",
relPath: ["build"],
},
args: ["rnd_image_id"]
};
vdds.view(body).then(res => {
// handle response
}).catch(error => {
// handle error
});# InvalidInput
{
"success": false,
"code": 106997,
"description": "Invalid Input"
}
# ConfigurationError
{
"success": false,
"code": 505126,
"description": "Configuration Error"
}
# FileNotFoundException
{
"success": false,
"code": 505126,
"description": "File not found"
}
# checkout
git clone https://github.com/Trust1Team/vdds-test-exec
# build
mkdir build
cd build
cmake ..
cmake --build .```powershell
curl --location 'https://t1c.t1t.io:55000/v3/modules/fileexchange/apps/file/create-type' \
--header 'X-CSRF-Token: t1c-js' \
--header 'Content-Type: application/json' \
--header 'Authorization: ••••••' \
--data '{
"entity": "MyCompany",
"type": "vdds",
"modal": true
}'
```{
"success": true,
"data": {
"entity": "MyComp",
"type": "vdds",
"absPath": "/Users/michallispashidis/_git/vdds-test-exec",
"accessMode": "d",
"total": 0,
"appId": "unknown"
}
}curl --location 'https://t1c.t1t.io:55000/v3/modules/vdds/cmd/exec' \
--header 'Content-Type: application/json' \
--header 'Authorization: ••••••' \
--data '{
"exec": {
"entity": "MyComp",
"type": "vdds",
"relPath": ["build"],
"cmd": "import"
},
"file": {
"entity": "Crossuite",
"type": "vdds",
"relPath": ["files"],
"fileName": "somefile.txt"
}
}
'{
"exec": {
"entity": "MyComp",
"type": "vdds",
"relPath": ["build"],
"cmd": "export"
},
"file": {
"entity": "Crossuite",
"type": "vdds",
"relPath": ["files"],
"fileName": "somefile.txt"
}
}{
"exec": {
"entity": "Crossuite",
"type": "vdds",
"relPath": ["build"],
"cmd": "view"
},
"args": ["rnd_image_id"]
}