@rpothin/powerplatform 0.1.1

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.
package/provider.ts ADDED
@@ -0,0 +1,44 @@
1
+ // *** WARNING: this file was generated by pulumi-language-nodejs. ***
2
+ // *** Do not edit by hand unless you're certain you know what you are doing! ***
3
+
4
+ import * as pulumi from "@pulumi/pulumi";
5
+ import * as utilities from "./utilities";
6
+
7
+ export class Provider extends pulumi.ProviderResource {
8
+ /** @internal */
9
+ public static readonly __pulumiType = 'powerplatform';
10
+
11
+ /**
12
+ * Returns true if the given object is an instance of Provider. This is designed to work even
13
+ * when multiple copies of the Pulumi SDK have been loaded into the same process.
14
+ */
15
+ public static isInstance(obj: any): obj is Provider {
16
+ if (obj === undefined || obj === null) {
17
+ return false;
18
+ }
19
+ return obj['__pulumiType'] === "pulumi:providers:" + Provider.__pulumiType;
20
+ }
21
+
22
+
23
+ /**
24
+ * Create a Provider resource with the given unique name, arguments, and options.
25
+ *
26
+ * @param name The _unique_ name of the resource.
27
+ * @param args The arguments to use to populate this resource's properties.
28
+ * @param opts A bag of options that control this resource's behavior.
29
+ */
30
+ constructor(name: string, args?: ProviderArgs, opts?: pulumi.ResourceOptions) {
31
+ let resourceInputs: pulumi.Inputs = {};
32
+ opts = opts || {};
33
+ {
34
+ }
35
+ opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
36
+ super(Provider.__pulumiType, name, resourceInputs, opts);
37
+ }
38
+ }
39
+
40
+ /**
41
+ * The set of arguments for constructing a Provider resource.
42
+ */
43
+ export interface ProviderArgs {
44
+ }
@@ -0,0 +1,115 @@
1
+ // *** WARNING: this file was generated by pulumi-language-nodejs. ***
2
+ // *** Do not edit by hand unless you're certain you know what you are doing! ***
3
+
4
+ import * as pulumi from "@pulumi/pulumi";
5
+ import * as utilities from "./utilities";
6
+
7
+ /**
8
+ * Assigns a role to a principal (user, group, or service principal) at a specified scope. Role assignments are immutable — any change to inputs triggers replacement.
9
+ */
10
+ export class RoleAssignment extends pulumi.CustomResource {
11
+ /**
12
+ * Get an existing RoleAssignment resource's state with the given name, ID, and optional extra
13
+ * properties used to qualify the lookup.
14
+ *
15
+ * @param name The _unique_ name of the resulting resource.
16
+ * @param id The _unique_ provider ID of the resource to lookup.
17
+ * @param opts Optional settings to control the behavior of the CustomResource.
18
+ */
19
+ public static get(name: string, id: pulumi.Input<pulumi.ID>, opts?: pulumi.CustomResourceOptions): RoleAssignment {
20
+ return new RoleAssignment(name, undefined as any, { ...opts, id: id });
21
+ }
22
+
23
+ /** @internal */
24
+ public static readonly __pulumiType = 'powerplatform:index:RoleAssignment';
25
+
26
+ /**
27
+ * Returns true if the given object is an instance of RoleAssignment. This is designed to work even
28
+ * when multiple copies of the Pulumi SDK have been loaded into the same process.
29
+ */
30
+ public static isInstance(obj: any): obj is RoleAssignment {
31
+ if (obj === undefined || obj === null) {
32
+ return false;
33
+ }
34
+ return obj['__pulumiType'] === RoleAssignment.__pulumiType;
35
+ }
36
+
37
+ /**
38
+ * The timestamp when the role assignment was created.
39
+ */
40
+ declare public /*out*/ readonly createdOn: pulumi.Output<string | undefined>;
41
+ /**
42
+ * The object ID of the assigned principal.
43
+ */
44
+ declare public readonly principalObjectId: pulumi.Output<string>;
45
+ /**
46
+ * The type of the assigned principal.
47
+ */
48
+ declare public readonly principalType: pulumi.Output<string>;
49
+ /**
50
+ * The role definition ID.
51
+ */
52
+ declare public readonly roleDefinitionId: pulumi.Output<string>;
53
+ /**
54
+ * The scope of the role assignment.
55
+ */
56
+ declare public readonly scope: pulumi.Output<string | undefined>;
57
+
58
+ /**
59
+ * Create a RoleAssignment resource with the given unique name, arguments, and options.
60
+ *
61
+ * @param name The _unique_ name of the resource.
62
+ * @param args The arguments to use to populate this resource's properties.
63
+ * @param opts A bag of options that control this resource's behavior.
64
+ */
65
+ constructor(name: string, args: RoleAssignmentArgs, opts?: pulumi.CustomResourceOptions) {
66
+ let resourceInputs: pulumi.Inputs = {};
67
+ opts = opts || {};
68
+ if (!opts.id) {
69
+ if (args?.principalObjectId === undefined && !opts.urn) {
70
+ throw new Error("Missing required property 'principalObjectId'");
71
+ }
72
+ if (args?.principalType === undefined && !opts.urn) {
73
+ throw new Error("Missing required property 'principalType'");
74
+ }
75
+ if (args?.roleDefinitionId === undefined && !opts.urn) {
76
+ throw new Error("Missing required property 'roleDefinitionId'");
77
+ }
78
+ resourceInputs["principalObjectId"] = args?.principalObjectId;
79
+ resourceInputs["principalType"] = args?.principalType;
80
+ resourceInputs["roleDefinitionId"] = args?.roleDefinitionId;
81
+ resourceInputs["scope"] = args?.scope;
82
+ resourceInputs["createdOn"] = undefined /*out*/;
83
+ } else {
84
+ resourceInputs["createdOn"] = undefined /*out*/;
85
+ resourceInputs["principalObjectId"] = undefined /*out*/;
86
+ resourceInputs["principalType"] = undefined /*out*/;
87
+ resourceInputs["roleDefinitionId"] = undefined /*out*/;
88
+ resourceInputs["scope"] = undefined /*out*/;
89
+ }
90
+ opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
91
+ super(RoleAssignment.__pulumiType, name, resourceInputs, opts);
92
+ }
93
+ }
94
+
95
+ /**
96
+ * The set of arguments for constructing a RoleAssignment resource.
97
+ */
98
+ export interface RoleAssignmentArgs {
99
+ /**
100
+ * The object ID of the principal (user, group, or service principal) to assign the role to.
101
+ */
102
+ principalObjectId: pulumi.Input<string>;
103
+ /**
104
+ * The type of the principal: User, Group, or ServicePrincipal.
105
+ */
106
+ principalType: pulumi.Input<string>;
107
+ /**
108
+ * The ID of the role definition to assign.
109
+ */
110
+ roleDefinitionId: pulumi.Input<string>;
111
+ /**
112
+ * The scope of the role assignment (e.g., tenant, environment, or environment group).
113
+ */
114
+ scope?: pulumi.Input<string>;
115
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,44 @@
1
+ {
2
+ "compilerOptions": {
3
+ // Output
4
+ "outDir": "bin",
5
+ "declaration": true,
6
+ "declarationMap": true,
7
+ "sourceMap": true,
8
+ "stripInternal": true,
9
+ // Environment
10
+ "target": "ES2022",
11
+ "module": "nodenext",
12
+ "moduleResolution": "nodenext",
13
+ "moduleDetection": "force",
14
+ "types": ["node"],
15
+ // Type Checking
16
+ "strict": true,
17
+ "noFallthroughCasesInSwitch": true,
18
+ "noImplicitReturns": true,
19
+ "skipLibCheck": true
20
+ },
21
+ "files": [
22
+ "billingPolicy.ts",
23
+ "config/index.ts",
24
+ "config/vars.ts",
25
+ "dlpPolicy.ts",
26
+ "environment.ts",
27
+ "environmentBackup.ts",
28
+ "environmentGroup.ts",
29
+ "environmentSettings.ts",
30
+ "getApps.ts",
31
+ "getConnectors.ts",
32
+ "getEnvironments.ts",
33
+ "getFlows.ts",
34
+ "index.ts",
35
+ "isvContract.ts",
36
+ "managedEnvironment.ts",
37
+ "provider.ts",
38
+ "roleAssignment.ts",
39
+ "types/index.ts",
40
+ "types/input.ts",
41
+ "types/output.ts",
42
+ "utilities.ts"
43
+ ]
44
+ }
package/types/index.ts ADDED
@@ -0,0 +1,13 @@
1
+ // *** WARNING: this file was generated by pulumi-language-nodejs. ***
2
+ // *** Do not edit by hand unless you're certain you know what you are doing! ***
3
+
4
+ import * as utilities from "../utilities";
5
+
6
+ // Export sub-modules:
7
+ import * as input from "./input";
8
+ import * as output from "./output";
9
+
10
+ export {
11
+ input,
12
+ output,
13
+ };
package/types/input.ts ADDED
@@ -0,0 +1,42 @@
1
+ // *** WARNING: this file was generated by pulumi-language-nodejs. ***
2
+ // *** Do not edit by hand unless you're certain you know what you are doing! ***
3
+
4
+ import * as pulumi from "@pulumi/pulumi";
5
+ import * as inputs from "../types/input";
6
+ import * as outputs from "../types/output";
7
+
8
+ /**
9
+ * Azure billing instrument (subscription) details for a billing policy.
10
+ */
11
+ export interface BillingInstrumentArgs {
12
+ /**
13
+ * The billing instrument identifier.
14
+ */
15
+ id?: pulumi.Input<string>;
16
+ /**
17
+ * The Azure resource group within the subscription.
18
+ */
19
+ resourceGroup?: pulumi.Input<string>;
20
+ /**
21
+ * The Azure subscription ID.
22
+ */
23
+ subscriptionId?: pulumi.Input<string>;
24
+ }
25
+
26
+ /**
27
+ * A rule set for a DLP policy, defining data loss prevention rules.
28
+ */
29
+ export interface RuleSetArgs {
30
+ /**
31
+ * The unique identifier of the rule set.
32
+ */
33
+ id?: pulumi.Input<string>;
34
+ /**
35
+ * The inputs for the rule set, which may vary based on the rule.
36
+ */
37
+ inputs?: pulumi.Input<{[key: string]: any}>;
38
+ /**
39
+ * The version of the rule set.
40
+ */
41
+ version?: pulumi.Input<string>;
42
+ }
@@ -0,0 +1,159 @@
1
+ // *** WARNING: this file was generated by pulumi-language-nodejs. ***
2
+ // *** Do not edit by hand unless you're certain you know what you are doing! ***
3
+
4
+ import * as pulumi from "@pulumi/pulumi";
5
+ import * as inputs from "../types/input";
6
+ import * as outputs from "../types/output";
7
+
8
+ /**
9
+ * Summary information about a Power App.
10
+ */
11
+ export interface AppSummary {
12
+ /**
13
+ * The display name of the app.
14
+ */
15
+ displayName?: string;
16
+ /**
17
+ * The unique identifier of the app.
18
+ */
19
+ id?: string;
20
+ /**
21
+ * The internal name of the app.
22
+ */
23
+ name?: string;
24
+ }
25
+
26
+ /**
27
+ * Azure billing instrument (subscription) details for a billing policy.
28
+ */
29
+ export interface BillingInstrument {
30
+ /**
31
+ * The billing instrument identifier.
32
+ */
33
+ id?: string;
34
+ /**
35
+ * The Azure resource group within the subscription.
36
+ */
37
+ resourceGroup?: string;
38
+ /**
39
+ * The Azure subscription ID.
40
+ */
41
+ subscriptionId?: string;
42
+ }
43
+
44
+ /**
45
+ * Summary information about a Power Platform connector.
46
+ */
47
+ export interface ConnectorSummary {
48
+ /**
49
+ * The display name of the connector.
50
+ */
51
+ displayName?: string;
52
+ /**
53
+ * The unique identifier of the connector.
54
+ */
55
+ id?: string;
56
+ /**
57
+ * The internal name of the connector.
58
+ */
59
+ name?: string;
60
+ /**
61
+ * The type of the connector.
62
+ */
63
+ type?: string;
64
+ }
65
+
66
+ /**
67
+ * Summary information about a Power Platform environment.
68
+ */
69
+ export interface EnvironmentSummary {
70
+ /**
71
+ * The Azure region of the environment.
72
+ */
73
+ azureRegion?: string;
74
+ /**
75
+ * The Dataverse organization ID.
76
+ */
77
+ dataverseId?: string;
78
+ /**
79
+ * The display name of the environment.
80
+ */
81
+ displayName?: string;
82
+ /**
83
+ * The domain name of the Dataverse database.
84
+ */
85
+ domainName?: string;
86
+ /**
87
+ * The environment group to which this environment belongs.
88
+ */
89
+ environmentGroupId?: string;
90
+ /**
91
+ * The geographical region of the environment.
92
+ */
93
+ geo?: string;
94
+ /**
95
+ * The unique identifier of the environment.
96
+ */
97
+ id?: string;
98
+ /**
99
+ * The security group that controls access.
100
+ */
101
+ securityGroupId?: string;
102
+ /**
103
+ * The current state of the environment.
104
+ */
105
+ state?: string;
106
+ /**
107
+ * The tenant that the environment belongs to.
108
+ */
109
+ tenantId?: string;
110
+ /**
111
+ * The type (SKU) of the environment.
112
+ */
113
+ type?: string;
114
+ /**
115
+ * The URL of the Dataverse database.
116
+ */
117
+ url?: string;
118
+ /**
119
+ * The version of the Dataverse database.
120
+ */
121
+ version?: string;
122
+ }
123
+
124
+ /**
125
+ * Summary information about a Cloud Flow.
126
+ */
127
+ export interface FlowSummary {
128
+ /**
129
+ * The display name of the flow.
130
+ */
131
+ displayName?: string;
132
+ /**
133
+ * The unique identifier of the flow.
134
+ */
135
+ id?: string;
136
+ /**
137
+ * The internal name of the flow.
138
+ */
139
+ name?: string;
140
+ }
141
+
142
+ /**
143
+ * A rule set for a DLP policy, defining data loss prevention rules.
144
+ */
145
+ export interface RuleSet {
146
+ /**
147
+ * The unique identifier of the rule set.
148
+ */
149
+ id?: string;
150
+ /**
151
+ * The inputs for the rule set, which may vary based on the rule.
152
+ */
153
+ inputs?: {[key: string]: any};
154
+ /**
155
+ * The version of the rule set.
156
+ */
157
+ version?: string;
158
+ }
159
+
package/utilities.ts ADDED
@@ -0,0 +1,96 @@
1
+ // *** WARNING: this file was generated by pulumi-language-nodejs. ***
2
+ // *** Do not edit by hand unless you're certain you know what you are doing! ***
3
+
4
+
5
+ import * as runtime from "@pulumi/pulumi/runtime";
6
+ import * as pulumi from "@pulumi/pulumi";
7
+
8
+ export function getEnv(...vars: string[]): string | undefined {
9
+ for (const v of vars) {
10
+ const value = process.env[v];
11
+ if (value) {
12
+ return value;
13
+ }
14
+ }
15
+ return undefined;
16
+ }
17
+
18
+ export function getEnvBoolean(...vars: string[]): boolean | undefined {
19
+ const s = getEnv(...vars);
20
+ if (s !== undefined) {
21
+ // NOTE: these values are taken from https://golang.org/src/strconv/atob.go?s=351:391#L1, which is what
22
+ // Terraform uses internally when parsing boolean values.
23
+ if (["1", "t", "T", "true", "TRUE", "True"].find(v => v === s) !== undefined) {
24
+ return true;
25
+ }
26
+ if (["0", "f", "F", "false", "FALSE", "False"].find(v => v === s) !== undefined) {
27
+ return false;
28
+ }
29
+ }
30
+ return undefined;
31
+ }
32
+
33
+ export function getEnvNumber(...vars: string[]): number | undefined {
34
+ const s = getEnv(...vars);
35
+ if (s !== undefined) {
36
+ const f = parseFloat(s);
37
+ if (!isNaN(f)) {
38
+ return f;
39
+ }
40
+ }
41
+ return undefined;
42
+ }
43
+
44
+ export function getVersion(): string {
45
+ let version = require('./package.json').version;
46
+ // Node allows for the version to be prefixed by a "v", while semver doesn't.
47
+ // If there is a v, strip it off.
48
+ if (version.indexOf('v') === 0) {
49
+ version = version.slice(1);
50
+ }
51
+ return version;
52
+ }
53
+
54
+ /** @internal */
55
+ export function resourceOptsDefaults(): any {
56
+ return { version: getVersion(), pluginDownloadURL: "github://api.github.com/rpothin" };
57
+ }
58
+
59
+ /** @internal */
60
+ export function lazyLoad(exports: any, props: string[], loadModule: any) {
61
+ for (let property of props) {
62
+ Object.defineProperty(exports, property, {
63
+ enumerable: true,
64
+ get: function() {
65
+ return loadModule()[property];
66
+ },
67
+ });
68
+ }
69
+ }
70
+
71
+ /** @internal */
72
+ export async function callAsync<T>(
73
+ tok: string,
74
+ props: pulumi.Inputs,
75
+ res?: pulumi.Resource,
76
+ opts?: {property?: string},
77
+ ): Promise<T> {
78
+ const o: any = runtime.call<T>(tok, props, res);
79
+ const value = await o.promise(true /*withUnknowns*/);
80
+ const isKnown = await o.isKnown;
81
+ const isSecret = await o.isSecret;
82
+ const problem: string|undefined =
83
+ !isKnown ? "an unknown value"
84
+ : isSecret ? "a secret value"
85
+ : undefined;
86
+ // Ingoring o.resources silently. They are typically non-empty, r.f() calls include r as a dependency.
87
+ if (problem) {
88
+ throw new Error(`Plain resource method "${tok}" incorrectly returned ${problem}. ` +
89
+ "This is an error in the provider, please report this to the provider developer.");
90
+ }
91
+ // Extract a single property if requested.
92
+ if (opts && opts.property) {
93
+ return value[opts.property];
94
+ }
95
+ return value;
96
+ }