@gradientedge/cdk-utils-azure 2.33.0 → 2.35.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/dist/src/common/constants.d.ts +7 -1
  2. package/dist/src/common/constants.js +7 -1
  3. package/dist/src/common/construct.d.ts +47 -0
  4. package/dist/src/common/construct.js +45 -0
  5. package/dist/src/common/resource-name-formatter.d.ts +5 -0
  6. package/dist/src/common/resource-name-formatter.js +5 -0
  7. package/dist/src/common/stack.d.ts +29 -0
  8. package/dist/src/common/stack.js +29 -0
  9. package/dist/src/common/types.d.ts +53 -4
  10. package/dist/src/construct/event-handler/main.d.ts +4 -0
  11. package/dist/src/construct/event-handler/main.js +4 -0
  12. package/dist/src/construct/event-handler/types.d.ts +43 -6
  13. package/dist/src/construct/function-app/main.d.ts +23 -0
  14. package/dist/src/construct/function-app/main.js +23 -0
  15. package/dist/src/construct/function-app/types.d.ts +38 -3
  16. package/dist/src/construct/rest-api/main.d.ts +3 -0
  17. package/dist/src/construct/rest-api/main.js +3 -0
  18. package/dist/src/construct/rest-api/types.d.ts +26 -3
  19. package/dist/src/construct/rest-api-function/main.d.ts +2 -0
  20. package/dist/src/construct/rest-api-function/main.js +2 -0
  21. package/dist/src/construct/rest-api-function/types.d.ts +34 -4
  22. package/dist/src/construct/rest-api-with-cache/main.d.ts +2 -0
  23. package/dist/src/construct/rest-api-with-cache/main.js +1 -0
  24. package/dist/src/construct/rest-api-with-cache/types.d.ts +14 -2
  25. package/dist/src/construct/site-with-webapp/main.d.ts +3 -0
  26. package/dist/src/construct/site-with-webapp/main.js +3 -0
  27. package/dist/src/construct/site-with-webapp/types.d.ts +29 -3
  28. package/dist/src/services/api-management/types.d.ts +110 -17
  29. package/dist/src/services/app-configuration/types.d.ts +5 -1
  30. package/dist/src/services/app-service/types.d.ts +10 -2
  31. package/dist/src/services/application-insights/renderer.d.ts +21 -0
  32. package/dist/src/services/application-insights/renderer.js +21 -0
  33. package/dist/src/services/application-insights/types.d.ts +30 -4
  34. package/dist/src/services/authorisation/constants.d.ts +7 -0
  35. package/dist/src/services/authorisation/constants.js +7 -0
  36. package/dist/src/services/authorisation/types.d.ts +5 -1
  37. package/dist/src/services/cosmosdb/constants.d.ts +14 -2
  38. package/dist/src/services/cosmosdb/constants.js +14 -2
  39. package/dist/src/services/cosmosdb/types.d.ts +20 -4
  40. package/dist/src/services/dns/types.d.ts +20 -4
  41. package/dist/src/services/eventgrid/types.d.ts +25 -5
  42. package/dist/src/services/function/types.d.ts +27 -3
  43. package/dist/src/services/key-vault/types.d.ts +10 -2
  44. package/dist/src/services/monitor/types.d.ts +5 -1
  45. package/dist/src/services/operational-insights/types.d.ts +10 -2
  46. package/dist/src/services/portal/error.d.ts +16 -1
  47. package/dist/src/services/portal/error.js +16 -1
  48. package/dist/src/services/portal/renderer.d.ts +44 -1
  49. package/dist/src/services/portal/renderer.js +44 -1
  50. package/dist/src/services/portal/types.d.ts +61 -8
  51. package/dist/src/services/redis/types.d.ts +16 -3
  52. package/dist/src/services/resource-group/types.d.ts +5 -1
  53. package/dist/src/services/security-center/types.d.ts +5 -1
  54. package/dist/src/services/servicebus/types.d.ts +25 -5
  55. package/dist/src/services/storage/types.d.ts +38 -6
  56. package/dist/src/types/index.d.ts +5 -1
  57. package/package.json +5 -5
@@ -1,7 +1,28 @@
1
1
  import { WorkbookRenderer } from './types.js';
2
+ /**
3
+ * Renders Azure Application Insights workbook templates from YAML to JSON
4
+ * - Reads YAML templates from a configurable template directory
5
+ * - Compiles templates using Lodash template interpolation
6
+ * - Writes rendered JSON output to an artifacts directory
7
+ * @category Service
8
+ */
2
9
  export declare class AzureWorkbookRenderer implements WorkbookRenderer {
10
+ /** Absolute path to the directory containing workbook YAML templates */
3
11
  readonly templatePath: string;
12
+ /** Absolute path to the directory where rendered output files are written */
4
13
  readonly outputDir: string;
14
+ /**
15
+ * @summary Create a new AzureWorkbookRenderer
16
+ * @param basePath optional base path for workbook templates; defaults to '<appRoot>/template/workbook'
17
+ * @param outputDir optional output directory for rendered files; defaults to '<appRoot>/.artifacts'
18
+ */
5
19
  constructor(basePath?: string, outputDir?: string);
20
+ /**
21
+ * @summary Render a workbook template to a JSON file
22
+ * @param filename the output filename slug (used as '<filename>-workbook.json')
23
+ * @param templateId the template identifier to locate in the template directory
24
+ * @param variables the variables to substitute into the template using Lodash interpolation
25
+ * @returns the absolute path to the rendered output file
26
+ */
6
27
  renderToFile(filename: string, templateId: string, variables: Record<string, string>): string;
7
28
  }
@@ -3,13 +3,34 @@ import path from 'node:path';
3
3
  import appRoot from 'app-root-path';
4
4
  import { parse } from 'yaml';
5
5
  import _ from 'lodash';
6
+ /**
7
+ * Renders Azure Application Insights workbook templates from YAML to JSON
8
+ * - Reads YAML templates from a configurable template directory
9
+ * - Compiles templates using Lodash template interpolation
10
+ * - Writes rendered JSON output to an artifacts directory
11
+ * @category Service
12
+ */
6
13
  export class AzureWorkbookRenderer {
14
+ /** Absolute path to the directory containing workbook YAML templates */
7
15
  templatePath;
16
+ /** Absolute path to the directory where rendered output files are written */
8
17
  outputDir;
18
+ /**
19
+ * @summary Create a new AzureWorkbookRenderer
20
+ * @param basePath optional base path for workbook templates; defaults to '<appRoot>/template/workbook'
21
+ * @param outputDir optional output directory for rendered files; defaults to '<appRoot>/.artifacts'
22
+ */
9
23
  constructor(basePath, outputDir) {
10
24
  this.templatePath = basePath ?? path.join(appRoot.path, 'template', 'workbook');
11
25
  this.outputDir = outputDir ?? path.join(appRoot.path, '.artifacts');
12
26
  }
27
+ /**
28
+ * @summary Render a workbook template to a JSON file
29
+ * @param filename the output filename slug (used as '<filename>-workbook.json')
30
+ * @param templateId the template identifier to locate in the template directory
31
+ * @param variables the variables to substitute into the template using Lodash interpolation
32
+ * @returns the absolute path to the rendered output file
33
+ */
13
34
  renderToFile(filename, templateId, variables) {
14
35
  const templateFilePath = `${this.templatePath}/${templateId}.yaml`;
15
36
  const templateContent = fs.readFileSync(templateFilePath, 'utf-8');
@@ -1,18 +1,44 @@
1
1
  import { ComponentArgs, ComponentCurrentBillingFeatureArgs, WorkbookArgs } from '@pulumi/azure-native/applicationinsights/index.js';
2
- /** @category Interface */
2
+ /**
3
+ * Properties for configuring Application Insights billing features
4
+ * @see [Pulumi Azure Native Application Insights Billing Feature]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/insights/componentcurrentbillingfeature/}
5
+ * @category Interface
6
+ */
3
7
  export interface ComponentCurrentBillingFeatureProps extends ComponentCurrentBillingFeatureArgs {
4
8
  }
5
- /** @category Interface */
9
+ /**
10
+ * Properties for creating an Application Insights workbook
11
+ * @see [Pulumi Azure Native Application Insights Workbook]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/applicationinsights/workbook/}
12
+ * @category Interface
13
+ */
6
14
  export interface WorkbookProps extends WorkbookArgs {
15
+ /** Short slug identifier used as the workbook output filename */
7
16
  slug: string;
17
+ /** Template identifier used to locate the YAML workbook template */
8
18
  templateId: string;
19
+ /** Variables to substitute into the workbook template */
9
20
  variables: Record<string, any>;
10
21
  }
11
- /** @category Interface */
22
+ /**
23
+ * Properties for creating an Application Insights component
24
+ * @see [Pulumi Azure Native Application Insights Component]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/insights/component/}
25
+ * @category Interface
26
+ */
12
27
  export interface ApplicationInsightsProps extends ComponentArgs {
28
+ /** Optional billing feature configuration for the component */
13
29
  billingFeatures?: ComponentCurrentBillingFeatureProps;
14
30
  }
15
- /** @category Interface */
31
+ /**
32
+ * Interface for rendering workbook templates to files
33
+ * @category Interface
34
+ */
16
35
  export interface WorkbookRenderer {
36
+ /**
37
+ * Render a workbook template to a file
38
+ * @param filename the output filename slug
39
+ * @param templateId the template identifier to locate
40
+ * @param variables the variables to substitute into the template
41
+ * @returns the absolute path to the rendered output file
42
+ */
17
43
  renderToFile(filename: string, templateId: string, variables: Record<string, any>): string;
18
44
  }
@@ -4,11 +4,18 @@
4
4
  */
5
5
  /** @category Enum */
6
6
  export declare enum RoleDefinitionId {
7
+ /** Read-only access to Azure App Configuration key-values */
7
8
  APP_CONFIGURATION_DATA_READER = "/providers/Microsoft.Authorization/roleDefinitions/516239f1-63e1-4d78-a4de-a74fb236a071",
9
+ /** Full access to Azure App Configuration key-values */
8
10
  APP_CONFIGURATION_DATA_OWNER = "/providers/Microsoft.Authorization/roleDefinitions/5ae67dd6-50cb-40e7-96ff-dc2bfa4b606b",
11
+ /** Allows sending events to Event Grid topics */
9
12
  EVENTGRID_DATA_SENDER = "/providers/Microsoft.Authorization/roleDefinitions/d5a91429-5739-47e2-a06b-3470a27159e7",
13
+ /** Read certificates from Azure Key Vault */
10
14
  KEY_VAULT_CERTIFICATE_USER = "/providers/Microsoft.Authorization/roleDefinitions/db79e9a7-68ee-4b58-9aeb-b90e7c24fcba",
15
+ /** Read secrets from Azure Key Vault */
11
16
  KEY_VAULT_SECRETS_USER = "/providers/Microsoft.Authorization/roleDefinitions/4633458b-17de-408a-b874-0445c86b69e6",
17
+ /** Read, write, and delete Azure Storage blob data */
12
18
  STORAGE_BLOB_DATA_CONTRIBUTOR = "/providers/Microsoft.Authorization/roleDefinitions/ba92f5b4-2d11-453d-a403-e96b0029c9fe",
19
+ /** Read, write, and delete Azure Storage table data */
13
20
  STORAGE_TABLE_DATA_CONTRIBUTOR = "/providers/Microsoft.Authorization/roleDefinitions/0a9a7e1f-b9d0-4cc4-a60d-0319b160aaa3"
14
21
  }
@@ -5,11 +5,18 @@
5
5
  /** @category Enum */
6
6
  export var RoleDefinitionId;
7
7
  (function (RoleDefinitionId) {
8
+ /** Read-only access to Azure App Configuration key-values */
8
9
  RoleDefinitionId["APP_CONFIGURATION_DATA_READER"] = "/providers/Microsoft.Authorization/roleDefinitions/516239f1-63e1-4d78-a4de-a74fb236a071";
10
+ /** Full access to Azure App Configuration key-values */
9
11
  RoleDefinitionId["APP_CONFIGURATION_DATA_OWNER"] = "/providers/Microsoft.Authorization/roleDefinitions/5ae67dd6-50cb-40e7-96ff-dc2bfa4b606b";
12
+ /** Allows sending events to Event Grid topics */
10
13
  RoleDefinitionId["EVENTGRID_DATA_SENDER"] = "/providers/Microsoft.Authorization/roleDefinitions/d5a91429-5739-47e2-a06b-3470a27159e7";
14
+ /** Read certificates from Azure Key Vault */
11
15
  RoleDefinitionId["KEY_VAULT_CERTIFICATE_USER"] = "/providers/Microsoft.Authorization/roleDefinitions/db79e9a7-68ee-4b58-9aeb-b90e7c24fcba";
16
+ /** Read secrets from Azure Key Vault */
12
17
  RoleDefinitionId["KEY_VAULT_SECRETS_USER"] = "/providers/Microsoft.Authorization/roleDefinitions/4633458b-17de-408a-b874-0445c86b69e6";
18
+ /** Read, write, and delete Azure Storage blob data */
13
19
  RoleDefinitionId["STORAGE_BLOB_DATA_CONTRIBUTOR"] = "/providers/Microsoft.Authorization/roleDefinitions/ba92f5b4-2d11-453d-a403-e96b0029c9fe";
20
+ /** Read, write, and delete Azure Storage table data */
14
21
  RoleDefinitionId["STORAGE_TABLE_DATA_CONTRIBUTOR"] = "/providers/Microsoft.Authorization/roleDefinitions/0a9a7e1f-b9d0-4cc4-a60d-0319b160aaa3";
15
22
  })(RoleDefinitionId || (RoleDefinitionId = {}));
@@ -1,4 +1,8 @@
1
1
  import { RoleAssignmentArgs } from '@pulumi/azure-native/authorization/index.js';
2
- /** @category Interface */
2
+ /**
3
+ * Properties for creating an Azure role assignment
4
+ * @see [Pulumi Azure Native Role Assignment]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/authorization/roleassignment/}
5
+ * @category Interface
6
+ */
3
7
  export interface RoleAssignmentProps extends RoleAssignmentArgs {
4
8
  }
@@ -1,10 +1,22 @@
1
- /** @category Enum */
1
+ /**
2
+ * CosmosDB SQL role definition types
3
+ * @see https://learn.microsoft.com/en-us/azure/cosmos-db/how-to-setup-rbac
4
+ * @category Enum
5
+ */
2
6
  export declare enum CosmosRoleDefinition {
7
+ /** Full read-write access to CosmosDB SQL data */
3
8
  CONTRIBUTOR = "CONTRIBUTOR",
9
+ /** Read-only access to CosmosDB SQL data */
4
10
  READER = "READER"
5
11
  }
6
- /** @category Enum */
12
+ /**
13
+ * Built-in CosmosDB SQL role definition GUIDs
14
+ * @see https://learn.microsoft.com/en-us/azure/cosmos-db/how-to-setup-rbac#built-in-role-definitions
15
+ * @category Enum
16
+ */
7
17
  export declare enum CosmosRoleDefinitionId {
18
+ /** Built-in Cosmos DB Data Contributor role GUID */
8
19
  CONTRIBUTOR = "00000000-0000-0000-0000-000000000001",
20
+ /** Built-in Cosmos DB Data Reader role GUID */
9
21
  READER = "00000000-0000-0000-0000-000000000002"
10
22
  }
@@ -1,12 +1,24 @@
1
- /** @category Enum */
1
+ /**
2
+ * CosmosDB SQL role definition types
3
+ * @see https://learn.microsoft.com/en-us/azure/cosmos-db/how-to-setup-rbac
4
+ * @category Enum
5
+ */
2
6
  export var CosmosRoleDefinition;
3
7
  (function (CosmosRoleDefinition) {
8
+ /** Full read-write access to CosmosDB SQL data */
4
9
  CosmosRoleDefinition["CONTRIBUTOR"] = "CONTRIBUTOR";
10
+ /** Read-only access to CosmosDB SQL data */
5
11
  CosmosRoleDefinition["READER"] = "READER";
6
12
  })(CosmosRoleDefinition || (CosmosRoleDefinition = {}));
7
- /** @category Enum */
13
+ /**
14
+ * Built-in CosmosDB SQL role definition GUIDs
15
+ * @see https://learn.microsoft.com/en-us/azure/cosmos-db/how-to-setup-rbac#built-in-role-definitions
16
+ * @category Enum
17
+ */
8
18
  export var CosmosRoleDefinitionId;
9
19
  (function (CosmosRoleDefinitionId) {
20
+ /** Built-in Cosmos DB Data Contributor role GUID */
10
21
  CosmosRoleDefinitionId["CONTRIBUTOR"] = "00000000-0000-0000-0000-000000000001";
22
+ /** Built-in Cosmos DB Data Reader role GUID */
11
23
  CosmosRoleDefinitionId["READER"] = "00000000-0000-0000-0000-000000000002";
12
24
  })(CosmosRoleDefinitionId || (CosmosRoleDefinitionId = {}));
@@ -1,13 +1,29 @@
1
1
  import { DatabaseAccountArgs, SqlResourceSqlContainerArgs, SqlResourceSqlDatabaseArgs, SqlResourceSqlRoleAssignmentArgs } from '@pulumi/azure-native/cosmosdb/index.js';
2
- /** @category Interface */
2
+ /**
3
+ * Properties for creating a CosmosDB database account
4
+ * @see [Pulumi Azure Native CosmosDB Database Account]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/documentdb/databaseaccount/}
5
+ * @category Interface
6
+ */
3
7
  export interface CosmosdbAccountProps extends DatabaseAccountArgs {
4
8
  }
5
- /** @category Interface */
9
+ /**
10
+ * Properties for creating a CosmosDB SQL database
11
+ * @see [Pulumi Azure Native CosmosDB SQL Database]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/documentdb/sqlresourcesqldatabase/}
12
+ * @category Interface
13
+ */
6
14
  export interface CosmosdbSqlDatabaseProps extends SqlResourceSqlDatabaseArgs {
7
15
  }
8
- /** @category Interface */
16
+ /**
17
+ * Properties for creating a CosmosDB SQL container
18
+ * @see [Pulumi Azure Native CosmosDB SQL Container]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/documentdb/sqlresourcesqlcontainer/}
19
+ * @category Interface
20
+ */
9
21
  export interface CosmosdbSqlContainerProps extends SqlResourceSqlContainerArgs {
10
22
  }
11
- /** @category Interface */
23
+ /**
24
+ * Properties for creating a CosmosDB SQL role assignment
25
+ * @see [Pulumi Azure Native CosmosDB SQL Role Assignment]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/documentdb/sqlresourcesqlroleassignment/}
26
+ * @category Interface
27
+ */
12
28
  export interface SqlResourceSqlRoleAssignmentProps extends SqlResourceSqlRoleAssignmentArgs {
13
29
  }
@@ -1,13 +1,29 @@
1
1
  import { RecordSetArgs, ZoneArgs } from '@pulumi/azure-native/dns/index.js';
2
- /** @category Interface */
2
+ /**
3
+ * Properties for creating a DNS zone
4
+ * @see [Pulumi Azure Native DNS Zone]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/network/zone/}
5
+ * @category Interface
6
+ */
3
7
  export interface DnsZoneProps extends ZoneArgs {
4
8
  }
5
- /** @category Interface */
9
+ /**
10
+ * Properties for creating a DNS A record
11
+ * @see [Pulumi Azure Native DNS Record Set]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/network/recordset/}
12
+ * @category Interface
13
+ */
6
14
  export interface DnsARecordProps extends RecordSetArgs {
7
15
  }
8
- /** @category Interface */
16
+ /**
17
+ * Properties for creating a DNS CNAME record
18
+ * @see [Pulumi Azure Native DNS Record Set]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/network/recordset/}
19
+ * @category Interface
20
+ */
9
21
  export interface DnsCnameRecordProps extends RecordSetArgs {
10
22
  }
11
- /** @category Interface */
23
+ /**
24
+ * Properties for creating a DNS TXT record
25
+ * @see [Pulumi Azure Native DNS Record Set]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/network/recordset/}
26
+ * @category Interface
27
+ */
12
28
  export interface DnsTxtRecordProps extends RecordSetArgs {
13
29
  }
@@ -1,16 +1,36 @@
1
1
  import { EventSubscriptionArgs, GetTopicOutputArgs, SystemTopicArgs, SystemTopicEventSubscriptionArgs, TopicArgs } from '@pulumi/azure-native/eventgrid/index.js';
2
- /** @category Interface */
2
+ /**
3
+ * Properties for creating an EventGrid topic
4
+ * @see [Pulumi Azure Native Event Grid Topic]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/eventgrid/topic/}
5
+ * @category Interface
6
+ */
3
7
  export interface EventgridTopicProps extends TopicArgs {
4
8
  }
5
- /** @category Interface */
9
+ /**
10
+ * Properties for creating an EventGrid event subscription
11
+ * @see [Pulumi Azure Native Event Grid Event Subscription]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/eventgrid/eventsubscription/}
12
+ * @category Interface
13
+ */
6
14
  export interface EventgridEventSubscriptionProps extends EventSubscriptionArgs {
7
15
  }
8
- /** @category Interface */
16
+ /**
17
+ * Properties for creating an EventGrid system topic
18
+ * @see [Pulumi Azure Native Event Grid System Topic]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/eventgrid/systemtopic/}
19
+ * @category Interface
20
+ */
9
21
  export interface EventgridSystemTopicProps extends SystemTopicArgs {
10
22
  }
11
- /** @category Interface */
23
+ /**
24
+ * Properties for creating an EventGrid system topic event subscription
25
+ * @see [Pulumi Azure Native Event Grid System Topic Event Subscription]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/eventgrid/systemtopiceventsubscription/}
26
+ * @category Interface
27
+ */
12
28
  export interface EventgridSystemTopicEventSubscriptionProps extends SystemTopicEventSubscriptionArgs {
13
29
  }
14
- /** @category Interface */
30
+ /**
31
+ * Properties for resolving an existing EventGrid topic
32
+ * @see [Pulumi Azure Native Event Grid Topic]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/eventgrid/topic/}
33
+ * @category Interface
34
+ */
15
35
  export interface ResolveEventgridTopicProps extends GetTopicOutputArgs {
16
36
  }
@@ -1,23 +1,47 @@
1
1
  import { input } from '@pulumi/azure-native/types/index.js';
2
2
  import { WebAppArgs, WebAppFunctionArgs } from '@pulumi/azure-native/web/index.js';
3
- /** @category Interface */
3
+ /**
4
+ * Properties for creating an Azure Function App
5
+ * @see [Pulumi Azure Native Function App]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/web/webapp/}
6
+ * @category Interface
7
+ */
4
8
  export interface FunctionAppProps extends WebAppArgs {
9
+ /** Optional display name for the function app */
5
10
  name?: string;
6
11
  }
7
- /** @category Interface */
12
+ /**
13
+ * Properties for creating an individual function within a Function App
14
+ * @see [Pulumi Azure Native Function Envelope]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/web/webappfunction/}
15
+ * @category Interface
16
+ */
8
17
  export interface FunctionProps extends WebAppFunctionArgs {
18
+ /** Function name */
9
19
  name: string;
20
+ /** The resource ID of the parent function app */
10
21
  functionAppId: string;
22
+ /** Programming language of the function */
11
23
  language?: string;
24
+ /** Function configuration JSON (bindings, etc.) */
12
25
  configJson?: any;
26
+ /** Test data for the function */
13
27
  testData?: string;
28
+ /** Whether the function is enabled */
14
29
  enabled?: boolean;
15
30
  }
16
- /** @category Interface */
31
+ /**
32
+ * Properties for creating an Azure Function App with Flex Consumption hosting
33
+ * @see [Pulumi Azure Native Function App (Flex Consumption)]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/web/webapp/}
34
+ * @category Interface
35
+ */
17
36
  export interface FunctionAppFlexConsumptionProps extends WebAppArgs {
37
+ /** Optional display name for the function app */
18
38
  name?: string;
39
+ /** Runtime configuration (language and version) */
19
40
  runtime?: input.web.FunctionsRuntimeArgs;
41
+ /** Scale and concurrency configuration (instance memory, max instances) */
20
42
  scaleAndConcurrency?: input.web.FunctionsScaleAndConcurrencyArgs;
43
+ /** Storage authentication type for deployment storage */
21
44
  storageAuthenticationType?: string;
45
+ /** Storage container type for deployment storage */
22
46
  storageContainerType?: string;
23
47
  }
@@ -1,7 +1,15 @@
1
1
  import { SecretArgs, VaultArgs } from '@pulumi/azure-native/keyvault/index.js';
2
- /** @category Interface */
2
+ /**
3
+ * Properties for creating an Azure Key Vault
4
+ * @see [Pulumi Azure Native Key Vault]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/keyvault/vault/}
5
+ * @category Interface
6
+ */
3
7
  export interface KeyVaultProps extends VaultArgs {
4
8
  }
5
- /** @category Interface */
9
+ /**
10
+ * Properties for creating an Azure Key Vault secret
11
+ * @see [Pulumi Azure Native Key Vault Secret]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/keyvault/secret/}
12
+ * @category Interface
13
+ */
6
14
  export interface SecretProps extends SecretArgs {
7
15
  }
@@ -1,4 +1,8 @@
1
1
  import { DiagnosticSettingArgs } from '@pulumi/azure-native/monitor/index.js';
2
- /** @category Interface */
2
+ /**
3
+ * Properties for creating an Azure Monitor diagnostic setting
4
+ * @see [Pulumi Azure Native Monitor Diagnostic Settings]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/insights/diagnosticsetting/}
5
+ * @category Interface
6
+ */
3
7
  export interface MonitorDiagnosticSettingProps extends DiagnosticSettingArgs {
4
8
  }
@@ -1,7 +1,15 @@
1
1
  import { TableArgs, WorkspaceArgs } from '@pulumi/azure-native/operationalinsights/index.js';
2
- /** @category Interface */
2
+ /**
3
+ * Properties for creating a Log Analytics workspace
4
+ * @see [Pulumi Azure Native Operational Insights Workspace]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/operationalinsights/workspace/}
5
+ * @category Interface
6
+ */
3
7
  export interface WorkspaceProps extends WorkspaceArgs {
4
8
  }
5
- /** @category Interface */
9
+ /**
10
+ * Properties for creating a Log Analytics workspace table
11
+ * @see [Pulumi Azure Native Operational Insights Table]{@link https://www.pulumi.com/registry/packages/azure-native/api-docs/operationalinsights/table/}
12
+ * @category Interface
13
+ */
6
14
  export interface WorkspaceTableProps extends TableArgs {
7
15
  }
@@ -1,6 +1,21 @@
1
- /** @category Service */
1
+ /**
2
+ * Custom error class for dashboard template rendering failures
3
+ * - Thrown when required variables or properties are missing from a template
4
+ * - Use {@link TemplateError.isInstance} for type-safe error checking
5
+ * @category Service
6
+ */
2
7
  export declare class TemplateError extends Error {
8
+ /** Discriminator flag for identifying TemplateError instances */
3
9
  readonly isTemplateError = true;
10
+ /**
11
+ * @summary Create a new TemplateError
12
+ * @param message descriptive error message indicating the rendering failure
13
+ */
4
14
  constructor(message: string);
15
+ /**
16
+ * @summary Type guard to check if an unknown error is a TemplateError
17
+ * @param error the error to check
18
+ * @returns true if the error is a TemplateError instance
19
+ */
5
20
  static isInstance(error: unknown): error is TemplateError;
6
21
  }
@@ -1,10 +1,25 @@
1
- /** @category Service */
1
+ /**
2
+ * Custom error class for dashboard template rendering failures
3
+ * - Thrown when required variables or properties are missing from a template
4
+ * - Use {@link TemplateError.isInstance} for type-safe error checking
5
+ * @category Service
6
+ */
2
7
  export class TemplateError extends Error {
8
+ /** Discriminator flag for identifying TemplateError instances */
3
9
  isTemplateError = true;
10
+ /**
11
+ * @summary Create a new TemplateError
12
+ * @param message descriptive error message indicating the rendering failure
13
+ */
4
14
  constructor(message) {
5
15
  super(message);
6
16
  this.name = 'TemplateError';
7
17
  }
18
+ /**
19
+ * @summary Type guard to check if an unknown error is a TemplateError
20
+ * @param error the error to check
21
+ * @returns true if the error is a TemplateError instance
22
+ */
8
23
  static isInstance(error) {
9
24
  return error instanceof Object && 'isTemplateError' in error && error.isTemplateError === true;
10
25
  }
@@ -1,12 +1,55 @@
1
1
  import { DashboardRenderer, MissingKeys, PaneTemplate, RenderParams } from './types.js';
2
- /** @category Service */
2
+ /**
3
+ * Renders Azure Portal dashboard templates from YAML pane definitions into JSON
4
+ * - Reads pane templates from a configurable template directory
5
+ * - Compiles templates using Lodash template interpolation with `{{}}` delimiters
6
+ * - Validates required variables and properties before rendering
7
+ * - Assembles multiple panes into a single dashboard JSON structure
8
+ * @category Service
9
+ */
3
10
  export declare class AzureDashboardRenderer implements DashboardRenderer {
11
+ /** Absolute path to the directory containing pane YAML templates */
4
12
  readonly paneTemplatePath: string;
13
+ /** Absolute path to the directory where rendered dashboard files are written */
5
14
  readonly outputDir: string;
15
+ /**
16
+ * @summary Create a new AzureDashboardRenderer
17
+ * @param basePath optional base path for pane templates; defaults to '<appRoot>/template/dashboard'
18
+ * @param outputDir optional output directory for rendered files; defaults to '<appRoot>/.artifacts'
19
+ */
6
20
  constructor(basePath?: string, outputDir?: string);
21
+ /**
22
+ * @summary Load and parse a pane template by its identifier
23
+ * @param id the pane template identifier (corresponds to a YAML filename without extension)
24
+ * @returns the parsed pane template including dimensions, properties, variables, and template content
25
+ */
7
26
  protected getPaneId(id: string): PaneTemplate;
27
+ /**
28
+ * @summary Check for required properties that are missing from the render parameters
29
+ * @param template the pane template defining required properties
30
+ * @param properties the provided properties to check against the template
31
+ * @returns an object indicating which required property keys are missing
32
+ */
8
33
  getMissingProperties(template: PaneTemplate, properties?: RenderParams['properties']): MissingKeys;
34
+ /**
35
+ * @summary Check for required variables that are missing from the render parameters
36
+ * @param template the pane template defining required variables
37
+ * @param variables the provided variables to check against the template
38
+ * @returns an object indicating which required variable keys are missing
39
+ */
9
40
  getMissingVariables(template: PaneTemplate, variables: RenderParams['variables']): MissingKeys;
41
+ /**
42
+ * @summary Render a complete dashboard from multiple pane templates
43
+ * @param params render parameters including panes, variables, properties, and optional filter settings
44
+ * @returns the rendered dashboard JSON string
45
+ * @throws {@link TemplateError} if required variables or properties are missing
46
+ */
10
47
  render(params: RenderParams): string;
48
+ /**
49
+ * @summary Render a dashboard and write the output to a template file
50
+ * @param filename the output filename (used as '<filename>.tftpl')
51
+ * @param params render parameters including panes, variables, properties, and optional filter settings
52
+ * @returns the absolute path to the rendered output file
53
+ */
11
54
  renderToFile(filename: string, params: RenderParams): string;
12
55
  }
@@ -4,20 +4,45 @@ import appRoot from 'app-root-path';
4
4
  import _ from 'lodash';
5
5
  import { parse } from 'yaml';
6
6
  import { TemplateError } from './error.js';
7
- /** @category Service */
7
+ /**
8
+ * Renders Azure Portal dashboard templates from YAML pane definitions into JSON
9
+ * - Reads pane templates from a configurable template directory
10
+ * - Compiles templates using Lodash template interpolation with `{{}}` delimiters
11
+ * - Validates required variables and properties before rendering
12
+ * - Assembles multiple panes into a single dashboard JSON structure
13
+ * @category Service
14
+ */
8
15
  export class AzureDashboardRenderer {
16
+ /** Absolute path to the directory containing pane YAML templates */
9
17
  paneTemplatePath;
18
+ /** Absolute path to the directory where rendered dashboard files are written */
10
19
  outputDir;
20
+ /**
21
+ * @summary Create a new AzureDashboardRenderer
22
+ * @param basePath optional base path for pane templates; defaults to '<appRoot>/template/dashboard'
23
+ * @param outputDir optional output directory for rendered files; defaults to '<appRoot>/.artifacts'
24
+ */
11
25
  constructor(basePath, outputDir) {
12
26
  this.paneTemplatePath = basePath ?? path.join(appRoot.path, 'template', 'dashboard');
13
27
  this.outputDir = outputDir ?? path.join(appRoot.path, '.artifacts');
14
28
  }
29
+ /**
30
+ * @summary Load and parse a pane template by its identifier
31
+ * @param id the pane template identifier (corresponds to a YAML filename without extension)
32
+ * @returns the parsed pane template including dimensions, properties, variables, and template content
33
+ */
15
34
  getPaneId(id) {
16
35
  const panePath = `${this.paneTemplatePath}/${id}.yaml`;
17
36
  const paneFileContent = fs.readFileSync(panePath, 'utf-8');
18
37
  const paneTemplate = parse(paneFileContent);
19
38
  return paneTemplate;
20
39
  }
40
+ /**
41
+ * @summary Check for required properties that are missing from the render parameters
42
+ * @param template the pane template defining required properties
43
+ * @param properties the provided properties to check against the template
44
+ * @returns an object indicating which required property keys are missing
45
+ */
21
46
  getMissingProperties(template, properties = []) {
22
47
  const keys = Object.keys(template.properties ?? {}).filter(key => !(key in properties));
23
48
  return {
@@ -25,6 +50,12 @@ export class AzureDashboardRenderer {
25
50
  hasMissingKeys: keys.length !== 0,
26
51
  };
27
52
  }
53
+ /**
54
+ * @summary Check for required variables that are missing from the render parameters
55
+ * @param template the pane template defining required variables
56
+ * @param variables the provided variables to check against the template
57
+ * @returns an object indicating which required variable keys are missing
58
+ */
28
59
  getMissingVariables(template, variables) {
29
60
  const keys = Object.keys(template.variables ?? {}).filter(key => !(key in variables));
30
61
  return {
@@ -32,6 +63,12 @@ export class AzureDashboardRenderer {
32
63
  hasMissingKeys: keys.length !== 0,
33
64
  };
34
65
  }
66
+ /**
67
+ * @summary Render a complete dashboard from multiple pane templates
68
+ * @param params render parameters including panes, variables, properties, and optional filter settings
69
+ * @returns the rendered dashboard JSON string
70
+ * @throws {@link TemplateError} if required variables or properties are missing
71
+ */
35
72
  render(params) {
36
73
  _.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
37
74
  // if client is used instead of hosts
@@ -143,6 +180,12 @@ export class AzureDashboardRenderer {
143
180
  };
144
181
  return JSON.stringify(dashboard, null, 2);
145
182
  }
183
+ /**
184
+ * @summary Render a dashboard and write the output to a template file
185
+ * @param filename the output filename (used as '<filename>.tftpl')
186
+ * @param params render parameters including panes, variables, properties, and optional filter settings
187
+ * @returns the absolute path to the rendered output file
188
+ */
146
189
  renderToFile(filename, params) {
147
190
  const templateOutput = this.render(params);
148
191
  if (!fs.existsSync(this.outputDir)) {