| 60 | } |
| 61 | |
| 62 | export async function listApplications( |
| 63 | client: AppConfigClient, |
| 64 | maxResults?: number | null, |
| 65 | nextToken?: string | null |
| 66 | ) { |
| 67 | const response = await client.send( |
| 68 | new ListApplicationsCommand({ |
| 69 | ...(maxResults ? { MaxResults: maxResults } : {}), |
| 70 | ...(nextToken ? { NextToken: nextToken } : {}), |
| 71 | }) |
| 72 | ) |
| 73 | |
| 74 | const applications = (response.Items ?? []).map((item) => ({ |
| 75 | id: item.Id ?? '', |
| 76 | name: item.Name ?? '', |
| 77 | description: item.Description ?? null, |
| 78 | })) |
| 79 | |
| 80 | return { |
| 81 | applications, |
| 82 | nextToken: response.NextToken ?? null, |
| 83 | count: applications.length, |
| 84 | } |
| 85 | } |
| 86 | |
| 87 | export async function createApplication( |
| 88 | client: AppConfigClient, |