mirror of
https://github.com/appwrite/appwrite
synced 2026-05-24 09:28:40 +00:00
Merge pull request #10553 from appwrite/update-platform-type
fix: enum typing for platform in specs
This commit is contained in:
commit
cf92c259ed
6 changed files with 72 additions and 19 deletions
|
|
@ -25153,7 +25153,7 @@
|
||||||
"properties": {
|
"properties": {
|
||||||
"type": {
|
"type": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"description": "Platform type.",
|
"description": "Platform type. Possible values are: web, flutter-web, flutter-ios, flutter-android, flutter-linux, flutter-macos, flutter-windows, apple-ios, apple-macos, apple-watchos, apple-tvos, android, unity, react-native-ios, react-native-android.",
|
||||||
"x-example": "web",
|
"x-example": "web",
|
||||||
"enum": [
|
"enum": [
|
||||||
"web",
|
"web",
|
||||||
|
|
@ -53440,16 +53440,24 @@
|
||||||
},
|
},
|
||||||
"type": {
|
"type": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"description": "Platform type. Possible values are: web, flutter-web, flutter-ios, flutter-android, ios, android, and unity.",
|
"description": "Platform type. Possible values are: web, flutter-web, flutter-ios, flutter-android, flutter-linux, flutter-macos, flutter-windows, apple-ios, apple-macos, apple-watchos, apple-tvos, android, unity, react-native-ios, react-native-android.",
|
||||||
"x-example": "web",
|
"x-example": "web",
|
||||||
"enum": [
|
"enum": [
|
||||||
"web",
|
"web",
|
||||||
"flutter-web",
|
"flutter-web",
|
||||||
"flutter-ios",
|
"flutter-ios",
|
||||||
"flutter-android",
|
"flutter-android",
|
||||||
"ios",
|
"flutter-linux",
|
||||||
|
"flutter-macos",
|
||||||
|
"flutter-windows",
|
||||||
|
"apple-ios",
|
||||||
|
"apple-macos",
|
||||||
|
"apple-watchos",
|
||||||
|
"apple-tvos",
|
||||||
"android",
|
"android",
|
||||||
"unity"
|
"unity",
|
||||||
|
"react-native-ios",
|
||||||
|
"react-native-android"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"key": {
|
"key": {
|
||||||
|
|
|
||||||
|
|
@ -25153,7 +25153,7 @@
|
||||||
"properties": {
|
"properties": {
|
||||||
"type": {
|
"type": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"description": "Platform type.",
|
"description": "Platform type. Possible values are: web, flutter-web, flutter-ios, flutter-android, flutter-linux, flutter-macos, flutter-windows, apple-ios, apple-macos, apple-watchos, apple-tvos, android, unity, react-native-ios, react-native-android.",
|
||||||
"x-example": "web",
|
"x-example": "web",
|
||||||
"enum": [
|
"enum": [
|
||||||
"web",
|
"web",
|
||||||
|
|
@ -53440,16 +53440,24 @@
|
||||||
},
|
},
|
||||||
"type": {
|
"type": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"description": "Platform type. Possible values are: web, flutter-web, flutter-ios, flutter-android, ios, android, and unity.",
|
"description": "Platform type. Possible values are: web, flutter-web, flutter-ios, flutter-android, flutter-linux, flutter-macos, flutter-windows, apple-ios, apple-macos, apple-watchos, apple-tvos, android, unity, react-native-ios, react-native-android.",
|
||||||
"x-example": "web",
|
"x-example": "web",
|
||||||
"enum": [
|
"enum": [
|
||||||
"web",
|
"web",
|
||||||
"flutter-web",
|
"flutter-web",
|
||||||
"flutter-ios",
|
"flutter-ios",
|
||||||
"flutter-android",
|
"flutter-android",
|
||||||
"ios",
|
"flutter-linux",
|
||||||
|
"flutter-macos",
|
||||||
|
"flutter-windows",
|
||||||
|
"apple-ios",
|
||||||
|
"apple-macos",
|
||||||
|
"apple-watchos",
|
||||||
|
"apple-tvos",
|
||||||
"android",
|
"android",
|
||||||
"unity"
|
"unity",
|
||||||
|
"react-native-ios",
|
||||||
|
"react-native-android"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"key": {
|
"key": {
|
||||||
|
|
|
||||||
|
|
@ -25305,7 +25305,7 @@
|
||||||
"properties": {
|
"properties": {
|
||||||
"type": {
|
"type": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"description": "Platform type.",
|
"description": "Platform type. Possible values are: web, flutter-web, flutter-ios, flutter-android, flutter-linux, flutter-macos, flutter-windows, apple-ios, apple-macos, apple-watchos, apple-tvos, android, unity, react-native-ios, react-native-android.",
|
||||||
"default": null,
|
"default": null,
|
||||||
"x-example": "web",
|
"x-example": "web",
|
||||||
"enum": [
|
"enum": [
|
||||||
|
|
@ -53396,16 +53396,24 @@
|
||||||
},
|
},
|
||||||
"type": {
|
"type": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"description": "Platform type. Possible values are: web, flutter-web, flutter-ios, flutter-android, ios, android, and unity.",
|
"description": "Platform type. Possible values are: web, flutter-web, flutter-ios, flutter-android, flutter-linux, flutter-macos, flutter-windows, apple-ios, apple-macos, apple-watchos, apple-tvos, android, unity, react-native-ios, react-native-android.",
|
||||||
"x-example": "web",
|
"x-example": "web",
|
||||||
"enum": [
|
"enum": [
|
||||||
"web",
|
"web",
|
||||||
"flutter-web",
|
"flutter-web",
|
||||||
"flutter-ios",
|
"flutter-ios",
|
||||||
"flutter-android",
|
"flutter-android",
|
||||||
"ios",
|
"flutter-linux",
|
||||||
|
"flutter-macos",
|
||||||
|
"flutter-windows",
|
||||||
|
"apple-ios",
|
||||||
|
"apple-macos",
|
||||||
|
"apple-watchos",
|
||||||
|
"apple-tvos",
|
||||||
"android",
|
"android",
|
||||||
"unity"
|
"unity",
|
||||||
|
"react-native-ios",
|
||||||
|
"react-native-android"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"key": {
|
"key": {
|
||||||
|
|
|
||||||
|
|
@ -25305,7 +25305,7 @@
|
||||||
"properties": {
|
"properties": {
|
||||||
"type": {
|
"type": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"description": "Platform type.",
|
"description": "Platform type. Possible values are: web, flutter-web, flutter-ios, flutter-android, flutter-linux, flutter-macos, flutter-windows, apple-ios, apple-macos, apple-watchos, apple-tvos, android, unity, react-native-ios, react-native-android.",
|
||||||
"default": null,
|
"default": null,
|
||||||
"x-example": "web",
|
"x-example": "web",
|
||||||
"enum": [
|
"enum": [
|
||||||
|
|
@ -53396,16 +53396,24 @@
|
||||||
},
|
},
|
||||||
"type": {
|
"type": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"description": "Platform type. Possible values are: web, flutter-web, flutter-ios, flutter-android, ios, android, and unity.",
|
"description": "Platform type. Possible values are: web, flutter-web, flutter-ios, flutter-android, flutter-linux, flutter-macos, flutter-windows, apple-ios, apple-macos, apple-watchos, apple-tvos, android, unity, react-native-ios, react-native-android.",
|
||||||
"x-example": "web",
|
"x-example": "web",
|
||||||
"enum": [
|
"enum": [
|
||||||
"web",
|
"web",
|
||||||
"flutter-web",
|
"flutter-web",
|
||||||
"flutter-ios",
|
"flutter-ios",
|
||||||
"flutter-android",
|
"flutter-android",
|
||||||
"ios",
|
"flutter-linux",
|
||||||
|
"flutter-macos",
|
||||||
|
"flutter-windows",
|
||||||
|
"apple-ios",
|
||||||
|
"apple-macos",
|
||||||
|
"apple-watchos",
|
||||||
|
"apple-tvos",
|
||||||
"android",
|
"android",
|
||||||
"unity"
|
"unity",
|
||||||
|
"react-native-ios",
|
||||||
|
"react-native-android"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"key": {
|
"key": {
|
||||||
|
|
|
||||||
|
|
@ -1756,7 +1756,28 @@ App::post('/v1/projects/:projectId/platforms')
|
||||||
]
|
]
|
||||||
))
|
))
|
||||||
->param('projectId', '', new UID(), 'Project unique ID.')
|
->param('projectId', '', new UID(), 'Project unique ID.')
|
||||||
->param('type', null, new WhiteList([Platform::TYPE_WEB, Platform::TYPE_FLUTTER_WEB, Platform::TYPE_FLUTTER_IOS, Platform::TYPE_FLUTTER_ANDROID, Platform::TYPE_FLUTTER_LINUX, Platform::TYPE_FLUTTER_MACOS, Platform::TYPE_FLUTTER_WINDOWS, Platform::TYPE_APPLE_IOS, Platform::TYPE_APPLE_MACOS, Platform::TYPE_APPLE_WATCHOS, Platform::TYPE_APPLE_TVOS, Platform::TYPE_ANDROID, Platform::TYPE_UNITY, Platform::TYPE_REACT_NATIVE_IOS, Platform::TYPE_REACT_NATIVE_ANDROID], true), 'Platform type.')
|
->param(
|
||||||
|
'type',
|
||||||
|
null,
|
||||||
|
new WhiteList([
|
||||||
|
Platform::TYPE_WEB,
|
||||||
|
Platform::TYPE_FLUTTER_WEB,
|
||||||
|
Platform::TYPE_FLUTTER_IOS,
|
||||||
|
Platform::TYPE_FLUTTER_ANDROID,
|
||||||
|
Platform::TYPE_FLUTTER_LINUX,
|
||||||
|
Platform::TYPE_FLUTTER_MACOS,
|
||||||
|
Platform::TYPE_FLUTTER_WINDOWS,
|
||||||
|
Platform::TYPE_APPLE_IOS,
|
||||||
|
Platform::TYPE_APPLE_MACOS,
|
||||||
|
Platform::TYPE_APPLE_WATCHOS,
|
||||||
|
Platform::TYPE_APPLE_TVOS,
|
||||||
|
Platform::TYPE_ANDROID,
|
||||||
|
Platform::TYPE_UNITY,
|
||||||
|
Platform::TYPE_REACT_NATIVE_IOS,
|
||||||
|
Platform::TYPE_REACT_NATIVE_ANDROID,
|
||||||
|
], true),
|
||||||
|
'Platform type. Possible values are: web, flutter-web, flutter-ios, flutter-android, flutter-linux, flutter-macos, flutter-windows, apple-ios, apple-macos, apple-watchos, apple-tvos, android, unity, react-native-ios, react-native-android.'
|
||||||
|
)
|
||||||
->param('name', null, new Text(128), 'Platform name. Max length: 128 chars.')
|
->param('name', null, new Text(128), 'Platform name. Max length: 128 chars.')
|
||||||
->param('key', '', new Text(256), 'Package name for Android or bundle ID for iOS or macOS. Max length: 256 chars.', true)
|
->param('key', '', new Text(256), 'Package name for Android or bundle ID for iOS or macOS. Max length: 256 chars.', true)
|
||||||
->param('store', '', new Text(256), 'App store or Google Play store ID. Max length: 256 chars.', true)
|
->param('store', '', new Text(256), 'App store or Google Play store ID. Max length: 256 chars.', true)
|
||||||
|
|
|
||||||
|
|
@ -41,10 +41,10 @@ class Platform extends Model
|
||||||
])
|
])
|
||||||
->addRule('type', [
|
->addRule('type', [
|
||||||
'type' => self::TYPE_ENUM,
|
'type' => self::TYPE_ENUM,
|
||||||
'description' => 'Platform type. Possible values are: web, flutter-web, flutter-ios, flutter-android, ios, android, and unity.',
|
'description' => 'Platform type. Possible values are: web, flutter-web, flutter-ios, flutter-android, flutter-linux, flutter-macos, flutter-windows, apple-ios, apple-macos, apple-watchos, apple-tvos, android, unity, react-native-ios, react-native-android.',
|
||||||
'default' => '',
|
'default' => '',
|
||||||
'example' => 'web',
|
'example' => 'web',
|
||||||
'enum' => ['web', 'flutter-web', 'flutter-ios', 'flutter-android', 'ios', 'android', 'unity'],
|
'enum' => ['web', 'flutter-web', 'flutter-ios', 'flutter-android', 'flutter-linux', 'flutter-macos', 'flutter-windows', 'apple-ios', 'apple-macos', 'apple-watchos', 'apple-tvos', 'android', 'unity', 'react-native-ios', 'react-native-android'],
|
||||||
])
|
])
|
||||||
->addRule('key', [
|
->addRule('key', [
|
||||||
'type' => self::TYPE_STRING,
|
'type' => self::TYPE_STRING,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue