diff --git a/Dockerfile b/Dockerfile index a8330cf..a3a5bc5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ # Dockerfile to run e2e integration tests against a test PocketBase server FROM node:16-alpine3.16 -ARG POCKETBASE_VERSION=0.13.0 +ARG POCKETBASE_VERSION=0.15.0 WORKDIR /app/output/ WORKDIR /app/ diff --git a/test/integration/pb_data/data.db b/test/integration/pb_data/data.db index e0c8494..f1ea6a4 100644 Binary files a/test/integration/pb_data/data.db and b/test/integration/pb_data/data.db differ diff --git a/test/integration/run.sh b/test/integration/run.sh index 222438a..9e3fc81 100644 --- a/test/integration/run.sh +++ b/test/integration/run.sh @@ -11,4 +11,11 @@ node ./dist/index.js --url http://0.0.0.0:8090 --email test@test.com --password node ./dist/index.js --db pb_data/data.db --out output/pocketbase-types-db.ts node integration.js -echo "Integration tests pass" \ No newline at end of file +exit_status=$? + +if [ $exit_status -eq 0 ]; then + echo "Integration tests pass" +else + echo "FAIL integration tests" + exit $exit_status +fi diff --git a/test/pb_schema.json b/test/pb_schema.json index a7c3a8b..4246a95 100644 --- a/test/pb_schema.json +++ b/test/pb_schema.json @@ -1,4 +1,55 @@ [ + { + "id": "ngpunwfmpl9x50r", + "name": "my_view", + "type": "view", + "system": false, + "schema": [ + { + "id": "iwh5jvyg", + "name": "post_relation_field", + "type": "relation", + "system": false, + "required": false, + "options": { + "collectionId": "z6b9mssubo9megi", + "cascadeDelete": false, + "minSelect": null, + "maxSelect": 1, + "displayFields": null + } + }, + { + "id": "ze7zu2ji", + "name": "text_field", + "type": "text", + "system": false, + "required": false, + "options": { + "min": null, + "max": null, + "pattern": "" + } + }, + { + "id": "pbwoyo77", + "name": "json_field", + "type": "json", + "system": false, + "required": false, + "options": {} + } + ], + "indexes": [], + "listRule": "", + "viewRule": "", + "createRule": null, + "updateRule": null, + "deleteRule": null, + "options": { + "query": "select id, post_relation_field, text_field, json_field from everything" + } + }, { "id": "_pb_users_auth_", "name": "users", @@ -11,7 +62,6 @@ "type": "text", "system": false, "required": false, - "unique": false, "options": { "min": null, "max": null, @@ -24,7 +74,6 @@ "type": "file", "system": false, "required": false, - "unique": false, "options": { "maxSelect": 1, "maxSize": 5242880, @@ -35,10 +84,14 @@ "image/svg+xml", "image/gif" ], - "thumbs": null + "thumbs": null, + "protected": false } } ], + "indexes": [ + "CREATE INDEX `__pb_users_auth__created_idx` ON `users` (`created`)" + ], "listRule": "id = @request.auth.id", "viewRule": "id = @request.auth.id", "createRule": "", @@ -67,7 +120,6 @@ "type": "text", "system": false, "required": false, - "unique": false, "options": { "min": null, "max": null, @@ -80,7 +132,6 @@ "type": "number", "system": false, "required": false, - "unique": false, "options": { "min": null, "max": null @@ -92,7 +143,6 @@ "type": "bool", "system": false, "required": false, - "unique": false, "options": {} }, { @@ -101,7 +151,6 @@ "type": "email", "system": false, "required": false, - "unique": false, "options": { "exceptDomains": [], "onlyDomains": [] @@ -113,7 +162,6 @@ "type": "url", "system": false, "required": false, - "unique": false, "options": { "exceptDomains": null, "onlyDomains": null @@ -125,7 +173,6 @@ "type": "date", "system": false, "required": false, - "unique": false, "options": { "min": "", "max": "" @@ -137,7 +184,6 @@ "type": "select", "system": false, "required": false, - "unique": false, "options": { "maxSelect": 1, "values": [ @@ -157,7 +203,6 @@ "type": "json", "system": false, "required": false, - "unique": false, "options": {} }, { @@ -166,7 +211,6 @@ "type": "json", "system": false, "required": false, - "unique": false, "options": {} }, { @@ -175,12 +219,12 @@ "type": "file", "system": false, "required": false, - "unique": false, "options": { "maxSelect": 1, "maxSize": 5242880, "mimeTypes": [], - "thumbs": [] + "thumbs": [], + "protected": false } }, { @@ -189,12 +233,12 @@ "type": "file", "system": false, "required": false, - "unique": false, "options": { "maxSelect": 3, "maxSize": 5242880, "mimeTypes": [], - "thumbs": [] + "thumbs": [], + "protected": false } }, { @@ -203,7 +247,6 @@ "type": "relation", "system": false, "required": false, - "unique": false, "options": { "collectionId": "_pb_users_auth_", "cascadeDelete": false, @@ -218,7 +261,6 @@ "type": "relation", "system": false, "required": false, - "unique": false, "options": { "collectionId": "rs7hepu8zl6kr8e", "cascadeDelete": false, @@ -233,7 +275,6 @@ "type": "relation", "system": false, "required": false, - "unique": false, "options": { "collectionId": "z6b9mssubo9megi", "cascadeDelete": false, @@ -248,7 +289,6 @@ "type": "text", "system": false, "required": false, - "unique": false, "options": { "min": null, "max": null, @@ -261,10 +301,12 @@ "type": "editor", "system": false, "required": false, - "unique": false, "options": {} } ], + "indexes": [ + "CREATE INDEX `_8uexthr74u6jat4_created_idx` ON `everything` (`created`)" + ], "listRule": "", "viewRule": "", "createRule": "", @@ -284,7 +326,6 @@ "type": "text", "system": false, "required": false, - "unique": false, "options": { "min": null, "max": null, @@ -297,7 +338,6 @@ "type": "text", "system": false, "required": true, - "unique": false, "options": { "min": null, "max": null, @@ -310,7 +350,6 @@ "type": "bool", "system": false, "required": true, - "unique": false, "options": {} }, { @@ -319,13 +358,15 @@ "type": "number", "system": false, "required": false, - "unique": false, "options": { "min": null, "max": null } } ], + "indexes": [ + "CREATE INDEX `_z6b9mssubo9megi_created_idx` ON `posts` (`created`)" + ], "listRule": "", "viewRule": "", "createRule": "", @@ -345,7 +386,6 @@ "type": "text", "system": false, "required": false, - "unique": false, "options": { "min": null, "max": null, @@ -353,6 +393,9 @@ } } ], + "indexes": [ + "CREATE INDEX `_rs7hepu8zl6kr8e_created_idx` ON `custom_auth` (`created`)" + ], "listRule": null, "viewRule": null, "createRule": null, @@ -381,7 +424,6 @@ "type": "text", "system": false, "required": false, - "unique": false, "options": { "min": null, "max": null, @@ -389,64 +431,14 @@ } } ], + "indexes": [ + "CREATE INDEX `_kr8109mcfuu18qq_created_idx` ON `base` (`created`)" + ], "listRule": null, "viewRule": null, "createRule": null, "updateRule": null, "deleteRule": null, "options": {} - }, - { - "id": "ngpunwfmpl9x50r", - "name": "my_view", - "type": "view", - "system": false, - "schema": [ - { - "id": "iwh5jvyg", - "name": "post_relation_field", - "type": "relation", - "system": false, - "required": false, - "unique": false, - "options": { - "collectionId": "z6b9mssubo9megi", - "cascadeDelete": false, - "minSelect": null, - "maxSelect": 1, - "displayFields": null - } - }, - { - "id": "ze7zu2ji", - "name": "text_field", - "type": "text", - "system": false, - "required": false, - "unique": false, - "options": { - "min": null, - "max": null, - "pattern": "" - } - }, - { - "id": "pbwoyo77", - "name": "json_field", - "type": "json", - "system": false, - "required": false, - "unique": false, - "options": {} - } - ], - "listRule": "", - "viewRule": "", - "createRule": null, - "updateRule": null, - "deleteRule": null, - "options": { - "query": "select id, post_relation_field, text_field, json_field from everything" - } } ]