ApplicationInstall
A document representing one configured install of one Application. The platform creates and manages it; you read and (rarely) update it from inside connectors and custom nodes.
import ApplicationInstall from '@orchesty/nodejs-sdk/dist/lib/Application/Database/ApplicationInstall';
Methods provided #
| Method | Returns | Purpose |
|---|---|---|
getKey() | string | Application name (matches getName() of the Application class). |
getUser() | string | User identifier this install belongs to. |
getSettings() | Record<string, Record<string, unknown>> | Form values, organized by form key. Decrypted on read. |
addSettings(values) | this | Merge new encrypted settings (credentials, tokens). |
getNonEncryptedSettings() | Record<string, unknown> | Form values not subject to encryption (display fields, watermarks). |
addNonEncryptedSettings(values) | this | Merge new non-encrypted settings. |
getCreated() / getUpdated() | Date | Lifecycle timestamps. |
Persistence #
Use ApplicationInstallRepository (also exported by the SDK) to persist changes:
const install = await this.getApplicationInstallFromProcess(dto);
install.addNonEncryptedSettings({ lastSyncAt: new Date().toISOString() });
await this.applicationInstallRepository.update(install);