Class AppsResource

Hierarchy

  • Resource
    • AppsResource

Constructors

Methods

  • Crea la app del cliente. Exige token de usuario (512) y sólo puede haber una (536).

    keycloak_client_idenfifier —con la errata, que es el nombre del campo— es el client_id con el que luego se pide el token, y tiene que ser único en todo PlanVortex (534). Los dominios y las urls de redirección tienen que ser URLs válidas (531 y 532), y webhook_url también (535).

    Parameters

    • idClient: string
    • body: {
          allowed_domains?: string[];
          keycloak_client_idenfifier: string;
          name: string;
          redirect_urls?: string[];
          webhook_url?: string;
      }
      • Optionalallowed_domains?: string[]

        Origins allowed to call the API with this app's identity. Every entry has to be a valid URL (error 531).

      • keycloak_client_idenfifier: string

        The app's client_id, which is what you send to POST /oauth/token.

        **Format is enforced** (error 533): lowercase letters, numbers, `.`, `-` and `_`, starting with a letter or a number, between 3 and 64 characters — `shop-integration`, not `Shop Integration`. Keycloak itself accepts anything, so an identifier with a space in it used to create an app that could never get a token.
        
        It also has to be unique across PlanVortex (error 534), and **it cannot be changed once the app exists** (error 547): it is what your integration authenticates with, so renaming it would lock out everything already using the old one. Send it unchanged on an update, or leave it out. The spelling of the field is historical and kept for compatibility.
        
        shop-integration
        
      • name: string

        A name for the app. Cannot be blank (error 525).

      • Optionalredirect_urls?: string[]

        URLs the connect flow is allowed to come back to. A redirect_uri that is not in this list is refused when issuing a temporal connect token (error 532).

      • Optionalwebhook_url?: string

        Where PlanVortex posts events. Has to be a valid URL (error 535). See ClientApp.webhook_url for what arrives and how it is signed.

    • options: RequestOptions = {}

    Returns Promise<
        {
            _id: string;
            allowed_domains: string[];
            creation_date: string;
            deleted: boolean;
            deleted_date?: string;
            id_client: string;
            id_user?: string;
            keycloak_client_idenfifier: string;
            name: string;
            redirect_urls: string[];
            webhook_url?: string;
        },
    >

  • Una app. Es de lo poco de esta sección que sí admite un token de app: una app puede leer su propio registro.

    Parameters

    Returns Promise<
        {
            _id: string;
            allowed_domains: string[];
            creation_date: string;
            deleted: boolean;
            deleted_date?: string;
            id_client: string;
            id_user?: string;
            keycloak_client_idenfifier: string;
            name: string;
            redirect_urls: string[];
            webhook_url?: string;
        },
    >

  • Las apps del cliente. Exige token de usuario (512) y devuelve como mucho una.

    Parameters

    Returns Promise<
        Paginated<
            {
                _id: string;
                allowed_domains: string[];
                creation_date: string;
                deleted: boolean;
                deleted_date?: string;
                id_client: string;
                id_user?: string;
                keycloak_client_idenfifier: string;
                name: string;
                redirect_urls: string[];
                webhook_url?: string;
            },
        >,
    >

  • Borra la app. Exige token de usuario (512).

    El cliente de Keycloak se borra de verdad —así que las credenciales dejan de servir en el acto— y el documento se marca como borrado en vez de desaparecer.

    Parameters

    Returns Promise<void>

  • Rota el client_secret y devuelve el nuevo. Exige token de usuario (512) y client_app:update.

    El secreto anterior deja de valer en cuanto esto contesta, sin periodo de gracia: lo que siga usándolo recibe invalid_client en su siguiente petición de token. Y cambia también la firma de los webhooks, que es un HMAC con este mismo secreto: un receptor que la verifique rechazará las entregas legítimas hasta que se actualice. Repártelo antes de rotar, no después.

    Parameters

    Returns Promise<string>

  • El client_secret de la app. Exige token de usuario (512).

    Viene de Keycloak, así que es el secreto vivo y no una copia: trátalo como una credencial, no lo escribas en un log y no lo guardes donde no guardarías una contraseña.

    Parameters

    Returns Promise<string>

  • Cambia la app. Admite token de app: una app puede actualizar su propio registro.

    REEMPLAZA los cinco campos con lo que traiga el cuerpo. No es un PATCH: mandar una actualización sin webhook_url apaga el webhook, y sin redirect_urls deja la lista vacía — con lo que el flujo de conexión de cuentas deja de admitir ninguna redirección. Lee la app primero y devuélvela entera.

    Parameters

    • idClient: string
    • idApp: string
    • body: {
          allowed_domains?: string[];
          keycloak_client_idenfifier: string;
          name: string;
          redirect_urls?: string[];
          webhook_url?: string;
      }
      • Optionalallowed_domains?: string[]

        Origins allowed to call the API with this app's identity. Every entry has to be a valid URL (error 531).

      • keycloak_client_idenfifier: string

        The app's client_id, which is what you send to POST /oauth/token.

        **Format is enforced** (error 533): lowercase letters, numbers, `.`, `-` and `_`, starting with a letter or a number, between 3 and 64 characters — `shop-integration`, not `Shop Integration`. Keycloak itself accepts anything, so an identifier with a space in it used to create an app that could never get a token.
        
        It also has to be unique across PlanVortex (error 534), and **it cannot be changed once the app exists** (error 547): it is what your integration authenticates with, so renaming it would lock out everything already using the old one. Send it unchanged on an update, or leave it out. The spelling of the field is historical and kept for compatibility.
        
        shop-integration
        
      • name: string

        A name for the app. Cannot be blank (error 525).

      • Optionalredirect_urls?: string[]

        URLs the connect flow is allowed to come back to. A redirect_uri that is not in this list is refused when issuing a temporal connect token (error 532).

      • Optionalwebhook_url?: string

        Where PlanVortex posts events. Has to be a valid URL (error 535). See ClientApp.webhook_url for what arrives and how it is signed.

    • options: RequestOptions = {}

    Returns Promise<
        {
            _id: string;
            allowed_domains: string[];
            creation_date: string;
            deleted: boolean;
            deleted_date?: string;
            id_client: string;
            id_user?: string;
            keycloak_client_idenfifier: string;
            name: string;
            redirect_urls: string[];
            webhook_url?: string;
        },
    >