mirror of
https://github.com/anyproto/anytype-heart.git
synced 2025-06-08 05:47:07 +09:00
Merge pull request #2435 from anyproto/go-5589-rest-api-stage-3-fixes
GO-5589 API Key Fixes
This commit is contained in:
commit
e5d70d412b
8 changed files with 863 additions and 47 deletions
File diff suppressed because one or more lines are too long
|
@ -158,7 +158,7 @@
|
|||
"$ref": "#/components/schemas/apimodel.PropertyFormat"
|
||||
},
|
||||
"key": {
|
||||
"description": "The key of the property",
|
||||
"description": "The key of the property; should always be snake_case, otherwise it will be converted to snake_case",
|
||||
"example": "some_user_defined_property_key",
|
||||
"type": "string"
|
||||
},
|
||||
|
@ -215,7 +215,7 @@
|
|||
"$ref": "#/components/schemas/apimodel.Icon"
|
||||
},
|
||||
"key": {
|
||||
"description": "The key of the type",
|
||||
"description": "The key of the type; should always be snake_case, otherwise it will be converted to snake_case",
|
||||
"example": "some_user_defined_type_key",
|
||||
"type": "string"
|
||||
},
|
||||
|
@ -503,6 +503,403 @@
|
|||
"IconFormatIcon"
|
||||
]
|
||||
},
|
||||
"apimodel.IconName": {
|
||||
"description": "The name of the icon",
|
||||
"example": "document",
|
||||
"type": "string",
|
||||
"x-enum-varnames": [
|
||||
"IconNameAccessibility",
|
||||
"IconNameAddCircle",
|
||||
"IconNameAirplane",
|
||||
"IconNameAlarm",
|
||||
"IconNameAlbums",
|
||||
"IconNameAlertCircle",
|
||||
"IconNameAmericanFootball",
|
||||
"IconNameAnalytics",
|
||||
"IconNameAperture",
|
||||
"IconNameApps",
|
||||
"IconNameArchive",
|
||||
"IconNameArrowBackCircle",
|
||||
"IconNameArrowDownCircle",
|
||||
"IconNameArrowForwardCircle",
|
||||
"IconNameArrowRedoCircle",
|
||||
"IconNameArrowRedo",
|
||||
"IconNameArrowUndoCircle",
|
||||
"IconNameArrowUndo",
|
||||
"IconNameArrowUpCircle",
|
||||
"IconNameAtCircle",
|
||||
"IconNameAttach",
|
||||
"IconNameBackspace",
|
||||
"IconNameBagAdd",
|
||||
"IconNameBagCheck",
|
||||
"IconNameBagHandle",
|
||||
"IconNameBagRemove",
|
||||
"IconNameBag",
|
||||
"IconNameBalloon",
|
||||
"IconNameBan",
|
||||
"IconNameBandage",
|
||||
"IconNameBarChart",
|
||||
"IconNameBarbell",
|
||||
"IconNameBarcode",
|
||||
"IconNameBaseball",
|
||||
"IconNameBasket",
|
||||
"IconNameBasketball",
|
||||
"IconNameBatteryCharging",
|
||||
"IconNameBatteryDead",
|
||||
"IconNameBatteryFull",
|
||||
"IconNameBatteryHalf",
|
||||
"IconNameBeaker",
|
||||
"IconNameBed",
|
||||
"IconNameBeer",
|
||||
"IconNameBicycle",
|
||||
"IconNameBinoculars",
|
||||
"IconNameBluetooth",
|
||||
"IconNameBoat",
|
||||
"IconNameBody",
|
||||
"IconNameBonfire",
|
||||
"IconNameBook",
|
||||
"IconNameBookmark",
|
||||
"IconNameBookmarks",
|
||||
"IconNameBowlingBall",
|
||||
"IconNameBriefcase",
|
||||
"IconNameBrowsers",
|
||||
"IconNameBrush",
|
||||
"IconNameBug",
|
||||
"IconNameBuild",
|
||||
"IconNameBulb",
|
||||
"IconNameBus",
|
||||
"IconNameBusiness",
|
||||
"IconNameCafe",
|
||||
"IconNameCalculator",
|
||||
"IconNameCalendarClear",
|
||||
"IconNameCalendarNumber",
|
||||
"IconNameCalendar",
|
||||
"IconNameCall",
|
||||
"IconNameCameraReverse",
|
||||
"IconNameCamera",
|
||||
"IconNameCarSport",
|
||||
"IconNameCar",
|
||||
"IconNameCard",
|
||||
"IconNameCaretBackCircle",
|
||||
"IconNameCaretBack",
|
||||
"IconNameCaretDownCircle",
|
||||
"IconNameCaretDown",
|
||||
"IconNameCaretForwardCircle",
|
||||
"IconNameCaretForward",
|
||||
"IconNameCaretUpCircle",
|
||||
"IconNameCaretUp",
|
||||
"IconNameCart",
|
||||
"IconNameCash",
|
||||
"IconNameCellular",
|
||||
"IconNameChatboxEllipses",
|
||||
"IconNameChatbox",
|
||||
"IconNameChatbubbleEllipses",
|
||||
"IconNameChatbubble",
|
||||
"IconNameChatbubbles",
|
||||
"IconNameCheckbox",
|
||||
"IconNameCheckmarkCircle",
|
||||
"IconNameCheckmarkDoneCircle",
|
||||
"IconNameChevronBackCircle",
|
||||
"IconNameChevronDownCircle",
|
||||
"IconNameChevronForwardCircle",
|
||||
"IconNameChevronUpCircle",
|
||||
"IconNameClipboard",
|
||||
"IconNameCloseCircle",
|
||||
"IconNameCloudCircle",
|
||||
"IconNameCloudDone",
|
||||
"IconNameCloudDownload",
|
||||
"IconNameCloudOffline",
|
||||
"IconNameCloudUpload",
|
||||
"IconNameCloud",
|
||||
"IconNameCloudyNight",
|
||||
"IconNameCloudy",
|
||||
"IconNameCodeSlash",
|
||||
"IconNameCode",
|
||||
"IconNameCog",
|
||||
"IconNameColorFill",
|
||||
"IconNameColorFilter",
|
||||
"IconNameColorPalette",
|
||||
"IconNameColorWand",
|
||||
"IconNameCompass",
|
||||
"IconNameConstruct",
|
||||
"IconNameContact",
|
||||
"IconNameContract",
|
||||
"IconNameContrast",
|
||||
"IconNameCopy",
|
||||
"IconNameCreate",
|
||||
"IconNameCrop",
|
||||
"IconNameCube",
|
||||
"IconNameCut",
|
||||
"IconNameDesktop",
|
||||
"IconNameDiamond",
|
||||
"IconNameDice",
|
||||
"IconNameDisc",
|
||||
"IconNameDocumentAttach",
|
||||
"IconNameDocumentLock",
|
||||
"IconNameDocumentText",
|
||||
"IconNameDocument",
|
||||
"IconNameDocuments",
|
||||
"IconNameDownload",
|
||||
"IconNameDuplicate",
|
||||
"IconNameEar",
|
||||
"IconNameEarth",
|
||||
"IconNameEasel",
|
||||
"IconNameEgg",
|
||||
"IconNameEllipse",
|
||||
"IconNameEllipsisHorizontalCircle",
|
||||
"IconNameEllipsisVerticalCircle",
|
||||
"IconNameEnter",
|
||||
"IconNameExit",
|
||||
"IconNameExpand",
|
||||
"IconNameExtensionPuzzle",
|
||||
"IconNameEyeOff",
|
||||
"IconNameEye",
|
||||
"IconNameEyedrop",
|
||||
"IconNameFastFood",
|
||||
"IconNameFemale",
|
||||
"IconNameFileTrayFull",
|
||||
"IconNameFileTrayStacked",
|
||||
"IconNameFileTray",
|
||||
"IconNameFilm",
|
||||
"IconNameFilterCircle",
|
||||
"IconNameFingerPrint",
|
||||
"IconNameFish",
|
||||
"IconNameFitness",
|
||||
"IconNameFlag",
|
||||
"IconNameFlame",
|
||||
"IconNameFlashOff",
|
||||
"IconNameFlash",
|
||||
"IconNameFlashlight",
|
||||
"IconNameFlask",
|
||||
"IconNameFlower",
|
||||
"IconNameFolderOpen",
|
||||
"IconNameFolder",
|
||||
"IconNameFootball",
|
||||
"IconNameFootsteps",
|
||||
"IconNameFunnel",
|
||||
"IconNameGameController",
|
||||
"IconNameGift",
|
||||
"IconNameGitBranch",
|
||||
"IconNameGitCommit",
|
||||
"IconNameGitCompare",
|
||||
"IconNameGitMerge",
|
||||
"IconNameGitNetwork",
|
||||
"IconNameGitPullRequest",
|
||||
"IconNameGlasses",
|
||||
"IconNameGlobe",
|
||||
"IconNameGolf",
|
||||
"IconNameGrid",
|
||||
"IconNameHammer",
|
||||
"IconNameHandLeft",
|
||||
"IconNameHandRight",
|
||||
"IconNameHappy",
|
||||
"IconNameHardwareChip",
|
||||
"IconNameHeadset",
|
||||
"IconNameHeartCircle",
|
||||
"IconNameHeartDislikeCircle",
|
||||
"IconNameHeartDislike",
|
||||
"IconNameHeartHalf",
|
||||
"IconNameHeart",
|
||||
"IconNameHelpBuoy",
|
||||
"IconNameHelpCircle",
|
||||
"IconNameHome",
|
||||
"IconNameHourglass",
|
||||
"IconNameIceCream",
|
||||
"IconNameIdCard",
|
||||
"IconNameImage",
|
||||
"IconNameImages",
|
||||
"IconNameInfinite",
|
||||
"IconNameInformationCircle",
|
||||
"IconNameInvertMode",
|
||||
"IconNameJournal",
|
||||
"IconNameKey",
|
||||
"IconNameKeypad",
|
||||
"IconNameLanguage",
|
||||
"IconNameLaptop",
|
||||
"IconNameLayers",
|
||||
"IconNameLeaf",
|
||||
"IconNameLibrary",
|
||||
"IconNameLink",
|
||||
"IconNameListCircle",
|
||||
"IconNameList",
|
||||
"IconNameLocate",
|
||||
"IconNameLocation",
|
||||
"IconNameLockClosed",
|
||||
"IconNameLockOpen",
|
||||
"IconNameLogIn",
|
||||
"IconNameLogOut",
|
||||
"IconNameLogoAlipay",
|
||||
"IconNameLogoAmazon",
|
||||
"IconNameLogoAmplify",
|
||||
"IconNameLogoAndroid",
|
||||
"IconNameMagnet",
|
||||
"IconNameMailOpen",
|
||||
"IconNameMailUnread",
|
||||
"IconNameMail",
|
||||
"IconNameMaleFemale",
|
||||
"IconNameMale",
|
||||
"IconNameMan",
|
||||
"IconNameMap",
|
||||
"IconNameMedal",
|
||||
"IconNameMedical",
|
||||
"IconNameMedkit",
|
||||
"IconNameMegaphone",
|
||||
"IconNameMenu",
|
||||
"IconNameMicCircle",
|
||||
"IconNameMicOffCircle",
|
||||
"IconNameMicOff",
|
||||
"IconNameMic",
|
||||
"IconNameMoon",
|
||||
"IconNameMove",
|
||||
"IconNameMusicalNote",
|
||||
"IconNameMusicalNotes",
|
||||
"IconNameNavigateCircle",
|
||||
"IconNameNavigate",
|
||||
"IconNameNewspaper",
|
||||
"IconNameNotificationsCircle",
|
||||
"IconNameNotificationsOffCircle",
|
||||
"IconNameNotificationsOff",
|
||||
"IconNameNotifications",
|
||||
"IconNameNuclear",
|
||||
"IconNameNutrition",
|
||||
"IconNameOptions",
|
||||
"IconNamePaperPlane",
|
||||
"IconNamePartlySunny",
|
||||
"IconNamePauseCircle",
|
||||
"IconNamePause",
|
||||
"IconNamePaw",
|
||||
"IconNamePencil",
|
||||
"IconNamePeopleCircle",
|
||||
"IconNamePeople",
|
||||
"IconNamePersonAdd",
|
||||
"IconNamePersonCircle",
|
||||
"IconNamePersonRemove",
|
||||
"IconNamePerson",
|
||||
"IconNamePhoneLandscape",
|
||||
"IconNamePhonePortrait",
|
||||
"IconNamePieChart",
|
||||
"IconNamePin",
|
||||
"IconNamePint",
|
||||
"IconNamePizza",
|
||||
"IconNamePlanet",
|
||||
"IconNamePlayBackCircle",
|
||||
"IconNamePlayBack",
|
||||
"IconNamePlayCircle",
|
||||
"IconNamePlayForwardCircle",
|
||||
"IconNamePlayForward",
|
||||
"IconNamePlaySkipBackCircle",
|
||||
"IconNamePlaySkipBack",
|
||||
"IconNamePlaySkipForwardCircle",
|
||||
"IconNamePlaySkipForward",
|
||||
"IconNamePlay",
|
||||
"IconNamePodium",
|
||||
"IconNamePower",
|
||||
"IconNamePricetag",
|
||||
"IconNamePricetags",
|
||||
"IconNamePrint",
|
||||
"IconNamePrism",
|
||||
"IconNamePulse",
|
||||
"IconNamePush",
|
||||
"IconNameQrCode",
|
||||
"IconNameRadioButtonOff",
|
||||
"IconNameRadioButtonOn",
|
||||
"IconNameRadio",
|
||||
"IconNameRainy",
|
||||
"IconNameReader",
|
||||
"IconNameReceipt",
|
||||
"IconNameRecording",
|
||||
"IconNameRefreshCircle",
|
||||
"IconNameRefresh",
|
||||
"IconNameReloadCircle",
|
||||
"IconNameReload",
|
||||
"IconNameRemoveCircle",
|
||||
"IconNameRepeat",
|
||||
"IconNameResize",
|
||||
"IconNameRestaurant",
|
||||
"IconNameRibbon",
|
||||
"IconNameRocket",
|
||||
"IconNameRose",
|
||||
"IconNameSad",
|
||||
"IconNameSave",
|
||||
"IconNameScale",
|
||||
"IconNameScanCircle",
|
||||
"IconNameScan",
|
||||
"IconNameSchool",
|
||||
"IconNameSearchCircle",
|
||||
"IconNameSearch",
|
||||
"IconNameSend",
|
||||
"IconNameServer",
|
||||
"IconNameSettings",
|
||||
"IconNameShapes",
|
||||
"IconNameShareSocial",
|
||||
"IconNameShare",
|
||||
"IconNameShieldCheckmark",
|
||||
"IconNameShieldHalf",
|
||||
"IconNameShield",
|
||||
"IconNameShirt",
|
||||
"IconNameShuffle",
|
||||
"IconNameSkull",
|
||||
"IconNameSnow",
|
||||
"IconNameSparkles",
|
||||
"IconNameSpeedometer",
|
||||
"IconNameSquare",
|
||||
"IconNameStarHalf",
|
||||
"IconNameStar",
|
||||
"IconNameStatsChart",
|
||||
"IconNameStopCircle",
|
||||
"IconNameStop",
|
||||
"IconNameStopwatch",
|
||||
"IconNameStorefront",
|
||||
"IconNameSubway",
|
||||
"IconNameSunny",
|
||||
"IconNameSwapHorizontal",
|
||||
"IconNameSwapVertical",
|
||||
"IconNameSyncCircle",
|
||||
"IconNameSync",
|
||||
"IconNameTabletLandscape",
|
||||
"IconNameTabletPortrait",
|
||||
"IconNameTelescope",
|
||||
"IconNameTennisball",
|
||||
"IconNameTerminal",
|
||||
"IconNameText",
|
||||
"IconNameThermometer",
|
||||
"IconNameThumbsDown",
|
||||
"IconNameThumbsUp",
|
||||
"IconNameThunderstorm",
|
||||
"IconNameTicket",
|
||||
"IconNameTime",
|
||||
"IconNameTimer",
|
||||
"IconNameToday",
|
||||
"IconNameToggle",
|
||||
"IconNameTrailSign",
|
||||
"IconNameTrain",
|
||||
"IconNameTransgender",
|
||||
"IconNameTrashBin",
|
||||
"IconNameTrash",
|
||||
"IconNameTrendingDown",
|
||||
"IconNameTrendingUp",
|
||||
"IconNameTriangle",
|
||||
"IconNameTrophy",
|
||||
"IconNameTv",
|
||||
"IconNameUmbrella",
|
||||
"IconNameUnlink",
|
||||
"IconNameVideocamOff",
|
||||
"IconNameVideocam",
|
||||
"IconNameVolumeHigh",
|
||||
"IconNameVolumeLow",
|
||||
"IconNameVolumeMedium",
|
||||
"IconNameVolumeMute",
|
||||
"IconNameVolumeOff",
|
||||
"IconNameWalk",
|
||||
"IconNameWallet",
|
||||
"IconNameWarning",
|
||||
"IconNameWatch",
|
||||
"IconNameWater",
|
||||
"IconNameWifi",
|
||||
"IconNameWine",
|
||||
"IconNameWoman"
|
||||
]
|
||||
},
|
||||
"apimodel.Member": {
|
||||
"description": "The member",
|
||||
"properties": {
|
||||
|
@ -634,9 +1031,7 @@
|
|||
"$ref": "#/components/schemas/apimodel.IconFormat"
|
||||
},
|
||||
"name": {
|
||||
"description": "The name of the icon",
|
||||
"example": "document",
|
||||
"type": "string"
|
||||
"$ref": "#/components/schemas/apimodel.IconName"
|
||||
}
|
||||
},
|
||||
"type": "object"
|
||||
|
@ -1552,7 +1947,7 @@
|
|||
"apimodel.UpdatePropertyRequest": {
|
||||
"properties": {
|
||||
"key": {
|
||||
"description": "The key to set for the property",
|
||||
"description": "The key to set for the property; ; should always be snake_case, otherwise it will be converted to snake_case",
|
||||
"example": "some_user_defined_property_key",
|
||||
"type": "string"
|
||||
},
|
||||
|
@ -1601,7 +1996,7 @@
|
|||
"$ref": "#/components/schemas/apimodel.Icon"
|
||||
},
|
||||
"key": {
|
||||
"description": "The key to set for the type",
|
||||
"description": "The key to set for the type; should always be snake_case, otherwise it will be converted to snake_case",
|
||||
"example": "some_user_defined_type_key",
|
||||
"type": "string"
|
||||
},
|
||||
|
|
|
@ -123,7 +123,8 @@ components:
|
|||
format:
|
||||
$ref: '#/components/schemas/apimodel.PropertyFormat'
|
||||
key:
|
||||
description: The key of the property
|
||||
description: The key of the property; should always be snake_case, otherwise
|
||||
it will be converted to snake_case
|
||||
example: some_user_defined_property_key
|
||||
type: string
|
||||
name:
|
||||
|
@ -164,7 +165,8 @@ components:
|
|||
icon:
|
||||
$ref: '#/components/schemas/apimodel.Icon'
|
||||
key:
|
||||
description: The key of the type
|
||||
description: The key of the type; should always be snake_case, otherwise
|
||||
it will be converted to snake_case
|
||||
example: some_user_defined_type_key
|
||||
type: string
|
||||
layout:
|
||||
|
@ -377,6 +379,401 @@ components:
|
|||
- IconFormatEmoji
|
||||
- IconFormatFile
|
||||
- IconFormatIcon
|
||||
apimodel.IconName:
|
||||
description: The name of the icon
|
||||
example: document
|
||||
type: string
|
||||
x-enum-varnames:
|
||||
- IconNameAccessibility
|
||||
- IconNameAddCircle
|
||||
- IconNameAirplane
|
||||
- IconNameAlarm
|
||||
- IconNameAlbums
|
||||
- IconNameAlertCircle
|
||||
- IconNameAmericanFootball
|
||||
- IconNameAnalytics
|
||||
- IconNameAperture
|
||||
- IconNameApps
|
||||
- IconNameArchive
|
||||
- IconNameArrowBackCircle
|
||||
- IconNameArrowDownCircle
|
||||
- IconNameArrowForwardCircle
|
||||
- IconNameArrowRedoCircle
|
||||
- IconNameArrowRedo
|
||||
- IconNameArrowUndoCircle
|
||||
- IconNameArrowUndo
|
||||
- IconNameArrowUpCircle
|
||||
- IconNameAtCircle
|
||||
- IconNameAttach
|
||||
- IconNameBackspace
|
||||
- IconNameBagAdd
|
||||
- IconNameBagCheck
|
||||
- IconNameBagHandle
|
||||
- IconNameBagRemove
|
||||
- IconNameBag
|
||||
- IconNameBalloon
|
||||
- IconNameBan
|
||||
- IconNameBandage
|
||||
- IconNameBarChart
|
||||
- IconNameBarbell
|
||||
- IconNameBarcode
|
||||
- IconNameBaseball
|
||||
- IconNameBasket
|
||||
- IconNameBasketball
|
||||
- IconNameBatteryCharging
|
||||
- IconNameBatteryDead
|
||||
- IconNameBatteryFull
|
||||
- IconNameBatteryHalf
|
||||
- IconNameBeaker
|
||||
- IconNameBed
|
||||
- IconNameBeer
|
||||
- IconNameBicycle
|
||||
- IconNameBinoculars
|
||||
- IconNameBluetooth
|
||||
- IconNameBoat
|
||||
- IconNameBody
|
||||
- IconNameBonfire
|
||||
- IconNameBook
|
||||
- IconNameBookmark
|
||||
- IconNameBookmarks
|
||||
- IconNameBowlingBall
|
||||
- IconNameBriefcase
|
||||
- IconNameBrowsers
|
||||
- IconNameBrush
|
||||
- IconNameBug
|
||||
- IconNameBuild
|
||||
- IconNameBulb
|
||||
- IconNameBus
|
||||
- IconNameBusiness
|
||||
- IconNameCafe
|
||||
- IconNameCalculator
|
||||
- IconNameCalendarClear
|
||||
- IconNameCalendarNumber
|
||||
- IconNameCalendar
|
||||
- IconNameCall
|
||||
- IconNameCameraReverse
|
||||
- IconNameCamera
|
||||
- IconNameCarSport
|
||||
- IconNameCar
|
||||
- IconNameCard
|
||||
- IconNameCaretBackCircle
|
||||
- IconNameCaretBack
|
||||
- IconNameCaretDownCircle
|
||||
- IconNameCaretDown
|
||||
- IconNameCaretForwardCircle
|
||||
- IconNameCaretForward
|
||||
- IconNameCaretUpCircle
|
||||
- IconNameCaretUp
|
||||
- IconNameCart
|
||||
- IconNameCash
|
||||
- IconNameCellular
|
||||
- IconNameChatboxEllipses
|
||||
- IconNameChatbox
|
||||
- IconNameChatbubbleEllipses
|
||||
- IconNameChatbubble
|
||||
- IconNameChatbubbles
|
||||
- IconNameCheckbox
|
||||
- IconNameCheckmarkCircle
|
||||
- IconNameCheckmarkDoneCircle
|
||||
- IconNameChevronBackCircle
|
||||
- IconNameChevronDownCircle
|
||||
- IconNameChevronForwardCircle
|
||||
- IconNameChevronUpCircle
|
||||
- IconNameClipboard
|
||||
- IconNameCloseCircle
|
||||
- IconNameCloudCircle
|
||||
- IconNameCloudDone
|
||||
- IconNameCloudDownload
|
||||
- IconNameCloudOffline
|
||||
- IconNameCloudUpload
|
||||
- IconNameCloud
|
||||
- IconNameCloudyNight
|
||||
- IconNameCloudy
|
||||
- IconNameCodeSlash
|
||||
- IconNameCode
|
||||
- IconNameCog
|
||||
- IconNameColorFill
|
||||
- IconNameColorFilter
|
||||
- IconNameColorPalette
|
||||
- IconNameColorWand
|
||||
- IconNameCompass
|
||||
- IconNameConstruct
|
||||
- IconNameContact
|
||||
- IconNameContract
|
||||
- IconNameContrast
|
||||
- IconNameCopy
|
||||
- IconNameCreate
|
||||
- IconNameCrop
|
||||
- IconNameCube
|
||||
- IconNameCut
|
||||
- IconNameDesktop
|
||||
- IconNameDiamond
|
||||
- IconNameDice
|
||||
- IconNameDisc
|
||||
- IconNameDocumentAttach
|
||||
- IconNameDocumentLock
|
||||
- IconNameDocumentText
|
||||
- IconNameDocument
|
||||
- IconNameDocuments
|
||||
- IconNameDownload
|
||||
- IconNameDuplicate
|
||||
- IconNameEar
|
||||
- IconNameEarth
|
||||
- IconNameEasel
|
||||
- IconNameEgg
|
||||
- IconNameEllipse
|
||||
- IconNameEllipsisHorizontalCircle
|
||||
- IconNameEllipsisVerticalCircle
|
||||
- IconNameEnter
|
||||
- IconNameExit
|
||||
- IconNameExpand
|
||||
- IconNameExtensionPuzzle
|
||||
- IconNameEyeOff
|
||||
- IconNameEye
|
||||
- IconNameEyedrop
|
||||
- IconNameFastFood
|
||||
- IconNameFemale
|
||||
- IconNameFileTrayFull
|
||||
- IconNameFileTrayStacked
|
||||
- IconNameFileTray
|
||||
- IconNameFilm
|
||||
- IconNameFilterCircle
|
||||
- IconNameFingerPrint
|
||||
- IconNameFish
|
||||
- IconNameFitness
|
||||
- IconNameFlag
|
||||
- IconNameFlame
|
||||
- IconNameFlashOff
|
||||
- IconNameFlash
|
||||
- IconNameFlashlight
|
||||
- IconNameFlask
|
||||
- IconNameFlower
|
||||
- IconNameFolderOpen
|
||||
- IconNameFolder
|
||||
- IconNameFootball
|
||||
- IconNameFootsteps
|
||||
- IconNameFunnel
|
||||
- IconNameGameController
|
||||
- IconNameGift
|
||||
- IconNameGitBranch
|
||||
- IconNameGitCommit
|
||||
- IconNameGitCompare
|
||||
- IconNameGitMerge
|
||||
- IconNameGitNetwork
|
||||
- IconNameGitPullRequest
|
||||
- IconNameGlasses
|
||||
- IconNameGlobe
|
||||
- IconNameGolf
|
||||
- IconNameGrid
|
||||
- IconNameHammer
|
||||
- IconNameHandLeft
|
||||
- IconNameHandRight
|
||||
- IconNameHappy
|
||||
- IconNameHardwareChip
|
||||
- IconNameHeadset
|
||||
- IconNameHeartCircle
|
||||
- IconNameHeartDislikeCircle
|
||||
- IconNameHeartDislike
|
||||
- IconNameHeartHalf
|
||||
- IconNameHeart
|
||||
- IconNameHelpBuoy
|
||||
- IconNameHelpCircle
|
||||
- IconNameHome
|
||||
- IconNameHourglass
|
||||
- IconNameIceCream
|
||||
- IconNameIdCard
|
||||
- IconNameImage
|
||||
- IconNameImages
|
||||
- IconNameInfinite
|
||||
- IconNameInformationCircle
|
||||
- IconNameInvertMode
|
||||
- IconNameJournal
|
||||
- IconNameKey
|
||||
- IconNameKeypad
|
||||
- IconNameLanguage
|
||||
- IconNameLaptop
|
||||
- IconNameLayers
|
||||
- IconNameLeaf
|
||||
- IconNameLibrary
|
||||
- IconNameLink
|
||||
- IconNameListCircle
|
||||
- IconNameList
|
||||
- IconNameLocate
|
||||
- IconNameLocation
|
||||
- IconNameLockClosed
|
||||
- IconNameLockOpen
|
||||
- IconNameLogIn
|
||||
- IconNameLogOut
|
||||
- IconNameLogoAlipay
|
||||
- IconNameLogoAmazon
|
||||
- IconNameLogoAmplify
|
||||
- IconNameLogoAndroid
|
||||
- IconNameMagnet
|
||||
- IconNameMailOpen
|
||||
- IconNameMailUnread
|
||||
- IconNameMail
|
||||
- IconNameMaleFemale
|
||||
- IconNameMale
|
||||
- IconNameMan
|
||||
- IconNameMap
|
||||
- IconNameMedal
|
||||
- IconNameMedical
|
||||
- IconNameMedkit
|
||||
- IconNameMegaphone
|
||||
- IconNameMenu
|
||||
- IconNameMicCircle
|
||||
- IconNameMicOffCircle
|
||||
- IconNameMicOff
|
||||
- IconNameMic
|
||||
- IconNameMoon
|
||||
- IconNameMove
|
||||
- IconNameMusicalNote
|
||||
- IconNameMusicalNotes
|
||||
- IconNameNavigateCircle
|
||||
- IconNameNavigate
|
||||
- IconNameNewspaper
|
||||
- IconNameNotificationsCircle
|
||||
- IconNameNotificationsOffCircle
|
||||
- IconNameNotificationsOff
|
||||
- IconNameNotifications
|
||||
- IconNameNuclear
|
||||
- IconNameNutrition
|
||||
- IconNameOptions
|
||||
- IconNamePaperPlane
|
||||
- IconNamePartlySunny
|
||||
- IconNamePauseCircle
|
||||
- IconNamePause
|
||||
- IconNamePaw
|
||||
- IconNamePencil
|
||||
- IconNamePeopleCircle
|
||||
- IconNamePeople
|
||||
- IconNamePersonAdd
|
||||
- IconNamePersonCircle
|
||||
- IconNamePersonRemove
|
||||
- IconNamePerson
|
||||
- IconNamePhoneLandscape
|
||||
- IconNamePhonePortrait
|
||||
- IconNamePieChart
|
||||
- IconNamePin
|
||||
- IconNamePint
|
||||
- IconNamePizza
|
||||
- IconNamePlanet
|
||||
- IconNamePlayBackCircle
|
||||
- IconNamePlayBack
|
||||
- IconNamePlayCircle
|
||||
- IconNamePlayForwardCircle
|
||||
- IconNamePlayForward
|
||||
- IconNamePlaySkipBackCircle
|
||||
- IconNamePlaySkipBack
|
||||
- IconNamePlaySkipForwardCircle
|
||||
- IconNamePlaySkipForward
|
||||
- IconNamePlay
|
||||
- IconNamePodium
|
||||
- IconNamePower
|
||||
- IconNamePricetag
|
||||
- IconNamePricetags
|
||||
- IconNamePrint
|
||||
- IconNamePrism
|
||||
- IconNamePulse
|
||||
- IconNamePush
|
||||
- IconNameQrCode
|
||||
- IconNameRadioButtonOff
|
||||
- IconNameRadioButtonOn
|
||||
- IconNameRadio
|
||||
- IconNameRainy
|
||||
- IconNameReader
|
||||
- IconNameReceipt
|
||||
- IconNameRecording
|
||||
- IconNameRefreshCircle
|
||||
- IconNameRefresh
|
||||
- IconNameReloadCircle
|
||||
- IconNameReload
|
||||
- IconNameRemoveCircle
|
||||
- IconNameRepeat
|
||||
- IconNameResize
|
||||
- IconNameRestaurant
|
||||
- IconNameRibbon
|
||||
- IconNameRocket
|
||||
- IconNameRose
|
||||
- IconNameSad
|
||||
- IconNameSave
|
||||
- IconNameScale
|
||||
- IconNameScanCircle
|
||||
- IconNameScan
|
||||
- IconNameSchool
|
||||
- IconNameSearchCircle
|
||||
- IconNameSearch
|
||||
- IconNameSend
|
||||
- IconNameServer
|
||||
- IconNameSettings
|
||||
- IconNameShapes
|
||||
- IconNameShareSocial
|
||||
- IconNameShare
|
||||
- IconNameShieldCheckmark
|
||||
- IconNameShieldHalf
|
||||
- IconNameShield
|
||||
- IconNameShirt
|
||||
- IconNameShuffle
|
||||
- IconNameSkull
|
||||
- IconNameSnow
|
||||
- IconNameSparkles
|
||||
- IconNameSpeedometer
|
||||
- IconNameSquare
|
||||
- IconNameStarHalf
|
||||
- IconNameStar
|
||||
- IconNameStatsChart
|
||||
- IconNameStopCircle
|
||||
- IconNameStop
|
||||
- IconNameStopwatch
|
||||
- IconNameStorefront
|
||||
- IconNameSubway
|
||||
- IconNameSunny
|
||||
- IconNameSwapHorizontal
|
||||
- IconNameSwapVertical
|
||||
- IconNameSyncCircle
|
||||
- IconNameSync
|
||||
- IconNameTabletLandscape
|
||||
- IconNameTabletPortrait
|
||||
- IconNameTelescope
|
||||
- IconNameTennisball
|
||||
- IconNameTerminal
|
||||
- IconNameText
|
||||
- IconNameThermometer
|
||||
- IconNameThumbsDown
|
||||
- IconNameThumbsUp
|
||||
- IconNameThunderstorm
|
||||
- IconNameTicket
|
||||
- IconNameTime
|
||||
- IconNameTimer
|
||||
- IconNameToday
|
||||
- IconNameToggle
|
||||
- IconNameTrailSign
|
||||
- IconNameTrain
|
||||
- IconNameTransgender
|
||||
- IconNameTrashBin
|
||||
- IconNameTrash
|
||||
- IconNameTrendingDown
|
||||
- IconNameTrendingUp
|
||||
- IconNameTriangle
|
||||
- IconNameTrophy
|
||||
- IconNameTv
|
||||
- IconNameUmbrella
|
||||
- IconNameUnlink
|
||||
- IconNameVideocamOff
|
||||
- IconNameVideocam
|
||||
- IconNameVolumeHigh
|
||||
- IconNameVolumeLow
|
||||
- IconNameVolumeMedium
|
||||
- IconNameVolumeMute
|
||||
- IconNameVolumeOff
|
||||
- IconNameWalk
|
||||
- IconNameWallet
|
||||
- IconNameWarning
|
||||
- IconNameWatch
|
||||
- IconNameWater
|
||||
- IconNameWifi
|
||||
- IconNameWine
|
||||
- IconNameWoman
|
||||
apimodel.Member:
|
||||
description: The member
|
||||
properties:
|
||||
|
@ -477,9 +874,7 @@ components:
|
|||
format:
|
||||
$ref: '#/components/schemas/apimodel.IconFormat'
|
||||
name:
|
||||
description: The name of the icon
|
||||
example: document
|
||||
type: string
|
||||
$ref: '#/components/schemas/apimodel.IconName'
|
||||
type: object
|
||||
apimodel.NumberPropertyLinkValue:
|
||||
properties:
|
||||
|
@ -1151,7 +1546,8 @@ components:
|
|||
apimodel.UpdatePropertyRequest:
|
||||
properties:
|
||||
key:
|
||||
description: The key to set for the property
|
||||
description: The key to set for the property; ; should always be snake_case,
|
||||
otherwise it will be converted to snake_case
|
||||
example: some_user_defined_property_key
|
||||
type: string
|
||||
name:
|
||||
|
@ -1186,7 +1582,8 @@ components:
|
|||
icon:
|
||||
$ref: '#/components/schemas/apimodel.Icon'
|
||||
key:
|
||||
description: The key to set for the type
|
||||
description: The key to set for the type; should always be snake_case, otherwise
|
||||
it will be converted to snake_case
|
||||
example: some_user_defined_type_key
|
||||
type: string
|
||||
layout:
|
||||
|
|
|
@ -42,13 +42,13 @@ type PropertyResponse struct {
|
|||
}
|
||||
|
||||
type CreatePropertyRequest struct {
|
||||
Key string `json:"key" example:"some_user_defined_property_key"` // The key of the property
|
||||
Key string `json:"key" example:"some_user_defined_property_key"` // The key of the property; should always be snake_case, otherwise it will be converted to snake_case
|
||||
Name string `json:"name" binding:"required" example:"Last modified date"` // The name of the property
|
||||
Format PropertyFormat `json:"format" binding:"required" enums:"text,number,select,multi_select,date,files,checkbox,url,email,phone,objects"` // The format of the property
|
||||
}
|
||||
|
||||
type UpdatePropertyRequest struct {
|
||||
Key *string `json:"key,omitempty" example:"some_user_defined_property_key"` // The key to set for the property
|
||||
Key *string `json:"key,omitempty" example:"some_user_defined_property_key"` // The key to set for the property; ; should always be snake_case, otherwise it will be converted to snake_case
|
||||
Name *string `json:"name,omitempty" binding:"required" example:"Last modified date"` // The name to set for the property
|
||||
}
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ type TypeResponse struct {
|
|||
}
|
||||
|
||||
type CreateTypeRequest struct {
|
||||
Key string `json:"key" example:"some_user_defined_type_key"` // The key of the type
|
||||
Key string `json:"key" example:"some_user_defined_type_key"` // The key of the type; should always be snake_case, otherwise it will be converted to snake_case
|
||||
Name string `json:"name" binding:"required" example:"Page"` // The name of the type
|
||||
PluralName string `json:"plural_name" binding:"required" example:"Pages"` // The plural name of the type
|
||||
Icon Icon `json:"icon" oneOf:"EmojiIcon,FileIcon,NamedIcon"` // The icon of the type
|
||||
|
@ -44,7 +44,7 @@ type CreateTypeRequest struct {
|
|||
}
|
||||
|
||||
type UpdateTypeRequest struct {
|
||||
Key *string `json:"key,omitempty" example:"some_user_defined_type_key"` // The key to set for the type
|
||||
Key *string `json:"key,omitempty" example:"some_user_defined_type_key"` // The key to set for the type; should always be snake_case, otherwise it will be converted to snake_case
|
||||
Name *string `json:"name,omitempty" example:"Page"` // The name to set for the type
|
||||
PluralName *string `json:"plural_name,omitempty" example:"Pages"` // The plural name to set for the type
|
||||
Icon *Icon `json:"icon,omitempty" oneOf:"EmojiIcon,FileIcon,NamedIcon"` // The icon to set for the type
|
||||
|
|
|
@ -9,6 +9,7 @@ import (
|
|||
"time"
|
||||
|
||||
"github.com/gogo/protobuf/types"
|
||||
"github.com/iancoleman/strcase"
|
||||
|
||||
apimodel "github.com/anyproto/anytype-heart/core/api/model"
|
||||
"github.com/anyproto/anytype-heart/core/api/pagination"
|
||||
|
@ -199,7 +200,15 @@ func (s *Service) CreateProperty(ctx context.Context, spaceId string, request ap
|
|||
}
|
||||
|
||||
if request.Key != "" {
|
||||
details.Fields[bundle.RelationKeyApiObjectKey.String()] = pbtypes.String(s.sanitizedString(request.Key))
|
||||
apiKey := strcase.ToSnake(s.sanitizedString(request.Key))
|
||||
propMap, err := s.getPropertyMapFromStore(ctx, spaceId, false)
|
||||
if err != nil {
|
||||
return apimodel.Property{}, err
|
||||
}
|
||||
if _, exists := propMap[apiKey]; exists {
|
||||
return apimodel.Property{}, util.ErrBadInput(fmt.Sprintf("property key %q already exists", apiKey))
|
||||
}
|
||||
details.Fields[bundle.RelationKeyApiObjectKey.String()] = pbtypes.String(apiKey)
|
||||
}
|
||||
|
||||
resp := s.mw.ObjectCreateRelation(ctx, &pb.RpcObjectCreateRelationRequest{
|
||||
|
@ -234,12 +243,20 @@ func (s *Service) UpdateProperty(ctx context.Context, spaceId string, propertyId
|
|||
})
|
||||
}
|
||||
if request.Key != nil {
|
||||
newKey := strcase.ToSnake(s.sanitizedString(*request.Key))
|
||||
propMap, err := s.getPropertyMapFromStore(ctx, spaceId, false)
|
||||
if err != nil {
|
||||
return apimodel.Property{}, err
|
||||
}
|
||||
if existing, exists := propMap[newKey]; exists && existing.Id != propertyId {
|
||||
return apimodel.Property{}, util.ErrBadInput(fmt.Sprintf("property key %q already exists", newKey))
|
||||
}
|
||||
if bundle.HasRelation(domain.RelationKey(prop.RelationKey)) {
|
||||
return apimodel.Property{}, util.ErrBadInput("property key of bundled properties cannot be changed")
|
||||
}
|
||||
detailsToUpdate = append(detailsToUpdate, &model.Detail{
|
||||
Key: bundle.RelationKeyApiObjectKey.String(),
|
||||
Value: pbtypes.String(s.sanitizedString(*request.Key)),
|
||||
Value: pbtypes.String(newKey),
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
@ -3,8 +3,10 @@ package service
|
|||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
"github.com/gogo/protobuf/types"
|
||||
"github.com/iancoleman/strcase"
|
||||
|
||||
apimodel "github.com/anyproto/anytype-heart/core/api/model"
|
||||
"github.com/anyproto/anytype-heart/core/api/pagination"
|
||||
|
@ -118,6 +120,21 @@ func (s *Service) GetType(ctx context.Context, spaceId string, typeId string) (a
|
|||
|
||||
// CreateType creates a new type in a specific space.
|
||||
func (s *Service) CreateType(ctx context.Context, spaceId string, request apimodel.CreateTypeRequest) (apimodel.Type, error) {
|
||||
if request.Key != "" {
|
||||
newKey := strcase.ToSnake(s.sanitizedString(request.Key))
|
||||
propertyMap, err := s.getPropertyMapFromStore(ctx, spaceId, true)
|
||||
if err != nil {
|
||||
return apimodel.Type{}, err
|
||||
}
|
||||
typeMap, err := s.getTypeMapFromStore(ctx, spaceId, propertyMap, true)
|
||||
if err != nil {
|
||||
return apimodel.Type{}, err
|
||||
}
|
||||
if _, exists := typeMap[newKey]; exists {
|
||||
return apimodel.Type{}, util.ErrBadInput(fmt.Sprintf("type key %q already exists", newKey))
|
||||
}
|
||||
}
|
||||
|
||||
details, err := s.buildTypeDetails(ctx, spaceId, request)
|
||||
if err != nil {
|
||||
return apimodel.Type{}, err
|
||||
|
@ -266,7 +283,7 @@ func (s *Service) getTypeFromStruct(details *types.Struct, propertyMap map[strin
|
|||
Archived: details.Fields[bundle.RelationKeyIsArchived.String()].GetBoolValue(),
|
||||
Layout: s.otLayoutToObjectLayout(model.ObjectTypeLayout(details.Fields[bundle.RelationKeyRecommendedLayout.String()].GetNumberValue())),
|
||||
Properties: s.getRecommendedPropertiesFromLists(details.Fields[bundle.RelationKeyRecommendedFeaturedRelations.String()].GetListValue(), details.Fields[bundle.RelationKeyRecommendedRelations.String()].GetListValue(), propertyMap),
|
||||
UniqueKey: uk,
|
||||
UniqueKey: uk, // internal only for simplified lookup
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -288,7 +305,7 @@ func (s *Service) buildTypeDetails(ctx context.Context, spaceId string, request
|
|||
}
|
||||
|
||||
if request.Key != "" {
|
||||
fields[bundle.RelationKeyApiObjectKey.String()] = pbtypes.String(s.sanitizedString(request.Key))
|
||||
fields[bundle.RelationKeyApiObjectKey.String()] = pbtypes.String(strcase.ToSnake(s.sanitizedString(request.Key)))
|
||||
}
|
||||
|
||||
iconFields, err := s.processIconFields(spaceId, request.Icon, true)
|
||||
|
@ -352,10 +369,22 @@ func (s *Service) buildUpdatedTypeDetails(ctx context.Context, spaceId string, t
|
|||
fields[bundle.RelationKeyRecommendedLayout.String()] = pbtypes.Int64(int64(s.typeLayoutToObjectTypeLayout(*request.Layout)))
|
||||
}
|
||||
if request.Key != nil {
|
||||
newKey := strcase.ToSnake(s.sanitizedString(*request.Key))
|
||||
propertyMap, err := s.getPropertyMapFromStore(ctx, spaceId, true)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
typeMap, err := s.getTypeMapFromStore(ctx, spaceId, propertyMap, true)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if existing, exists := typeMap[newKey]; exists && existing.Id != t.Id {
|
||||
return nil, util.ErrBadInput(fmt.Sprintf("type key %q already exists", newKey))
|
||||
}
|
||||
if bundle.HasObjectTypeByKey(domain.TypeKey(util.ToTypeApiKey(t.UniqueKey))) {
|
||||
return nil, util.ErrBadInput("type key of bundled types cannot be changed")
|
||||
}
|
||||
fields[bundle.RelationKeyApiObjectKey.String()] = pbtypes.String(s.sanitizedString(*request.Key))
|
||||
fields[bundle.RelationKeyApiObjectKey.String()] = pbtypes.String(newKey)
|
||||
}
|
||||
|
||||
if request.Icon != nil {
|
||||
|
|
|
@ -18,7 +18,7 @@ const (
|
|||
propPrefix = ""
|
||||
typePrefix = ""
|
||||
tagPrefix = ""
|
||||
internalRelationPrefix = "" // interally, we're using rk instead of uk when working with relations from api, where no "rel-" prefix exists
|
||||
internalRelationPrefix = "" // internally, we're using rk instead of uk when working with relations from api, where no "rel-" prefix exists
|
||||
internalObjectTypePrefix = "ot-"
|
||||
internalRelationOptionPrefix = "opt-"
|
||||
)
|
||||
|
@ -32,28 +32,15 @@ func ToPropertyApiKey(internalKey string) string {
|
|||
return toApiKey(propPrefix, internalRelationPrefix, internalKey)
|
||||
}
|
||||
|
||||
// func FromPropertyApiKey(apiKey string) string {
|
||||
// return fromApiKey(propPrefix, internalRelationPrefix, apiKey)
|
||||
// }
|
||||
|
||||
func ToTypeApiKey(internalKey string) string {
|
||||
return toApiKey(typePrefix, internalObjectTypePrefix, internalKey)
|
||||
}
|
||||
|
||||
// func FromTypeApiKey(apiKey string) string {
|
||||
// return fromApiKey(typePrefix, internalObjectTypePrefix, apiKey)
|
||||
// }
|
||||
|
||||
func ToTagApiKey(internalKey string) string {
|
||||
return toApiKey(tagPrefix, internalRelationOptionPrefix, internalKey)
|
||||
}
|
||||
|
||||
// func FromTagApiKey(apiKey string) string {
|
||||
// return fromApiKey(tagPrefix, internalRelationOptionPrefix, apiKey)
|
||||
// }
|
||||
|
||||
// IsCustomKey returns true if key is exactly 24 letters and contains at least a digit.
|
||||
// Non-custom properties never contain a digit.
|
||||
func IsCustomKey(key string) bool {
|
||||
return len(key) == 24 && hex24Pattern.MatchString(key) && digitPattern.MatchString(key)
|
||||
}
|
||||
|
@ -69,12 +56,3 @@ func toApiKey(prefix, internalPrefix, internalKey string) string {
|
|||
}
|
||||
return prefix + k
|
||||
}
|
||||
|
||||
// fromApiKey converts an API key back into internal format by stripping the API prefix and re-adding the internal prefix.
|
||||
func fromApiKey(prefix, internalPrefix, apiKey string) string {
|
||||
k := strings.TrimPrefix(apiKey, prefix)
|
||||
if IsCustomKey(k) {
|
||||
return internalPrefix + k
|
||||
}
|
||||
return internalPrefix + strcase.ToLowerCamel(k)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue