Az alkalmazásleíró a Crowdin alkalmazások egyik alapvető alkotóeleme. Az alkalmazásleíró egy JSON fájl (például: crowdin.json
), amely általános információkat tartalmaz az alkalmazásról, valamint azokról a modulokról, amelyekkel az alkalmazás működni vagy bővülni szeretne. Leírja, hogyan fog működni az alkalmazás, milyen erőforrásokat fog használni, stb. Az alábbiakban láthat ehhez egy példát.
{
"identifier": "your-application-identifier",
"name": "Your Application",
"description": "Application description",
"logo": "/assets/logos/app-logo.png",
"baseUrl": "http://example.com",
"authentication": {
"type": "authorization_code",
"clientId": "your-client-id"
},
"events": {
"installed": "/hooks/installed"
},
"scopes": [
"project"
],
"modules": {
"integrations": [
{
"key": "your-module-key",
"name": "Module Name",
"description": "Module description",
"logo": "/assets/logos/module-logo.png",
"url": "/page/integration",
"environments": [
"crowdin-enterprise"
]
}
]
}
}
identifier | Type: Note: Don't use uppercase in the app identifier. Szükséges: igen Leírás: Egy egyedi kulcs az alkalmazás azonosításához. Az azonosító megengedett hossza <= 255 characters. |
name | Típus: Szükséges: igen Leírás: Az ember által olvasható alkalmazásnév. |
baseUrl | Típus: Szükséges: igen Description: The base URL of the remote app, which is used for all communications back to the app instance. Ez fontos: bölcsen válassza ki a baseUrl-t, mielőtt alkalmazását nyilvánosságra hozná. Megjegyzés: Minden alkalmazásnak rendelkeznie kell egy egyedi baseUrl-lel. Ha több alkalmazást szeretne kiszolgálni ugyanarról a hosztról, |
authentication | Típus: Szükséges: igen Leírás: Megadja a hitelesítési típust, amelyet a gazdaalkalmazás és a Crowdin alkalmazás közötti kérelmek aláírásakor használ. |
description | Típus: Description: The human-readable description of what the app does. |
logo | Típus: Description: The image URL relative to the app's base URL which will be displayed in the Crowdin Enterprise UI. |
events | Típus: Description: Allow the app to register for app event notifications. |
scopes | Típus: [ Description: Set of scopes requested by this app.
|
modules | Típus: Description: The list of modules this app provides. |
environments | Típus: [ Allowed values: Description: Set of environments where a module could be installed.
|
Specifies the authentication type to use when signing requests from the host application to the Crowdin app. Crowdin Apps support two types of authentication:
authorization_code
value)none
value)In case your Crowdin app requires access to Crowdin API at any time, it’s recommended to use the authorization_code
, in other cases feel free to use the none
. The authentication type none
grants access to Crowdin API as well as the authorization_code
, but only when the Crowdin app is executed on the user side, for example, when the iframe opens.
Minta:
{
"authentication": {
"type": "authorization_code",
"clientId": "your-client-id"
}
}
Tulajdonságok:
type | Típus: Alapértelmezett: Allowed values: Leírás: A használni kívánt hitelesítés típusa. |
clientId | Típus: Leírás: OAuth ügyfélazonosító a hitelesítéshez az |
Modules are how apps extend Crowdin Enterprise and interact with it. Using modules your app can do the following things:
Read more about Modules.
Allow an app to register callbacks for events that occur in the workspace. When an event is fired, a POST request will be made to the appropriate URL registered for the event. The installed callback is an integral part of the installation process of an app, whereas the remaining events are essentially webhooks. Each property within this object is a URL relative to the app’s base URL.
Minta:
{
"events": {
"installed": "/hook/installed",
"uninstall": "/hook/uninstall"
}
}
Tulajdonságok:
installed | Típus: Description: The event that is sent to an app after a user installed the app in Crowdin Enterprise. This event is required if you use |
uninstall | Típus: Description: The event that is sent to an app before the app uninstallation from Crowdin Enterprise. |
Telepítve esemény
The Installed event is sent from Crowdin Enterprise to the remote Crowdin app when a user installs the app in Crowdin Enterprise. The Installed event contains the information about the Crowdin Enterprise workspace the Crowdin App was installed to, the information about the app itself, as well as the app authorization_code. As soon as the authorization_code is received it’s necessary to authorize the app using the access and refresh tokens.
Read more about Installed Event Flow.
Payload example:
{
"appId": "your-application-identifier",
"clientId": "your-client-id",
"userId": 1,
"organizationId": 1,
"domain": "{domain}",
"baseUrl": "https://{domain}.crowdin.com",
"code": "def.....608bdad9c625bd2eedf1fd6"
}
Tulajdonságok:
appId | Típus: Leírás: Az alkalmazás azonosítója, amely deklarálva van az alkalmazás leíró fájljában. |
clientId | Típus: Leírás: Az alkalmazásleíró fájlban deklarált OAuth ügyfélazonosító. |
userId | Típus: Description: The numeric identifier of the user that installed the app in Crowdin Enterprise. |
organizationId | Típus: Leírás: A szervezet numerikus azonosítója, amelybe az alkalmazást telepítették. |
domain | Típus: Leírás: A szervezet neve, amelybe az alkalmazást telepítették. |
baseUrl | Típus: Leírás: A szervezet baseUrl-e, amelybe az alkalmazást telepítették. |
code | Típus: Leírás: A Crowdin alkalmazás engedélyezéséhez használt kód. |
Eltávolítási esemény
The uninstall event is sent from Crowdin Enterprise to the remote Crowdin app when a user uninstalls the app from Crowdin Enterprise. The Uninstall event, like the install event, contains the information about the Crowdin Enterprise workspace the Crowdin App was installed to, and the information about the app itself. Az eltávolítási esemény fogadása után meg kell keresni és eltávolítani a Crowdin Enterprise munkaterülethez kapcsolódó összes adatot, amelyből az alkalmazás eltávolításra kerül.
Payload example:
{
"appId": "your-application-identifier",
"clientId": "your-client-id",
"organizationId": 1,
"domain": "{domain}",
"baseUrl": "https://{domain}.crowdin.com"
}
Tulajdonságok:
appId | Típus: Leírás: Az alkalmazás azonosítója, amely deklarálva van az alkalmazás leíró fájljában. |
clientId | Típus: Leírás: Az alkalmazásleíró fájlban deklarált OAuth ügyfélazonosító. |
organizationId | Típus: Leírás: A szervezet numerikus azonosítója, amelyből az alkalmazás eltávolításra kerül. |
domain | Típus: Leírás: A szervezet neve, amelyből az alkalmazás eltávolításra kerül. |
baseUrl | Típus: Leírás: A szervezet baseUrl-e, amelyből az alkalmazás eltávolításra kerül. |