Skip to content

Commit 0a6cca9

Browse files
authored
[APP-7814] Add GetAppContent API (#500)
1 parent 0028acf commit 0a6cca9

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed

src/app/app-client.spec.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1734,6 +1734,29 @@ describe('AppClient tests', () => {
17341734
});
17351735
});
17361736

1737+
describe('getAppContent tests', () => {
1738+
beforeEach(() => {
1739+
mockTransport = createRouterTransport(({ service }) => {
1740+
service(AppService, {
1741+
getAppContent: () =>
1742+
new pb.GetAppContentResponse({
1743+
blobPath: '/path/to/blob',
1744+
entrypoint: 'index.html',
1745+
}),
1746+
});
1747+
});
1748+
});
1749+
1750+
it('getAppContent', async () => {
1751+
const response = await subject().getAppContent(
1752+
'publicNamespace',
1753+
'machineName'
1754+
);
1755+
expect(response.blobPath).toEqual('/path/to/blob');
1756+
expect(response.entrypoint).toEqual('index.html');
1757+
});
1758+
});
1759+
17371760
describe('getOrganizationMetadata', () => {
17381761
beforeEach(() => {
17391762
mockTransport = createRouterTransport(({ service }) => {

src/app/app-client.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
CreateModuleResponse,
1313
Fragment,
1414
FragmentVisibility,
15+
GetAppContentResponse,
1516
GetRobotPartLogsResponse,
1617
GetRobotPartResponse,
1718
ListOrganizationMembersResponse,
@@ -1177,6 +1178,20 @@ export class AppClient {
11771178
return this.client.createKeyFromExistingKeyAuthorizations({ id });
11781179
}
11791180

1181+
/**
1182+
* Retrieves the app content for an organization.
1183+
*
1184+
* @param publicNamespace The public namespace of the organization
1185+
* @param name The name of the app
1186+
* @returns The blob path and entrypoint of the app content
1187+
*/
1188+
async getAppContent(
1189+
publicNamespace: string,
1190+
name: string
1191+
): Promise<GetAppContentResponse> {
1192+
return this.client.getAppContent({ publicNamespace, name });
1193+
}
1194+
11801195
/**
11811196
* Retrieves user-defined metadata for an organization.
11821197
*

0 commit comments

Comments
 (0)