Skip to content

Commit

Permalink
fix: use domino by default for app create W-10809399 (#90)
Browse files Browse the repository at this point in the history
* fix: use domino by default for app create W-10809399
  • Loading branch information
reidaelliott authored Mar 23, 2022
1 parent 956d52c commit 0300f5c
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/lib/analytics/app/folder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export type AppFolder = Record<string, unknown> & {
templateSourceId?: string;
templateValues?: Record<string, unknown>;
templateVersion?: string;
templateOptions?: Record<string, unknown>;
};

export type CreateAppBody = {
Expand All @@ -39,15 +40,22 @@ export type CreateAppBody = {
assetIcon?: string;
templateValues?: Record<string, unknown>;
name?: string;
templateOptions?: {
dynamicOptions?: Record<string, unknown>;
appAction?: string;
disableApex?: boolean;
};
};

export default class Folder {
public readonly serverVersion: number;
private readonly connection: Connection;
private readonly foldersUrl: string;

public constructor(organization: Org) {
this.connection = organization.getConnection();
this.foldersUrl = `${this.connection.baseUrl()}/wave/folders/`;
this.serverVersion = +this.connection.getApiVersion();
}

public async fetch(folderid: string, includeLog = false): Promise<AppFolder> {
Expand All @@ -63,6 +71,13 @@ export default class Folder {
}

public async create(body: CreateAppBody): Promise<string | undefined> {
if (this.serverVersion >= 55.0) {
if (!body.templateOptions) {
body.templateOptions = { dynamicOptions: { productionType: 'ATF_3_0', runtimeLogEntryLevel: 'Warning' } };
} else if (!body.templateOptions.dynamicOptions) {
body.templateOptions.dynamicOptions = { productionType: 'ATF_3_0', runtimeLogEntryLevel: 'Warning' };
}
}
const response = await connectRequest<AppFolder>(this.connection, {
method: 'POST',
url: this.foldersUrl,
Expand Down

0 comments on commit 0300f5c

Please sign in to comment.