Skip to content

Commit 0727718

Browse files
Update api spec (#222)
* YOYO NEW API SPEC! * I have generated the latest API! --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 5858b55 commit 0727718

File tree

5 files changed

+230
-0
lines changed

5 files changed

+230
-0
lines changed

examples_test.go

Lines changed: 17 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

kittycad.go.patch.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,14 @@
9595
"op": "add",
9696
"path": "/paths/~1async~1operations~1{id}/get/x-go"
9797
},
98+
{
99+
"value": {
100+
"example": "// AuthAPIKey: Authenticate using an api-key. This is disabled on production but can be used in dev to login without email magic.\n// \n// This returns a session token.\n// \n// AuthAPIKey: Authenticate using an api-key. This is disabled on production but can be used in dev to login without email magic.\n// This returns a session token.\nfunc ExampleHiddenService_AuthAPIKey() {\n\tclient, err := kittycad.NewClientFromEnv(\"your apps user agent\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tresult, err := client.Hidden.AuthAPIKey()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Printf(\"%#v\", result)\n\n}\n",
101+
"libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#HiddenService.AuthAPIKey"
102+
},
103+
"op": "add",
104+
"path": "/paths/~1auth~1api-key/post/x-go"
105+
},
98106
{
99107
"value": {
100108
"example": "// AuthEmail: Create an email verification request for a user.\n// \n// \n// Parameters\n// \n// \t- `body`: The body of the form for email authentication.\n// \n// AuthEmail: Create an email verification request for a user.\n// Parameters\n//\n// - `body`: The body of the form for email authentication.\nfunc ExampleHiddenService_AuthEmail() {\n\tclient, err := kittycad.NewClientFromEnv(\"your apps user agent\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tresult, err := client.Hidden.AuthEmail(kittycad.EmailAuthenticationForm{CallbackUrl: kittycad.URL{\u0026url.URL{Scheme: \"https\", Host: \"example.com\"}}, Email: \"[email protected]\"})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Printf(\"%#v\", result)\n\n}\n",

paths.go

Lines changed: 39 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

spec.json

Lines changed: 160 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1167,6 +1167,153 @@
11671167
}
11681168
}
11691169
},
1170+
"/auth/api-key": {
1171+
"post": {
1172+
"tags": [
1173+
"hidden"
1174+
],
1175+
"summary": "Authenticate using an api-key. This is disabled on production but can be used in dev to login without email magic.",
1176+
"description": "This returns a session token.",
1177+
"operationId": "auth_api_key",
1178+
"responses": {
1179+
"200": {
1180+
"description": "successful operation",
1181+
"headers": {
1182+
"Access-Control-Allow-Credentials": {
1183+
"description": "Access-Control-Allow-Credentials header.",
1184+
"style": "simple",
1185+
"schema": {
1186+
"nullable": true,
1187+
"type": "string"
1188+
}
1189+
},
1190+
"Access-Control-Allow-Headers": {
1191+
"description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.",
1192+
"style": "simple",
1193+
"schema": {
1194+
"nullable": true,
1195+
"type": "string"
1196+
}
1197+
},
1198+
"Access-Control-Allow-Methods": {
1199+
"description": "Access-Control-Allow-Methods header.",
1200+
"style": "simple",
1201+
"schema": {
1202+
"nullable": true,
1203+
"type": "string"
1204+
}
1205+
},
1206+
"Access-Control-Allow-Origin": {
1207+
"description": "Access-Control-Allow-Origin header.",
1208+
"style": "simple",
1209+
"schema": {
1210+
"nullable": true,
1211+
"type": "string"
1212+
}
1213+
},
1214+
"Set-Cookie": {
1215+
"description": "Set-Cookie header.",
1216+
"style": "simple",
1217+
"schema": {
1218+
"nullable": true,
1219+
"type": "string"
1220+
}
1221+
},
1222+
"X-Api-Call-Id": {
1223+
"description": "ID for this request. We return it so that users can report this to us and help us debug their problems.",
1224+
"style": "simple",
1225+
"required": true,
1226+
"schema": {
1227+
"type": "string"
1228+
}
1229+
}
1230+
},
1231+
"content": {
1232+
"application/json": {
1233+
"schema": {
1234+
"$ref": "#/components/schemas/AuthApiKeyResponse"
1235+
}
1236+
}
1237+
}
1238+
},
1239+
"4XX": {
1240+
"$ref": "#/components/responses/Error"
1241+
},
1242+
"5XX": {
1243+
"$ref": "#/components/responses/Error"
1244+
}
1245+
}
1246+
},
1247+
"options": {
1248+
"tags": [
1249+
"hidden"
1250+
],
1251+
"summary": "OPTIONS endpoint.",
1252+
"description": "This is necessary for some preflight requests, specifically POST, PUT, and DELETE.",
1253+
"operationId": "options_auth_api_key",
1254+
"responses": {
1255+
"204": {
1256+
"description": "resource updated",
1257+
"headers": {
1258+
"Access-Control-Allow-Credentials": {
1259+
"description": "Access-Control-Allow-Credentials header.",
1260+
"style": "simple",
1261+
"schema": {
1262+
"nullable": true,
1263+
"type": "string"
1264+
}
1265+
},
1266+
"Access-Control-Allow-Headers": {
1267+
"description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.",
1268+
"style": "simple",
1269+
"schema": {
1270+
"nullable": true,
1271+
"type": "string"
1272+
}
1273+
},
1274+
"Access-Control-Allow-Methods": {
1275+
"description": "Access-Control-Allow-Methods header.",
1276+
"style": "simple",
1277+
"schema": {
1278+
"nullable": true,
1279+
"type": "string"
1280+
}
1281+
},
1282+
"Access-Control-Allow-Origin": {
1283+
"description": "Access-Control-Allow-Origin header.",
1284+
"style": "simple",
1285+
"schema": {
1286+
"nullable": true,
1287+
"type": "string"
1288+
}
1289+
},
1290+
"Set-Cookie": {
1291+
"description": "Set-Cookie header.",
1292+
"style": "simple",
1293+
"schema": {
1294+
"nullable": true,
1295+
"type": "string"
1296+
}
1297+
},
1298+
"X-Api-Call-Id": {
1299+
"description": "ID for this request. We return it so that users can report this to us and help us debug their problems.",
1300+
"style": "simple",
1301+
"required": true,
1302+
"schema": {
1303+
"type": "string"
1304+
}
1305+
}
1306+
}
1307+
},
1308+
"4XX": {
1309+
"$ref": "#/components/responses/Error"
1310+
},
1311+
"5XX": {
1312+
"$ref": "#/components/responses/Error"
1313+
}
1314+
}
1315+
}
1316+
},
11701317
"/auth/email": {
11711318
"post": {
11721319
"tags": [
@@ -19367,6 +19514,19 @@
1936719514
}
1936819515
]
1936919516
},
19517+
"AuthApiKeyResponse": {
19518+
"description": "The response from the `/auth/api-key` endpoint.",
19519+
"type": "object",
19520+
"properties": {
19521+
"session_token": {
19522+
"description": "The session token",
19523+
"type": "string"
19524+
}
19525+
},
19526+
"required": [
19527+
"session_token"
19528+
]
19529+
},
1937019530
"AuthCallback": {
1937119531
"description": "The authentication callback from the OAuth 2.0 client. This is typically posted to the redirect URL as query params after authenticating.",
1937219532
"type": "object",

types.go

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)