Skip to content

Latest commit

 

History

History
475 lines (430 loc) · 9.06 KB

File metadata and controls

475 lines (430 loc) · 9.06 KB

API Documentation


Models

User

	@User{
		id: @string,
		username: @string,
		password: @string,
		email: @string
	}

Project

	@Project{
		id: @string,
		userIds: array(@string),
		primary: @string,
		name: @string,
		image: @string,
		description: @string,
		db_name: @string
	}

Layout

	@Layout{
		w : @int,
		h : @int,
		x : @int,
		y : @int,
		i : @string,
		minW : @int,
		minH : @int,
		moved : boolean,
		static : boolean
	}

Collection

	@Collection{
		refId : @string
		viewId: @string,
		altsid : array(@string),
		collectionName : @string,
		text : @string,
		tags : array(@string),
		viewType : Enum{1:"file view", 2:"parallel view", 3:"list view"},
		isSinked: @boolean,
		err : @boolean,
		status : Enum{"ACTIVE":"alt exists", "DELETED":"alt was removed"}
		collectionNameView: @string
	}
	@CollectionWithLayout{
		refId : @string
		viewId: @string,
		altsid : array(@string),
		collectionName : @string,
		text : @string,
		tags : array(@string),
		viewType : Enum{1:"file view", 2:"parallel view", 3:"list view"},
		isSinked: @boolean,
		err : @boolean,
		status : Enum{"ACTIVE":"alt exists", "DELETED":"alt was removed"}
		collectionNameView: @string,
		layout: @Layout
	}
	@CollectionWithKeySets{
		refId : @string
		viewId: @string,
		altsid : array(@string),
		collectionName : @string,
		text : @string,
		tags : array(@string),
		viewType : Enum{1:"file view", 2:"parallel view", 3:"list view"},
		isSinked: @boolean,
		err : @boolean,
		status : Enum{"ACTIVE":"alt exists", "DELETED":"alt was removed"}
		collectionNameView: @string,
		keySets:array(@string),
		isInput:array(@boolean)
	}

Attribute

	@Attribute{
		key: @string,
	    value: @int,
		typeName : Enum{},
	    isInput: @boolean,
	    ordered : @boolean,
		max : @int,
		min : @int,
		step : @int
	}

Alternative

	@Alternative{
		_id : @string,
		refId : @string,
		viewId: @string,
		collectionViewId: @string,
		collectionRefId: @string,
		image: @string,
		xml: @string,
		gltf: @string,
		geometry: @string,
		collectionName: @string,
		RhinoFile: @string,
		tags: array(@string),
		attributes: array(@Attributes),
		history: array(@string),
		parents: array(@string),
		status : Enum{"ACTIVE":"alt exists", "DELETED":"alt was removed"}
	}
	AlternativeDetailed{
		_id : @string,
		refId : @string,
		viewId: @string,
		collectionViewId: @string,
		collectionRefId: @string,
		image: @string,
		xml: @string,
		gltf: @string,
		geometry: @string,
		collectionName: @string,
		RhinoFile: @string,
		tags: array(@string),
		params: @Dictionary(input:value),
		outputs: @Dictionary(output:value),
	}
	@AlternativeShort{
		refId : @string,
		viewId: @string,
		image: @string
	}

File

	@File{
		id : @string,
		refId : @string,
		filename : @string,
		data : @string,
		type : @string,
		err : @boolean
	}

APIs

Users

Login

	Url: /user/login
	Method: POST
	Description: it logs in to an existing account
	Headers:{
	}
	Body:{
		username:@string,
		password:@string
	}
	Response:{
		success:@boolean,		
		user:@User
	}

Registere

	Url: /user/register
	Method: POST
	Description: it creates a new account
	Headers:{
	}
	Body:{
		username:@string,
		password:@string
	}
	Response:{
		success:@boolean,
		user:@User
	}

Projects

Fetch

	Url: /project
	Method: GET
	Description: it fethes all the projects
	Headers:{
		userid:@string
	}
	Body:{
	}
	Response:{
		success:@boolean,
		projects:array(@Project),
		db_loaded:@boolean
	}

Create

	Url: /project
	Method: POST
	Description: it creates a new projecct
	Headers:{
		userid:@string
	}
	Body:{
		name:@string,
		description:@string
	}
	Response:{
		success:@boolean,
		projects:array(@Project),
		db_loaded:@boolean
	}

Select

	Url: /project/select
	Method: POST
	Description: it selects a new projecct
	Headers:{
		userid:@string
	}
	Body:{
		id:@string
	}
	Response:{
		success:@boolean,
		project:@Project
	}

Update (NIY)

	Url: /project
	Method: PUT
	Description: it updates a new projecct
	Headers:{
		userid:@string
	}
	Body:{
		projects:array(@Project)
	}
	Response:{
		success:@boolean,
		projects:array(@Project)
	}

Layout

	Url: /layout
	Method: Get
	Description: it fetches all the layouts
	Headers:{
		userid:@string,
		projectid:@string
	}
	Body:{
	}
	Response:{
		layout:array(@Layout)
	}

Collections

Fetch

	Url: /collections
	Method: GET
	Description: it fetches all the collections or the specified ones
	Headers:{
		userid:@string,
		projectid:@string
	}
	Body: array(@string) (optional)
	Response:array(@CollectionWithKeySets)

Create

	Url: /collections
	Method: POST
	Description: it creates a new collection or the specified number of collections
	Headers:{
		userid:@string,
		projectid:@string
	}
	Body:{
		numberOfCollections:@int
	}
	Response:array(@Collection)

Update

	Url: /collections
	Method: PUT
	Description: it updates specified collections
	Headers:{
		userid:@string,
		projectid:@string
	}
	Body:array(@Collection)
	Response:array(@collection)

Renaming

	Url: /collections/renaming
	Method: PUT
	Description: it renames specified collections
	Headers:{
		userid:@string,
		projectid:@string
	}
	Body:array(@Collection)
	Response:array(@collection)

Remove

	Url: /collections
	Method: DELETE
	Description: it removes specified collections
	Headers:{
		userid:@string,
		projectid:@string
	}
	Body:array(@int)
	Response:{
		success:@boolean
	}

Copy With Ref

	Url: /collections/copy/ref
	Method: POST
	Description: it copies collections with refrence to the original collections
	Headers:{
		userid:@string,
		projectid:@string
	}
	Body:array(@CollectionWithLayout)
	Response:array({
		alternatives:array(@AlternativeDetailed),
		collections:array(@CollectionWithKeySets)
	})

Clone

	Url: /collections/clone
	Method: POST
	Description: it clones collections with no refrence to the original collections. The alternatives inside the collection will have refrence to the original alternatives.
	Headers:{
		userid:@string,
		projectid:@string
	}
	Body:array(@CollectionWithLayout)
	Response:array({
		alternatives:array(@AlternativeDetailed),
		collections:array(@CollectionWithKeySets)
	})

Deep Clone

	Url: /collections/clone/deep
	Method: POST
	Description: it clones collections with no refrence to the original collections. The alternatives inside the collection will not have refrence to the original alternatives.
	Headers:{
		userid:@string,
		projectid:@string
	}
	Body:array(@CollectionWithLayout)
	Response:array({
		alternatives:array(@AlternativeDetailed),
		collections:array(@CollectionWithKeySets)
	})

Sink

	Url: /collections/sink
	Method: POST
	Description: it puts a collection into the sink
	Headers:{
		userid:@string,
		projectid:@string
	}
	Body:{
		collectionId:@string
	}
	Response:{
		success:@boolean
	}

Alternatives

Generative

Cartesian Product

	Url: /computeCP
	Method: POST
	Description: Check the description here
	Headers:{
		userid:@string,
		projectid:@string
	}
	Body:{
		collectionId:@string
	}
	Response:{
		success:@boolean
	}

Grasshopper

Websocket

Admin

Clean Database

	Url: /clean-db?projectId=
	Method: Get
	Description: it removes everything in a project
	Body:{}
	Response:{
		success:@boolean
	}