App Descriptor

App-deskriptoren er en af de vigtigste byggesten i Crowdin-apps. App-deskriptoren er en JSON-fil (f.eks. manifest.json) indeholdende generelle oplysninger om appen, samt de moduler, appen ønsker at operere med eller udvide. Den beskriver, hvordan appen vil fungere, hvilke ressourcer, som vil blive brugt mv. Et eks. ses nedenfor

App-deskriptorstruktur

{
   "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", "crowdin-enterprise"
              ]
           }
       ]
   }
}
identifier

Type: string (^[a-z0-9-._]+$)

Bemærk: Brug ikke majuskler i app-identifikatoren.

Required: yes

Beskrivelse: En unik nøgle til app-identifikation. Denne identifikator skal være <= 255 characters.

navn

Type: string

Required: yes

Beskrivelse: Menneskeligt læsbare app-navn.

baseUrl

Type: string (uri)

Required: yes

Beskrivelse: Fjern-appens basis-URL brugt til al kommunikation retur til app-instansen.
Efter appen er installeret i et arbejdsområde, kan dens baseUrl ikke ændres uden forudgående afinstallation af appen.

Dette er vigtigt: Vælg baseUrl klogt, før offentliggørelsen af appen.
BaseUrl skal starte med https:// for at sikre, at alle data sendes sikkert mellem vores cloud-instanser og appen.

Bemærk: Hver app skal have en unik baseUrl. Ønskes flere apps tilgængeliggjort fra samme vært,
overveje da at føje et stipræfiks til baseUrl'en.

authentication

Type: Authentication

Required: yes

Beskrivelse: Angiver den godkendelsestype, der skal bruges ved signering af anmodninger mellem værts-appen og Crowdin-appen.

description

Type: string

Description: Klartekstbeskrivelsen af, hvad appen gør.
Beskrivelsen fremgår i Crowdin-UI'en.

logo

Type: string (relativeUri)

Beskrivelse: Billed-URL'en relativ til appens basis-URL, som vist i Crowdin UI'en.

events

Type: Events

Beskrivelse: Tillad app'en at registrere sig til app-event notifikationer.

scopes

Type: [string, … ]

Beskrivelse: Sæt af anmodede udtrækninger fra appen.

{
  "scopes": [
    "project",
    "tm"
  ]
}
modules

Type: object

Beskrivelse: Listen over modultyper, appen muliggør.

environments

Type: [string, … ]

Allowed values: crowdin, crowdin-enterprise

Beskrivelse: Sæt af miljøer, hvor et modul kan installeres.

{
  "environments": [
    "crowdin-enterprise"
  ]
}

Authentication

​Specifies the authentication type to use when signing requests from the host application to the Crowdin app. Crowdin-apps understøtter to godkendelsestyper:

  • brug af OAuth-app (authorization_code-værdi)
  • uden OAuth-app (ingen-værdi)

In case your Crowdin app requires access to Crowdin API at any time, it’s recommended to use the crowdin_app, in other cases feel free to use the none. The authentication type none grants access to Crowdin API as well as the crowdin_app, but only when the Crowdin app is executed on the user side, for example, when the iframe opens.

Eks.:

{
   "authentication": {
       "type": "authorization_code",
       "clientId": "klient-id"
   }
}

​ Properties:

type

Type: string

Defaults to: none

Allowed values: none, authorization_code

Beskrivelse: Godkendelsestypen, der skal anvendes.

clientId

Type: string

Beskrivelse: OAuth-klient-ID for godkendelse via typen authorization_code.

Modules

Moduler er måden, hvorpå apps udvider og interagerer med Crowdin. Vha. moduler kan en app gøre flg.:

  • Udvid Crowdin-UI’en.
  • Opret integrationer med eksterne tjenester.
  • Add support for new custom file formats.
  • Customize processing for supported file formats.

Read more about UI Modules and File Processing Modules.

Events

Tillad en app at registrere tilbagekald for begivenheder, som forekommer i arbejdsområdet. Når en begivenhed udløses, vil en POST-anmodning gå til den relevante URL registreret til begivenheden. Det installerede callback er en integreret del af en apps installationsproces, mens de resterende begivenheder hovedsagelig udgør webhooks. Hver egenskab i dette objekt er en URL relativ til appens basis-URL.

Eksempel:

{
   "events": {
       "installed": "/hook/installed",
       "uninstall": "/hook/uninstall"
   }
}

​ Properties:

installed

Type: string

Beskrivelse: Begivenheden sendt til en app, efter at en bruger har installeret appen i Crowdin.

This event is required if you use crowdin_app. Læs mere om Godkendelse.

uninstall

Type: string

Beskrivelse: Begivenheden sendt til en app, inden den afinstalleres i Crowdin.

Installed Event Payload

The Installed event is sent from Crowdin to the remote app when a user installs the app in Crowdin. The Installed event contains the information about the Crowdin workspace or profile the Crowdin App was installed to, the information about the app itself, as well as the credentials to fetch an API token.

Læs mere om Installed Event Flow.

Payload examples:

{
   "appId": "app-identifikator",
   "clientId": "Klient-ID'en",
   "userId": 1,
   "organizationId": 1,
   "domain": null,
   "baseUrl": "https://crowdin.com",
   "code": "def.....608bdad9c625bd2eedf1fd6"
}
{
   "appId": "applikationsidentifikator",
   "clientId": "klient-ID",
   "userId": 1,
   "organisationsID": 1,
   "domain": "{domain}",
   "baseUrl": "https://{domain}.crowdin.com",
   "code": "def.....608bdad9c625bd2eedf1fd6"
}

Egenskaber:

appId

Type: string

Beskrivelse: Identifikator for appen er angivet i app-deskriptor filen.

appSecret

Type: string

Beskrivelse: OAuth-klientidentifikator, som erklæret i app-deskriptor filen.

clientId

Type: string

Beskrivelse: Den numeriske identifikator på den bruger, der installerede appen i Enterprise.

userId

Type: integer

Beskrivelse: Den numeriske identifikator på organisationen, hvori appen er installeret.

organizationId

Type: integer

Beskrivelse: Den numeriske identifikator på organisationen, hvori appen er installeret.

domain

Type: string

Description: The name of the organization in Crowdin Enterprise the app was installed to. For Crowdin the domain value is always null

baseUrl

Type: string

Description: The baseUrl of the organization in Crowdin Enterprise the app was installed to. Til Crowdin er baseURL-værdien altid "https://crowdin.com"

Uninstall Event Payload

Afinstallér-begivenheden sendes fra Enterprise til Crowdin fjer-appen, når en bruger afinstallerer appen i Enterprise. The Uninstall event, like the install event, contains the information about the Crowdin workspace or account the Crowdin App was installed to, and the information about the app itself. After receiving the uninstall event, it’s necessary to find and remove all of the data related to the Crowdin workspace or account the app is removed from.

Payload examples:

{
   "appId": "app-identifikator",
   "clientId": "klient-ID",
   "organizationId": 1,
   "domain": null,
   "baseUrl": "https://crowdin.com"
}
{
   "appId": "applikationsidentifikator",
   "clientId": "klient-ID",
   "organizationId": 1,
   "domain": "{domain}",
   "baseUrl": "https://{domain}.crowdin.com"
}

Egenskaber:

appId

Type: string

Beskrivelse: Identifikator for appen er angivet i app-deskriptor filen.

clientId

Type: string

Beskrivelse: OAuth-klientidentifikator, som erklæret i app-deskriptor filen.

organizationId

Type: integer

Beskrivelse: Den numeriske identifikator på organisationen, hvorfra appen er afinstalleret.

domain

Type: string

Description: The name of the organization in Crowdin Enterprise the app uninstalled from. For Crowdin the domain value is always null

baseUrl

Type: string

Description: The baseUrl of the organization in Crowdin Enterprise the app uninstalled from. Til Crowdin er baseURL-værdien altid "https://crowdin.com"

Var denne artikel nyttig?