diff --git a/package-lock.json b/package-lock.json index c28ef45..eb84a45 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,7 +13,7 @@ "zod": "^3.23.8" }, "devDependencies": { - "@seamapi/types": "1.242.0", + "@seamapi/types": "1.245.1", "@types/node": "^20.8.10", "ava": "^6.0.1", "c8": "^10.1.2", @@ -1052,10 +1052,11 @@ ] }, "node_modules/@seamapi/types": { - "version": "1.242.0", - "resolved": "https://registry.npmjs.org/@seamapi/types/-/types-1.242.0.tgz", - "integrity": "sha512-s3r5T9ttfEgdhKgY4RgsA2FOc25q4hxYet82WqKfB7TsGDwrl1V5LUKf9xQOHbWQuTfigitZOOzqUbg1PaiNbA==", + "version": "1.245.1", + "resolved": "https://registry.npmjs.org/@seamapi/types/-/types-1.245.1.tgz", + "integrity": "sha512-ffCqFrVjWCY/tm/HDjUtaEaaOf1pPV+IyJ9FzUHIThwT5VU28+XjXydULbmliC9CQz6STL7SdKfXroz1RD6FBg==", "dev": true, + "license": "MIT", "engines": { "node": ">=18.12.0", "npm": ">= 9.0.0" diff --git a/package.json b/package.json index 8ec3586..79233a7 100644 --- a/package.json +++ b/package.json @@ -73,7 +73,7 @@ "zod": "^3.23.8" }, "devDependencies": { - "@seamapi/types": "1.242.0", + "@seamapi/types": "1.245.1", "@types/node": "^20.8.10", "ava": "^6.0.1", "c8": "^10.1.2", diff --git a/src/lib/blueprint.ts b/src/lib/blueprint.ts index bd817fd..0261c53 100644 --- a/src/lib/blueprint.ts +++ b/src/lib/blueprint.ts @@ -255,7 +255,7 @@ export const createBlueprint = async ( const openapi = typesModule.openapi as Openapi const isFakeData = openapi.info.title === 'Foo' - const targetPaths = ['/acs', '/events'] + const targetPaths = ['/acs', '/events', '/thermostats'] const targetSchemas = [ 'acs_access_group', 'acs_credential', @@ -265,6 +265,8 @@ export const createBlueprint = async ( 'acs_system', 'acs_user', 'event', + 'climate_preset', + 'thermostat_schedule', ] const context = { @@ -637,6 +639,7 @@ const createParameter = ( } return { ...baseParam, format: 'record', jsonType: 'object' } case 'number': + case 'integer': return { ...baseParam, format: 'number', @@ -828,6 +831,7 @@ const createProperty = ( } return { ...baseProperty, format: 'record', jsonType: 'object' } case 'number': + case 'integer': return { ...baseProperty, format: 'number', diff --git a/test/snapshots/blueprint.test.ts.md b/test/snapshots/blueprint.test.ts.md index 9cfbee8..26ca1ee 100644 --- a/test/snapshots/blueprint.test.ts.md +++ b/test/snapshots/blueprint.test.ts.md @@ -847,81 +847,80 @@ Generated by [AVA](https://avajs.dev). }, title: 'List foos', }, - ], - isDeprecated: false, - isUndocumented: false, - name: 'foos', - namespace: null, - path: '/foos', - subroutes: [], - }, - { - endpoints: [ { codeSamples: [ { code: { javascript: { - request: 'await seam.transport.air.planes.list()', + request: 'await seam.foos.get({"foo_id":"8d7e0b3a-b889-49a7-9164-4b71a0506a33"})', request_syntax: 'javascript', - response: '[{"plane_id":"9d3163f9-9185-40d3-a0ce-a03d3c7ce402","name":"Woosh"}]', + response: '{"foo_id":"8d7e0b3a-b889-49a7-9164-4b71a0506a33","name":"Best foo","nullable_prop":null,"number_prop":10,"object_prop":{"foo":"bar"},"array_prop":["foo","bar"]}', response_syntax: 'javascript', title: 'JavaScript', }, php: { request: `transport->air->planes->list()`, + $seam->foos->get(foo_id:"8d7e0b3a-b889-49a7-9164-4b71a0506a33")`, request_syntax: 'php', - response: '[["plane_id" => "9d3163f9-9185-40d3-a0ce-a03d3c7ce402","name" => "Woosh"]]', + response: '["foo_id" => "8d7e0b3a-b889-49a7-9164-4b71a0506a33","name" => "Best foo","nullable_prop" => null,"number_prop" => 10,"object_prop" => ["foo" => "bar"],"array_prop" => ["foo", "bar"]]', response_syntax: 'php', title: 'PHP', }, python: { - request: 'seam.transport.air.planes.list()', + request: 'seam.foos.get(foo_id="8d7e0b3a-b889-49a7-9164-4b71a0506a33")', request_syntax: 'python', - response: '[Plane(plane_id="9d3163f9-9185-40d3-a0ce-a03d3c7ce402", name="Woosh")]', + response: 'Foo(foo_id="8d7e0b3a-b889-49a7-9164-4b71a0506a33", name="Best foo", nullable_prop=None, number_prop=10, object_prop={"foo":"bar"}, array_prop=["foo","bar"])', response_syntax: 'python', title: 'Python', }, ruby: { - request: 'seam.transport.air.planes.list()', + request: 'seam.foos.get(foo_id: "8d7e0b3a-b889-49a7-9164-4b71a0506a33")', request_syntax: 'ruby', - response: '[{"plane_id" => "9d3163f9-9185-40d3-a0ce-a03d3c7ce402","name" => "Woosh"}]', + response: '{"foo_id" => "8d7e0b3a-b889-49a7-9164-4b71a0506a33","name" => "Best foo","nullable_prop" => nil,"number_prop" => 10,"object_prop" => {"foo":"bar"},"array_prop" => ["foo","bar"]}', response_syntax: 'ruby', title: 'Ruby', }, seam_cli: { - request: 'seam transport air planes list ', + request: 'seam foos get --foo_id "8d7e0b3a-b889-49a7-9164-4b71a0506a33"', request_syntax: 'bash', - response: '[{"plane_id":"9d3163f9-9185-40d3-a0ce-a03d3c7ce402","name":"Woosh"}]', + response: '{"foo_id":"8d7e0b3a-b889-49a7-9164-4b71a0506a33","name":"Best foo","nullable_prop":null,"number_prop":10,"object_prop":{"foo":"bar"},"array_prop":["foo","bar"]}', response_syntax: 'json', title: 'Seam CLI', }, }, - description: 'This is the wya to get all plans', + description: 'This is the way to get a foo', request: { - parameters: {}, - path: '/transport/air/planes/list', + parameters: { + foo_id: '8d7e0b3a-b889-49a7-9164-4b71a0506a33', + }, + path: '/foos/get', }, response: { body: { - planes: [ - { - name: 'Woosh', - plane_id: '9d3163f9-9185-40d3-a0ce-a03d3c7ce402', + foo: { + array_prop: [ + 'foo', + 'bar', + ], + foo_id: '8d7e0b3a-b889-49a7-9164-4b71a0506a33', + name: 'Best foo', + nullable_prop: null, + number_prop: 10, + object_prop: { + foo: 'bar', }, - ], + }, }, }, - title: 'List planes', + title: 'Get a foo by ID', }, ], deprecationMessage: '', description: '', isDeprecated: false, isUndocumented: false, - name: 'list', - path: '/transport/air/planes/list', + name: 'get', + path: '/foos/get', request: { methods: [ 'GET', @@ -931,166 +930,177 @@ Generated by [AVA](https://avajs.dev). semanticMethod: 'GET', }, response: { - description: 'List all planes.', - resourceType: 'plane', - responseKey: 'planes', - responseType: 'resource_list', + description: 'Get a foo by ID.', + resourceType: 'foo', + responseKey: 'foo', + responseType: 'resource', }, - title: 'List planes', + title: 'Get a foo', }, { codeSamples: [ { code: { javascript: { - request: 'await seam.transport.air.planes.list()', + request: 'await seam.foos.get({"foo_id":"8d7e0b3a-b889-49a7-9164-4b71a0506a33"})', request_syntax: 'javascript', - response: '[{"plane_id":"9d3163f9-9185-40d3-a0ce-a03d3c7ce402","name":"Woosh"}]', + response: '{"foo_id":"8d7e0b3a-b889-49a7-9164-4b71a0506a33","name":"Best foo","nullable_prop":null,"number_prop":10,"object_prop":{"foo":"bar"},"array_prop":["foo","bar"]}', response_syntax: 'javascript', title: 'JavaScript', }, php: { request: `transport->air->planes->list()`, + $seam->foos->get(foo_id:"8d7e0b3a-b889-49a7-9164-4b71a0506a33")`, request_syntax: 'php', - response: '[["plane_id" => "9d3163f9-9185-40d3-a0ce-a03d3c7ce402","name" => "Woosh"]]', + response: '["foo_id" => "8d7e0b3a-b889-49a7-9164-4b71a0506a33","name" => "Best foo","nullable_prop" => null,"number_prop" => 10,"object_prop" => ["foo" => "bar"],"array_prop" => ["foo", "bar"]]', response_syntax: 'php', title: 'PHP', }, python: { - request: 'seam.transport.air.planes.list()', + request: 'seam.foos.get(foo_id="8d7e0b3a-b889-49a7-9164-4b71a0506a33")', request_syntax: 'python', - response: '[Plane(plane_id="9d3163f9-9185-40d3-a0ce-a03d3c7ce402", name="Woosh")]', + response: 'Foo(foo_id="8d7e0b3a-b889-49a7-9164-4b71a0506a33", name="Best foo", nullable_prop=None, number_prop=10, object_prop={"foo":"bar"}, array_prop=["foo","bar"])', response_syntax: 'python', title: 'Python', }, ruby: { - request: 'seam.transport.air.planes.list()', + request: 'seam.foos.get(foo_id: "8d7e0b3a-b889-49a7-9164-4b71a0506a33")', request_syntax: 'ruby', - response: '[{"plane_id" => "9d3163f9-9185-40d3-a0ce-a03d3c7ce402","name" => "Woosh"}]', + response: '{"foo_id" => "8d7e0b3a-b889-49a7-9164-4b71a0506a33","name" => "Best foo","nullable_prop" => nil,"number_prop" => 10,"object_prop" => {"foo":"bar"},"array_prop" => ["foo","bar"]}', response_syntax: 'ruby', title: 'Ruby', }, seam_cli: { - request: 'seam transport air planes list ', + request: 'seam foos get --foo_id "8d7e0b3a-b889-49a7-9164-4b71a0506a33"', request_syntax: 'bash', - response: '[{"plane_id":"9d3163f9-9185-40d3-a0ce-a03d3c7ce402","name":"Woosh"}]', + response: '{"foo_id":"8d7e0b3a-b889-49a7-9164-4b71a0506a33","name":"Best foo","nullable_prop":null,"number_prop":10,"object_prop":{"foo":"bar"},"array_prop":["foo","bar"]}', response_syntax: 'json', title: 'Seam CLI', }, }, - description: 'This is the wya to get all plans', + description: 'This is the way to get a foo', request: { - parameters: {}, - path: '/transport/air/planes/list', + parameters: { + foo_id: '8d7e0b3a-b889-49a7-9164-4b71a0506a33', + }, + path: '/foos/get', }, response: { body: { - planes: [ - { - name: 'Woosh', - plane_id: '9d3163f9-9185-40d3-a0ce-a03d3c7ce402', + foo: { + array_prop: [ + 'foo', + 'bar', + ], + foo_id: '8d7e0b3a-b889-49a7-9164-4b71a0506a33', + name: 'Best foo', + nullable_prop: null, + number_prop: 10, + object_prop: { + foo: 'bar', }, - ], + }, }, }, - title: 'List planes', + title: 'Get a foo by ID', }, ], deprecationMessage: '', description: '', isDeprecated: false, isUndocumented: false, - name: 'list', - path: '/transport/air/planes/list', + name: 'get', + path: '/foos/get', request: { methods: [ - 'GET', + 'POST', ], parameters: [], - preferredMethod: 'GET', - semanticMethod: 'GET', + preferredMethod: 'POST', + semanticMethod: 'POST', }, response: { - description: 'List all planes.', - resourceType: 'plane', - responseKey: 'planes', - responseType: 'resource_list', + description: 'Get a foo by ID.', + resourceType: 'foo', + responseKey: 'foo', + responseType: 'resource', }, - title: 'List planes', + title: 'Get a foo', }, - ], - isDeprecated: false, - isUndocumented: false, - name: 'planes', - namespace: { - isDeprecated: false, - isUndocumented: false, - path: '/transport/air', - }, - path: '/transport/air/planes', - subroutes: [], - }, - { - endpoints: [ { codeSamples: [ { code: { javascript: { - request: 'await seam.deprecated.undocumented.endpoint()', + request: 'await seam.foos.list()', request_syntax: 'javascript', - response: 'void', + response: '[{"foo_id":"8d7e0b3a-b889-49a7-9164-4b71a0506a33","name":"Best foo","nullable_prop":null,"number_prop":10,"object_prop":{"foo":"bar"},"array_prop":["foo","bar"]}]', response_syntax: 'javascript', title: 'JavaScript', }, php: { request: `deprecated->undocumented->endpoint()`, + $seam->foos->list()`, request_syntax: 'php', - response: 'null', + response: '[["foo_id" => "8d7e0b3a-b889-49a7-9164-4b71a0506a33","name" => "Best foo","nullable_prop" => null,"number_prop" => 10,"object_prop" => ["foo" => "bar"],"array_prop" => ["foo", "bar"]]]', response_syntax: 'php', title: 'PHP', }, python: { - request: 'seam.deprecated.undocumented.endpoint()', + request: 'seam.foos.list()', request_syntax: 'python', - response: 'None', + response: '[Foo(foo_id="8d7e0b3a-b889-49a7-9164-4b71a0506a33", name="Best foo", nullable_prop=None, number_prop=10, object_prop={"foo":"bar"}, array_prop=["foo","bar"])]', response_syntax: 'python', title: 'Python', }, ruby: { - request: 'seam.deprecated.undocumented.endpoint()', + request: 'seam.foos.list()', request_syntax: 'ruby', - response: 'nil', + response: '[{"foo_id" => "8d7e0b3a-b889-49a7-9164-4b71a0506a33","name" => "Best foo","nullable_prop" => nil,"number_prop" => 10,"object_prop" => {"foo":"bar"},"array_prop" => ["foo","bar"]}]', response_syntax: 'ruby', title: 'Ruby', }, seam_cli: { - request: 'seam deprecated undocumented endpoint ', + request: 'seam foos list ', request_syntax: 'bash', - response: 'void', + response: '[{"foo_id":"8d7e0b3a-b889-49a7-9164-4b71a0506a33","name":"Best foo","nullable_prop":null,"number_prop":10,"object_prop":{"foo":"bar"},"array_prop":["foo","bar"]}]', response_syntax: 'json', title: 'Seam CLI', }, }, - description: 'This is a deprecated and undocumented endpoint', + description: 'This is the way to list foos', request: { parameters: {}, - path: '/deprecated/undocumented/endpoint', + path: '/foos/list', }, response: { - body: {}, + body: { + foos: [ + { + array_prop: [ + 'foo', + 'bar', + ], + foo_id: '8d7e0b3a-b889-49a7-9164-4b71a0506a33', + name: 'Best foo', + nullable_prop: null, + number_prop: 10, + object_prop: { + foo: 'bar', + }, + }, + ], + }, }, - title: 'Deprecated and undocumented endpoint', + title: 'List foos', }, ], deprecationMessage: '', description: '', - isDeprecated: true, - isUndocumented: true, - name: 'endpoint', - path: '/deprecated/undocumented/endpoint', + isDeprecated: false, + isUndocumented: false, + name: 'list', + path: '/foos/list', request: { methods: [ 'GET', @@ -1100,171 +1110,674 @@ Generated by [AVA](https://avajs.dev). semanticMethod: 'GET', }, response: { - description: 'Deprecated and undocumented endpoint', - responseType: 'void', + description: 'List all foos.', + resourceType: 'foo', + responseKey: 'foos', + responseType: 'resource_list', }, - title: 'Deprecated and undocumented endpoint', + title: 'List foos', }, { codeSamples: [ { code: { javascript: { - request: 'await seam.deprecated.undocumented.endpoint()', + request: 'await seam.foos.list()', request_syntax: 'javascript', - response: 'void', + response: '[{"foo_id":"8d7e0b3a-b889-49a7-9164-4b71a0506a33","name":"Best foo","nullable_prop":null,"number_prop":10,"object_prop":{"foo":"bar"},"array_prop":["foo","bar"]}]', response_syntax: 'javascript', title: 'JavaScript', }, php: { request: `deprecated->undocumented->endpoint()`, + $seam->foos->list()`, request_syntax: 'php', - response: 'null', + response: '[["foo_id" => "8d7e0b3a-b889-49a7-9164-4b71a0506a33","name" => "Best foo","nullable_prop" => null,"number_prop" => 10,"object_prop" => ["foo" => "bar"],"array_prop" => ["foo", "bar"]]]', response_syntax: 'php', title: 'PHP', }, python: { - request: 'seam.deprecated.undocumented.endpoint()', + request: 'seam.foos.list()', request_syntax: 'python', - response: 'None', + response: '[Foo(foo_id="8d7e0b3a-b889-49a7-9164-4b71a0506a33", name="Best foo", nullable_prop=None, number_prop=10, object_prop={"foo":"bar"}, array_prop=["foo","bar"])]', response_syntax: 'python', title: 'Python', }, ruby: { - request: 'seam.deprecated.undocumented.endpoint()', + request: 'seam.foos.list()', request_syntax: 'ruby', - response: 'nil', + response: '[{"foo_id" => "8d7e0b3a-b889-49a7-9164-4b71a0506a33","name" => "Best foo","nullable_prop" => nil,"number_prop" => 10,"object_prop" => {"foo":"bar"},"array_prop" => ["foo","bar"]}]', response_syntax: 'ruby', title: 'Ruby', }, seam_cli: { - request: 'seam deprecated undocumented endpoint ', + request: 'seam foos list ', request_syntax: 'bash', - response: 'void', + response: '[{"foo_id":"8d7e0b3a-b889-49a7-9164-4b71a0506a33","name":"Best foo","nullable_prop":null,"number_prop":10,"object_prop":{"foo":"bar"},"array_prop":["foo","bar"]}]', response_syntax: 'json', title: 'Seam CLI', }, }, - description: 'This is a deprecated and undocumented endpoint', + description: 'This is the way to list foos', request: { parameters: {}, - path: '/deprecated/undocumented/endpoint', + path: '/foos/list', }, response: { - body: {}, + body: { + foos: [ + { + array_prop: [ + 'foo', + 'bar', + ], + foo_id: '8d7e0b3a-b889-49a7-9164-4b71a0506a33', + name: 'Best foo', + nullable_prop: null, + number_prop: 10, + object_prop: { + foo: 'bar', + }, + }, + ], + }, }, - title: 'Deprecated and undocumented endpoint', + title: 'List foos', }, ], deprecationMessage: '', description: '', - isDeprecated: true, - isUndocumented: true, - name: 'endpoint', - path: '/deprecated/undocumented/endpoint', + isDeprecated: false, + isUndocumented: false, + name: 'list', + path: '/foos/list', request: { methods: [ - 'GET', + 'POST', ], parameters: [], - preferredMethod: 'GET', - semanticMethod: 'GET', + preferredMethod: 'POST', + semanticMethod: 'POST', }, response: { - description: 'Deprecated and undocumented endpoint', - responseType: 'void', + description: 'List all foos.', + resourceType: 'foo', + responseKey: 'foos', + responseType: 'resource_list', }, - title: 'Deprecated and undocumented endpoint', + title: 'List foos', }, ], - isDeprecated: true, - isUndocumented: true, - name: 'undocumented', - namespace: { - isDeprecated: true, - isUndocumented: true, - path: '/deprecated', - }, - path: '/deprecated/undocumented', + isDeprecated: false, + isUndocumented: false, + name: 'foos', + namespace: null, + path: '/foos', subroutes: [], }, - ], - title: 'Foo', - } - -## createBlueprint: with formatCode - -> blueprint - - { - resources: { - foo: { - description: 'A foo resource.', - properties: [ - { - deprecationMessage: '', - description: 'Foo id', - format: 'id', - isDeprecated: false, - isUndocumented: false, - jsonType: 'string', - name: 'foo_id', - }, - { - deprecationMessage: '', - description: 'Foo name', - format: 'string', - isDeprecated: false, - isUndocumented: false, - jsonType: 'string', - name: 'name', - }, - { - deprecationMessage: 'This prop will be removed in the next version', - description: 'This prop is deprecated', - format: 'string', - isDeprecated: true, - isUndocumented: false, - jsonType: 'string', - name: 'deprecated_prop', - }, - { - deprecationMessage: '', - description: 'This prop is undocumented', - format: 'string', - isDeprecated: false, - isUndocumented: true, - jsonType: 'string', - name: 'undocumented_prop', - }, + { + endpoints: [ { + codeSamples: [ + { + code: { + javascript: { + request: 'await seam.transport.air.planes.list()', + request_syntax: 'javascript', + response: '[{"plane_id":"9d3163f9-9185-40d3-a0ce-a03d3c7ce402","name":"Woosh"}]', + response_syntax: 'javascript', + title: 'JavaScript', + }, + php: { + request: `transport->air->planes->list()`, + request_syntax: 'php', + response: '[["plane_id" => "9d3163f9-9185-40d3-a0ce-a03d3c7ce402","name" => "Woosh"]]', + response_syntax: 'php', + title: 'PHP', + }, + python: { + request: 'seam.transport.air.planes.list()', + request_syntax: 'python', + response: '[Plane(plane_id="9d3163f9-9185-40d3-a0ce-a03d3c7ce402", name="Woosh")]', + response_syntax: 'python', + title: 'Python', + }, + ruby: { + request: 'seam.transport.air.planes.list()', + request_syntax: 'ruby', + response: '[{"plane_id" => "9d3163f9-9185-40d3-a0ce-a03d3c7ce402","name" => "Woosh"}]', + response_syntax: 'ruby', + title: 'Ruby', + }, + seam_cli: { + request: 'seam transport air planes list ', + request_syntax: 'bash', + response: '[{"plane_id":"9d3163f9-9185-40d3-a0ce-a03d3c7ce402","name":"Woosh"}]', + response_syntax: 'json', + title: 'Seam CLI', + }, + }, + description: 'This is the wya to get all plans', + request: { + parameters: {}, + path: '/transport/air/planes/list', + }, + response: { + body: { + planes: [ + { + name: 'Woosh', + plane_id: '9d3163f9-9185-40d3-a0ce-a03d3c7ce402', + }, + ], + }, + }, + title: 'List planes', + }, + ], deprecationMessage: '', - description: 'This prop is nullable', - format: 'string', + description: '', isDeprecated: false, isUndocumented: false, - jsonType: 'string', - name: 'nullable_prop', + name: 'list', + path: '/transport/air/planes/list', + request: { + methods: [ + 'GET', + ], + parameters: [], + preferredMethod: 'GET', + semanticMethod: 'GET', + }, + response: { + description: 'List all planes.', + resourceType: 'plane', + responseKey: 'planes', + responseType: 'resource_list', + }, + title: 'List planes', }, { + codeSamples: [ + { + code: { + javascript: { + request: 'await seam.transport.air.planes.list()', + request_syntax: 'javascript', + response: '[{"plane_id":"9d3163f9-9185-40d3-a0ce-a03d3c7ce402","name":"Woosh"}]', + response_syntax: 'javascript', + title: 'JavaScript', + }, + php: { + request: `transport->air->planes->list()`, + request_syntax: 'php', + response: '[["plane_id" => "9d3163f9-9185-40d3-a0ce-a03d3c7ce402","name" => "Woosh"]]', + response_syntax: 'php', + title: 'PHP', + }, + python: { + request: 'seam.transport.air.planes.list()', + request_syntax: 'python', + response: '[Plane(plane_id="9d3163f9-9185-40d3-a0ce-a03d3c7ce402", name="Woosh")]', + response_syntax: 'python', + title: 'Python', + }, + ruby: { + request: 'seam.transport.air.planes.list()', + request_syntax: 'ruby', + response: '[{"plane_id" => "9d3163f9-9185-40d3-a0ce-a03d3c7ce402","name" => "Woosh"}]', + response_syntax: 'ruby', + title: 'Ruby', + }, + seam_cli: { + request: 'seam transport air planes list ', + request_syntax: 'bash', + response: '[{"plane_id":"9d3163f9-9185-40d3-a0ce-a03d3c7ce402","name":"Woosh"}]', + response_syntax: 'json', + title: 'Seam CLI', + }, + }, + description: 'This is the wya to get all plans', + request: { + parameters: {}, + path: '/transport/air/planes/list', + }, + response: { + body: { + planes: [ + { + name: 'Woosh', + plane_id: '9d3163f9-9185-40d3-a0ce-a03d3c7ce402', + }, + ], + }, + }, + title: 'List planes', + }, + ], deprecationMessage: '', - description: 'This prop is a number', - format: 'number', + description: '', isDeprecated: false, isUndocumented: false, - jsonType: 'number', - name: 'number_prop', + name: 'list', + path: '/transport/air/planes/list', + request: { + methods: [ + 'GET', + ], + parameters: [], + preferredMethod: 'GET', + semanticMethod: 'GET', + }, + response: { + description: 'List all planes.', + resourceType: 'plane', + responseKey: 'planes', + responseType: 'resource_list', + }, + title: 'List planes', }, { - deprecationMessage: '', - description: '', - format: 'object', - isDeprecated: false, - isUndocumented: false, - jsonType: 'object', - name: 'object_prop', - properties: [ + codeSamples: [ + { + code: { + javascript: { + request: 'await seam.transport.air.planes.list()', + request_syntax: 'javascript', + response: '[{"plane_id":"9d3163f9-9185-40d3-a0ce-a03d3c7ce402","name":"Woosh"}]', + response_syntax: 'javascript', + title: 'JavaScript', + }, + php: { + request: `transport->air->planes->list()`, + request_syntax: 'php', + response: '[["plane_id" => "9d3163f9-9185-40d3-a0ce-a03d3c7ce402","name" => "Woosh"]]', + response_syntax: 'php', + title: 'PHP', + }, + python: { + request: 'seam.transport.air.planes.list()', + request_syntax: 'python', + response: '[Plane(plane_id="9d3163f9-9185-40d3-a0ce-a03d3c7ce402", name="Woosh")]', + response_syntax: 'python', + title: 'Python', + }, + ruby: { + request: 'seam.transport.air.planes.list()', + request_syntax: 'ruby', + response: '[{"plane_id" => "9d3163f9-9185-40d3-a0ce-a03d3c7ce402","name" => "Woosh"}]', + response_syntax: 'ruby', + title: 'Ruby', + }, + seam_cli: { + request: 'seam transport air planes list ', + request_syntax: 'bash', + response: '[{"plane_id":"9d3163f9-9185-40d3-a0ce-a03d3c7ce402","name":"Woosh"}]', + response_syntax: 'json', + title: 'Seam CLI', + }, + }, + description: 'This is the wya to get all plans', + request: { + parameters: {}, + path: '/transport/air/planes/list', + }, + response: { + body: { + planes: [ + { + name: 'Woosh', + plane_id: '9d3163f9-9185-40d3-a0ce-a03d3c7ce402', + }, + ], + }, + }, + title: 'List planes', + }, + ], + deprecationMessage: '', + description: '', + isDeprecated: false, + isUndocumented: false, + name: 'list', + path: '/transport/air/planes/list', + request: { + methods: [ + 'GET', + ], + parameters: [], + preferredMethod: 'GET', + semanticMethod: 'GET', + }, + response: { + description: 'List all planes.', + resourceType: 'plane', + responseKey: 'planes', + responseType: 'resource_list', + }, + title: 'List planes', + }, + ], + isDeprecated: false, + isUndocumented: false, + name: 'planes', + namespace: { + isDeprecated: false, + isUndocumented: false, + path: '/transport/air', + }, + path: '/transport/air/planes', + subroutes: [], + }, + { + endpoints: [ + { + codeSamples: [ + { + code: { + javascript: { + request: 'await seam.deprecated.undocumented.endpoint()', + request_syntax: 'javascript', + response: 'void', + response_syntax: 'javascript', + title: 'JavaScript', + }, + php: { + request: `deprecated->undocumented->endpoint()`, + request_syntax: 'php', + response: 'null', + response_syntax: 'php', + title: 'PHP', + }, + python: { + request: 'seam.deprecated.undocumented.endpoint()', + request_syntax: 'python', + response: 'None', + response_syntax: 'python', + title: 'Python', + }, + ruby: { + request: 'seam.deprecated.undocumented.endpoint()', + request_syntax: 'ruby', + response: 'nil', + response_syntax: 'ruby', + title: 'Ruby', + }, + seam_cli: { + request: 'seam deprecated undocumented endpoint ', + request_syntax: 'bash', + response: 'void', + response_syntax: 'json', + title: 'Seam CLI', + }, + }, + description: 'This is a deprecated and undocumented endpoint', + request: { + parameters: {}, + path: '/deprecated/undocumented/endpoint', + }, + response: { + body: {}, + }, + title: 'Deprecated and undocumented endpoint', + }, + ], + deprecationMessage: '', + description: '', + isDeprecated: true, + isUndocumented: true, + name: 'endpoint', + path: '/deprecated/undocumented/endpoint', + request: { + methods: [ + 'GET', + ], + parameters: [], + preferredMethod: 'GET', + semanticMethod: 'GET', + }, + response: { + description: 'Deprecated and undocumented endpoint', + responseType: 'void', + }, + title: 'Deprecated and undocumented endpoint', + }, + { + codeSamples: [ + { + code: { + javascript: { + request: 'await seam.deprecated.undocumented.endpoint()', + request_syntax: 'javascript', + response: 'void', + response_syntax: 'javascript', + title: 'JavaScript', + }, + php: { + request: `deprecated->undocumented->endpoint()`, + request_syntax: 'php', + response: 'null', + response_syntax: 'php', + title: 'PHP', + }, + python: { + request: 'seam.deprecated.undocumented.endpoint()', + request_syntax: 'python', + response: 'None', + response_syntax: 'python', + title: 'Python', + }, + ruby: { + request: 'seam.deprecated.undocumented.endpoint()', + request_syntax: 'ruby', + response: 'nil', + response_syntax: 'ruby', + title: 'Ruby', + }, + seam_cli: { + request: 'seam deprecated undocumented endpoint ', + request_syntax: 'bash', + response: 'void', + response_syntax: 'json', + title: 'Seam CLI', + }, + }, + description: 'This is a deprecated and undocumented endpoint', + request: { + parameters: {}, + path: '/deprecated/undocumented/endpoint', + }, + response: { + body: {}, + }, + title: 'Deprecated and undocumented endpoint', + }, + ], + deprecationMessage: '', + description: '', + isDeprecated: true, + isUndocumented: true, + name: 'endpoint', + path: '/deprecated/undocumented/endpoint', + request: { + methods: [ + 'GET', + ], + parameters: [], + preferredMethod: 'GET', + semanticMethod: 'GET', + }, + response: { + description: 'Deprecated and undocumented endpoint', + responseType: 'void', + }, + title: 'Deprecated and undocumented endpoint', + }, + { + codeSamples: [ + { + code: { + javascript: { + request: 'await seam.deprecated.undocumented.endpoint()', + request_syntax: 'javascript', + response: 'void', + response_syntax: 'javascript', + title: 'JavaScript', + }, + php: { + request: `deprecated->undocumented->endpoint()`, + request_syntax: 'php', + response: 'null', + response_syntax: 'php', + title: 'PHP', + }, + python: { + request: 'seam.deprecated.undocumented.endpoint()', + request_syntax: 'python', + response: 'None', + response_syntax: 'python', + title: 'Python', + }, + ruby: { + request: 'seam.deprecated.undocumented.endpoint()', + request_syntax: 'ruby', + response: 'nil', + response_syntax: 'ruby', + title: 'Ruby', + }, + seam_cli: { + request: 'seam deprecated undocumented endpoint ', + request_syntax: 'bash', + response: 'void', + response_syntax: 'json', + title: 'Seam CLI', + }, + }, + description: 'This is a deprecated and undocumented endpoint', + request: { + parameters: {}, + path: '/deprecated/undocumented/endpoint', + }, + response: { + body: {}, + }, + title: 'Deprecated and undocumented endpoint', + }, + ], + deprecationMessage: '', + description: '', + isDeprecated: true, + isUndocumented: true, + name: 'endpoint', + path: '/deprecated/undocumented/endpoint', + request: { + methods: [ + 'GET', + ], + parameters: [], + preferredMethod: 'GET', + semanticMethod: 'GET', + }, + response: { + description: 'Deprecated and undocumented endpoint', + responseType: 'void', + }, + title: 'Deprecated and undocumented endpoint', + }, + ], + isDeprecated: true, + isUndocumented: true, + name: 'undocumented', + namespace: { + isDeprecated: true, + isUndocumented: true, + path: '/deprecated', + }, + path: '/deprecated/undocumented', + subroutes: [], + }, + ], + title: 'Foo', + } + +## createBlueprint: with formatCode + +> blueprint + + { + resources: { + foo: { + description: 'A foo resource.', + properties: [ + { + deprecationMessage: '', + description: 'Foo id', + format: 'id', + isDeprecated: false, + isUndocumented: false, + jsonType: 'string', + name: 'foo_id', + }, + { + deprecationMessage: '', + description: 'Foo name', + format: 'string', + isDeprecated: false, + isUndocumented: false, + jsonType: 'string', + name: 'name', + }, + { + deprecationMessage: 'This prop will be removed in the next version', + description: 'This prop is deprecated', + format: 'string', + isDeprecated: true, + isUndocumented: false, + jsonType: 'string', + name: 'deprecated_prop', + }, + { + deprecationMessage: '', + description: 'This prop is undocumented', + format: 'string', + isDeprecated: false, + isUndocumented: true, + jsonType: 'string', + name: 'undocumented_prop', + }, + { + deprecationMessage: '', + description: 'This prop is nullable', + format: 'string', + isDeprecated: false, + isUndocumented: false, + jsonType: 'string', + name: 'nullable_prop', + }, + { + deprecationMessage: '', + description: 'This prop is a number', + format: 'number', + isDeprecated: false, + isUndocumented: false, + jsonType: 'number', + name: 'number_prop', + }, + { + deprecationMessage: '', + description: '', + format: 'object', + isDeprecated: false, + isUndocumented: false, + jsonType: 'object', + name: 'object_prop', + properties: [ { deprecationMessage: '', description: '', @@ -1275,47 +1788,447 @@ Generated by [AVA](https://avajs.dev). name: 'foo', }, ], - }, - { + }, + { + deprecationMessage: '', + description: '', + format: 'list', + isDeprecated: false, + isUndocumented: false, + jsonType: 'array', + name: 'array_prop', + }, + ], + resourceType: 'foo', + }, + plane: { + description: 'A plane resource.', + properties: [ + { + deprecationMessage: '', + description: 'plane id', + format: 'id', + isDeprecated: false, + isUndocumented: false, + jsonType: 'string', + name: 'plane_id', + }, + { + deprecationMessage: '', + description: 'Planej name', + format: 'string', + isDeprecated: false, + isUndocumented: false, + jsonType: 'string', + name: 'name', + }, + ], + resourceType: 'plane', + }, + }, + routes: [ + { + endpoints: [ + { + codeSamples: [ + { + code: { + javascript: { + request: `// javascript␊ + await seam.foos.get({"foo_id":"8d7e0b3a-b889-49a7-9164-4b71a0506a33"})`, + request_syntax: 'javascript', + response: `// javascript␊ + {"foo_id":"8d7e0b3a-b889-49a7-9164-4b71a0506a33","name":"Best foo","nullable_prop":null,"number_prop":10,"object_prop":{"foo":"bar"},"array_prop":["foo","bar"]}`, + response_syntax: 'javascript', + title: 'JavaScript', + }, + php: { + request: `// php␊ + foos->get(foo_id:"8d7e0b3a-b889-49a7-9164-4b71a0506a33")`, + request_syntax: 'php', + response: `// php␊ + ["foo_id" => "8d7e0b3a-b889-49a7-9164-4b71a0506a33","name" => "Best foo","nullable_prop" => null,"number_prop" => 10,"object_prop" => ["foo" => "bar"],"array_prop" => ["foo", "bar"]]`, + response_syntax: 'php', + title: 'PHP', + }, + python: { + request: `// python␊ + seam.foos.get(foo_id="8d7e0b3a-b889-49a7-9164-4b71a0506a33")`, + request_syntax: 'python', + response: `// python␊ + Foo(foo_id="8d7e0b3a-b889-49a7-9164-4b71a0506a33", name="Best foo", nullable_prop=None, number_prop=10, object_prop={"foo":"bar"}, array_prop=["foo","bar"])`, + response_syntax: 'python', + title: 'Python', + }, + ruby: { + request: `// ruby␊ + seam.foos.get(foo_id: "8d7e0b3a-b889-49a7-9164-4b71a0506a33")`, + request_syntax: 'ruby', + response: `// ruby␊ + {"foo_id" => "8d7e0b3a-b889-49a7-9164-4b71a0506a33","name" => "Best foo","nullable_prop" => nil,"number_prop" => 10,"object_prop" => {"foo":"bar"},"array_prop" => ["foo","bar"]}`, + response_syntax: 'ruby', + title: 'Ruby', + }, + seam_cli: { + request: `// bash␊ + seam foos get --foo_id "8d7e0b3a-b889-49a7-9164-4b71a0506a33"`, + request_syntax: 'bash', + response: `// json␊ + {"foo_id":"8d7e0b3a-b889-49a7-9164-4b71a0506a33","name":"Best foo","nullable_prop":null,"number_prop":10,"object_prop":{"foo":"bar"},"array_prop":["foo","bar"]}`, + response_syntax: 'json', + title: 'Seam CLI', + }, + }, + description: 'This is the way to get a foo', + request: { + parameters: { + foo_id: '8d7e0b3a-b889-49a7-9164-4b71a0506a33', + }, + path: '/foos/get', + }, + response: { + body: { + foo: { + array_prop: [ + 'foo', + 'bar', + ], + foo_id: '8d7e0b3a-b889-49a7-9164-4b71a0506a33', + name: 'Best foo', + nullable_prop: null, + number_prop: 10, + object_prop: { + foo: 'bar', + }, + }, + }, + }, + title: 'Get a foo by ID', + }, + ], + deprecationMessage: '', + description: '', + isDeprecated: false, + isUndocumented: false, + name: 'get', + path: '/foos/get', + request: { + methods: [ + 'GET', + ], + parameters: [], + preferredMethod: 'GET', + semanticMethod: 'GET', + }, + response: { + description: 'Get a foo by ID.', + resourceType: 'foo', + responseKey: 'foo', + responseType: 'resource', + }, + title: 'Get a foo', + }, + { + codeSamples: [ + { + code: { + javascript: { + request: `// javascript␊ + await seam.foos.get({"foo_id":"8d7e0b3a-b889-49a7-9164-4b71a0506a33"})`, + request_syntax: 'javascript', + response: `// javascript␊ + {"foo_id":"8d7e0b3a-b889-49a7-9164-4b71a0506a33","name":"Best foo","nullable_prop":null,"number_prop":10,"object_prop":{"foo":"bar"},"array_prop":["foo","bar"]}`, + response_syntax: 'javascript', + title: 'JavaScript', + }, + php: { + request: `// php␊ + foos->get(foo_id:"8d7e0b3a-b889-49a7-9164-4b71a0506a33")`, + request_syntax: 'php', + response: `// php␊ + ["foo_id" => "8d7e0b3a-b889-49a7-9164-4b71a0506a33","name" => "Best foo","nullable_prop" => null,"number_prop" => 10,"object_prop" => ["foo" => "bar"],"array_prop" => ["foo", "bar"]]`, + response_syntax: 'php', + title: 'PHP', + }, + python: { + request: `// python␊ + seam.foos.get(foo_id="8d7e0b3a-b889-49a7-9164-4b71a0506a33")`, + request_syntax: 'python', + response: `// python␊ + Foo(foo_id="8d7e0b3a-b889-49a7-9164-4b71a0506a33", name="Best foo", nullable_prop=None, number_prop=10, object_prop={"foo":"bar"}, array_prop=["foo","bar"])`, + response_syntax: 'python', + title: 'Python', + }, + ruby: { + request: `// ruby␊ + seam.foos.get(foo_id: "8d7e0b3a-b889-49a7-9164-4b71a0506a33")`, + request_syntax: 'ruby', + response: `// ruby␊ + {"foo_id" => "8d7e0b3a-b889-49a7-9164-4b71a0506a33","name" => "Best foo","nullable_prop" => nil,"number_prop" => 10,"object_prop" => {"foo":"bar"},"array_prop" => ["foo","bar"]}`, + response_syntax: 'ruby', + title: 'Ruby', + }, + seam_cli: { + request: `// bash␊ + seam foos get --foo_id "8d7e0b3a-b889-49a7-9164-4b71a0506a33"`, + request_syntax: 'bash', + response: `// json␊ + {"foo_id":"8d7e0b3a-b889-49a7-9164-4b71a0506a33","name":"Best foo","nullable_prop":null,"number_prop":10,"object_prop":{"foo":"bar"},"array_prop":["foo","bar"]}`, + response_syntax: 'json', + title: 'Seam CLI', + }, + }, + description: 'This is the way to get a foo', + request: { + parameters: { + foo_id: '8d7e0b3a-b889-49a7-9164-4b71a0506a33', + }, + path: '/foos/get', + }, + response: { + body: { + foo: { + array_prop: [ + 'foo', + 'bar', + ], + foo_id: '8d7e0b3a-b889-49a7-9164-4b71a0506a33', + name: 'Best foo', + nullable_prop: null, + number_prop: 10, + object_prop: { + foo: 'bar', + }, + }, + }, + }, + title: 'Get a foo by ID', + }, + ], + deprecationMessage: '', + description: '', + isDeprecated: false, + isUndocumented: false, + name: 'get', + path: '/foos/get', + request: { + methods: [ + 'POST', + ], + parameters: [], + preferredMethod: 'POST', + semanticMethod: 'POST', + }, + response: { + description: 'Get a foo by ID.', + resourceType: 'foo', + responseKey: 'foo', + responseType: 'resource', + }, + title: 'Get a foo', + }, + { + codeSamples: [ + { + code: { + javascript: { + request: `// javascript␊ + await seam.foos.list()`, + request_syntax: 'javascript', + response: `// javascript␊ + [{"foo_id":"8d7e0b3a-b889-49a7-9164-4b71a0506a33","name":"Best foo","nullable_prop":null,"number_prop":10,"object_prop":{"foo":"bar"},"array_prop":["foo","bar"]}]`, + response_syntax: 'javascript', + title: 'JavaScript', + }, + php: { + request: `// php␊ + foos->list()`, + request_syntax: 'php', + response: `// php␊ + [["foo_id" => "8d7e0b3a-b889-49a7-9164-4b71a0506a33","name" => "Best foo","nullable_prop" => null,"number_prop" => 10,"object_prop" => ["foo" => "bar"],"array_prop" => ["foo", "bar"]]]`, + response_syntax: 'php', + title: 'PHP', + }, + python: { + request: `// python␊ + seam.foos.list()`, + request_syntax: 'python', + response: `// python␊ + [Foo(foo_id="8d7e0b3a-b889-49a7-9164-4b71a0506a33", name="Best foo", nullable_prop=None, number_prop=10, object_prop={"foo":"bar"}, array_prop=["foo","bar"])]`, + response_syntax: 'python', + title: 'Python', + }, + ruby: { + request: `// ruby␊ + seam.foos.list()`, + request_syntax: 'ruby', + response: `// ruby␊ + [{"foo_id" => "8d7e0b3a-b889-49a7-9164-4b71a0506a33","name" => "Best foo","nullable_prop" => nil,"number_prop" => 10,"object_prop" => {"foo":"bar"},"array_prop" => ["foo","bar"]}]`, + response_syntax: 'ruby', + title: 'Ruby', + }, + seam_cli: { + request: `// bash␊ + seam foos list `, + request_syntax: 'bash', + response: `// json␊ + [{"foo_id":"8d7e0b3a-b889-49a7-9164-4b71a0506a33","name":"Best foo","nullable_prop":null,"number_prop":10,"object_prop":{"foo":"bar"},"array_prop":["foo","bar"]}]`, + response_syntax: 'json', + title: 'Seam CLI', + }, + }, + description: 'This is the way to list foos', + request: { + parameters: {}, + path: '/foos/list', + }, + response: { + body: { + foos: [ + { + array_prop: [ + 'foo', + 'bar', + ], + foo_id: '8d7e0b3a-b889-49a7-9164-4b71a0506a33', + name: 'Best foo', + nullable_prop: null, + number_prop: 10, + object_prop: { + foo: 'bar', + }, + }, + ], + }, + }, + title: 'List foos', + }, + ], + deprecationMessage: '', + description: '', + isDeprecated: false, + isUndocumented: false, + name: 'list', + path: '/foos/list', + request: { + methods: [ + 'GET', + ], + parameters: [], + preferredMethod: 'GET', + semanticMethod: 'GET', + }, + response: { + description: 'List all foos.', + resourceType: 'foo', + responseKey: 'foos', + responseType: 'resource_list', + }, + title: 'List foos', + }, + { + codeSamples: [ + { + code: { + javascript: { + request: `// javascript␊ + await seam.foos.list()`, + request_syntax: 'javascript', + response: `// javascript␊ + [{"foo_id":"8d7e0b3a-b889-49a7-9164-4b71a0506a33","name":"Best foo","nullable_prop":null,"number_prop":10,"object_prop":{"foo":"bar"},"array_prop":["foo","bar"]}]`, + response_syntax: 'javascript', + title: 'JavaScript', + }, + php: { + request: `// php␊ + foos->list()`, + request_syntax: 'php', + response: `// php␊ + [["foo_id" => "8d7e0b3a-b889-49a7-9164-4b71a0506a33","name" => "Best foo","nullable_prop" => null,"number_prop" => 10,"object_prop" => ["foo" => "bar"],"array_prop" => ["foo", "bar"]]]`, + response_syntax: 'php', + title: 'PHP', + }, + python: { + request: `// python␊ + seam.foos.list()`, + request_syntax: 'python', + response: `// python␊ + [Foo(foo_id="8d7e0b3a-b889-49a7-9164-4b71a0506a33", name="Best foo", nullable_prop=None, number_prop=10, object_prop={"foo":"bar"}, array_prop=["foo","bar"])]`, + response_syntax: 'python', + title: 'Python', + }, + ruby: { + request: `// ruby␊ + seam.foos.list()`, + request_syntax: 'ruby', + response: `// ruby␊ + [{"foo_id" => "8d7e0b3a-b889-49a7-9164-4b71a0506a33","name" => "Best foo","nullable_prop" => nil,"number_prop" => 10,"object_prop" => {"foo":"bar"},"array_prop" => ["foo","bar"]}]`, + response_syntax: 'ruby', + title: 'Ruby', + }, + seam_cli: { + request: `// bash␊ + seam foos list `, + request_syntax: 'bash', + response: `// json␊ + [{"foo_id":"8d7e0b3a-b889-49a7-9164-4b71a0506a33","name":"Best foo","nullable_prop":null,"number_prop":10,"object_prop":{"foo":"bar"},"array_prop":["foo","bar"]}]`, + response_syntax: 'json', + title: 'Seam CLI', + }, + }, + description: 'This is the way to list foos', + request: { + parameters: {}, + path: '/foos/list', + }, + response: { + body: { + foos: [ + { + array_prop: [ + 'foo', + 'bar', + ], + foo_id: '8d7e0b3a-b889-49a7-9164-4b71a0506a33', + name: 'Best foo', + nullable_prop: null, + number_prop: 10, + object_prop: { + foo: 'bar', + }, + }, + ], + }, + }, + title: 'List foos', + }, + ], deprecationMessage: '', description: '', - format: 'list', - isDeprecated: false, - isUndocumented: false, - jsonType: 'array', - name: 'array_prop', - }, - ], - resourceType: 'foo', - }, - plane: { - description: 'A plane resource.', - properties: [ - { - deprecationMessage: '', - description: 'plane id', - format: 'id', isDeprecated: false, isUndocumented: false, - jsonType: 'string', - name: 'plane_id', - }, - { - deprecationMessage: '', - description: 'Planej name', - format: 'string', - isDeprecated: false, - isUndocumented: false, - jsonType: 'string', - name: 'name', + name: 'list', + path: '/foos/list', + request: { + methods: [ + 'POST', + ], + parameters: [], + preferredMethod: 'POST', + semanticMethod: 'POST', + }, + response: { + description: 'List all foos.', + resourceType: 'foo', + responseKey: 'foos', + responseType: 'resource_list', + }, + title: 'List foos', }, - ], - resourceType: 'plane', - }, - }, - routes: [ - { - endpoints: [ { codeSamples: [ { @@ -2308,6 +3221,97 @@ Generated by [AVA](https://avajs.dev). }, title: 'List planes', }, + { + codeSamples: [ + { + code: { + javascript: { + request: `// javascript␊ + await seam.transport.air.planes.list()`, + request_syntax: 'javascript', + response: `// javascript␊ + [{"plane_id":"9d3163f9-9185-40d3-a0ce-a03d3c7ce402","name":"Woosh"}]`, + response_syntax: 'javascript', + title: 'JavaScript', + }, + php: { + request: `// php␊ + transport->air->planes->list()`, + request_syntax: 'php', + response: `// php␊ + [["plane_id" => "9d3163f9-9185-40d3-a0ce-a03d3c7ce402","name" => "Woosh"]]`, + response_syntax: 'php', + title: 'PHP', + }, + python: { + request: `// python␊ + seam.transport.air.planes.list()`, + request_syntax: 'python', + response: `// python␊ + [Plane(plane_id="9d3163f9-9185-40d3-a0ce-a03d3c7ce402", name="Woosh")]`, + response_syntax: 'python', + title: 'Python', + }, + ruby: { + request: `// ruby␊ + seam.transport.air.planes.list()`, + request_syntax: 'ruby', + response: `// ruby␊ + [{"plane_id" => "9d3163f9-9185-40d3-a0ce-a03d3c7ce402","name" => "Woosh"}]`, + response_syntax: 'ruby', + title: 'Ruby', + }, + seam_cli: { + request: `// bash␊ + seam transport air planes list `, + request_syntax: 'bash', + response: `// json␊ + [{"plane_id":"9d3163f9-9185-40d3-a0ce-a03d3c7ce402","name":"Woosh"}]`, + response_syntax: 'json', + title: 'Seam CLI', + }, + }, + description: 'This is the wya to get all plans', + request: { + parameters: {}, + path: '/transport/air/planes/list', + }, + response: { + body: { + planes: [ + { + name: 'Woosh', + plane_id: '9d3163f9-9185-40d3-a0ce-a03d3c7ce402', + }, + ], + }, + }, + title: 'List planes', + }, + ], + deprecationMessage: '', + description: '', + isDeprecated: false, + isUndocumented: false, + name: 'list', + path: '/transport/air/planes/list', + request: { + methods: [ + 'GET', + ], + parameters: [], + preferredMethod: 'GET', + semanticMethod: 'GET', + }, + response: { + description: 'List all planes.', + resourceType: 'plane', + responseKey: 'planes', + responseType: 'resource_list', + }, + title: 'List planes', + }, ], isDeprecated: false, isUndocumented: false, @@ -2486,6 +3490,88 @@ Generated by [AVA](https://avajs.dev). }, title: 'Deprecated and undocumented endpoint', }, + { + codeSamples: [ + { + code: { + javascript: { + request: `// javascript␊ + await seam.deprecated.undocumented.endpoint()`, + request_syntax: 'javascript', + response: `// javascript␊ + void`, + response_syntax: 'javascript', + title: 'JavaScript', + }, + php: { + request: `// php␊ + deprecated->undocumented->endpoint()`, + request_syntax: 'php', + response: `// php␊ + null`, + response_syntax: 'php', + title: 'PHP', + }, + python: { + request: `// python␊ + seam.deprecated.undocumented.endpoint()`, + request_syntax: 'python', + response: `// python␊ + None`, + response_syntax: 'python', + title: 'Python', + }, + ruby: { + request: `// ruby␊ + seam.deprecated.undocumented.endpoint()`, + request_syntax: 'ruby', + response: `// ruby␊ + nil`, + response_syntax: 'ruby', + title: 'Ruby', + }, + seam_cli: { + request: `// bash␊ + seam deprecated undocumented endpoint `, + request_syntax: 'bash', + response: `// json␊ + void`, + response_syntax: 'json', + title: 'Seam CLI', + }, + }, + description: 'This is a deprecated and undocumented endpoint', + request: { + parameters: {}, + path: '/deprecated/undocumented/endpoint', + }, + response: { + body: {}, + }, + title: 'Deprecated and undocumented endpoint', + }, + ], + deprecationMessage: '', + description: '', + isDeprecated: true, + isUndocumented: true, + name: 'endpoint', + path: '/deprecated/undocumented/endpoint', + request: { + methods: [ + 'GET', + ], + parameters: [], + preferredMethod: 'GET', + semanticMethod: 'GET', + }, + response: { + description: 'Deprecated and undocumented endpoint', + responseType: 'void', + }, + title: 'Deprecated and undocumented endpoint', + }, ], isDeprecated: true, isUndocumented: true, diff --git a/test/snapshots/blueprint.test.ts.snap b/test/snapshots/blueprint.test.ts.snap index 2c9df4c..ce53be3 100644 Binary files a/test/snapshots/blueprint.test.ts.snap and b/test/snapshots/blueprint.test.ts.snap differ diff --git a/test/snapshots/seam-blueprint.test.ts.md b/test/snapshots/seam-blueprint.test.ts.md index d0c1670..e1cd460 100644 --- a/test/snapshots/seam-blueprint.test.ts.md +++ b/test/snapshots/seam-blueprint.test.ts.md @@ -918,7 +918,7 @@ Generated by [AVA](https://avajs.dev). properties: [ { deprecationMessage: '', - description: '', + description: 'IP address or hostname of the main Visionline server relative to the Seam Bridge on the local network.', format: 'string', isDeprecated: false, isUndocumented: false, @@ -927,7 +927,7 @@ Generated by [AVA](https://avajs.dev). }, { deprecationMessage: '', - description: '', + description: 'Keyset loaded into a reader. Mobile keys and reader administration tools securely authenticate only with readers programmed with a matching keyset.', format: 'string', isDeprecated: false, isUndocumented: false, @@ -936,7 +936,7 @@ Generated by [AVA](https://avajs.dev). }, { deprecationMessage: '', - description: '', + description: 'Unique ID assigned by the ASSA ABLOY licensing team that identifies each hotel in your credential manager.', format: 'string', isDeprecated: false, isUndocumented: false, @@ -1216,6 +1216,142 @@ Generated by [AVA](https://avajs.dev). ], resourceType: 'acs_user', }, + climate_preset: { + description: '', + properties: [ + { + deprecationMessage: '', + description: '', + format: 'boolean', + isDeprecated: false, + isUndocumented: false, + jsonType: 'boolean', + name: 'can_delete', + }, + { + deprecationMessage: '', + description: '', + format: 'boolean', + isDeprecated: false, + isUndocumented: false, + jsonType: 'boolean', + name: 'can_edit', + }, + { + deprecationMessage: '', + description: '', + format: 'string', + isDeprecated: false, + isUndocumented: false, + jsonType: 'string', + name: 'climate_preset_key', + }, + { + deprecationMessage: '', + description: '', + format: 'number', + isDeprecated: false, + isUndocumented: false, + jsonType: 'number', + name: 'cooling_set_point_celsius', + }, + { + deprecationMessage: '', + description: '', + format: 'number', + isDeprecated: false, + isUndocumented: false, + jsonType: 'number', + name: 'cooling_set_point_fahrenheit', + }, + { + deprecationMessage: '', + description: '', + format: 'string', + isDeprecated: false, + isUndocumented: false, + jsonType: 'string', + name: 'display_name', + }, + { + deprecationMessage: '', + description: '', + format: 'enum', + isDeprecated: false, + isUndocumented: false, + jsonType: 'string', + name: 'fan_mode_setting', + values: [ + { + name: 'auto', + }, + { + name: 'on', + }, + ], + }, + { + deprecationMessage: '', + description: '', + format: 'number', + isDeprecated: false, + isUndocumented: false, + jsonType: 'number', + name: 'heating_set_point_celsius', + }, + { + deprecationMessage: '', + description: '', + format: 'number', + isDeprecated: false, + isUndocumented: false, + jsonType: 'number', + name: 'heating_set_point_fahrenheit', + }, + { + deprecationMessage: '', + description: '', + format: 'enum', + isDeprecated: false, + isUndocumented: false, + jsonType: 'string', + name: 'hvac_mode_setting', + values: [ + { + name: 'off', + }, + { + name: 'heat', + }, + { + name: 'cool', + }, + { + name: 'heat_cool', + }, + ], + }, + { + deprecationMessage: '', + description: '', + format: 'boolean', + isDeprecated: false, + isUndocumented: false, + jsonType: 'boolean', + name: 'manual_override_allowed', + }, + { + deprecationMessage: '', + description: '', + format: 'string', + isDeprecated: false, + isUndocumented: false, + jsonType: 'string', + name: 'name', + }, + ], + resourceType: 'climate_preset', + }, event: { description: '', properties: [ @@ -1339,6 +1475,84 @@ Generated by [AVA](https://avajs.dev). ], resourceType: 'event', }, + thermostat_schedule: { + description: '', + properties: [ + { + deprecationMessage: '', + description: '', + format: 'string', + isDeprecated: false, + isUndocumented: false, + jsonType: 'string', + name: 'climate_preset_key', + }, + { + deprecationMessage: '', + description: '', + format: 'datetime', + isDeprecated: false, + isUndocumented: false, + jsonType: 'string', + name: 'created_at', + }, + { + deprecationMessage: '', + description: '', + format: 'id', + isDeprecated: false, + isUndocumented: false, + jsonType: 'string', + name: 'device_id', + }, + { + deprecationMessage: '', + description: '', + format: 'datetime', + isDeprecated: false, + isUndocumented: false, + jsonType: 'string', + name: 'ends_at', + }, + { + deprecationMessage: '', + description: '', + format: 'number', + isDeprecated: false, + isUndocumented: false, + jsonType: 'number', + name: 'max_override_period_minutes', + }, + { + deprecationMessage: '', + description: '', + format: 'string', + isDeprecated: false, + isUndocumented: false, + jsonType: 'string', + name: 'name', + }, + { + deprecationMessage: '', + description: '', + format: 'datetime', + isDeprecated: false, + isUndocumented: false, + jsonType: 'string', + name: 'starts_at', + }, + { + deprecationMessage: '', + description: '', + format: 'id', + isDeprecated: false, + isUndocumented: false, + jsonType: 'string', + name: 'thermostat_schedule_id', + }, + ], + resourceType: 'thermostat_schedule', + }, }, routes: [ { @@ -3625,7 +3839,7 @@ Generated by [AVA](https://avajs.dev). deprecationMessage: '', description: '', isDeprecated: false, - isUndocumented: false, + isUndocumented: true, name: 'get', path: '/acs/users/unmanaged/get', request: { @@ -3658,7 +3872,7 @@ Generated by [AVA](https://avajs.dev). deprecationMessage: '', description: '', isDeprecated: false, - isUndocumented: false, + isUndocumented: true, name: 'list', path: '/acs/users/unmanaged/list', request: { @@ -3728,7 +3942,7 @@ Generated by [AVA](https://avajs.dev). }, ], isDeprecated: false, - isUndocumented: false, + isUndocumented: true, name: 'unmanaged', namespace: { isDeprecated: false, @@ -4119,6 +4333,1569 @@ Generated by [AVA](https://avajs.dev). path: '/events', subroutes: [], }, + { + endpoints: [ + { + codeSamples: [], + deprecationMessage: '', + description: '', + isDeprecated: false, + isUndocumented: false, + name: 'activate_climate_preset', + path: '/thermostats/activate_climate_preset', + request: { + methods: [ + 'POST', + ], + parameters: [ + { + deprecationMessage: '', + description: '', + format: 'string', + isDeprecated: false, + isRequired: true, + isUndocumented: false, + jsonType: 'string', + name: 'climate_preset_key', + }, + { + deprecationMessage: '', + description: '', + format: 'id', + isDeprecated: false, + isRequired: true, + isUndocumented: false, + jsonType: 'string', + name: 'device_id', + }, + ], + preferredMethod: 'POST', + semanticMethod: 'POST', + }, + response: { + description: 'OK', + responseType: 'void', + }, + title: '', + }, + { + codeSamples: [], + deprecationMessage: '', + description: '', + isDeprecated: false, + isUndocumented: false, + name: 'cool', + path: '/thermostats/cool', + request: { + methods: [ + 'POST', + ], + parameters: [ + { + deprecationMessage: '', + description: '', + format: 'number', + isDeprecated: false, + isRequired: false, + isUndocumented: false, + jsonType: 'number', + name: 'cooling_set_point_celsius', + }, + { + deprecationMessage: '', + description: '', + format: 'number', + isDeprecated: false, + isRequired: false, + isUndocumented: false, + jsonType: 'number', + name: 'cooling_set_point_fahrenheit', + }, + { + deprecationMessage: '', + description: '', + format: 'id', + isDeprecated: false, + isRequired: true, + isUndocumented: false, + jsonType: 'string', + name: 'device_id', + }, + { + deprecationMessage: '', + description: '', + format: 'boolean', + isDeprecated: false, + isRequired: false, + isUndocumented: false, + jsonType: 'boolean', + name: 'sync', + }, + ], + preferredMethod: 'POST', + semanticMethod: 'POST', + }, + response: { + description: 'OK', + responseType: 'void', + }, + title: '', + }, + { + codeSamples: [], + deprecationMessage: '', + description: '', + isDeprecated: false, + isUndocumented: false, + name: 'create_climate_preset', + path: '/thermostats/create_climate_preset', + request: { + methods: [ + 'POST', + ], + parameters: [ + { + deprecationMessage: '', + description: '', + format: 'string', + isDeprecated: false, + isRequired: true, + isUndocumented: false, + jsonType: 'string', + name: 'climate_preset_key', + }, + { + deprecationMessage: '', + description: '', + format: 'number', + isDeprecated: false, + isRequired: false, + isUndocumented: false, + jsonType: 'number', + name: 'cooling_set_point_celsius', + }, + { + deprecationMessage: '', + description: '', + format: 'number', + isDeprecated: false, + isRequired: false, + isUndocumented: false, + jsonType: 'number', + name: 'cooling_set_point_fahrenheit', + }, + { + deprecationMessage: '', + description: '', + format: 'id', + isDeprecated: false, + isRequired: true, + isUndocumented: false, + jsonType: 'string', + name: 'device_id', + }, + { + deprecationMessage: '', + description: '', + format: 'enum', + isDeprecated: false, + isRequired: false, + isUndocumented: false, + jsonType: 'string', + name: 'fan_mode_setting', + values: [ + { + name: 'auto', + }, + { + name: 'on', + }, + ], + }, + { + deprecationMessage: '', + description: '', + format: 'number', + isDeprecated: false, + isRequired: false, + isUndocumented: false, + jsonType: 'number', + name: 'heating_set_point_celsius', + }, + { + deprecationMessage: '', + description: '', + format: 'number', + isDeprecated: false, + isRequired: false, + isUndocumented: false, + jsonType: 'number', + name: 'heating_set_point_fahrenheit', + }, + { + deprecationMessage: '', + description: '', + format: 'enum', + isDeprecated: false, + isRequired: false, + isUndocumented: false, + jsonType: 'string', + name: 'hvac_mode_setting', + values: [ + { + name: 'off', + }, + { + name: 'heat', + }, + { + name: 'cool', + }, + { + name: 'heat_cool', + }, + ], + }, + { + deprecationMessage: '', + description: '', + format: 'boolean', + isDeprecated: false, + isRequired: true, + isUndocumented: false, + jsonType: 'boolean', + name: 'manual_override_allowed', + }, + { + deprecationMessage: '', + description: '', + format: 'string', + isDeprecated: false, + isRequired: false, + isUndocumented: false, + jsonType: 'string', + name: 'name', + }, + ], + preferredMethod: 'POST', + semanticMethod: 'POST', + }, + response: { + description: 'OK', + responseType: 'void', + }, + title: '', + }, + { + codeSamples: [], + deprecationMessage: '', + description: '', + isDeprecated: false, + isUndocumented: false, + name: 'delete_climate_preset', + path: '/thermostats/delete_climate_preset', + request: { + methods: [ + 'POST', + ], + parameters: [ + { + deprecationMessage: '', + description: '', + format: 'string', + isDeprecated: false, + isRequired: true, + isUndocumented: false, + jsonType: 'string', + name: 'climate_preset_key', + }, + { + deprecationMessage: '', + description: '', + format: 'id', + isDeprecated: false, + isRequired: true, + isUndocumented: false, + jsonType: 'string', + name: 'device_id', + }, + ], + preferredMethod: 'POST', + semanticMethod: 'POST', + }, + response: { + description: 'OK', + responseType: 'void', + }, + title: '', + }, + { + codeSamples: [], + deprecationMessage: 'Use `/devices/get` instead.', + description: '', + isDeprecated: false, + isUndocumented: false, + name: 'get', + path: '/thermostats/get', + request: { + methods: [ + 'POST', + ], + parameters: [ + { + deprecationMessage: '', + description: '', + format: 'id', + isDeprecated: false, + isRequired: false, + isUndocumented: false, + jsonType: 'string', + name: 'device_id', + }, + { + deprecationMessage: '', + description: '', + format: 'string', + isDeprecated: false, + isRequired: false, + isUndocumented: false, + jsonType: 'string', + name: 'name', + }, + ], + preferredMethod: 'POST', + semanticMethod: 'POST', + }, + response: { + description: 'OK', + responseType: 'void', + }, + title: '', + }, + { + codeSamples: [], + deprecationMessage: '', + description: '', + isDeprecated: false, + isUndocumented: false, + name: 'heat', + path: '/thermostats/heat', + request: { + methods: [ + 'POST', + ], + parameters: [ + { + deprecationMessage: '', + description: '', + format: 'id', + isDeprecated: false, + isRequired: true, + isUndocumented: false, + jsonType: 'string', + name: 'device_id', + }, + { + deprecationMessage: '', + description: '', + format: 'number', + isDeprecated: false, + isRequired: false, + isUndocumented: false, + jsonType: 'number', + name: 'heating_set_point_celsius', + }, + { + deprecationMessage: '', + description: '', + format: 'number', + isDeprecated: false, + isRequired: false, + isUndocumented: false, + jsonType: 'number', + name: 'heating_set_point_fahrenheit', + }, + { + deprecationMessage: '', + description: '', + format: 'boolean', + isDeprecated: false, + isRequired: false, + isUndocumented: false, + jsonType: 'boolean', + name: 'sync', + }, + ], + preferredMethod: 'POST', + semanticMethod: 'POST', + }, + response: { + description: 'OK', + responseType: 'void', + }, + title: '', + }, + { + codeSamples: [], + deprecationMessage: '', + description: '', + isDeprecated: false, + isUndocumented: false, + name: 'heat_cool', + path: '/thermostats/heat_cool', + request: { + methods: [ + 'POST', + ], + parameters: [ + { + deprecationMessage: '', + description: '', + format: 'number', + isDeprecated: false, + isRequired: false, + isUndocumented: false, + jsonType: 'number', + name: 'cooling_set_point_celsius', + }, + { + deprecationMessage: '', + description: '', + format: 'number', + isDeprecated: false, + isRequired: false, + isUndocumented: false, + jsonType: 'number', + name: 'cooling_set_point_fahrenheit', + }, + { + deprecationMessage: '', + description: '', + format: 'id', + isDeprecated: false, + isRequired: true, + isUndocumented: false, + jsonType: 'string', + name: 'device_id', + }, + { + deprecationMessage: '', + description: '', + format: 'number', + isDeprecated: false, + isRequired: false, + isUndocumented: false, + jsonType: 'number', + name: 'heating_set_point_celsius', + }, + { + deprecationMessage: '', + description: '', + format: 'number', + isDeprecated: false, + isRequired: false, + isUndocumented: false, + jsonType: 'number', + name: 'heating_set_point_fahrenheit', + }, + { + deprecationMessage: '', + description: '', + format: 'boolean', + isDeprecated: false, + isRequired: false, + isUndocumented: false, + jsonType: 'boolean', + name: 'sync', + }, + ], + preferredMethod: 'POST', + semanticMethod: 'POST', + }, + response: { + description: 'OK', + responseType: 'void', + }, + title: '', + }, + { + codeSamples: [], + deprecationMessage: '', + description: '', + isDeprecated: false, + isUndocumented: false, + name: 'list', + path: '/thermostats/list', + request: { + methods: [ + 'POST', + ], + parameters: [ + { + deprecationMessage: '', + description: '', + format: 'id', + isDeprecated: false, + isRequired: false, + isUndocumented: false, + jsonType: 'string', + name: 'connect_webview_id', + }, + { + deprecationMessage: '', + description: 'List all devices owned by this connected account', + format: 'id', + isDeprecated: false, + isRequired: false, + isUndocumented: false, + jsonType: 'string', + name: 'connected_account_id', + }, + { + deprecationMessage: '', + description: '', + format: 'list', + isDeprecated: false, + isRequired: false, + isUndocumented: false, + jsonType: 'array', + name: 'connected_account_ids', + }, + { + deprecationMessage: '', + description: '', + format: 'datetime', + isDeprecated: false, + isRequired: false, + isUndocumented: false, + jsonType: 'string', + name: 'created_before', + }, + { + deprecationMessage: '', + description: '', + format: 'record', + isDeprecated: false, + isRequired: false, + isUndocumented: false, + jsonType: 'object', + name: 'custom_metadata_has', + }, + { + deprecationMessage: '', + description: '', + format: 'list', + isDeprecated: false, + isRequired: false, + isUndocumented: false, + jsonType: 'array', + name: 'device_ids', + }, + { + deprecationMessage: '', + description: '', + format: 'list', + isDeprecated: false, + isRequired: false, + isUndocumented: false, + jsonType: 'array', + name: 'device_types', + }, + { + deprecationMessage: '', + description: '', + format: 'list', + isDeprecated: false, + isRequired: false, + isUndocumented: false, + jsonType: 'array', + name: 'exclude_if', + }, + { + deprecationMessage: '', + description: '', + format: 'list', + isDeprecated: false, + isRequired: false, + isUndocumented: false, + jsonType: 'array', + name: 'include_if', + }, + { + deprecationMessage: '', + description: '', + format: 'number', + isDeprecated: false, + isRequired: false, + isUndocumented: false, + jsonType: 'number', + name: 'limit', + }, + { + deprecationMessage: '', + description: '', + format: 'enum', + isDeprecated: false, + isRequired: false, + isUndocumented: false, + jsonType: 'string', + name: 'manufacturer', + values: [ + { + name: 'akuvox', + }, + { + name: 'august', + }, + { + name: 'avigilon_alta', + }, + { + name: 'brivo', + }, + { + name: 'butterflymx', + }, + { + name: 'doorking', + }, + { + name: 'four_suites', + }, + { + name: 'genie', + }, + { + name: 'igloo', + }, + { + name: 'keywe', + }, + { + name: 'kwikset', + }, + { + name: 'linear', + }, + { + name: 'lockly', + }, + { + name: 'nuki', + }, + { + name: 'philia', + }, + { + name: 'salto', + }, + { + name: 'samsung', + }, + { + name: 'schlage', + }, + { + name: 'seam', + }, + { + name: 'unknown', + }, + { + name: 'wyze', + }, + { + name: 'yale', + }, + { + name: 'minut', + }, + { + name: 'two_n', + }, + { + name: 'ttlock', + }, + { + name: 'nest', + }, + { + name: 'igloohome', + }, + { + name: 'ecobee', + }, + { + name: 'hubitat', + }, + { + name: 'controlbyweb', + }, + { + name: 'smartthings', + }, + { + name: 'dormakaba_oracode', + }, + { + name: 'tedee', + }, + { + name: 'honeywell_resideo', + }, + ], + }, + { + deprecationMessage: '', + description: '', + format: 'string', + isDeprecated: false, + isRequired: false, + isUndocumented: false, + jsonType: 'string', + name: 'user_identifier_key', + }, + ], + preferredMethod: 'POST', + semanticMethod: 'POST', + }, + response: { + description: 'OK', + responseType: 'void', + }, + title: '', + }, + { + codeSamples: [], + deprecationMessage: '', + description: '', + isDeprecated: false, + isUndocumented: false, + name: 'off', + path: '/thermostats/off', + request: { + methods: [ + 'POST', + ], + parameters: [ + { + deprecationMessage: '', + description: '', + format: 'id', + isDeprecated: false, + isRequired: true, + isUndocumented: false, + jsonType: 'string', + name: 'device_id', + }, + { + deprecationMessage: '', + description: '', + format: 'boolean', + isDeprecated: false, + isRequired: false, + isUndocumented: false, + jsonType: 'boolean', + name: 'sync', + }, + ], + preferredMethod: 'POST', + semanticMethod: 'POST', + }, + response: { + description: 'OK', + responseType: 'void', + }, + title: '', + }, + { + codeSamples: [], + deprecationMessage: '', + description: '', + isDeprecated: false, + isUndocumented: false, + name: 'set_fallback_climate_preset', + path: '/thermostats/set_fallback_climate_preset', + request: { + methods: [ + 'POST', + ], + parameters: [ + { + deprecationMessage: '', + description: '', + format: 'string', + isDeprecated: false, + isRequired: true, + isUndocumented: false, + jsonType: 'string', + name: 'climate_preset_key', + }, + { + deprecationMessage: '', + description: '', + format: 'id', + isDeprecated: false, + isRequired: true, + isUndocumented: false, + jsonType: 'string', + name: 'device_id', + }, + ], + preferredMethod: 'POST', + semanticMethod: 'POST', + }, + response: { + description: 'OK', + responseType: 'void', + }, + title: '', + }, + { + codeSamples: [], + deprecationMessage: '', + description: '', + isDeprecated: false, + isUndocumented: false, + name: 'set_fan_mode', + path: '/thermostats/set_fan_mode', + request: { + methods: [ + 'POST', + ], + parameters: [ + { + deprecationMessage: '', + description: '', + format: 'id', + isDeprecated: false, + isRequired: true, + isUndocumented: false, + jsonType: 'string', + name: 'device_id', + }, + { + deprecationMessage: 'use fan_mode_setting instead.', + description: '', + format: 'enum', + isDeprecated: true, + isRequired: false, + isUndocumented: false, + jsonType: 'string', + name: 'fan_mode', + values: [ + { + name: 'auto', + }, + { + name: 'on', + }, + ], + }, + { + deprecationMessage: '', + description: '', + format: 'enum', + isDeprecated: false, + isRequired: false, + isUndocumented: false, + jsonType: 'string', + name: 'fan_mode_setting', + values: [ + { + name: 'auto', + }, + { + name: 'on', + }, + ], + }, + { + deprecationMessage: '', + description: '', + format: 'boolean', + isDeprecated: false, + isRequired: false, + isUndocumented: false, + jsonType: 'boolean', + name: 'sync', + }, + ], + preferredMethod: 'POST', + semanticMethod: 'POST', + }, + response: { + description: 'OK', + responseType: 'void', + }, + title: '', + }, + { + codeSamples: [], + deprecationMessage: '', + description: '', + isDeprecated: false, + isUndocumented: false, + name: 'update_climate_preset', + path: '/thermostats/update_climate_preset', + request: { + methods: [ + 'PATCH', + ], + parameters: [ + { + deprecationMessage: '', + description: '', + format: 'string', + isDeprecated: false, + isRequired: true, + isUndocumented: false, + jsonType: 'string', + name: 'climate_preset_key', + }, + { + deprecationMessage: '', + description: '', + format: 'number', + isDeprecated: false, + isRequired: false, + isUndocumented: false, + jsonType: 'number', + name: 'cooling_set_point_celsius', + }, + { + deprecationMessage: '', + description: '', + format: 'number', + isDeprecated: false, + isRequired: false, + isUndocumented: false, + jsonType: 'number', + name: 'cooling_set_point_fahrenheit', + }, + { + deprecationMessage: '', + description: '', + format: 'id', + isDeprecated: false, + isRequired: true, + isUndocumented: false, + jsonType: 'string', + name: 'device_id', + }, + { + deprecationMessage: '', + description: '', + format: 'enum', + isDeprecated: false, + isRequired: false, + isUndocumented: false, + jsonType: 'string', + name: 'fan_mode_setting', + values: [ + { + name: 'auto', + }, + { + name: 'on', + }, + ], + }, + { + deprecationMessage: '', + description: '', + format: 'number', + isDeprecated: false, + isRequired: false, + isUndocumented: false, + jsonType: 'number', + name: 'heating_set_point_celsius', + }, + { + deprecationMessage: '', + description: '', + format: 'number', + isDeprecated: false, + isRequired: false, + isUndocumented: false, + jsonType: 'number', + name: 'heating_set_point_fahrenheit', + }, + { + deprecationMessage: '', + description: '', + format: 'enum', + isDeprecated: false, + isRequired: false, + isUndocumented: false, + jsonType: 'string', + name: 'hvac_mode_setting', + values: [ + { + name: 'off', + }, + { + name: 'heat', + }, + { + name: 'cool', + }, + { + name: 'heat_cool', + }, + ], + }, + { + deprecationMessage: '', + description: '', + format: 'boolean', + isDeprecated: false, + isRequired: true, + isUndocumented: false, + jsonType: 'boolean', + name: 'manual_override_allowed', + }, + { + deprecationMessage: '', + description: '', + format: 'string', + isDeprecated: false, + isRequired: false, + isUndocumented: false, + jsonType: 'string', + name: 'name', + }, + ], + preferredMethod: 'PATCH', + semanticMethod: 'PATCH', + }, + response: { + description: 'OK', + responseType: 'void', + }, + title: '', + }, + { + codeSamples: [], + deprecationMessage: '', + description: '', + isDeprecated: false, + isUndocumented: false, + name: 'update_climate_preset', + path: '/thermostats/update_climate_preset', + request: { + methods: [ + 'POST', + ], + parameters: [ + { + deprecationMessage: '', + description: '', + format: 'string', + isDeprecated: false, + isRequired: true, + isUndocumented: false, + jsonType: 'string', + name: 'climate_preset_key', + }, + { + deprecationMessage: '', + description: '', + format: 'number', + isDeprecated: false, + isRequired: false, + isUndocumented: false, + jsonType: 'number', + name: 'cooling_set_point_celsius', + }, + { + deprecationMessage: '', + description: '', + format: 'number', + isDeprecated: false, + isRequired: false, + isUndocumented: false, + jsonType: 'number', + name: 'cooling_set_point_fahrenheit', + }, + { + deprecationMessage: '', + description: '', + format: 'id', + isDeprecated: false, + isRequired: true, + isUndocumented: false, + jsonType: 'string', + name: 'device_id', + }, + { + deprecationMessage: '', + description: '', + format: 'enum', + isDeprecated: false, + isRequired: false, + isUndocumented: false, + jsonType: 'string', + name: 'fan_mode_setting', + values: [ + { + name: 'auto', + }, + { + name: 'on', + }, + ], + }, + { + deprecationMessage: '', + description: '', + format: 'number', + isDeprecated: false, + isRequired: false, + isUndocumented: false, + jsonType: 'number', + name: 'heating_set_point_celsius', + }, + { + deprecationMessage: '', + description: '', + format: 'number', + isDeprecated: false, + isRequired: false, + isUndocumented: false, + jsonType: 'number', + name: 'heating_set_point_fahrenheit', + }, + { + deprecationMessage: '', + description: '', + format: 'enum', + isDeprecated: false, + isRequired: false, + isUndocumented: false, + jsonType: 'string', + name: 'hvac_mode_setting', + values: [ + { + name: 'off', + }, + { + name: 'heat', + }, + { + name: 'cool', + }, + { + name: 'heat_cool', + }, + ], + }, + { + deprecationMessage: '', + description: '', + format: 'boolean', + isDeprecated: false, + isRequired: true, + isUndocumented: false, + jsonType: 'boolean', + name: 'manual_override_allowed', + }, + { + deprecationMessage: '', + description: '', + format: 'string', + isDeprecated: false, + isRequired: false, + isUndocumented: false, + jsonType: 'string', + name: 'name', + }, + ], + preferredMethod: 'POST', + semanticMethod: 'POST', + }, + response: { + description: 'OK', + responseType: 'void', + }, + title: '', + }, + ], + isDeprecated: false, + isUndocumented: false, + name: 'thermostats', + namespace: null, + path: '/thermostats', + subroutes: [], + }, + { + endpoints: [ + { + codeSamples: [], + deprecationMessage: '', + description: '', + isDeprecated: false, + isUndocumented: false, + name: 'create', + path: '/thermostats/schedules/create', + request: { + methods: [ + 'POST', + ], + parameters: [ + { + deprecationMessage: '', + description: '', + format: 'string', + isDeprecated: false, + isRequired: true, + isUndocumented: false, + jsonType: 'string', + name: 'climate_preset_key', + }, + { + deprecationMessage: '', + description: '', + format: 'string', + isDeprecated: false, + isRequired: true, + isUndocumented: false, + jsonType: 'string', + name: 'device_id', + }, + { + deprecationMessage: '', + description: '', + format: 'string', + isDeprecated: false, + isRequired: true, + isUndocumented: false, + jsonType: 'string', + name: 'ends_at', + }, + { + deprecationMessage: '', + description: '', + format: 'number', + isDeprecated: false, + isRequired: false, + isUndocumented: false, + jsonType: 'number', + name: 'max_override_period_minutes', + }, + { + deprecationMessage: '', + description: '', + format: 'string', + isDeprecated: false, + isRequired: false, + isUndocumented: false, + jsonType: 'string', + name: 'name', + }, + { + deprecationMessage: '', + description: '', + format: 'string', + isDeprecated: false, + isRequired: true, + isUndocumented: false, + jsonType: 'string', + name: 'starts_at', + }, + ], + preferredMethod: 'POST', + semanticMethod: 'POST', + }, + response: { + description: 'OK', + responseType: 'void', + }, + title: '', + }, + { + codeSamples: [], + deprecationMessage: '', + description: '', + isDeprecated: false, + isUndocumented: false, + name: 'delete', + path: '/thermostats/schedules/delete', + request: { + methods: [ + 'POST', + ], + parameters: [ + { + deprecationMessage: '', + description: '', + format: 'id', + isDeprecated: false, + isRequired: true, + isUndocumented: false, + jsonType: 'string', + name: 'thermostat_schedule_id', + }, + ], + preferredMethod: 'POST', + semanticMethod: 'POST', + }, + response: { + description: 'OK', + responseType: 'void', + }, + title: '', + }, + { + codeSamples: [], + deprecationMessage: '', + description: '', + isDeprecated: false, + isUndocumented: false, + name: 'get', + path: '/thermostats/schedules/get', + request: { + methods: [ + 'POST', + ], + parameters: [ + { + deprecationMessage: '', + description: '', + format: 'id', + isDeprecated: false, + isRequired: true, + isUndocumented: false, + jsonType: 'string', + name: 'thermostat_schedule_id', + }, + ], + preferredMethod: 'POST', + semanticMethod: 'POST', + }, + response: { + description: 'OK', + responseType: 'void', + }, + title: '', + }, + { + codeSamples: [], + deprecationMessage: '', + description: '', + isDeprecated: false, + isUndocumented: false, + name: 'list', + path: '/thermostats/schedules/list', + request: { + methods: [ + 'POST', + ], + parameters: [ + { + deprecationMessage: '', + description: '', + format: 'id', + isDeprecated: false, + isRequired: true, + isUndocumented: false, + jsonType: 'string', + name: 'device_id', + }, + { + deprecationMessage: '', + description: '', + format: 'string', + isDeprecated: false, + isRequired: false, + isUndocumented: false, + jsonType: 'string', + name: 'user_identifier_key', + }, + ], + preferredMethod: 'POST', + semanticMethod: 'POST', + }, + response: { + description: 'OK', + responseType: 'void', + }, + title: '', + }, + { + codeSamples: [], + deprecationMessage: '', + description: '', + isDeprecated: false, + isUndocumented: false, + name: 'update', + path: '/thermostats/schedules/update', + request: { + methods: [ + 'PATCH', + ], + parameters: [ + { + deprecationMessage: '', + description: '', + format: 'string', + isDeprecated: false, + isRequired: false, + isUndocumented: false, + jsonType: 'string', + name: 'climate_preset_key', + }, + { + deprecationMessage: '', + description: '', + format: 'string', + isDeprecated: false, + isRequired: false, + isUndocumented: false, + jsonType: 'string', + name: 'ends_at', + }, + { + deprecationMessage: '', + description: '', + format: 'number', + isDeprecated: false, + isRequired: false, + isUndocumented: false, + jsonType: 'number', + name: 'max_override_period_minutes', + }, + { + deprecationMessage: '', + description: '', + format: 'string', + isDeprecated: false, + isRequired: false, + isUndocumented: false, + jsonType: 'string', + name: 'name', + }, + { + deprecationMessage: '', + description: '', + format: 'string', + isDeprecated: false, + isRequired: false, + isUndocumented: false, + jsonType: 'string', + name: 'starts_at', + }, + { + deprecationMessage: '', + description: '', + format: 'id', + isDeprecated: false, + isRequired: true, + isUndocumented: false, + jsonType: 'string', + name: 'thermostat_schedule_id', + }, + ], + preferredMethod: 'PATCH', + semanticMethod: 'PATCH', + }, + response: { + description: 'OK', + responseType: 'void', + }, + title: '', + }, + { + codeSamples: [], + deprecationMessage: '', + description: '', + isDeprecated: false, + isUndocumented: false, + name: 'update', + path: '/thermostats/schedules/update', + request: { + methods: [ + 'POST', + ], + parameters: [ + { + deprecationMessage: '', + description: '', + format: 'string', + isDeprecated: false, + isRequired: false, + isUndocumented: false, + jsonType: 'string', + name: 'climate_preset_key', + }, + { + deprecationMessage: '', + description: '', + format: 'string', + isDeprecated: false, + isRequired: false, + isUndocumented: false, + jsonType: 'string', + name: 'ends_at', + }, + { + deprecationMessage: '', + description: '', + format: 'number', + isDeprecated: false, + isRequired: false, + isUndocumented: false, + jsonType: 'number', + name: 'max_override_period_minutes', + }, + { + deprecationMessage: '', + description: '', + format: 'string', + isDeprecated: false, + isRequired: false, + isUndocumented: false, + jsonType: 'string', + name: 'name', + }, + { + deprecationMessage: '', + description: '', + format: 'string', + isDeprecated: false, + isRequired: false, + isUndocumented: false, + jsonType: 'string', + name: 'starts_at', + }, + { + deprecationMessage: '', + description: '', + format: 'id', + isDeprecated: false, + isRequired: true, + isUndocumented: false, + jsonType: 'string', + name: 'thermostat_schedule_id', + }, + ], + preferredMethod: 'POST', + semanticMethod: 'POST', + }, + response: { + description: 'OK', + responseType: 'void', + }, + title: '', + }, + ], + isDeprecated: false, + isUndocumented: false, + name: 'schedules', + namespace: null, + path: '/thermostats/schedules', + subroutes: [], + }, ], title: 'Seam Connect', } diff --git a/test/snapshots/seam-blueprint.test.ts.snap b/test/snapshots/seam-blueprint.test.ts.snap index 9c397fa..51f81c2 100644 Binary files a/test/snapshots/seam-blueprint.test.ts.snap and b/test/snapshots/seam-blueprint.test.ts.snap differ