docs/_schemas.md in losant_rest-1.5.1 vs docs/_schemas.md in losant_rest-1.5.2

- old
+ new

@@ -84,10 +84,15 @@ * [Experience Users](#experience-users) * [Experience View](#experience-view) * [Experience View Patch](#experience-view-patch) * [Experience View Post](#experience-view-post) * [Experience Views](#experience-views) +* [File Schema](#file-schema) +* [File Patch](#file-patch) +* [File Post](#file-post) +* [File Post Response](#file-post-response) +* [Files Schema](#files-schema) * [Workflow](#workflow) * [Workflow Log](#workflow-log) * [Workflow Patch](#workflow-patch) * [Workflow Post](#workflow-post) * [Workflow Storage Entries](#workflow-storage-entries) @@ -657,10 +662,12 @@ "experienceUsers.*", "experienceView.*", "experienceViews.*", "integration.*", "integrations.*", + "file.*", + "files.*", "flow.*", "flows.*", "flowVersion.*", "flowVersions.*", "webhook.*", @@ -755,10 +762,16 @@ "experienceView.delete", "experienceView.get", "experienceView.patch", "experienceViews.get", "experienceViews.post", + "file.get", + "file.patch", + "file.move", + "file.delete", + "files.get", + "files.post", "flow.delete", "flow.clearStorageEntries", "flow.get", "flow.getStorageEntries", "flow.log", @@ -2629,11 +2642,12 @@ "maxLength": 2048 }, "newPassword": { "type": "string", "minLength": 8, - "maxLength": 2048 + "maxLength": 2048, + "pattern": "^(?=.*[A-Z])(?=.*[^A-z0-9])(?=.*[0-9])(?=.*[a-z]).{8,}$" }, "invalidateExistingTokens": { "type": "boolean" } }, @@ -4479,11 +4493,95 @@ "type": "string", "format": "email", "maxLength": 1024 }, "query": { - "$ref": "#/definitions/dataTableQuery" + "title": "Data Table Query", + "description": "Schema for a data table query", + "type": "object", + "properties": { + "$and": { + "type": "array", + "items": { + "$ref": "#/definitions/dataTableQuery" + } + }, + "$or": { + "type": "array", + "items": { + "$ref": "#/definitions/dataTableQuery" + } + } + }, + "patternProperties": { + "^[0-9a-zA-Z_-]{1,255}$": { + "oneOf": [ + { + "type": [ + "string", + "number", + "boolean", + "null" + ] + }, + { + "type": "object", + "properties": { + "$eq": { + "type": [ + "string", + "number", + "boolean", + "null" + ] + }, + "$ne": { + "type": [ + "string", + "number", + "boolean", + "null" + ] + }, + "$gt": { + "type": [ + "string", + "number", + "boolean", + "null" + ] + }, + "$lt": { + "type": [ + "string", + "number", + "boolean", + "null" + ] + }, + "$gte": { + "type": [ + "string", + "number", + "boolean", + "null" + ] + }, + "$lte": { + "type": [ + "string", + "number", + "boolean", + "null" + ] + } + } + } + ] + } + }, + "additionalProperties": false }, "queryOptions": { "type": "object", "properties": { "sortDirection": { @@ -9481,10 +9579,540 @@ } ``` <br/> +## File Schema + +Schema for a single file + +### <a name="file-schema-schema"></a> Schema + +```json +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "type": "object", + "properties": { + "id": { + "type": "string", + "pattern": "^[A-Fa-f\\d]{24}$" + }, + "applicationId": { + "type": "string", + "pattern": "^[A-Fa-f\\d]{24}$" + }, + "creationDate": { + "type": "string", + "format": "date-time" + }, + "lastUpdated": { + "type": "string", + "format": "date-time" + }, + "authorId": { + "type": "string", + "pattern": "^[A-Fa-f\\d]{24}$" + }, + "authorType": { + "type": "string", + "enum": [ + "flow", + "user", + "device", + "apiToken" + ] + }, + "status": { + "type": "string", + "enum": [ + "pending", + "moving", + "deleting", + "completed" + ] + }, + "name": { + "type": "string", + "minLength": 1, + "maxLength": 2048 + }, + "parentDirectory": { + "type": "string", + "maxLength": 2048 + }, + "type": { + "type": "string", + "enum": [ + "file", + "directory" + ] + }, + "fileSize": { + "type": "number" + }, + "contentType": { + "type": "string", + "maxLength": 1024 + }, + "fileDimensions": { + "type": "object", + "properties": { + "width": { + "type": "number" + }, + "height": { + "type": "number" + } + } + } + } +} +``` +### <a name="file-schema-example"></a> Example + +```json +{ + "id": "575ec8687ae143cd83dc4a97", + "applicationId": "575ec8687ae143cd83dc4a97", + "creationDate": "2016-06-13T04:00:00.000Z", + "lastUpdated": "2016-06-13T04:00:00.000Z", + "authorId": "575ed70c7ae143cd83dc4aa9", + "authorType": "user", + "status": "pending", + "name": "file.csv", + "type": "file", + "parentDirectory": "/", + "fileSize": 500, + "contentType": "text/csv" +} +``` + +<br/> + +## File Patch + +Schema to patch a file + +### <a name="file-patch-schema"></a> Schema + +```json +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "type": "object", + "properties": { + "fileSize": { + "type": "number" + }, + "contentType": { + "type": "string", + "maxLength": 1024 + }, + "fileDimensions": { + "type": "object", + "properties": { + "width": { + "type": "number" + }, + "height": { + "type": "number" + } + } + } + } +} +``` +### <a name="file-patch-example"></a> Example + +```json +{ + "fileSize": 500, + "contentType": "image", + "fileDimensions": { + "width": 200, + "height": 200 + } +} +``` + +<br/> + +## File Post + +Schema to create a single file or directory + +### <a name="file-post-schema"></a> Schema + +```json +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "type": "object", + "properties": { + "name": { + "type": "string", + "minLength": 1, + "maxLength": 2048 + }, + "parentDirectory": { + "type": "string", + "maxLength": 2048 + }, + "type": { + "type": "string", + "enum": [ + "file", + "directory" + ] + }, + "fileSize": { + "type": "number" + }, + "contentType": { + "type": "string", + "maxLength": 1024 + }, + "fileDimensions": { + "type": "object", + "properties": { + "width": { + "type": "number" + }, + "height": { + "type": "number" + } + } + } + } +} +``` +### <a name="file-post-example"></a> Example + +```json +{ + "name": "file.csv", + "type": "file", + "parentDirectory": "/", + "fileSize": 500, + "contentType": "text/csv" +} +``` + +<br/> + +## File Post Response + +Schema to upload the file to s3 + +### <a name="file-post-response-schema"></a> Schema + +```json +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "type": "object", + "properties": { + "id": { + "type": "string", + "pattern": "^[A-Fa-f\\d]{24}$" + }, + "applicationId": { + "type": "string", + "pattern": "^[A-Fa-f\\d]{24}$" + }, + "creationDate": { + "type": "string", + "format": "date-time" + }, + "lastUpdated": { + "type": "string", + "format": "date-time" + }, + "authorId": { + "type": "string", + "pattern": "^[A-Fa-f\\d]{24}$" + }, + "authorType": { + "type": "string", + "enum": [ + "flow", + "user", + "device", + "apiToken" + ] + }, + "status": { + "type": "string", + "enum": [ + "pending", + "moving", + "deleting", + "completed" + ] + }, + "name": { + "type": "string", + "minLength": 1, + "maxLength": 2048 + }, + "parentDirectory": { + "type": "string", + "maxLength": 2048 + }, + "type": { + "type": "string", + "enum": [ + "file", + "directory" + ] + }, + "fileSize": { + "type": "number" + }, + "contentType": { + "type": "string", + "maxLength": 1024 + }, + "fileDimensions": { + "type": "object", + "properties": { + "width": { + "type": "number" + }, + "height": { + "type": "number" + } + } + }, + "upload": { + "url": { + "type": "string" + }, + "fields": { + "type": "object", + "properties": { + "key": { + "type": "string" + }, + "bucket": { + "type": "string" + }, + "X-Amz-Algorithm": { + "type": "string" + }, + "X-Amz-Credential": { + "type": "string" + }, + "X-Amz-Date": { + "type": "string" + }, + "Policy": { + "type": "string" + }, + "X-Amz-Signature": { + "type": "string" + } + } + } + } + } +} +``` +### <a name="file-post-response-example"></a> Example + +```json +{ + "id": "575ec8687ae143cd83dc4a97", + "applicationId": "575ec8687ae143cd83dc4a97", + "creationDate": "2016-06-13T04:00:00.000Z", + "lastUpdated": "2016-06-13T04:00:00.000Z", + "authorId": "575ed70c7ae143cd83dc4aa9", + "authorType": "user", + "status": "pending", + "name": "file.csv", + "type": "file", + "parentDirectory": "/", + "fileSize": 500, + "contentType": "text/csv", + "upload": { + "url": "https://s3.us-west-1.amazonaws.com/a-bucket-on-amazon", + "fields": { + "key": "5630dcbe1035c9d0011/file.js", + "bucket": "a-bucket-on-amazon", + "X-Amz-Algorithm": "AWS4-HMAC-SHA256", + "X-Amz-Credential": "AKIAJPGQGBQX4PYM6FXA/20180416/us-west-1/s3/aws4_request", + "X-Amz-Date": "20180416T142402Z", + "Policy": "wMloiLCJjb25kaXRpb25zIjpbeyJrZXkiOiI1NjMwZGNiZTEwM2Y4ZTQ4NWM5ZDAwMTEvZmlsZS5qcyJ9LHsiYnVja2V0IjoibG9zYW50LWZpbGVzIn0seyJYLUFtei1BbGdvcml0aG0iOiJBV1M0LUhNQUMtU0hBMjU2In0seyJYLUFtei1DcmVkZW50aWFsIjoiQUtJQUpQR1FHQlFYNFBZTTZGWEEvMjAxODA0MTYvdXMtd2VzdC0xL3MzL2F3czRfcmVxdWVzdCJ9LHsiWC1BbXotRGF0ZSI6IjIwMTgwNDE2VDE0MjQwMloifV19", + "X-Amz-Signature": "a4a411df572c43b4427ff08ef51763bc2d834fa399c3688f347d936370" + } + } +} +``` + +<br/> + +## Files Schema + +Schema for a collection of files + +### <a name="files-schema-schema"></a> Schema + +```json +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "type": "object", + "properties": { + "items": { + "type": "array", + "items": { + "title": "File Schema", + "description": "Schema for a single file", + "type": "object", + "properties": { + "id": { + "type": "string", + "pattern": "^[A-Fa-f\\d]{24}$" + }, + "applicationId": { + "type": "string", + "pattern": "^[A-Fa-f\\d]{24}$" + }, + "creationDate": { + "type": "string", + "format": "date-time" + }, + "lastUpdated": { + "type": "string", + "format": "date-time" + }, + "authorId": { + "type": "string", + "pattern": "^[A-Fa-f\\d]{24}$" + }, + "authorType": { + "type": "string", + "enum": [ + "flow", + "user", + "device", + "apiToken" + ] + }, + "status": { + "type": "string", + "enum": [ + "pending", + "moving", + "deleting", + "completed" + ] + }, + "name": { + "type": "string", + "minLength": 1, + "maxLength": 2048 + }, + "parentDirectory": { + "type": "string", + "maxLength": 2048 + }, + "type": { + "type": "string", + "enum": [ + "file", + "directory" + ] + }, + "fileSize": { + "type": "number" + }, + "contentType": { + "type": "string", + "maxLength": 1024 + }, + "fileDimensions": { + "type": "object", + "properties": { + "width": { + "type": "number" + }, + "height": { + "type": "number" + } + } + } + } + } + }, + "count": { + "type": "integer" + }, + "totalCount": { + "type": "integer" + }, + "perPage": { + "type": "integer" + }, + "page": { + "type": "integer" + }, + "filter": { + "type": "string" + }, + "filterField": { + "type": "string" + }, + "sortField": { + "type": "string" + }, + "sortDirection": { + "type": "string", + "enum": [ + "asc", + "desc" + ] + } + } +} +``` +### <a name="files-schema-example"></a> Example + +```json +{ + "items": [ + { + "id": "575ec8687ae143cd83dc4a97", + "applicationId": "575ec8687ae143cd83dc4a97", + "creationDate": "2016-06-13T04:00:00.000Z", + "lastUpdated": "2016-06-13T04:00:00.000Z", + "authorId": "575ed70c7ae143cd83dc4aa9", + "authorType": "user", + "status": "pending", + "name": "file.csv", + "type": "file", + "parentDirectory": "/", + "fileSize": 500, + "contentType": "text/csv" + }, + { + "id": "575ec8687ae143cd83dc4a96", + "applicationId": "575ec8687ae143cd83dc4a97", + "creationDate": "2016-06-13T04:00:00.000Z", + "lastUpdated": "2016-06-13T04:00:00.000Z", + "authorId": "575ed70c7ae143cd83dc4aa9", + "authorType": "user", + "status": "completed", + "name": "b", + "type": "directory", + "parentDirectory": "/a/", + "fileSize": 500, + "contentType": "text/csv" + } + ], + "count": 2 +} +``` + +<br/> + ## Workflow Schema for a single Workflow ### <a name="workflow-schema"></a> Schema @@ -12793,11 +13421,12 @@ "maxLength": 1024 }, "password": { "type": "string", "minLength": 8, - "maxLength": 2048 + "maxLength": 2048, + "pattern": "^(?=.*[A-Z])(?=.*[^A-z0-9])(?=.*[0-9])(?=.*[a-z]).{8,}$" }, "tokenCutoff": { "type": "string", "format": "date-time" } @@ -14927,11 +15556,12 @@ "type": "boolean" }, "password": { "type": "string", "minLength": 8, - "maxLength": 2048 + "maxLength": 2048, + "pattern": "^(?=.*[A-Z])(?=.*[^A-z0-9])(?=.*[0-9])(?=.*[a-z]).{8,}$" }, "twoFactorAuthKey": { "type": "string", "minLength": 52, "maxLength": 52 @@ -15019,11 +15649,12 @@ "type": "boolean" }, "password": { "type": "string", "minLength": 8, - "maxLength": 2048 + "maxLength": 2048, + "pattern": "^(?=.*[A-Z])(?=.*[^A-z0-9])(?=.*[0-9])(?=.*[a-z]).{8,}$" }, "twoFactorAuthKey": { "type": "string", "minLength": 52, "maxLength": 52 @@ -15492,11 +16123,12 @@ "COUNT", "MAX", "MIN", "MEDIAN", "MEAN", - "SUM" + "SUM", + "NONE" ] }, "devices": { "type": "object", "patternProperties": { @@ -15639,10 +16271,11 @@ "COUNT", "MAX", "MIN", "MEDIAN", "MEAN", - "SUM" + "SUM", + "NONE" ] }, "attributes": { "type": "array", "items": {