pulumi-namecheap 2.2.6 → 2.2.8

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/bin/provider.d.ts CHANGED
@@ -1,70 +1,63 @@
1
1
  import * as pulumi from "@pulumi/pulumi";
2
-
3
- //#region provider.d.ts
4
-
5
2
  /**
6
3
  * The provider type for the namecheap package. By default, resources use package-wide configuration
7
4
  * settings, however an explicit `Provider` instance may be created and passed during resource
8
5
  * construction to achieve fine-grained programmatic control over provider settings. See the
9
6
  * [documentation](https://www.pulumi.com/docs/reference/programming-model/#providers) for more information.
10
7
  */
11
- declare class Provider extends pulumi.ProviderResource {
12
- /** @internal */
13
- static readonly __pulumiType: string;
14
- /**
15
- * Returns true if the given object is an instance of Provider. This is designed to work even
16
- * when multiple copies of the Pulumi SDK have been loaded into the same process.
17
- */
18
- static isInstance(obj: any): obj is Provider;
19
- /**
20
- * The namecheap API key
21
- */
22
- readonly apiKey!: pulumi.Output<string>;
23
- /**
24
- * A registered api user for namecheap
25
- */
26
- readonly apiUser!: pulumi.Output<string>;
27
- /**
28
- * Client IP address
29
- */
30
- readonly clientIp!: pulumi.Output<string | undefined>;
31
- /**
32
- * A registered user name for namecheap
33
- */
34
- readonly userName!: pulumi.Output<string>;
35
- /**
36
- * Create a Provider resource with the given unique name, arguments, and options.
37
- *
38
- * @param name The _unique_ name of the resource.
39
- * @param args The arguments to use to populate this resource's properties.
40
- * @param opts A bag of options that control this resource's behavior.
41
- */
42
- constructor(name: string, args: ProviderArgs, opts?: pulumi.ResourceOptions);
8
+ export declare class Provider extends pulumi.ProviderResource {
9
+ /**
10
+ * Returns true if the given object is an instance of Provider. This is designed to work even
11
+ * when multiple copies of the Pulumi SDK have been loaded into the same process.
12
+ */
13
+ static isInstance(obj: any): obj is Provider;
14
+ /**
15
+ * The namecheap API key
16
+ */
17
+ readonly apiKey: pulumi.Output<string>;
18
+ /**
19
+ * A registered api user for namecheap
20
+ */
21
+ readonly apiUser: pulumi.Output<string>;
22
+ /**
23
+ * Client IP address
24
+ */
25
+ readonly clientIp: pulumi.Output<string | undefined>;
26
+ /**
27
+ * A registered user name for namecheap
28
+ */
29
+ readonly userName: pulumi.Output<string>;
30
+ /**
31
+ * Create a Provider resource with the given unique name, arguments, and options.
32
+ *
33
+ * @param name The _unique_ name of the resource.
34
+ * @param args The arguments to use to populate this resource's properties.
35
+ * @param opts A bag of options that control this resource's behavior.
36
+ */
37
+ constructor(name: string, args: ProviderArgs, opts?: pulumi.ResourceOptions);
43
38
  }
44
39
  /**
45
40
  * The set of arguments for constructing a Provider resource.
46
41
  */
47
- interface ProviderArgs {
48
- /**
49
- * The namecheap API key
50
- */
51
- apiKey: pulumi.Input<string>;
52
- /**
53
- * A registered api user for namecheap
54
- */
55
- apiUser: pulumi.Input<string>;
56
- /**
57
- * Client IP address
58
- */
59
- clientIp?: pulumi.Input<string>;
60
- /**
61
- * Use sandbox API endpoints
62
- */
63
- useSandbox?: pulumi.Input<boolean>;
64
- /**
65
- * A registered user name for namecheap
66
- */
67
- userName: pulumi.Input<string>;
42
+ export interface ProviderArgs {
43
+ /**
44
+ * The namecheap API key
45
+ */
46
+ apiKey: pulumi.Input<string>;
47
+ /**
48
+ * A registered api user for namecheap
49
+ */
50
+ apiUser: pulumi.Input<string>;
51
+ /**
52
+ * Client IP address
53
+ */
54
+ clientIp?: pulumi.Input<string>;
55
+ /**
56
+ * Use sandbox API endpoints
57
+ */
58
+ useSandbox?: pulumi.Input<boolean>;
59
+ /**
60
+ * A registered user name for namecheap
61
+ */
62
+ userName: pulumi.Input<string>;
68
63
  }
69
- //#endregion
70
- export { Provider, ProviderArgs };
package/bin/provider.js CHANGED
@@ -1,64 +1,58 @@
1
- import { __esm, __export } from "./_virtual/rolldown_runtime.js";
2
- import { getPackage, init_utilities, resourceOptsDefaults } from "./utilities.js";
3
- import * as pulumi from "@pulumi/pulumi";
4
-
5
- //#region provider.ts
6
- var provider_exports = {};
7
- __export(provider_exports, { Provider: () => Provider });
8
- var Provider;
9
- var init_provider = __esm({ "provider.ts": (() => {
10
- init_utilities();
11
- Provider = class Provider extends pulumi.ProviderResource {
12
- /** @internal */
13
- static __pulumiType = "namecheap";
14
- /**
15
- * Returns true if the given object is an instance of Provider. This is designed to work even
16
- * when multiple copies of the Pulumi SDK have been loaded into the same process.
17
- */
18
- static isInstance(obj) {
19
- if (obj === void 0 || obj === null) return false;
20
- return obj["__pulumiType"] === "pulumi:providers:" + Provider.__pulumiType;
21
- }
22
- /**
23
- * The namecheap API key
24
- */
25
- apiKey;
26
- /**
27
- * A registered api user for namecheap
28
- */
29
- apiUser;
30
- /**
31
- * Client IP address
32
- */
33
- clientIp;
34
- /**
35
- * A registered user name for namecheap
36
- */
37
- userName;
38
- /**
39
- * Create a Provider resource with the given unique name, arguments, and options.
40
- *
41
- * @param name The _unique_ name of the resource.
42
- * @param args The arguments to use to populate this resource's properties.
43
- * @param opts A bag of options that control this resource's behavior.
44
- */
45
- constructor(name, args, opts) {
46
- let resourceInputs = {};
47
- opts = opts || {};
48
- if ((!args || args.apiKey === void 0) && !opts.urn) throw new Error("Missing required property 'apiKey'");
49
- if ((!args || args.apiUser === void 0) && !opts.urn) throw new Error("Missing required property 'apiUser'");
50
- if ((!args || args.userName === void 0) && !opts.urn) throw new Error("Missing required property 'userName'");
51
- resourceInputs["apiKey"] = args ? args.apiKey : void 0;
52
- resourceInputs["apiUser"] = args ? args.apiUser : void 0;
53
- resourceInputs["clientIp"] = args ? args.clientIp : void 0;
54
- resourceInputs["useSandbox"] = pulumi.output(args ? args.useSandbox : void 0).apply(JSON.stringify);
55
- resourceInputs["userName"] = args ? args.userName : void 0;
56
- opts = pulumi.mergeOptions(resourceOptsDefaults(), opts);
57
- super(Provider.__pulumiType, name, resourceInputs, opts, false, getPackage());
58
- }
59
- };
60
- }) });
61
-
62
- //#endregion
63
- init_provider();
64
- export { init_provider, provider_exports };
1
+ "use strict";
2
+ // *** WARNING: this file was generated by pulumi-language-nodejs. ***
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 namecheap 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
+ * Returns true if the given object is an instance of Provider. This is designed to work even
17
+ * when multiple copies of the Pulumi SDK have been loaded into the same process.
18
+ */
19
+ static isInstance(obj) {
20
+ if (obj === undefined || obj === null) {
21
+ return false;
22
+ }
23
+ return obj['__pulumiType'] === "pulumi:providers:" + Provider.__pulumiType;
24
+ }
25
+ /**
26
+ * Create a Provider resource with the given unique name, arguments, and options.
27
+ *
28
+ * @param name The _unique_ name of the resource.
29
+ * @param args The arguments to use to populate this resource's properties.
30
+ * @param opts A bag of options that control this resource's behavior.
31
+ */
32
+ constructor(name, args, opts) {
33
+ let resourceInputs = {};
34
+ opts = opts || {};
35
+ {
36
+ if ((!args || args.apiKey === undefined) && !opts.urn) {
37
+ throw new Error("Missing required property 'apiKey'");
38
+ }
39
+ if ((!args || args.apiUser === undefined) && !opts.urn) {
40
+ throw new Error("Missing required property 'apiUser'");
41
+ }
42
+ if ((!args || args.userName === undefined) && !opts.urn) {
43
+ throw new Error("Missing required property 'userName'");
44
+ }
45
+ resourceInputs["apiKey"] = args ? args.apiKey : undefined;
46
+ resourceInputs["apiUser"] = args ? args.apiUser : undefined;
47
+ resourceInputs["clientIp"] = args ? args.clientIp : undefined;
48
+ resourceInputs["useSandbox"] = pulumi.output(args ? args.useSandbox : undefined).apply(JSON.stringify);
49
+ resourceInputs["userName"] = args ? args.userName : undefined;
50
+ }
51
+ opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
52
+ super(Provider.__pulumiType, name, resourceInputs, opts, false /*dependency*/, utilities.getPackage());
53
+ }
54
+ }
55
+ exports.Provider = Provider;
56
+ /** @internal */
57
+ Provider.__pulumiType = 'namecheap';
58
+ //# sourceMappingURL=provider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"provider.js","sourceRoot":"","sources":["../provider.ts"],"names":[],"mappings":";AAAA,sEAAsE;AACtE,iFAAiF;;;AAEjF,yCAAyC;AACzC,yCAAyC;AAEzC;;;;;GAKG;AACH,MAAa,QAAS,SAAQ,MAAM,CAAC,gBAAgB;IAIjD;;;OAGG;IACI,MAAM,CAAC,UAAU,CAAC,GAAQ;QAC7B,IAAI,GAAG,KAAK,SAAS,IAAI,GAAG,KAAK,IAAI,EAAE,CAAC;YACpC,OAAO,KAAK,CAAC;QACjB,CAAC;QACD,OAAO,GAAG,CAAC,cAAc,CAAC,KAAK,mBAAmB,GAAG,QAAQ,CAAC,YAAY,CAAC;IAC/E,CAAC;IAmBD;;;;;;OAMG;IACH,YAAY,IAAY,EAAE,IAAkB,EAAE,IAA6B;QACvE,IAAI,cAAc,GAAkB,EAAE,CAAC;QACvC,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC;QAClB,CAAC;YACG,IAAI,CAAC,CAAC,IAAI,IAAI,IAAI,CAAC,MAAM,KAAK,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;gBACpD,MAAM,IAAI,KAAK,CAAC,oCAAoC,CAAC,CAAC;YAC1D,CAAC;YACD,IAAI,CAAC,CAAC,IAAI,IAAI,IAAI,CAAC,OAAO,KAAK,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;gBACrD,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAC;YAC3D,CAAC;YACD,IAAI,CAAC,CAAC,IAAI,IAAI,IAAI,CAAC,QAAQ,KAAK,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;gBACtD,MAAM,IAAI,KAAK,CAAC,sCAAsC,CAAC,CAAC;YAC5D,CAAC;YACD,cAAc,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;YAC1D,cAAc,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;YAC5D,cAAc,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC;YAC9D,cAAc,CAAC,YAAY,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;YACvG,cAAc,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC;QAClE,CAAC;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,EAAE,KAAK,CAAC,cAAc,EAAE,SAAS,CAAC,UAAU,EAAE,CAAC,CAAC;IAC3G,CAAC;;AA5DL,4BA6DC;AA5DG,gBAAgB;AACO,qBAAY,GAAG,WAAW,CAAC"}
@@ -1,9 +1,3 @@
1
- import { input_d_exports } from "./input.js";
2
- import { output_d_exports } from "./output.js";
3
-
4
- //#region types/index.d.ts
5
- declare namespace index_d_exports {
6
- export { input_d_exports as input, output_d_exports as output };
7
- }
8
- //#endregion
9
- export { index_d_exports };
1
+ import * as input from "./input";
2
+ import * as output from "./output";
3
+ export { input, output, };
@@ -1,13 +1,11 @@
1
- import { __export } from "../_virtual/rolldown_runtime.js";
2
- import { input_exports } from "./input.js";
3
- import { output_exports } from "./output.js";
4
-
5
- //#region types/index.ts
6
- var types_exports = {};
7
- __export(types_exports, {
8
- input: () => input_exports,
9
- output: () => output_exports
10
- });
11
-
12
- //#endregion
13
- export { types_exports };
1
+ "use strict";
2
+ // *** WARNING: this file was generated by pulumi-language-nodejs. ***
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.output = exports.input = void 0;
6
+ // Export sub-modules:
7
+ const input = require("./input");
8
+ exports.input = input;
9
+ const output = require("./output");
10
+ exports.output = output;
11
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../types/index.ts"],"names":[],"mappings":";AAAA,sEAAsE;AACtE,iFAAiF;;;AAIjF,sBAAsB;AACtB,iCAAiC;AAI7B,sBAAK;AAHT,mCAAmC;AAI/B,wBAAM"}
@@ -1,30 +1,23 @@
1
1
  import * as pulumi from "@pulumi/pulumi";
2
-
3
- //#region types/input.d.ts
4
- declare namespace input_d_exports {
5
- export { DomainRecordsRecord };
2
+ export interface DomainRecordsRecord {
3
+ /**
4
+ * Possible values are URL or IP address. The value for this parameter is based on record type
5
+ */
6
+ address: pulumi.Input<string>;
7
+ /**
8
+ * Sub-domain/hostname to create the record for
9
+ */
10
+ hostname: pulumi.Input<string>;
11
+ /**
12
+ * MX preference for host. Applicable for MX records only
13
+ */
14
+ mxPref?: pulumi.Input<number>;
15
+ /**
16
+ * Time to live for all record types. Possible values: any value between 60 to 60000
17
+ */
18
+ ttl?: pulumi.Input<number>;
19
+ /**
20
+ * Possible values: A, AAAA, ALIAS, CAA, CNAME, MX, MXE, NS, TXT, URL, URL301, FRAME
21
+ */
22
+ type: pulumi.Input<string>;
6
23
  }
7
- interface DomainRecordsRecord {
8
- /**
9
- * Possible values are URL or IP address. The value for this parameter is based on record type
10
- */
11
- address: pulumi.Input<string>;
12
- /**
13
- * Sub-domain/hostname to create the record for
14
- */
15
- hostname: pulumi.Input<string>;
16
- /**
17
- * MX preference for host. Applicable for MX records only
18
- */
19
- mxPref?: pulumi.Input<number>;
20
- /**
21
- * Time to live for all record types. Possible values: any value between 60 to 60000
22
- */
23
- ttl?: pulumi.Input<number>;
24
- /**
25
- * Possible values: A, AAAA, ALIAS, CAA, CNAME, MX, MXE, NS, TXT, URL, URL301, FRAME
26
- */
27
- type: pulumi.Input<string>;
28
- }
29
- //#endregion
30
- export { DomainRecordsRecord, input_d_exports };
@@ -1,5 +1,5 @@
1
- //#region types/input.ts
2
- var input_exports = {};
3
-
4
- //#endregion
5
- export { input_exports };
1
+ "use strict";
2
+ // *** WARNING: this file was generated by pulumi-language-nodejs. ***
3
+ // *** Do not edit by hand unless you're certain you know what you are doing! ***
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ //# sourceMappingURL=input.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"input.js","sourceRoot":"","sources":["../../types/input.ts"],"names":[],"mappings":";AAAA,sEAAsE;AACtE,iFAAiF"}
@@ -1,27 +1,22 @@
1
- declare namespace output_d_exports {
2
- export { DomainRecordsRecord };
1
+ export interface DomainRecordsRecord {
2
+ /**
3
+ * Possible values are URL or IP address. The value for this parameter is based on record type
4
+ */
5
+ address: string;
6
+ /**
7
+ * Sub-domain/hostname to create the record for
8
+ */
9
+ hostname: string;
10
+ /**
11
+ * MX preference for host. Applicable for MX records only
12
+ */
13
+ mxPref?: number;
14
+ /**
15
+ * Time to live for all record types. Possible values: any value between 60 to 60000
16
+ */
17
+ ttl?: number;
18
+ /**
19
+ * Possible values: A, AAAA, ALIAS, CAA, CNAME, MX, MXE, NS, TXT, URL, URL301, FRAME
20
+ */
21
+ type: string;
3
22
  }
4
- interface DomainRecordsRecord {
5
- /**
6
- * Possible values are URL or IP address. The value for this parameter is based on record type
7
- */
8
- address: string;
9
- /**
10
- * Sub-domain/hostname to create the record for
11
- */
12
- hostname: string;
13
- /**
14
- * MX preference for host. Applicable for MX records only
15
- */
16
- mxPref?: number;
17
- /**
18
- * Time to live for all record types. Possible values: any value between 60 to 60000
19
- */
20
- ttl?: number;
21
- /**
22
- * Possible values: A, AAAA, ALIAS, CAA, CNAME, MX, MXE, NS, TXT, URL, URL301, FRAME
23
- */
24
- type: string;
25
- }
26
- //#endregion
27
- export { DomainRecordsRecord, output_d_exports };
@@ -1,5 +1,5 @@
1
- //#region types/output.ts
2
- var output_exports = {};
3
-
4
- //#endregion
5
- export { output_exports };
1
+ "use strict";
2
+ // *** WARNING: this file was generated by pulumi-language-nodejs. ***
3
+ // *** Do not edit by hand unless you're certain you know what you are doing! ***
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ //# sourceMappingURL=output.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"output.js","sourceRoot":"","sources":["../../types/output.ts"],"names":[],"mappings":";AAAA,sEAAsE;AACtE,iFAAiF"}
@@ -0,0 +1,5 @@
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;
5
+ export declare function getPackage(): Promise<string | undefined>;
package/bin/utilities.js CHANGED
@@ -1,61 +1,141 @@
1
- import { __esm } from "./_virtual/rolldown_runtime.js";
2
- import { require_package } from "./package.js";
3
- import * as resproto from "@pulumi/pulumi/proto/resource_pb";
4
- import * as mutex from "async-mutex";
5
- import * as runtime from "@pulumi/pulumi/runtime";
6
-
7
- //#region utilities.ts
1
+ "use strict";
2
+ // *** WARNING: this file was generated by pulumi-language-nodejs. ***
3
+ // *** Do not edit by hand unless you're certain you know what you are doing! ***
4
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
5
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
6
+ return new (P || (P = Promise))(function (resolve, reject) {
7
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
8
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
9
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
10
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
11
+ });
12
+ };
13
+ Object.defineProperty(exports, "__esModule", { value: true });
14
+ exports.getEnv = getEnv;
15
+ exports.getEnvBoolean = getEnvBoolean;
16
+ exports.getEnvNumber = getEnvNumber;
17
+ exports.getVersion = getVersion;
18
+ exports.resourceOptsDefaults = resourceOptsDefaults;
19
+ exports.lazyLoad = lazyLoad;
20
+ exports.callAsync = callAsync;
21
+ exports.getPackage = getPackage;
22
+ const resproto = require("@pulumi/pulumi/proto/resource_pb");
23
+ const mutex = require("async-mutex");
24
+ const runtime = require("@pulumi/pulumi/runtime");
25
+ function getEnv(...vars) {
26
+ for (const v of vars) {
27
+ const value = process.env[v];
28
+ if (value) {
29
+ return value;
30
+ }
31
+ }
32
+ return undefined;
33
+ }
34
+ function getEnvBoolean(...vars) {
35
+ const s = getEnv(...vars);
36
+ if (s !== undefined) {
37
+ // NOTE: these values are taken from https://golang.org/src/strconv/atob.go?s=351:391#L1, which is what
38
+ // Terraform uses internally when parsing boolean values.
39
+ if (["1", "t", "T", "true", "TRUE", "True"].find(v => v === s) !== undefined) {
40
+ return true;
41
+ }
42
+ if (["0", "f", "F", "false", "FALSE", "False"].find(v => v === s) !== undefined) {
43
+ return false;
44
+ }
45
+ }
46
+ return undefined;
47
+ }
48
+ function getEnvNumber(...vars) {
49
+ const s = getEnv(...vars);
50
+ if (s !== undefined) {
51
+ const f = parseFloat(s);
52
+ if (!isNaN(f)) {
53
+ return f;
54
+ }
55
+ }
56
+ return undefined;
57
+ }
8
58
  function getVersion() {
9
- let version = require_package().version;
10
- if (version.indexOf("v") === 0) version = version.slice(1);
11
- return version;
59
+ let version = require('./package.json').version;
60
+ // Node allows for the version to be prefixed by a "v", while semver doesn't.
61
+ // If there is a v, strip it off.
62
+ if (version.indexOf('v') === 0) {
63
+ version = version.slice(1);
64
+ }
65
+ return version;
12
66
  }
13
67
  /** @internal */
14
68
  function resourceOptsDefaults() {
15
- return { version: getVersion() };
69
+ return { version: getVersion() };
16
70
  }
17
71
  /** @internal */
18
72
  function lazyLoad(exports, props, loadModule) {
19
- for (let property of props) Object.defineProperty(exports, property, {
20
- enumerable: true,
21
- get: function() {
22
- return loadModule()[property];
23
- }
24
- });
25
- }
26
- async function getPackage() {
27
- if (_packageRef === void 0) {
28
- if (!runtime.supportsParameterization()) throw new Error("The Pulumi CLI does not support parameterization. Please update the Pulumi CLI");
29
- await _packageLock.acquire();
30
- if (_packageRef === void 0) {
31
- const monitor = runtime.getMonitor();
32
- const params = new resproto.Parameterization();
33
- params.setName("namecheap");
34
- params.setVersion("2.2.0");
35
- params.setValue(Uint8Array.from(atob("eyJyZW1vdGUiOnsidXJsIjoicmVnaXN0cnkub3BlbnRvZnUub3JnL25hbWVjaGVhcC9uYW1lY2hlYXAiLCJ2ZXJzaW9uIjoiMi4yLjAifX0="), (c) => c.charCodeAt(0)));
36
- const req = new resproto.RegisterPackageRequest();
37
- req.setName("terraform-provider");
38
- req.setVersion("0.8.0");
39
- req.setDownloadUrl("");
40
- req.setParameterization(params);
41
- const resp = await new Promise((resolve, reject) => {
42
- monitor.registerPackage(req, (err, resp$1) => {
43
- if (err) reject(err);
44
- else resolve(resp$1);
45
- });
46
- });
47
- _packageRef = resp.getRef();
48
- }
49
- _packageLock.release();
50
- }
51
- return _packageRef;
52
- }
53
- var _packageLock, _packageRef;
54
- var init_utilities = __esm({ "utilities.ts": (() => {
55
- _packageLock = new mutex.Mutex();
56
- _packageRef = void 0;
57
- }) });
58
-
59
- //#endregion
60
- init_utilities();
61
- export { getPackage, getVersion, init_utilities, lazyLoad, resourceOptsDefaults };
73
+ for (let property of props) {
74
+ Object.defineProperty(exports, property, {
75
+ enumerable: true,
76
+ get: function () {
77
+ return loadModule()[property];
78
+ },
79
+ });
80
+ }
81
+ }
82
+ /** @internal */
83
+ function callAsync(tok, props, res, opts) {
84
+ return __awaiter(this, void 0, void 0, function* () {
85
+ const o = runtime.call(tok, props, res);
86
+ const value = yield o.promise(true /*withUnknowns*/);
87
+ const isKnown = yield o.isKnown;
88
+ const isSecret = yield o.isSecret;
89
+ const problem = !isKnown ? "an unknown value"
90
+ : isSecret ? "a secret value"
91
+ : undefined;
92
+ // Ingoring o.resources silently. They are typically non-empty, r.f() calls include r as a dependency.
93
+ if (problem) {
94
+ throw new Error(`Plain resource method "${tok}" incorrectly returned ${problem}. ` +
95
+ "This is an error in the provider, please report this to the provider developer.");
96
+ }
97
+ // Extract a single property if requested.
98
+ if (opts && opts.property) {
99
+ return value[opts.property];
100
+ }
101
+ return value;
102
+ });
103
+ }
104
+ const _packageLock = new mutex.Mutex();
105
+ var _packageRef = undefined;
106
+ function getPackage() {
107
+ return __awaiter(this, void 0, void 0, function* () {
108
+ if (_packageRef === undefined) {
109
+ if (!runtime.supportsParameterization()) {
110
+ throw new Error("The Pulumi CLI does not support parameterization. Please update the Pulumi CLI");
111
+ }
112
+ yield _packageLock.acquire();
113
+ if (_packageRef === undefined) {
114
+ const monitor = runtime.getMonitor();
115
+ const params = new resproto.Parameterization();
116
+ params.setName("namecheap");
117
+ params.setVersion("2.2.0");
118
+ params.setValue(Uint8Array.from(atob("eyJyZW1vdGUiOnsidXJsIjoicmVnaXN0cnkub3BlbnRvZnUub3JnL25hbWVjaGVhcC9uYW1lY2hlYXAiLCJ2ZXJzaW9uIjoiMi4yLjAifX0="), c => c.charCodeAt(0)));
119
+ const req = new resproto.RegisterPackageRequest();
120
+ req.setName("terraform-provider");
121
+ req.setVersion("0.8.0");
122
+ req.setDownloadUrl("");
123
+ req.setParameterization(params);
124
+ const resp = yield new Promise((resolve, reject) => {
125
+ monitor.registerPackage(req, (err, resp) => {
126
+ if (err) {
127
+ reject(err);
128
+ }
129
+ else {
130
+ resolve(resp);
131
+ }
132
+ });
133
+ });
134
+ _packageRef = resp.getRef();
135
+ }
136
+ _packageLock.release();
137
+ }
138
+ return _packageRef;
139
+ });
140
+ }
141
+ //# sourceMappingURL=utilities.js.map