@pulumi/slack 0.0.1-alpha.1647888073
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/LICENSE +202 -0
- package/README.md +55 -0
- package/config/index.d.ts +1 -0
- package/config/index.js +21 -0
- package/config/index.js.map +1 -0
- package/config/vars.d.ts +4 -0
- package/config/vars.js +13 -0
- package/config/vars.js.map +1 -0
- package/conversation.d.ts +235 -0
- package/conversation.js +137 -0
- package/conversation.js.map +1 -0
- package/getConversation.d.ts +108 -0
- package/getConversation.js +52 -0
- package/getConversation.js.map +1 -0
- package/getUser.d.ts +73 -0
- package/getUser.js +57 -0
- package/getUser.js.map +1 -0
- package/getUsergroup.d.ts +88 -0
- package/getUsergroup.js +55 -0
- package/getUsergroup.js.map +1 -0
- package/index.d.ts +8 -0
- package/index.js +60 -0
- package/index.js.map +1 -0
- package/package.json +28 -0
- package/package.json.bak +28 -0
- package/package.json.dev +28 -0
- package/provider.d.ts +35 -0
- package/provider.js +48 -0
- package/provider.js.map +1 -0
- package/scripts/install-pulumi-plugin.js +21 -0
- package/usergroup.d.ts +166 -0
- package/usergroup.js +121 -0
- package/usergroup.js.map +1 -0
- package/utilities.d.ts +4 -0
- package/utilities.js +57 -0
- package/utilities.js.map +1 -0
package/provider.js
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
|
|
3
|
+
// *** Do not edit by hand unless you're certain you know what you are doing! ***
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.Provider = void 0;
|
|
6
|
+
const pulumi = require("@pulumi/pulumi");
|
|
7
|
+
const utilities = require("./utilities");
|
|
8
|
+
/**
|
|
9
|
+
* The provider type for the slack package. By default, resources use package-wide configuration
|
|
10
|
+
* settings, however an explicit `Provider` instance may be created and passed during resource
|
|
11
|
+
* construction to achieve fine-grained programmatic control over provider settings. See the
|
|
12
|
+
* [documentation](https://www.pulumi.com/docs/reference/programming-model/#providers) for more information.
|
|
13
|
+
*/
|
|
14
|
+
class Provider extends pulumi.ProviderResource {
|
|
15
|
+
/**
|
|
16
|
+
* Create a Provider resource with the given unique name, arguments, and options.
|
|
17
|
+
*
|
|
18
|
+
* @param name The _unique_ name of the resource.
|
|
19
|
+
* @param args The arguments to use to populate this resource's properties.
|
|
20
|
+
* @param opts A bag of options that control this resource's behavior.
|
|
21
|
+
*/
|
|
22
|
+
constructor(name, args, opts) {
|
|
23
|
+
let resourceInputs = {};
|
|
24
|
+
opts = opts || {};
|
|
25
|
+
{
|
|
26
|
+
if ((!args || args.token === undefined) && !opts.urn) {
|
|
27
|
+
throw new Error("Missing required property 'token'");
|
|
28
|
+
}
|
|
29
|
+
resourceInputs["token"] = args ? args.token : undefined;
|
|
30
|
+
}
|
|
31
|
+
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
|
|
32
|
+
super(Provider.__pulumiType, name, resourceInputs, opts);
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Returns true if the given object is an instance of Provider. This is designed to work even
|
|
36
|
+
* when multiple copies of the Pulumi SDK have been loaded into the same process.
|
|
37
|
+
*/
|
|
38
|
+
static isInstance(obj) {
|
|
39
|
+
if (obj === undefined || obj === null) {
|
|
40
|
+
return false;
|
|
41
|
+
}
|
|
42
|
+
return obj['__pulumiType'] === Provider.__pulumiType;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
exports.Provider = Provider;
|
|
46
|
+
/** @internal */
|
|
47
|
+
Provider.__pulumiType = 'slack';
|
|
48
|
+
//# sourceMappingURL=provider.js.map
|
package/provider.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provider.js","sourceRoot":"","sources":["../provider.ts"],"names":[],"mappings":";AAAA,wFAAwF;AACxF,iFAAiF;;;AAEjF,yCAAyC;AACzC,yCAAyC;AAEzC;;;;;GAKG;AACH,MAAa,QAAS,SAAQ,MAAM,CAAC,gBAAgB;IAoBjD;;;;;;OAMG;IACH,YAAY,IAAY,EAAE,IAAkB,EAAE,IAA6B;QACvE,IAAI,cAAc,GAAkB,EAAE,CAAC;QACvC,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC;QAClB;YACI,IAAI,CAAC,CAAC,IAAI,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE;gBAClD,MAAM,IAAI,KAAK,CAAC,mCAAmC,CAAC,CAAC;aACxD;YACD,cAAc,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;SAC3D;QACD,IAAI,GAAG,MAAM,CAAC,YAAY,CAAC,SAAS,CAAC,oBAAoB,EAAE,EAAE,IAAI,CAAC,CAAC;QACnE,KAAK,CAAC,QAAQ,CAAC,YAAY,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,CAAC,CAAC;IAC7D,CAAC;IAlCD;;;OAGG;IACI,MAAM,CAAC,UAAU,CAAC,GAAQ;QAC7B,IAAI,GAAG,KAAK,SAAS,IAAI,GAAG,KAAK,IAAI,EAAE;YACnC,OAAO,KAAK,CAAC;SAChB;QACD,OAAO,GAAG,CAAC,cAAc,CAAC,KAAK,QAAQ,CAAC,YAAY,CAAC;IACzD,CAAC;;AAbL,4BAuCC;AAtCG,gBAAgB;AACO,qBAAY,GAAG,OAAO,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var childProcess = require("child_process");
|
|
3
|
+
|
|
4
|
+
var args = process.argv.slice(2);
|
|
5
|
+
var res = childProcess.spawnSync("pulumi", ["plugin", "install"].concat(args), {
|
|
6
|
+
stdio: ["ignore", "inherit", "inherit"]
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
if (res.error && res.error.code === "ENOENT") {
|
|
10
|
+
console.error("\nThere was an error installing the resource provider plugin. " +
|
|
11
|
+
"It looks like `pulumi` is not installed on your system. " +
|
|
12
|
+
"Please visit https://pulumi.com/ to install the Pulumi CLI.\n" +
|
|
13
|
+
"You may try manually installing the plugin by running " +
|
|
14
|
+
"`pulumi plugin install " + args.join(" ") + "`");
|
|
15
|
+
} else if (res.error || res.status !== 0) {
|
|
16
|
+
console.error("\nThere was an error installing the resource provider plugin. " +
|
|
17
|
+
"You may try to manually installing the plugin by running " +
|
|
18
|
+
"`pulumi plugin install " + args.join(" ") + "`");
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
process.exit(0);
|
package/usergroup.d.ts
ADDED
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import * as pulumi from "@pulumi/pulumi";
|
|
2
|
+
/**
|
|
3
|
+
* Manages a Slack User Group.
|
|
4
|
+
*
|
|
5
|
+
* ## Required scopes
|
|
6
|
+
*
|
|
7
|
+
* This resource requires the following scopes:
|
|
8
|
+
*
|
|
9
|
+
* - [usergroups:write](https://api.slack.com/scopes/usergroups:write)
|
|
10
|
+
* - [usergroups:read](https://api.slack.com/scopes/usergroups:read)
|
|
11
|
+
*
|
|
12
|
+
* The Slack API methods used by the resource are:
|
|
13
|
+
*
|
|
14
|
+
* - [usergroups.create](https://api.slack.com/methods/usergroups.create)
|
|
15
|
+
* - [usergroups.enable](https://api.slack.com/methods/usergroups.enable)
|
|
16
|
+
* - [usergroups.disable](https://api.slack.com/methods/usergroups.disable)
|
|
17
|
+
* - [usergroups.update](https://api.slack.com/methods/usergroups.update)
|
|
18
|
+
* - [usergroups.list](https://api.slack.com/methods/usergroups.list)
|
|
19
|
+
* - [usergroups.users.update](https://api.slack.com/methods/usergroups.users.update)
|
|
20
|
+
*
|
|
21
|
+
* If you get `missingScope` errors while using this resource check the scopes against
|
|
22
|
+
* the documentation for the methods above.
|
|
23
|
+
*
|
|
24
|
+
* ## Example Usage
|
|
25
|
+
*
|
|
26
|
+
* ```typescript
|
|
27
|
+
* import * as pulumi from "@pulumi/pulumi";
|
|
28
|
+
* import * as slack from "@pulumi/slack";
|
|
29
|
+
*
|
|
30
|
+
* const myGroup = new slack.Usergroup("my_group", {
|
|
31
|
+
* channels: ["CHANNEL00"],
|
|
32
|
+
* description: "Test user group",
|
|
33
|
+
* handle: "test",
|
|
34
|
+
* users: ["USER00"],
|
|
35
|
+
* });
|
|
36
|
+
* ```
|
|
37
|
+
*
|
|
38
|
+
* Note that if a channel is removed from the `channels` list users are
|
|
39
|
+
* **not** removed from the channel. In order to keep the users in the
|
|
40
|
+
* groups and in the channel in sync set `permanentUsers` in the channel:
|
|
41
|
+
*
|
|
42
|
+
* ```typescript
|
|
43
|
+
* import * as pulumi from "@pulumi/pulumi";
|
|
44
|
+
* import * as slack from "@pulumi/slack";
|
|
45
|
+
*
|
|
46
|
+
* const myGroup = new slack.Usergroup("myGroup", {
|
|
47
|
+
* handle: "test",
|
|
48
|
+
* description: "Test user group",
|
|
49
|
+
* users: ["USER00"],
|
|
50
|
+
* });
|
|
51
|
+
* const test = new slack.Conversation("test", {
|
|
52
|
+
* topic: "The topic for my channel",
|
|
53
|
+
* permanentMembers: myGroup.users,
|
|
54
|
+
* isPrivate: true,
|
|
55
|
+
* });
|
|
56
|
+
* ```
|
|
57
|
+
*
|
|
58
|
+
* ## Import
|
|
59
|
+
*
|
|
60
|
+
* `slack_usergroup` can be imported using the ID of the group, e.g.
|
|
61
|
+
*
|
|
62
|
+
* ```sh
|
|
63
|
+
* $ pulumi import slack:index/usergroup:Usergroup my_group S022GE79E9G
|
|
64
|
+
* ```
|
|
65
|
+
*/
|
|
66
|
+
export declare class Usergroup extends pulumi.CustomResource {
|
|
67
|
+
/**
|
|
68
|
+
* Get an existing Usergroup resource's state with the given name, ID, and optional extra
|
|
69
|
+
* properties used to qualify the lookup.
|
|
70
|
+
*
|
|
71
|
+
* @param name The _unique_ name of the resulting resource.
|
|
72
|
+
* @param id The _unique_ provider ID of the resource to lookup.
|
|
73
|
+
* @param state Any extra arguments used during the lookup.
|
|
74
|
+
* @param opts Optional settings to control the behavior of the CustomResource.
|
|
75
|
+
*/
|
|
76
|
+
static get(name: string, id: pulumi.Input<pulumi.ID>, state?: UsergroupState, opts?: pulumi.CustomResourceOptions): Usergroup;
|
|
77
|
+
/**
|
|
78
|
+
* Returns true if the given object is an instance of Usergroup. This is designed to work even
|
|
79
|
+
* when multiple copies of the Pulumi SDK have been loaded into the same process.
|
|
80
|
+
*/
|
|
81
|
+
static isInstance(obj: any): obj is Usergroup;
|
|
82
|
+
/**
|
|
83
|
+
* channel IDs for which the User Group uses as a default.
|
|
84
|
+
*/
|
|
85
|
+
readonly channels: pulumi.Output<string[] | undefined>;
|
|
86
|
+
/**
|
|
87
|
+
* a short description of the User Group.
|
|
88
|
+
*/
|
|
89
|
+
readonly description: pulumi.Output<string | undefined>;
|
|
90
|
+
/**
|
|
91
|
+
* a mention handle. Must be unique among channels, users
|
|
92
|
+
* and User Groups.
|
|
93
|
+
*/
|
|
94
|
+
readonly handle: pulumi.Output<string | undefined>;
|
|
95
|
+
/**
|
|
96
|
+
* a name for the User Group. Must be unique among User Groups.
|
|
97
|
+
*/
|
|
98
|
+
readonly name: pulumi.Output<string>;
|
|
99
|
+
/**
|
|
100
|
+
* user IDs that represent the entire list of users for the
|
|
101
|
+
* User Group.
|
|
102
|
+
*/
|
|
103
|
+
readonly users: pulumi.Output<string[] | undefined>;
|
|
104
|
+
/**
|
|
105
|
+
* Create a Usergroup resource with the given unique name, arguments, and options.
|
|
106
|
+
*
|
|
107
|
+
* @param name The _unique_ name of the resource.
|
|
108
|
+
* @param args The arguments to use to populate this resource's properties.
|
|
109
|
+
* @param opts A bag of options that control this resource's behavior.
|
|
110
|
+
*/
|
|
111
|
+
constructor(name: string, args?: UsergroupArgs, opts?: pulumi.CustomResourceOptions);
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Input properties used for looking up and filtering Usergroup resources.
|
|
115
|
+
*/
|
|
116
|
+
export interface UsergroupState {
|
|
117
|
+
/**
|
|
118
|
+
* channel IDs for which the User Group uses as a default.
|
|
119
|
+
*/
|
|
120
|
+
channels?: pulumi.Input<pulumi.Input<string>[]>;
|
|
121
|
+
/**
|
|
122
|
+
* a short description of the User Group.
|
|
123
|
+
*/
|
|
124
|
+
description?: pulumi.Input<string>;
|
|
125
|
+
/**
|
|
126
|
+
* a mention handle. Must be unique among channels, users
|
|
127
|
+
* and User Groups.
|
|
128
|
+
*/
|
|
129
|
+
handle?: pulumi.Input<string>;
|
|
130
|
+
/**
|
|
131
|
+
* a name for the User Group. Must be unique among User Groups.
|
|
132
|
+
*/
|
|
133
|
+
name?: pulumi.Input<string>;
|
|
134
|
+
/**
|
|
135
|
+
* user IDs that represent the entire list of users for the
|
|
136
|
+
* User Group.
|
|
137
|
+
*/
|
|
138
|
+
users?: pulumi.Input<pulumi.Input<string>[]>;
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* The set of arguments for constructing a Usergroup resource.
|
|
142
|
+
*/
|
|
143
|
+
export interface UsergroupArgs {
|
|
144
|
+
/**
|
|
145
|
+
* channel IDs for which the User Group uses as a default.
|
|
146
|
+
*/
|
|
147
|
+
channels?: pulumi.Input<pulumi.Input<string>[]>;
|
|
148
|
+
/**
|
|
149
|
+
* a short description of the User Group.
|
|
150
|
+
*/
|
|
151
|
+
description?: pulumi.Input<string>;
|
|
152
|
+
/**
|
|
153
|
+
* a mention handle. Must be unique among channels, users
|
|
154
|
+
* and User Groups.
|
|
155
|
+
*/
|
|
156
|
+
handle?: pulumi.Input<string>;
|
|
157
|
+
/**
|
|
158
|
+
* a name for the User Group. Must be unique among User Groups.
|
|
159
|
+
*/
|
|
160
|
+
name?: pulumi.Input<string>;
|
|
161
|
+
/**
|
|
162
|
+
* user IDs that represent the entire list of users for the
|
|
163
|
+
* User Group.
|
|
164
|
+
*/
|
|
165
|
+
users?: pulumi.Input<pulumi.Input<string>[]>;
|
|
166
|
+
}
|
package/usergroup.js
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
|
|
3
|
+
// *** Do not edit by hand unless you're certain you know what you are doing! ***
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.Usergroup = void 0;
|
|
6
|
+
const pulumi = require("@pulumi/pulumi");
|
|
7
|
+
const utilities = require("./utilities");
|
|
8
|
+
/**
|
|
9
|
+
* Manages a Slack User Group.
|
|
10
|
+
*
|
|
11
|
+
* ## Required scopes
|
|
12
|
+
*
|
|
13
|
+
* This resource requires the following scopes:
|
|
14
|
+
*
|
|
15
|
+
* - [usergroups:write](https://api.slack.com/scopes/usergroups:write)
|
|
16
|
+
* - [usergroups:read](https://api.slack.com/scopes/usergroups:read)
|
|
17
|
+
*
|
|
18
|
+
* The Slack API methods used by the resource are:
|
|
19
|
+
*
|
|
20
|
+
* - [usergroups.create](https://api.slack.com/methods/usergroups.create)
|
|
21
|
+
* - [usergroups.enable](https://api.slack.com/methods/usergroups.enable)
|
|
22
|
+
* - [usergroups.disable](https://api.slack.com/methods/usergroups.disable)
|
|
23
|
+
* - [usergroups.update](https://api.slack.com/methods/usergroups.update)
|
|
24
|
+
* - [usergroups.list](https://api.slack.com/methods/usergroups.list)
|
|
25
|
+
* - [usergroups.users.update](https://api.slack.com/methods/usergroups.users.update)
|
|
26
|
+
*
|
|
27
|
+
* If you get `missingScope` errors while using this resource check the scopes against
|
|
28
|
+
* the documentation for the methods above.
|
|
29
|
+
*
|
|
30
|
+
* ## Example Usage
|
|
31
|
+
*
|
|
32
|
+
* ```typescript
|
|
33
|
+
* import * as pulumi from "@pulumi/pulumi";
|
|
34
|
+
* import * as slack from "@pulumi/slack";
|
|
35
|
+
*
|
|
36
|
+
* const myGroup = new slack.Usergroup("my_group", {
|
|
37
|
+
* channels: ["CHANNEL00"],
|
|
38
|
+
* description: "Test user group",
|
|
39
|
+
* handle: "test",
|
|
40
|
+
* users: ["USER00"],
|
|
41
|
+
* });
|
|
42
|
+
* ```
|
|
43
|
+
*
|
|
44
|
+
* Note that if a channel is removed from the `channels` list users are
|
|
45
|
+
* **not** removed from the channel. In order to keep the users in the
|
|
46
|
+
* groups and in the channel in sync set `permanentUsers` in the channel:
|
|
47
|
+
*
|
|
48
|
+
* ```typescript
|
|
49
|
+
* import * as pulumi from "@pulumi/pulumi";
|
|
50
|
+
* import * as slack from "@pulumi/slack";
|
|
51
|
+
*
|
|
52
|
+
* const myGroup = new slack.Usergroup("myGroup", {
|
|
53
|
+
* handle: "test",
|
|
54
|
+
* description: "Test user group",
|
|
55
|
+
* users: ["USER00"],
|
|
56
|
+
* });
|
|
57
|
+
* const test = new slack.Conversation("test", {
|
|
58
|
+
* topic: "The topic for my channel",
|
|
59
|
+
* permanentMembers: myGroup.users,
|
|
60
|
+
* isPrivate: true,
|
|
61
|
+
* });
|
|
62
|
+
* ```
|
|
63
|
+
*
|
|
64
|
+
* ## Import
|
|
65
|
+
*
|
|
66
|
+
* `slack_usergroup` can be imported using the ID of the group, e.g.
|
|
67
|
+
*
|
|
68
|
+
* ```sh
|
|
69
|
+
* $ pulumi import slack:index/usergroup:Usergroup my_group S022GE79E9G
|
|
70
|
+
* ```
|
|
71
|
+
*/
|
|
72
|
+
class Usergroup extends pulumi.CustomResource {
|
|
73
|
+
constructor(name, argsOrState, opts) {
|
|
74
|
+
let resourceInputs = {};
|
|
75
|
+
opts = opts || {};
|
|
76
|
+
if (opts.id) {
|
|
77
|
+
const state = argsOrState;
|
|
78
|
+
resourceInputs["channels"] = state ? state.channels : undefined;
|
|
79
|
+
resourceInputs["description"] = state ? state.description : undefined;
|
|
80
|
+
resourceInputs["handle"] = state ? state.handle : undefined;
|
|
81
|
+
resourceInputs["name"] = state ? state.name : undefined;
|
|
82
|
+
resourceInputs["users"] = state ? state.users : undefined;
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
const args = argsOrState;
|
|
86
|
+
resourceInputs["channels"] = args ? args.channels : undefined;
|
|
87
|
+
resourceInputs["description"] = args ? args.description : undefined;
|
|
88
|
+
resourceInputs["handle"] = args ? args.handle : undefined;
|
|
89
|
+
resourceInputs["name"] = args ? args.name : undefined;
|
|
90
|
+
resourceInputs["users"] = args ? args.users : undefined;
|
|
91
|
+
}
|
|
92
|
+
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
|
|
93
|
+
super(Usergroup.__pulumiType, name, resourceInputs, opts);
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Get an existing Usergroup resource's state with the given name, ID, and optional extra
|
|
97
|
+
* properties used to qualify the lookup.
|
|
98
|
+
*
|
|
99
|
+
* @param name The _unique_ name of the resulting resource.
|
|
100
|
+
* @param id The _unique_ provider ID of the resource to lookup.
|
|
101
|
+
* @param state Any extra arguments used during the lookup.
|
|
102
|
+
* @param opts Optional settings to control the behavior of the CustomResource.
|
|
103
|
+
*/
|
|
104
|
+
static get(name, id, state, opts) {
|
|
105
|
+
return new Usergroup(name, state, Object.assign(Object.assign({}, opts), { id: id }));
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Returns true if the given object is an instance of Usergroup. This is designed to work even
|
|
109
|
+
* when multiple copies of the Pulumi SDK have been loaded into the same process.
|
|
110
|
+
*/
|
|
111
|
+
static isInstance(obj) {
|
|
112
|
+
if (obj === undefined || obj === null) {
|
|
113
|
+
return false;
|
|
114
|
+
}
|
|
115
|
+
return obj['__pulumiType'] === Usergroup.__pulumiType;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
exports.Usergroup = Usergroup;
|
|
119
|
+
/** @internal */
|
|
120
|
+
Usergroup.__pulumiType = 'slack:index/usergroup:Usergroup';
|
|
121
|
+
//# sourceMappingURL=usergroup.js.map
|
package/usergroup.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usergroup.js","sourceRoot":"","sources":["../usergroup.ts"],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AC,QAAQ,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;YAC1D,cAAc,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;YACtD,cAAc,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;SAC3D;QACD,IAAI,GAAG,MAAM,CAAC,YAAY,CAAC,SAAS,CAAC,oBAAoB,EAAE,EAAE,IAAI,CAAC,CAAC;QACnE,KAAK,CAAC,SAAS,CAAC,YAAY,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,CAAC,CAAC;IAC9D,CAAC;IA9ED;;;;;;;;OAQG;IACI,MAAM,CAAC,GAAG,CAAC,IAAY,EAAE,EAA2B,EAAE,KAAsB,EAAE,IAAmC;QACpH,OAAO,IAAI,SAAS,CAAC,IAAI,EAAO,KAAK,kCAAO,IAAI,KAAE,EAAE,EAAE,EAAE,IAAG,CAAC;IAChE,CAAC;IAKD;;;OAGG;IACI,MAAM,CAAC,UAAU,CAAC,GAAQ;QAC7B,IAAI,GAAG,KAAK,SAAS,IAAI,GAAG,KAAK,IAAI,EAAE;YACnC,OAAO,KAAK,CAAC;SAChB;QACD,OAAO,GAAG,CAAC,cAAc,CAAC,KAAK,SAAS,CAAC,YAAY,CAAC;IAC1D,CAAC;;AA1BL,8BAgFC;AAlEG,gBAAgB;AACO,sBAAY,GAAG,iCAAiC,CAAC"}
|
package/utilities.d.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare function getEnv(...vars: string[]): string | undefined;
|
|
2
|
+
export declare function getEnvBoolean(...vars: string[]): boolean | undefined;
|
|
3
|
+
export declare function getEnvNumber(...vars: string[]): number | undefined;
|
|
4
|
+
export declare function getVersion(): string;
|
package/utilities.js
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
|
|
3
|
+
// *** Do not edit by hand unless you're certain you know what you are doing! ***
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.resourceOptsDefaults = exports.getVersion = exports.getEnvNumber = exports.getEnvBoolean = exports.getEnv = void 0;
|
|
6
|
+
function getEnv(...vars) {
|
|
7
|
+
for (const v of vars) {
|
|
8
|
+
const value = process.env[v];
|
|
9
|
+
if (value) {
|
|
10
|
+
return value;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
return undefined;
|
|
14
|
+
}
|
|
15
|
+
exports.getEnv = getEnv;
|
|
16
|
+
function getEnvBoolean(...vars) {
|
|
17
|
+
const s = getEnv(...vars);
|
|
18
|
+
if (s !== undefined) {
|
|
19
|
+
// NOTE: these values are taken from https://golang.org/src/strconv/atob.go?s=351:391#L1, which is what
|
|
20
|
+
// Terraform uses internally when parsing boolean values.
|
|
21
|
+
if (["1", "t", "T", "true", "TRUE", "True"].find(v => v === s) !== undefined) {
|
|
22
|
+
return true;
|
|
23
|
+
}
|
|
24
|
+
if (["0", "f", "F", "false", "FALSE", "False"].find(v => v === s) !== undefined) {
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return undefined;
|
|
29
|
+
}
|
|
30
|
+
exports.getEnvBoolean = getEnvBoolean;
|
|
31
|
+
function getEnvNumber(...vars) {
|
|
32
|
+
const s = getEnv(...vars);
|
|
33
|
+
if (s !== undefined) {
|
|
34
|
+
const f = parseFloat(s);
|
|
35
|
+
if (!isNaN(f)) {
|
|
36
|
+
return f;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return undefined;
|
|
40
|
+
}
|
|
41
|
+
exports.getEnvNumber = getEnvNumber;
|
|
42
|
+
function getVersion() {
|
|
43
|
+
let version = require('./package.json').version;
|
|
44
|
+
// Node allows for the version to be prefixed by a "v", while semver doesn't.
|
|
45
|
+
// If there is a v, strip it off.
|
|
46
|
+
if (version.indexOf('v') === 0) {
|
|
47
|
+
version = version.slice(1);
|
|
48
|
+
}
|
|
49
|
+
return version;
|
|
50
|
+
}
|
|
51
|
+
exports.getVersion = getVersion;
|
|
52
|
+
/** @internal */
|
|
53
|
+
function resourceOptsDefaults() {
|
|
54
|
+
return { version: getVersion() };
|
|
55
|
+
}
|
|
56
|
+
exports.resourceOptsDefaults = resourceOptsDefaults;
|
|
57
|
+
//# sourceMappingURL=utilities.js.map
|
package/utilities.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utilities.js","sourceRoot":"","sources":["../utilities.ts"],"names":[],"mappings":";AAAA,wFAAwF;AACxF,iFAAiF;;;AAGjF,SAAgB,MAAM,CAAC,GAAG,IAAc;IACpC,KAAK,MAAM,CAAC,IAAI,IAAI,EAAE;QAClB,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QAC7B,IAAI,KAAK,EAAE;YACP,OAAO,KAAK,CAAC;SAChB;KACJ;IACD,OAAO,SAAS,CAAC;AACrB,CAAC;AARD,wBAQC;AAED,SAAgB,aAAa,CAAC,GAAG,IAAc;IAC3C,MAAM,CAAC,GAAG,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC;IAC1B,IAAI,CAAC,KAAK,SAAS,EAAE;QACjB,uGAAuG;QACvG,yDAAyD;QACzD,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,SAAS,EAAE;YAC1E,OAAO,IAAI,CAAC;SACf;QACD,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,IAAI,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