diff --git a/src/bcf/bcf/v3/bcfapi.py b/src/bcf/bcf/v3/bcfapi.py index 218caab3db..ad96af138c 100644 --- a/src/bcf/bcf/v3/bcfapi.py +++ b/src/bcf/bcf/v3/bcfapi.py @@ -7,6 +7,8 @@ import webbrowser import http.server import base64 +from werkzeug.datastructures import HeaderSet + client_id, client_secret = "", "" @@ -142,51 +144,66 @@ class BcfClient: # TODO: handle error http status codes and raise exception. Follow error.json standard. headers = {"Authorization": "Bearer " + self.foundation_client.get_access_token()} response = requests.get(f"{self.baseurl}{endpoint}", headers=headers, params=params or None) - if response.status_code == 200: - return response.json() - else: - raise Exception(f"{response.status_code}, {response.text}") + try: + response = requests.get(f"{self.baseurl}{endpoint}", headers=headers, params=params or None) + if response.status_code == 200: + return response.json() + response.raise_for_status() + except requests.exceptions.HTTPError as e: + print(f"message: {response.reason}' '{response.status_code}' '{ e }") def post(self, endpoint, data=None, params=None): headers = { "Authorization": "Bearer " + self.foundation_client.get_access_token(), "Content-type": "application/json", } - response = requests.post( - f"{self.baseurl}{endpoint}", - headers=headers, - params=params or None, - data=data or None, - ) - if response.status_code == 201: - return response.status_code, response.text - else: - raise Exception(f"{response.status_code}, {response.text}") + try: + response = requests.post( + f"{self.baseurl}{endpoint}", + headers=headers, + params=params or None, + data=data or None, + ) + if response.status_code == 201: + return response.status_code, response.text + response.raise_for_status() + except requests.exceptions.HTTPError as errh: + print(f"message: {response.reason}' '{response.status_code}, {errh}") def put(self, endpoint, data=None, params=None): headers = { "Authorization": "Bearer " + self.foundation_client.get_access_token(), "Content-type": "application/json", } - response = requests.put( - f"{self.baseurl}{endpoint}", - headers=headers, - params=params or None, - data=data or None, - ) - if response.status_code == 200: - return response.status_code, response.text - else: - raise Exception(f"{response.status_code}, {response.text}") + try: + response = requests.put( + f"{self.baseurl}{endpoint}", + headers=headers, + params=params or None, + data=data or None, + ) + if response.status_code == 200: + return response.status_code, response.text + response.raise_for_status() + except requests.exceptions.HTTPError as errh: + print(f"message: {response.reason}' '{response.status_code}, {errh}") def delete(self, endpoint, params=None): - headers = {"Authorization": "Bearer " + self.foundation_client.get_access_token()} - resp = requests.put( - f"{self.baseurl}{endpoint}", - headers=headers, - params=params or None, - ) - return resp.status_code + headers = { + "Authorization": "Bearer " + self.foundation_client.get_access_token(), + "Content-type": "application/json", + } + try: + response = requests.delete( + f"{self.baseurl}{endpoint}", + headers=headers, + params=params or None, + ) + if response.status_code == 200: + return response.status_code, response.text + response.raise_for_status() + except requests.exceptions.HTTPError as errh: + print(f"message: {response.reason}' '{response.status_code}, {errh}") def get_projects(self) -> list: return self.get( @@ -256,16 +273,27 @@ class BcfClient: return self.delete(f"/projects/{project_id}/topics/{topic_id}") def get_snippet(self, project_id="", topic_id="") -> str: - return self.get( - f"/projects/{project_id}/topics/{topic_id}/snippet", - { - "project_id": project_id, - "topic_id": topic_id, - }, + headers = { + "Authorization": "Bearer " + self.foundation_client.get_access_token(), + "Content-type": "application/octet-stream", + } + response = requests.get( + f"{self.baseurl}/projects/{project_id}/topics/{topic_id}/snippet", + headers=headers, ) + return response.status_code, response.content - def update_snippet(self, project_id="", topic_id="", data=None): - return self.put(f"/projects/{project_id}/topics", data=data) + def update_snippet(self, project_id="", topic_id="", files=None, data=None): + headers = { + "Authorization": "Bearer " + self.foundation_client.get_access_token(), + "Content-type": "application/octet-stream", + } + response = requests.put( + f"{self.baseurl}/projects/{project_id}/topics/{topic_id}/snippet", + headers=headers, + files=files, + ) + return response.status_code def get_files_information(self, project_id="") -> list: return self.get( @@ -488,6 +516,7 @@ class BcfClient: project_id="", topic_id="", guid=None, + files=None, data=None, ): headers = { @@ -498,8 +527,10 @@ class BcfClient: f"/projects/{project_id}/topics/{topic_id}/documents", data=data, params={guid}, + files=files, headers=headers, ) + return response.status_code def get_document(self, project_id="", topic_id="", document_id="") -> str: return self.get( diff --git a/src/foundationserver/bcfserver/bcf/routes.py b/src/foundationserver/bcfserver/bcf/routes.py index 699aa8011b..f9c3f2d5b6 100644 --- a/src/foundationserver/bcfserver/bcf/routes.py +++ b/src/foundationserver/bcfserver/bcf/routes.py @@ -1,11 +1,12 @@ -from operator import methodcaller from flask import jsonify, url_for, redirect, render_template, request, session, flash from flask_login import login_user, logout_user, login_required, current_user from flask.blueprints import Blueprint +from werkzeug.utils import send_file from foundation.models import User, OAuth2AuthorizationCode, OAuth2Token, OAuth2Client from run import app, db import json import os +from flask_expects_json import expects_json bcf = Blueprint("bcf", __name__, template_folder="templates", url_prefix="/bcf/3.0") my_absolute_dirpath = os.path.abspath(os.path.dirname(__file__)) @@ -13,6 +14,7 @@ data = open( f"{my_absolute_dirpath}/project.json", ) jdata = json.load(data) +schema_path = os.path.join(my_absolute_dirpath, "schemas") def validate_client(request): @@ -60,7 +62,12 @@ def project_details(project_id): return invalid_user() +project_put = open(f"{schema_path}/Project/project_PUT.json") +project_put = json.load(project_put) + + @bcf.route("/projects/", methods=["PUT"]) +@expects_json(project_put) def update_project(project_id): if validate_client(request) and request.method == "PUT": data = request.get_json() @@ -69,8 +76,7 @@ def update_project(project_id): response = jsonify(data) return response return invalid_project() - else: - return invalid_user() + return invalid_user() @bcf.route("/projects//extensions") @@ -91,14 +97,16 @@ def topics(project_id): if (project["project_id"]) == project_id: return jsonify(jdata["Topics"]) return invalid_project() + return invalid_user() - else: - return invalid_user() + +topic_post = open(f"{schema_path}/Collaboration/Topic/topic_POST.json") +topic_post = json.load(topic_post) @bcf.route("/projects//topics/", methods=["POST"]) +@expects_json(topic_post) def create_topic(project_id, topic_id): - if validate_client(request) and request.method == "POST": body = request.get_json() for project in jdata["Projects"]: @@ -109,9 +117,7 @@ def create_topic(project_id, topic_id): response.status_code = 201 return response return invalid_project() - - else: - return invalid_user() + return invalid_user() @bcf.route("/projects//topics/") @@ -123,11 +129,15 @@ def topic_details(project_id, topic_id): if (topic["guid"]) == topic_id: return jsonify(topic) return invalid_project() - else: - return invalid_user() + return invalid_user() + + +topic_put = open(f"{schema_path}/Collaboration/Topic/topic_PUT.json") +topic_put = json.load(topic_put) @bcf.route("/projects//topics/", methods=["PUT"]) +@expects_json(topic_put) def update_topic(project_id, topic_id): if validate_client(request) and request.method == "PUT": data = request.get_json() @@ -137,8 +147,7 @@ def update_topic(project_id, topic_id): if (topic["guid"]) == topic_id: return jsonify(data) return invalid_project() - else: - return invalid_user() + return invalid_user() @bcf.route("/projects//topics/", methods=["DELETE"]) @@ -148,10 +157,9 @@ def delete_topic(project_id, topic_id): if (project["project_id"]) == project_id: for topic in jdata["Topics"]: if (topic["guid"]) == topic_id: - return jsonify({"OK"}) + return jsonify("OK") return invalid_project() - else: - return invalid_user() + return invalid_user() @bcf.route("/projects//topics//snippet", methods=["GET"]) @@ -161,10 +169,9 @@ def get_snippet(project_id, topic_id): if (project["project_id"]) == project_id: for topic in jdata["Topics"]: if (topic["guid"]) == topic_id: - return jsonify({"Get Snippet Executed successfully"}) + return send_file(f"{my_absolute_dirpath}/success.txt", download_name="snippet.txt") return invalid_project() - else: - return invalid_user() + return invalid_user() @bcf.route("/projects//topics//snippet", methods=["PUT"]) @@ -175,10 +182,9 @@ def update_snippet(project_id, topic_id): if (project["project_id"]) == project_id: for topic in jdata["Topics"]: if (topic["guid"]) == topic_id: - return jsonify(data) + return jsonify("PUT Request Sucessfull") return invalid_project() - else: - return invalid_user() + return invalid_user() @bcf.route("/projects//files_information", methods=["GET"]) @@ -201,14 +207,16 @@ def get_files(project_id, topic_id): if (topic["guid"]) == topic_id: return jsonify("Get request for files successfull") return invalid_project() + return invalid_user() - else: - return invalid_user() + +file_put = open(f"{schema_path}/Collaboration/File/file_PUT.json") +file_put = json.load(file_put) @bcf.route("/projects//topics//files", methods=["PUT"]) +@expects_json(file_put) def update_files(project_id, topic_id): - if validate_client(request) and request.method == "PUT": data = request.get_json() for project in jdata["Projects"]: @@ -217,9 +225,7 @@ def update_files(project_id, topic_id): if (topic["guid"]) == topic_id: return jsonify(data) return invalid_project() - - else: - return invalid_user() + return invalid_user() @bcf.route("/projects//topics//comments", methods=["GET"]) @@ -231,11 +237,15 @@ def get_comments(project_id, topic_id): if (topic["guid"]) == topic_id: return jsonify(jdata["Comments"]) return invalid_project() - else: - return invalid_user() + return invalid_user() + + +comment_post = open(f"{schema_path}/Collaboration/Comment/comment_POST.json") +comment_post = json.load(comment_post) @bcf.route("/projects//topics//comments", methods=["POST"]) +@expects_json(comment_post) def create_comments(project_id, topic_id): if validate_client(request) and request.method == "POST": data = request.get_json() @@ -247,8 +257,7 @@ def create_comments(project_id, topic_id): response.status_code = 201 return response return invalid_project() - else: - return invalid_user() + return invalid_user() @bcf.route("/projects//topics//comments/", methods=["GET"]) @@ -263,11 +272,15 @@ def get_comment(project_id, topic_id, comment_id): if (comment["guid"]) == comment_id: return jsonify(comment) return invalid_project() - else: - return invalid_user() + return invalid_user() + + +comment_put = open(f"{schema_path}/Collaboration/Comment/comment_PUT.json") +comment_put = json.load(comment_put) @bcf.route("/projects//topics//comments/", methods=["PUT"]) +@expects_json(comment_put) def update_comment(project_id, topic_id, comment_id): if validate_client(request) and request.method == "PUT": data = request.get_json() @@ -279,8 +292,7 @@ def update_comment(project_id, topic_id, comment_id): if (comment["guid"]) == comment_id: return jsonify(data) return invalid_project() - else: - return invalid_user() + return invalid_user() @bcf.route("/projects//topics//comments/", methods=["DELETE"]) @@ -294,14 +306,11 @@ def delete_comment(project_id, topic_id, comment_id): if (comment["guid"]) == comment_id: return jsonify("OK") return invalid_project() - - else: - return invalid_user() + return invalid_user() @bcf.route("/projects//topics//viewpoints", methods=["GET"]) def get_viewpoints(project_id, topic_id): - if validate_client(request) and request.method == "GET": for project in jdata["Projects"]: if project["project_id"] == project_id: @@ -309,11 +318,15 @@ def get_viewpoints(project_id, topic_id): if topic["guid"] == topic_id: return jsonify(jdata["Viewpoints"]) return invalid_project() - else: - return invalid_user() + return invalid_user() + + +viewpoint_post = open(f"{schema_path}/Collaboration/Viewpoint/viewpoint_POST.json") +viewpoint_post = json.load(viewpoint_post) @bcf.route("/projects//topics//viewpoints", methods=["POST"]) +@expects_json(viewpoint_post) def create_viewpoints(project_id, topic_id): if validate_client(request) and request.method == "POST": for project in jdata["Projects"]: @@ -325,8 +338,7 @@ def create_viewpoints(project_id, topic_id): response.status_code = 201 return response return invalid_project() - else: - return invalid_user() + return invalid_user() @bcf.route("/projects//topics//viewpoints/", methods=["GET"]) @@ -342,8 +354,7 @@ def get_viewpoint(project_id, topic_id, viewpoint_id): response.status_code = 200 return response return invalid_project() - else: - return invalid_user() + return invalid_user() @bcf.route("/projects//topics//viewpoints/", methods=["DELETE"]) @@ -359,8 +370,7 @@ def delete_viewpoint(project_id, topic_id, viewpoint_id): response.status_code = 200 return response return invalid_project() - else: - return invalid_user() + return invalid_user() @bcf.route("/projects//topics//viewpoints//snapshot", methods=["GET"]) @@ -376,8 +386,7 @@ def get_snapshot(project_id, topic_id, viewpoint_id): response.status_code = 200 return response return invalid_project() - else: - return invalid_user() + return invalid_user() @bcf.route("/projects//topics//viewpoints//bitmaps/", methods=["GET"]) @@ -395,8 +404,7 @@ def get_bitmap(project_id, topic_id, viewpoint_id, bitmap_id): response.status_code = 200 return response return invalid_project() - else: - return invalid_user() + return invalid_user() @bcf.route("/projects//topics//viewpoints//selection", methods=["GET"]) @@ -412,8 +420,7 @@ def get_selection(project_id, topic_id, viewpoint_id): response.status_code = 200 return response return invalid_project() - else: - return invalid_user() + return invalid_user() @bcf.route("/projects//topics//viewpoints//coloring", methods=["GET"]) @@ -429,8 +436,7 @@ def get_coloring(project_id, topic_id, viewpoint_id): response.status_code = 200 return response return invalid_project() - else: - return invalid_user() + return invalid_user() @bcf.route("/projects//topics//viewpoints//visibility", methods=["GET"]) @@ -446,13 +452,11 @@ def get_visibility(project_id, topic_id, viewpoint_id): response.status_code = 200 return response return invalid_project() - else: - return invalid_user() + return invalid_user() @bcf.route("/projects//topics//related_topics", methods=["GET"]) def get_related_topics(project_id, topic_id): - if validate_client(request) and request.method == "GET": for project in jdata["Projects"]: if (project["project_id"]) == project_id: @@ -460,14 +464,16 @@ def get_related_topics(project_id, topic_id): if (topic["guid"]) == topic_id: return jsonify(jdata["RelatedTopics"]) return invalid_project() - return response - else: - return invalid_user() + return invalid_user() + + +related_topics_put = open(f"{schema_path}/Collaboration/RelatedTopic/related_topic_PUT.json") +related_topics_put = json.load(related_topics_put) @bcf.route("/projects//topics//related_topics", methods=["PUT"]) +@expects_json(related_topics_put) def update_related_topics(project_id, topic_id): - if validate_client(request) and request.method == "PUT": data = request.get_json() for project in jdata["Projects"]: @@ -476,14 +482,11 @@ def update_related_topics(project_id, topic_id): if (topic["guid"]) == topic_id: return jsonify(data) return invalid_project() - - else: - return invalid_user() + return invalid_user() @bcf.route("/projects//topics//document_references", methods=["GET"]) def get_document_references(project_id, topic_id): - if validate_client(request) and request.method == "GET": for project in jdata["Projects"]: if (project["project_id"]) == project_id: @@ -491,14 +494,16 @@ def get_document_references(project_id, topic_id): if (topic["guid"]) == topic_id: return jsonify(jdata["DocumentReferences"]) return invalid_project() + return invalid_user() - else: - return invalid_user() + +document_reference_post = open(f"{schema_path}/Collaboration/DocumentReference/document_reference_POST.json") +document_reference_post = json.load(document_reference_post) @bcf.route("/projects//topics//document_references", methods=["POST"]) +@expects_json(document_reference_post) def create_document_references(project_id, topic_id): - if validate_client(request) and request.method == "POST": data = request.get_json() for project in jdata["Projects"]: @@ -509,17 +514,19 @@ def create_document_references(project_id, topic_id): response.status_code = 201 return response return invalid_project() + return invalid_user() - else: - return invalid_user() + +document_reference_put = open(f"{schema_path}/Collaboration/DocumentReference/document_reference_PUT.json") +document_reference_put = json.load(document_reference_put) @bcf.route( "/projects//topics//document_references/", methods=["PUT"], ) +@expects_json(document_reference_put) def update_document_references(project_id, topic_id, document_reference_id): - if validate_client(request) and request.method == "PUT": data = request.get_json() for project in jdata["Projects"]: @@ -530,14 +537,11 @@ def update_document_references(project_id, topic_id, document_reference_id): if (document["guid"]) == document_reference_id: return jsonify(data) return invalid_project() - - else: - return invalid_user() + return invalid_user() @bcf.route("/projects//topics//documents", methods=["GET"]) def get_documents(project_id, topic_id): - if validate_client(request) and request.method == "GET": for project in jdata["Projects"]: if (project["project_id"]) == project_id: @@ -545,14 +549,11 @@ def get_documents(project_id, topic_id): if (topic["guid"]) == topic_id: return jsonify(jdata["Documents"]) return invalid_project() - - else: - return invalid_user() + return invalid_user() @bcf.route("/projects//topics//documents", methods=["POST"]) def create_documents(project_id, topic_id): - if validate_client(request) and request.method == "POST": data = request.get_json() for project in jdata["Projects"]: @@ -563,14 +564,11 @@ def create_documents(project_id, topic_id): response.status_code = 201 return response return invalid_project() - - else: - return invalid_user() + return invalid_user() @bcf.route("/projects//topics//documents/", methods=["GET"]) def get_document(project_id, topic_id, document_id): - if validate_client(request) and request.method == "GET": for project in jdata["Projects"]: if (project["project_id"]) == project_id: @@ -578,29 +576,23 @@ def get_document(project_id, topic_id, document_id): if (topic["guid"]) == topic_id: for document in jdata["Documents"]: if (document["guid"]) == document_id: - return jsonify(document) + return send_file(f"{my_absolute_dirpath}/success.txt", download_name="document.txt") return invalid_project() - - else: - return invalid_user() + return invalid_user() @bcf.route("/projects//topics/events", methods=["GET"]) def get_events(project_id): - if validate_client(request) and request.method == "GET": for project in jdata["Projects"]: if (project["project_id"]) == project_id: return jsonify(jdata["Events"]) return invalid_project() - - else: - return invalid_user() + return invalid_user() @bcf.route("/projects//topics//events", methods=["GET"]) def get_topic_events(project_id, topic_id): - if validate_client(request) and request.method == "GET": for project in jdata["Projects"]: if (project["project_id"]) == project_id: @@ -610,22 +602,17 @@ def get_topic_events(project_id, topic_id): if (event["topic_guid"]) == topic_id: return jsonify(event) return invalid_project() - - else: - return invalid_user() + return invalid_user() @bcf.route("/projects//topics/comments/events", methods=["GET"]) def get_comments_events(project_id): - if validate_client(request) and request.method == "GET": for project in jdata["Projects"]: if (project["project_id"]) == project_id: return jsonify(jdata["EventComments"]) return invalid_project() - - else: - return invalid_user() + return invalid_user() @bcf.route( @@ -633,7 +620,6 @@ def get_comments_events(project_id): methods=["GET"], ) def get_comment_events(project_id, topic_id, comment_id): - if validate_client(request) and request.method == "GET": for project in jdata["Projects"]: if (project["project_id"]) == project_id: @@ -643,6 +629,4 @@ def get_comment_events(project_id, topic_id, comment_id): if (comment["comment_guid"]) == comment_id: return jsonify(comment) return invalid_project() - - else: - return invalid_user() + return invalid_user() diff --git a/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Action/comment_actions.json b/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Action/comment_actions.json new file mode 100644 index 0000000000..1af06a26dc --- /dev/null +++ b/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Action/comment_actions.json @@ -0,0 +1,10 @@ +{ + "title": "comment_actions", + "required": false, + "type": "array", + "items": { + "type": "string", + "enum": ["update", + "delete"] + } +} diff --git a/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Action/project_actions.json b/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Action/project_actions.json new file mode 100644 index 0000000000..bf84ca72d5 --- /dev/null +++ b/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Action/project_actions.json @@ -0,0 +1,11 @@ +{ + "title": "project_actions", + "required": false, + "type": "array", + "items": { + "type": "string", + "enum": ["update", + "createTopic", + "createDocument"] + } +} diff --git a/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Action/topic_actions.json b/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Action/topic_actions.json new file mode 100644 index 0000000000..a88e007e11 --- /dev/null +++ b/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Action/topic_actions.json @@ -0,0 +1,16 @@ +{ + "title": "topic_actions", + "required": false, + "type": "array", + "items": { + "type": "string", + "enum": ["update", + "updateBimSnippet", + "updateRelatedTopics", + "updateDocumentReferences", + "updateFiles", + "createComment", + "createViewpoint", + "delete"] + } +} diff --git a/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Action/viewpoint_actions.json b/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Action/viewpoint_actions.json new file mode 100644 index 0000000000..8feb815658 --- /dev/null +++ b/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Action/viewpoint_actions.json @@ -0,0 +1,7 @@ +{ + "required": false, + "type": "array", + "items": { + "enum": ["delete"] + } +} diff --git a/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Comment/comment_GET.json b/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Comment/comment_GET.json new file mode 100644 index 0000000000..76c2d6a44e --- /dev/null +++ b/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Comment/comment_GET.json @@ -0,0 +1,47 @@ +{ + "title": "comment_GET", + "type": "object", + "properties": { + "guid": { + "required": true, + "type": "string" + }, + "date": { + "required": true, + "type": "string" + }, + "author": { + "required": true, + "type": "string" + }, + "comment": { + "required": true, + "type": "string" + }, + "topic_guid": { + "required": true, + "type": "string" + }, + "viewpoint_guid": { + "type": ["string", + "null"] + }, + "modified_date": { + "type": ["string", + "null"] + }, + "modified_author": { + "type": ["string", + "null"] + }, + "authorization": { + "type": "object", + "required": false, + "properties": { + "comment_actions": { + "$ref": "../Action/comment_actions.json" + } + } + } + } +} diff --git a/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Comment/comment_POST.json b/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Comment/comment_POST.json new file mode 100644 index 0000000000..bb3e60d12a --- /dev/null +++ b/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Comment/comment_POST.json @@ -0,0 +1,18 @@ +{ + "title": "comment_POST", + "type": "object", + "properties": { + "guid": { + "type": ["string", + "null"] + }, + "comment": { + "required": true, + "type": "string" + }, + "viewpoint_guid": { + "type": ["string", + "null"] + } + } +} diff --git a/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Comment/comment_PUT.json b/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Comment/comment_PUT.json new file mode 100644 index 0000000000..8ceff5afef --- /dev/null +++ b/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Comment/comment_PUT.json @@ -0,0 +1,14 @@ +{ + "title": "comment_PUT", + "type": "object", + "properties": { + "comment": { + "required": true, + "type": "string" + }, + "viewpoint_guid": { + "type": ["string", + "null"] + } + } +} diff --git a/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Document/document_GET.json b/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Document/document_GET.json new file mode 100644 index 0000000000..b8c4025977 --- /dev/null +++ b/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Document/document_GET.json @@ -0,0 +1,14 @@ +{ + "title": "document_GET", + "type": "object", + "properties": { + "guid": { + "required": true, + "type": "string" + }, + "filename": { + "required": true, + "type": "string" + } + } +} diff --git a/src/foundationserver/bcfserver/bcf/schemas/Collaboration/DocumentReference/document_reference_GET.json b/src/foundationserver/bcfserver/bcf/schemas/Collaboration/DocumentReference/document_reference_GET.json new file mode 100644 index 0000000000..37d649a06e --- /dev/null +++ b/src/foundationserver/bcfserver/bcf/schemas/Collaboration/DocumentReference/document_reference_GET.json @@ -0,0 +1,21 @@ +{ + "$schema": "http://json-schema.org/draft-03/schema#", + "title": "document_reference_GET", + "description": "Schema for a single document reference GET, BCF REST API.", + "type": "object", + "properties": { + "guid": { + "required": true, + "type": "string" + }, + "document_guid": { + "type": ["string", "null"] + }, + "url": { + "type": ["string", "null"] + }, + "description": { + "type": ["string", "null"] + } + } +} diff --git a/src/foundationserver/bcfserver/bcf/schemas/Collaboration/DocumentReference/document_reference_POST.json b/src/foundationserver/bcfserver/bcf/schemas/Collaboration/DocumentReference/document_reference_POST.json new file mode 100644 index 0000000000..0e198490db --- /dev/null +++ b/src/foundationserver/bcfserver/bcf/schemas/Collaboration/DocumentReference/document_reference_POST.json @@ -0,0 +1,18 @@ +{ + "title": "document_reference_POST", + "type": "object", + "properties": { + "guid": { + "type": ["string", "null"] + }, + "document_guid": { + "type": ["string", "null"] + }, + "url": { + "type": ["string", "null"] + }, + "description": { + "type": ["string", "null"] + } + } +} diff --git a/src/foundationserver/bcfserver/bcf/schemas/Collaboration/DocumentReference/document_reference_PUT.json b/src/foundationserver/bcfserver/bcf/schemas/Collaboration/DocumentReference/document_reference_PUT.json new file mode 100644 index 0000000000..2e2dbd4753 --- /dev/null +++ b/src/foundationserver/bcfserver/bcf/schemas/Collaboration/DocumentReference/document_reference_PUT.json @@ -0,0 +1,15 @@ +{ + "title": "document_reference_PUT", + "type": "object", + "properties": { + "document_guid": { + "type": ["string", "null"] + }, + "url": { + "type": ["string", "null"] + }, + "description": { + "type": ["string", "null"] + } + } +} diff --git a/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Events/comment_event_GET.json b/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Events/comment_event_GET.json new file mode 100644 index 0000000000..b623d8ee34 --- /dev/null +++ b/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Events/comment_event_GET.json @@ -0,0 +1,29 @@ +{ + "title": "comment_event_GET", + "type": "object", + "properties": { + "comment_guid": { + "required": true, + "type": "string" + }, + "topic_guid": { + "required": true, + "type": "string" + }, + "date": { + "required": true, + "type": "string" + }, + "author": { + "required": true, + "type": "string" + }, + "actions": { + "type": "array", + "minItems": 1, + "items": { + "$ref": "event_action.json" + } + } + } +} diff --git a/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Events/event_action.json b/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Events/event_action.json new file mode 100644 index 0000000000..a90c0604bc --- /dev/null +++ b/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Events/event_action.json @@ -0,0 +1,14 @@ +{ + "title": "event_action", + "type": ["object", "null"], + "properties": { + "type": { + "required": true, + "type": "string" + }, + "value": { + "type": ["string", + "null"] + } + } +} diff --git a/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Events/topic_event_GET.json b/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Events/topic_event_GET.json new file mode 100644 index 0000000000..1192e67ca1 --- /dev/null +++ b/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Events/topic_event_GET.json @@ -0,0 +1,25 @@ +{ + "title": "topic_event_GET", + "type": "object", + "properties": { + "topic_guid": { + "required": true, + "type": "string" + }, + "date": { + "required": true, + "type": "string" + }, + "author": { + "required": true, + "type": "string" + }, + "actions": { + "type": "array", + "minItems": 1, + "items": { + "$ref": "event_action.json" + } + } + } +} diff --git a/src/foundationserver/bcfserver/bcf/schemas/Collaboration/File/file_GET.json b/src/foundationserver/bcfserver/bcf/schemas/Collaboration/File/file_GET.json new file mode 100644 index 0000000000..55d6b8642f --- /dev/null +++ b/src/foundationserver/bcfserver/bcf/schemas/Collaboration/File/file_GET.json @@ -0,0 +1,28 @@ +{ + "$schema": "http://json-schema.org/draft-03/schema#", + "title": "file_GET", + "description": "Schema for a single file GET, BCF REST API.", + "type": "object", + "properties": { + "ifc_project": { + "type": ["string", + "null"] + }, + "ifc_spatial_structure_element": { + "type": ["string", + "null"] + }, + "filename": { + "type": ["string", + "null"] + }, + "date": { + "type": ["string", + "null"] + }, + "reference": { + "type": ["string", + "null"] + } + } +} diff --git a/src/foundationserver/bcfserver/bcf/schemas/Collaboration/File/file_PUT.json b/src/foundationserver/bcfserver/bcf/schemas/Collaboration/File/file_PUT.json new file mode 100644 index 0000000000..7152d6890c --- /dev/null +++ b/src/foundationserver/bcfserver/bcf/schemas/Collaboration/File/file_PUT.json @@ -0,0 +1,26 @@ +{ + "title": "file_PUT", + "type": "object", + "properties": { + "ifc_project": { + "type": ["string", + "null"] + }, + "ifc_spatial_structure_element": { + "type": ["string", + "null"] + }, + "filename": { + "type": ["string", + "null"] + }, + "date": { + "type": ["string", + "null"] + }, + "reference": { + "type": ["string", + "null"] + } + } +} diff --git a/src/foundationserver/bcfserver/bcf/schemas/Collaboration/File/project_file_display_information.json b/src/foundationserver/bcfserver/bcf/schemas/Collaboration/File/project_file_display_information.json new file mode 100644 index 0000000000..bb808f5dde --- /dev/null +++ b/src/foundationserver/bcfserver/bcf/schemas/Collaboration/File/project_file_display_information.json @@ -0,0 +1,16 @@ +{ + "$schema": "http://json-schema.org/draft-03/schema#", + "title": "project_file_display_information", + "description": "Schema for the display information of a project file, BCF REST API.", + "type": "object", + "properties": { + "field_display_name": { + "required": true, + "type": "string" + }, + "field_value": { + "required": true, + "type": "string" + } + } +} diff --git a/src/foundationserver/bcfserver/bcf/schemas/Collaboration/File/project_file_information.json b/src/foundationserver/bcfserver/bcf/schemas/Collaboration/File/project_file_information.json new file mode 100644 index 0000000000..b85bf59a1b --- /dev/null +++ b/src/foundationserver/bcfserver/bcf/schemas/Collaboration/File/project_file_information.json @@ -0,0 +1,13 @@ +{ + "title": "project_file_information", + "description": "Schema for a single project file information, BCF REST API.", + "type": "object", + "properties": { + "display_information": { + "type": "array", + "items": { "$ref": "project_file_display_information.json" }, + "default": [] + }, + "file": { "$ref": "file_GET.json" } + } +} diff --git a/src/foundationserver/bcfserver/bcf/schemas/Collaboration/File/project_files_information_GET.json b/src/foundationserver/bcfserver/bcf/schemas/Collaboration/File/project_files_information_GET.json new file mode 100644 index 0000000000..3a85e6a247 --- /dev/null +++ b/src/foundationserver/bcfserver/bcf/schemas/Collaboration/File/project_files_information_GET.json @@ -0,0 +1,8 @@ +{ + "description": "Schema for the listing the response of the GET project files information service", + "title": "project_files_information_GET", + "type": "array", + "items": { + "$ref": "project_file_information.json" + } +} diff --git a/src/foundationserver/bcfserver/bcf/schemas/Collaboration/RelatedTopic/related_topic_GET.json b/src/foundationserver/bcfserver/bcf/schemas/Collaboration/RelatedTopic/related_topic_GET.json new file mode 100644 index 0000000000..654ec6fc19 --- /dev/null +++ b/src/foundationserver/bcfserver/bcf/schemas/Collaboration/RelatedTopic/related_topic_GET.json @@ -0,0 +1,12 @@ +{ + "$schema": "http://json-schema.org/draft-03/schema#", + "title": "related_topic_GET", + "description": "Schema for single related topic GET, BCF REST API.", + "type": "object", + "properties": { + "related_topic_guid": { + "required": true, + "type": "string" + } + } +} diff --git a/src/foundationserver/bcfserver/bcf/schemas/Collaboration/RelatedTopic/related_topic_PUT.json b/src/foundationserver/bcfserver/bcf/schemas/Collaboration/RelatedTopic/related_topic_PUT.json new file mode 100644 index 0000000000..8511a768ea --- /dev/null +++ b/src/foundationserver/bcfserver/bcf/schemas/Collaboration/RelatedTopic/related_topic_PUT.json @@ -0,0 +1,12 @@ +{ + "$schema": "http://json-schema.org/draft-03/schema#", + "title": "related_topic_PUT", + "description": "Schema for related topic PUT, BCF REST API.", + "type": "object", + "properties": { + "related_topic_guid": { + "required": true, + "type": "string" + } + } +} diff --git a/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Topic/bim_snippet.json b/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Topic/bim_snippet.json new file mode 100644 index 0000000000..3be8fb8f73 --- /dev/null +++ b/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Topic/bim_snippet.json @@ -0,0 +1,23 @@ +{ + "title": "bim_snippet", + "type": ["object", + "null"], + "properties": { + "snippet_type": { + "required": true, + "type": "string" + }, + "is_external": { + "required": true, + "type": "boolean" + }, + "reference": { + "required": true, + "type": "string" + }, + "reference_schema": { + "required": true, + "type": "string" + } + } +} diff --git a/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Topic/topic_GET.json b/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Topic/topic_GET.json new file mode 100644 index 0000000000..584d041702 --- /dev/null +++ b/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Topic/topic_GET.json @@ -0,0 +1,101 @@ +{ + "title": "topic_GET", + "type": "object", + "properties": { + "guid": { + "required": true, + "type": "string" + }, + "server_assigned_id": { + "required": true, + "type": "string" + }, + "topic_type": { + "type": ["string", + "null"] + }, + "topic_status": { + "type": ["string", + "null"] + }, + "reference_links": { + "type": ["array", + "null"], + "items": { + "type": "string" + } + }, + "title": { + "required": true, + "type": "string" + }, + "priority": { + "type": ["string", + "null"] + }, + "index": { + "type": [ + "integer", + "null" + ] + }, + "labels": { + "type": ["array", + "null"], + "items": { + "type": ["string", + "null"] + } + }, + "creation_date": { + "required": true, + "type": "string" + }, + "creation_author": { + "required": true, + "type": "string" + }, + "modified_date": { + "type": "string" + }, + "modified_author": { + "type": ["string", + "null"] + }, + "assigned_to": { + "type": ["string", + "null"] + }, + "stage": { + "type": ["string", + "null"] + }, + "description": { + "type": ["string", + "null"] + }, + "bim_snippet": { + "$ref": "bim_snippet.json" + }, + "due_date": { + "type": ["string", + "null"] + }, + "authorization": { + "type": "object", + "required": false, + "properties": { + "topic_actions": { + "$ref": "../Action/topic_actions.json" + }, + "topic_status": { + "type": ["array", + "null"], + "items": { + "type": "string" + } + } + } + } + } +} diff --git a/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Topic/topic_POST.json b/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Topic/topic_POST.json new file mode 100644 index 0000000000..6ae49158fc --- /dev/null +++ b/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Topic/topic_POST.json @@ -0,0 +1,68 @@ +{ + "$schema": "http://json-schema.org/draft-03/schema#", + "title": "topic_POST", + "description": "Schema for topic POST, BCF REST API.", + "type": "object", + "properties": { + "guid": { + "type": ["string", + "null"] + }, + "topic_type": { + "type": ["string", + "null"] + }, + "topic_status": { + "type": ["string", + "null"] + }, + "reference_links": { + "type": ["array", + "null"], + "items": { + "type": "string" + } + }, + "title": { + "required": true, + "type": "string" + }, + "priority": { + "type": ["string", + "null"] + }, + "index": { + "type": [ + "integer", + "null" + ] + }, + "labels": { + "type": ["array", + "null"], + "items": { + "type": ["string", + "null"] + } + }, + "assigned_to": { + "type": ["string", + "null"] + }, + "stage": { + "type": ["string", + "null"] + }, + "description": { + "type": ["string", + "null"] + }, + "bim_snippet": { + "$ref": "bim_snippet.json" + }, + "due_date": { + "type": ["string", + "null"] + } + } +} diff --git a/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Topic/topic_PUT.json b/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Topic/topic_PUT.json new file mode 100644 index 0000000000..2b0935eb9a --- /dev/null +++ b/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Topic/topic_PUT.json @@ -0,0 +1,64 @@ +{ + "$schema": "http://json-schema.org/draft-03/schema#", + "title": "topic_PUT", + "description": "Schema for topic PUT, BCF REST API.", + "type": "object", + "properties": { + "topic_type": { + "type": ["string", + "null"] + }, + "topic_status": { + "type": ["string", + "null"] + }, + "reference_links": { + "type": ["array", + "null"], + "items": { + "type": "string" + } + }, + "title": { + "required": true, + "type": "string" + }, + "priority": { + "type": ["string", + "null"] + }, + "index": { + "type": [ + "integer", + "null" + ] + }, + "labels": { + "type": ["array", + "null"], + "items": { + "type": ["string", + "null"] + } + }, + "assigned_to": { + "type": ["string", + "null"] + }, + "stage": { + "type": ["string", + "null"] + }, + "description": { + "type": ["string", + "null"] + }, + "bim_snippet": { + "$ref": "bim_snippet.json" + }, + "due_date": { + "type": ["string", + "null"] + } + } +} diff --git a/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Viewpoint/bitmap_GET.json b/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Viewpoint/bitmap_GET.json new file mode 100644 index 0000000000..5373008612 --- /dev/null +++ b/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Viewpoint/bitmap_GET.json @@ -0,0 +1,24 @@ +{ + "type": "object", + "properties": { + "guid": { + "type": "string" + }, + "bitmap_type": { + "type": "string", + "enum": ["jpg", "png"] + }, + "location": { + "$ref": "location.json" + }, + "normal": { + "$ref": "direction.json" + }, + "up": { + "$ref": "direction.json" + }, + "height": { + "type": "number" + } + } +} diff --git a/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Viewpoint/bitmap_POST.json b/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Viewpoint/bitmap_POST.json new file mode 100644 index 0000000000..cd7932dcb3 --- /dev/null +++ b/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Viewpoint/bitmap_POST.json @@ -0,0 +1,25 @@ +{ + "type": "object", + "properties": { + "bitmap_type": { + "type": "string", + "enum": ["jpg", "png"] + }, + "bitmap_data": { + "type": "string", + "format": "base64" + }, + "location": { + "$ref": "location.json" + }, + "normal": { + "$ref": "direction.json" + }, + "up": { + "$ref": "direction.json" + }, + "height": { + "type": "number" + } + } +} diff --git a/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Viewpoint/clipping_plane.json b/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Viewpoint/clipping_plane.json new file mode 100644 index 0000000000..e9fad7b61e --- /dev/null +++ b/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Viewpoint/clipping_plane.json @@ -0,0 +1,13 @@ +{ + "title": "clipping_plane", + "type": ["object", + "null"], + "properties": { + "location": { + "$ref": "location.json" + }, + "direction": { + "$ref": "direction.json" + } + } +} diff --git a/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Viewpoint/coloring.json b/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Viewpoint/coloring.json new file mode 100644 index 0000000000..89d3270270 --- /dev/null +++ b/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Viewpoint/coloring.json @@ -0,0 +1,12 @@ +{ + "title": "coloring", + "type": "object", + "properties": { + "color": { + "type": "string" + }, + "components": { + "$ref": "component_list.json" + } + } +} diff --git a/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Viewpoint/coloring_GET.json b/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Viewpoint/coloring_GET.json new file mode 100644 index 0000000000..c738f20a86 --- /dev/null +++ b/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Viewpoint/coloring_GET.json @@ -0,0 +1,14 @@ +{ + "$schema": "http://json-schema.org/draft-03/schema#", + "title": "coloring_GET", + "description": "Schema for coloring GET, BCF REST API.", + "type": "object", + "properties": { + "coloring": { + "type": ["array", "null"], + "items": { + "$ref": "coloring.json" + } + } + } +} diff --git a/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Viewpoint/component.json b/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Viewpoint/component.json new file mode 100644 index 0000000000..49df1c0e1e --- /dev/null +++ b/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Viewpoint/component.json @@ -0,0 +1,15 @@ +{ + "title": "component", + "type": ["object"], + "properties": { + "ifc_guid": { + "type": ["string", "null"] + }, + "originating_system": { + "type": ["string", "null"] + }, + "authoring_tool_id": { + "type": ["string", "null"] + } + } +} diff --git a/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Viewpoint/component_list.json b/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Viewpoint/component_list.json new file mode 100644 index 0000000000..0ec6d59fe6 --- /dev/null +++ b/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Viewpoint/component_list.json @@ -0,0 +1,7 @@ +{ + "title": "component list", + "type": ["array", "null"], + "items": { + "$ref": "component.json" + } +} diff --git a/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Viewpoint/components.json b/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Viewpoint/components.json new file mode 100644 index 0000000000..66a233ae5f --- /dev/null +++ b/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Viewpoint/components.json @@ -0,0 +1,18 @@ +{ + "title": "components", + "type": ["object", "null"], + "properties": { + "selection": { + "$ref": "component_list.json" + }, + "coloring": { + "type": ["array", "null"], + "items": { + "$ref": "coloring.json" + } + }, + "visibility": { + "$ref": "visibility.json" + } + } +} diff --git a/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Viewpoint/direction.json b/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Viewpoint/direction.json new file mode 100644 index 0000000000..da6e137aee --- /dev/null +++ b/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Viewpoint/direction.json @@ -0,0 +1,15 @@ +{ + "title": "direction", + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + }, + "z": { + "type": "number" + } + } +} diff --git a/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Viewpoint/line.json b/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Viewpoint/line.json new file mode 100644 index 0000000000..4f4e0f3af4 --- /dev/null +++ b/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Viewpoint/line.json @@ -0,0 +1,12 @@ +{ + "title": "line", + "type": ["object", "null"], + "properties": { + "start_point": { + "$ref": "point.json" + }, + "end_point": { + "$ref": "point.json" + } + } +} diff --git a/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Viewpoint/location.json b/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Viewpoint/location.json new file mode 100644 index 0000000000..c38696d938 --- /dev/null +++ b/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Viewpoint/location.json @@ -0,0 +1,16 @@ +{ + "title": "location", + "type": ["object", + "null"], + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + }, + "z": { + "type": "number" + } + } +} diff --git a/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Viewpoint/orthogonal_camera.json b/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Viewpoint/orthogonal_camera.json new file mode 100644 index 0000000000..f9d69e47b8 --- /dev/null +++ b/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Viewpoint/orthogonal_camera.json @@ -0,0 +1,22 @@ +{ + "title": "orthogonal_camera", + "type": ["object", + "null"], + "properties": { + "camera_view_point": { + "$ref": "point.json" + }, + "camera_direction": { + "$ref": "direction.json" + }, + "camera_up_vector": { + "$ref": "direction.json" + }, + "view_to_world_scale": { + "type": "number" + }, + "aspect_ratio": { + "type": "number" + } + } +} diff --git a/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Viewpoint/perspective_camera.json b/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Viewpoint/perspective_camera.json new file mode 100644 index 0000000000..a3afcdd7ad --- /dev/null +++ b/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Viewpoint/perspective_camera.json @@ -0,0 +1,22 @@ +{ + "title": "perspective_camera", + "type": ["object", + "null"], + "properties": { + "camera_view_point": { + "$ref": "point.json" + }, + "camera_direction": { + "$ref": "direction.json" + }, + "camera_up_vector": { + "$ref": "direction.json" + }, + "field_of_view": { + "type": "number" + }, + "aspect_ratio": { + "type": "number" + } + } +} diff --git a/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Viewpoint/point.json b/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Viewpoint/point.json new file mode 100644 index 0000000000..19558a426d --- /dev/null +++ b/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Viewpoint/point.json @@ -0,0 +1,15 @@ +{ + "title": "point", + "type": "object", + "properties": { + "x": { + "type": "number" + }, + "y": { + "type": "number" + }, + "z": { + "type": "number" + } + } +} diff --git a/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Viewpoint/selection_GET.json b/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Viewpoint/selection_GET.json new file mode 100644 index 0000000000..2296b027f3 --- /dev/null +++ b/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Viewpoint/selection_GET.json @@ -0,0 +1,11 @@ +{ + "$schema": "http://json-schema.org/draft-03/schema#", + "title": "selection_GET", + "description": "Schema for selection GET, BCF REST API.", + "type": "object", + "properties": { + "selection": { + "$ref": "component_list.json" + } + } +} diff --git a/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Viewpoint/snapshot_GET.json b/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Viewpoint/snapshot_GET.json new file mode 100644 index 0000000000..6235b0add1 --- /dev/null +++ b/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Viewpoint/snapshot_GET.json @@ -0,0 +1,10 @@ +{ + "title": "snapshot_GET", + "type": ["object", "null"], + "properties": { + "snapshot_type": { + "type": ["string"], + "enum": ["jpg", "png"] + } + } +} diff --git a/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Viewpoint/snapshot_POST.json b/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Viewpoint/snapshot_POST.json new file mode 100644 index 0000000000..a349e91cdb --- /dev/null +++ b/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Viewpoint/snapshot_POST.json @@ -0,0 +1,14 @@ +{ + "title": "snapshot_POST", + "type": ["object", "null"], + "properties": { + "snapshot_type": { + "type": ["string"], + "enum": ["jpg", "png"] + }, + "snapshot_data": { + "type": ["string"], + "format": "base64" + } + } +} diff --git a/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Viewpoint/view_setup_hints.json b/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Viewpoint/view_setup_hints.json new file mode 100644 index 0000000000..81f8ab7f34 --- /dev/null +++ b/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Viewpoint/view_setup_hints.json @@ -0,0 +1,18 @@ +{ + "title": "view_setup_hints", + "type": ["object", "null"], + "properties": { + "spaces_visible": { + "type": "boolean", + "default": "false" + }, + "space_boundaries_visible": { + "type": "boolean", + "default": "false" + }, + "openings_visible": { + "type": "boolean", + "default": "false" + } + } +} diff --git a/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Viewpoint/viewpoint_GET.json b/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Viewpoint/viewpoint_GET.json new file mode 100644 index 0000000000..513c26d4ad --- /dev/null +++ b/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Viewpoint/viewpoint_GET.json @@ -0,0 +1,52 @@ +{ + "title": "viewpoint_GET", + "type": "object", + "properties": { + "index": { + "type": [ + "integer", + "null" + ] + }, + "guid": { + "required": true, + "type": "string" + }, + "orthogonal_camera": { + "$ref": "orthogonal_camera.json" + }, + "perspective_camera": { + "$ref": "perspective_camera.json" + }, + "lines": { + "type": ["array", "null"], + "items": { + "$ref": "line.json" + } + }, + "clipping_planes": { + "type": ["array", "null"], + "items": { + "$ref": "clipping_plane.json" + } + }, + "bitmaps": { + "type": ["array", "null"], + "items": { + "$ref": "bitmap_GET.json" + } + }, + "snapshot": { + "$ref": "snapshot_GET.json" + }, + "authorization": { + "type": "object", + "required": false, + "properties": { + "viewpoint_actions": { + "$ref": "../Action/viewpoint_actions.json" + } + } + } + } +} diff --git a/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Viewpoint/viewpoint_POST.json b/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Viewpoint/viewpoint_POST.json new file mode 100644 index 0000000000..b9408d0d9d --- /dev/null +++ b/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Viewpoint/viewpoint_POST.json @@ -0,0 +1,46 @@ +{ + "title": "viewpoint_POST", + "type": [ "object" ], + "properties": { + "guid": { + "type": ["string", + "null"] + }, + "index": { + "type": [ + "integer", + "null" + ] + }, + "orthogonal_camera": { + "$ref": "orthogonal_camera.json" + }, + "perspective_camera": { + "$ref": "perspective_camera.json" + }, + "lines": { + "type": ["array", "null"], + "items": { + "$ref": "line.json" + } + }, + "clipping_planes": { + "type": ["array", "null"], + "items": { + "$ref": "clipping_plane.json" + } + }, + "bitmaps": { + "type": ["array", "null"], + "items": { + "$ref": "bitmap_POST.json" + } + }, + "snapshot": { + "$ref": "snapshot_POST.json" + }, + "components": { + "$ref": "components.json" + } + } +} diff --git a/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Viewpoint/visibility.json b/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Viewpoint/visibility.json new file mode 100644 index 0000000000..13ea0d08fe --- /dev/null +++ b/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Viewpoint/visibility.json @@ -0,0 +1,16 @@ +{ + "title": "visibility", + "type": "object", + "properties": { + "default_visibility": { + "type": "boolean", + "default": "false" + }, + "exceptions": { + "$ref": "component_list.json" + }, + "view_setup_hints": { + "$ref": "view_setup_hints.json" + } + } +} diff --git a/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Viewpoint/visibility_GET.json b/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Viewpoint/visibility_GET.json new file mode 100644 index 0000000000..5fe8714168 --- /dev/null +++ b/src/foundationserver/bcfserver/bcf/schemas/Collaboration/Viewpoint/visibility_GET.json @@ -0,0 +1,12 @@ +{ + "$schema": "http://json-schema.org/draft-03/schema#", + "title": "visibility_GET", + "description": "Schema for visibility GET, BCF REST API.", + "type": "object", + + "properties": { + "visibility": { + "$ref": "visibility.json" + } + } +} diff --git a/src/foundationserver/bcfserver/bcf/schemas/Project/extensions_GET.json b/src/foundationserver/bcfserver/bcf/schemas/Project/extensions_GET.json new file mode 100644 index 0000000000..92de386640 --- /dev/null +++ b/src/foundationserver/bcfserver/bcf/schemas/Project/extensions_GET.json @@ -0,0 +1,78 @@ +{ + "title": "extensions_GET", + "type": "object", + "properties": { + "topic_type": { + "required": true, + "type": ["array", + "null"], + "items": { + "type": ["string", + "null"] + } + }, + "topic_status": { + "required": true, + "type": ["array", + "null"], + "items": { + "type": ["string", + "null"] + } + }, + "topic_label": { + "required": true, + "type": ["array", + "null"], + "items": { + "type": ["string", + "null"] + } + }, + "snippet_type": { + "required": true, + "type": ["array", + "null"], + "items": { + "type": ["string", + "null"] + } + }, + "priority": { + "required": true, + "type": ["array", + "null"], + "items": { + "type": ["string", + "null"] + } + }, + "users": { + "required": true, + "type": ["array", + "null"], + "items": { + "type": ["string", + "null"] + } + }, + "stage": { + "required": true, + "type": ["array", + "null"], + "items": { + "type": ["string", + "null"] + } + }, + "project_actions": { + "$ref": "../Collaboration/Action/project_actions.json" + }, + "topic_actions": { + "$ref": "../Collaboration/Action/topic_actions.json" + }, + "comment_actions": { + "$ref": "../Collaboration/Action/comment_actions.json" + } + } +} diff --git a/src/foundationserver/bcfserver/bcf/schemas/Project/project_GET.json b/src/foundationserver/bcfserver/bcf/schemas/Project/project_GET.json new file mode 100644 index 0000000000..e239d4e73a --- /dev/null +++ b/src/foundationserver/bcfserver/bcf/schemas/Project/project_GET.json @@ -0,0 +1,25 @@ +{ + "$schema": "http://json-schema.org/draft-03/schema#", + "title": "project_GET", + "description": "Schema for single project GET, BCF REST API.", + "type": "object", + "properties": { + "project_id": { + "type": "string", + "required": true + }, + "name": { + "type": "string", + "required": true + }, + "authorization": { + "type": "object", + "required": false, + "properties": { + "project_actions": { + "$ref": "../Collaboration/Action/project_actions.json" + } + } + } + } +} diff --git a/src/foundationserver/bcfserver/bcf/schemas/Project/project_PUT.json b/src/foundationserver/bcfserver/bcf/schemas/Project/project_PUT.json new file mode 100644 index 0000000000..5b317ab276 --- /dev/null +++ b/src/foundationserver/bcfserver/bcf/schemas/Project/project_PUT.json @@ -0,0 +1,12 @@ +{ + "$schema": "http://json-schema.org/draft-03/schema#", + "title": "project_PUT", + "description": "Schema for project PUT, BCF REST API.", + "type": "object", + "properties": { + "name": { + "type": "string", + "required": true + } + } +} diff --git a/src/foundationserver/bcfserver/bcf/schemas/User/user_GET.json b/src/foundationserver/bcfserver/bcf/schemas/User/user_GET.json new file mode 100644 index 0000000000..873129c155 --- /dev/null +++ b/src/foundationserver/bcfserver/bcf/schemas/User/user_GET.json @@ -0,0 +1,14 @@ +{ + "title": "user_GET", + "type": "object", + "properties": { + "id": { + "required": true, + "type": "string" + }, + "name": { + "type": ["string", + "null"] + } + } +} diff --git a/src/foundationserver/bcfserver/bcf/schemas/error.json b/src/foundationserver/bcfserver/bcf/schemas/error.json new file mode 100644 index 0000000000..66a5550975 --- /dev/null +++ b/src/foundationserver/bcfserver/bcf/schemas/error.json @@ -0,0 +1,12 @@ +{ + "$schema": "http://json-schema.org/draft-03/schema#", + "title": "Error", + "description": "Schema for error, BCF REST API.", + "type": "object", + "properties": { + "message": { + "type": "string", + "required": true + } + } +} diff --git a/src/foundationserver/bcfserver/bcf/success.txt b/src/foundationserver/bcfserver/bcf/success.txt new file mode 100644 index 0000000000..60f280850b --- /dev/null +++ b/src/foundationserver/bcfserver/bcf/success.txt @@ -0,0 +1 @@ +Your request was successfull \ No newline at end of file