@highstate/cloudflare 0.7.2 → 0.7.3
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/dist/chunk-G3PMV62Z.js +36 -0
- package/dist/chunk-G3PMV62Z.js.map +1 -0
- package/dist/connection/index.js +13 -9
- package/dist/connection/index.js.map +1 -0
- package/dist/highstate.manifest.json +6 -0
- package/dist/index.js +7342 -7417
- package/dist/index.js.map +1 -0
- package/package.json +8 -8
@@ -0,0 +1,36 @@
|
|
1
|
+
var __create = Object.create;
|
2
|
+
var __defProp = Object.defineProperty;
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
7
|
+
var __commonJS = (cb, mod) => function __require() {
|
8
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
9
|
+
};
|
10
|
+
var __export = (target, all) => {
|
11
|
+
for (var name in all)
|
12
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
13
|
+
};
|
14
|
+
var __copyProps = (to, from, except, desc) => {
|
15
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
16
|
+
for (let key of __getOwnPropNames(from))
|
17
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
18
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
19
|
+
}
|
20
|
+
return to;
|
21
|
+
};
|
22
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
23
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
24
|
+
// file that has been converted to a CommonJS file using a Babel-
|
25
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
26
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
27
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
28
|
+
mod
|
29
|
+
));
|
30
|
+
|
31
|
+
export {
|
32
|
+
__commonJS,
|
33
|
+
__export,
|
34
|
+
__toESM
|
35
|
+
};
|
36
|
+
//# sourceMappingURL=chunk-G3PMV62Z.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/dist/connection/index.js
CHANGED
@@ -1,10 +1,12 @@
|
|
1
|
-
import
|
2
|
-
import { forUnit } from '@highstate/pulumi';
|
3
|
-
import { Provider, getZones } from '@pulumi/cloudflare';
|
1
|
+
import "../chunk-G3PMV62Z.js";
|
4
2
|
|
5
|
-
|
6
|
-
|
7
|
-
|
3
|
+
// src/connection/index.ts
|
4
|
+
import { cloudflare } from "@highstate/library";
|
5
|
+
import { forUnit } from "@highstate/pulumi";
|
6
|
+
import { getZones, Provider } from "@pulumi/cloudflare";
|
7
|
+
var { name, secrets, outputs } = forUnit(cloudflare.connection);
|
8
|
+
var provider = new Provider("cloudflare", { apiToken: secrets.apiToken });
|
9
|
+
var { zones } = await getZones({ filter: {} }, { provider });
|
8
10
|
if (!zones.length) {
|
9
11
|
throw new Error(
|
10
12
|
"No zones found with the provided API token. Ensure the token has Zone.Zone:Read permission on the zone."
|
@@ -21,7 +23,7 @@ if (!zones[0].id) {
|
|
21
23
|
if (!zones[0].name) {
|
22
24
|
throw new Error("Zone name is missing.");
|
23
25
|
}
|
24
|
-
var
|
26
|
+
var connection_default = outputs({
|
25
27
|
dnsProvider: {
|
26
28
|
name,
|
27
29
|
type: "cloudflare",
|
@@ -40,5 +42,7 @@ var index = outputs({
|
|
40
42
|
}
|
41
43
|
}
|
42
44
|
});
|
43
|
-
|
44
|
-
|
45
|
+
export {
|
46
|
+
connection_default as default
|
47
|
+
};
|
48
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../../src/connection/index.ts"],"sourcesContent":["import { cloudflare } from \"@highstate/library\"\nimport { forUnit } from \"@highstate/pulumi\"\nimport { getZones, Provider } from \"@pulumi/cloudflare\"\n\nconst { name, secrets, outputs } = forUnit(cloudflare.connection)\n\nconst provider = new Provider(\"cloudflare\", { apiToken: secrets.apiToken })\nconst { zones } = await getZones({ filter: {} }, { provider })\n\nif (!zones.length) {\n throw new Error(\n \"No zones found with the provided API token. Ensure the token has Zone.Zone:Read permission on the zone.\",\n )\n}\n\nif (zones.length > 1) {\n throw new Error(\n \"Multiple zones found with the provided API token, please use separate tokens and connections for each zone.\",\n )\n}\n\nif (!zones[0].id) {\n throw new Error(\"Zone ID is missing.\")\n}\n\nif (!zones[0].name) {\n throw new Error(\"Zone name is missing.\")\n}\n\nexport default outputs({\n dnsProvider: {\n name,\n type: \"cloudflare\",\n domain: zones[0].name,\n data: {\n zoneId: zones[0].id,\n apiToken: secrets.apiToken,\n },\n },\n $status: {\n domain: {\n value: zones[0].name,\n },\n zoneId: {\n value: zones[0].id,\n },\n },\n})\n"],"mappings":";;;AAAA,SAAS,kBAAkB;AAC3B,SAAS,eAAe;AACxB,SAAS,UAAU,gBAAgB;AAEnC,IAAM,EAAE,MAAM,SAAS,QAAQ,IAAI,QAAQ,WAAW,UAAU;AAEhE,IAAM,WAAW,IAAI,SAAS,cAAc,EAAE,UAAU,QAAQ,SAAS,CAAC;AAC1E,IAAM,EAAE,MAAM,IAAI,MAAM,SAAS,EAAE,QAAQ,CAAC,EAAE,GAAG,EAAE,SAAS,CAAC;AAE7D,IAAI,CAAC,MAAM,QAAQ;AACjB,QAAM,IAAI;AAAA,IACR;AAAA,EACF;AACF;AAEA,IAAI,MAAM,SAAS,GAAG;AACpB,QAAM,IAAI;AAAA,IACR;AAAA,EACF;AACF;AAEA,IAAI,CAAC,MAAM,CAAC,EAAE,IAAI;AAChB,QAAM,IAAI,MAAM,qBAAqB;AACvC;AAEA,IAAI,CAAC,MAAM,CAAC,EAAE,MAAM;AAClB,QAAM,IAAI,MAAM,uBAAuB;AACzC;AAEA,IAAO,qBAAQ,QAAQ;AAAA,EACrB,aAAa;AAAA,IACX;AAAA,IACA,MAAM;AAAA,IACN,QAAQ,MAAM,CAAC,EAAE;AAAA,IACjB,MAAM;AAAA,MACJ,QAAQ,MAAM,CAAC,EAAE;AAAA,MACjB,UAAU,QAAQ;AAAA,IACpB;AAAA,EACF;AAAA,EACA,SAAS;AAAA,IACP,QAAQ;AAAA,MACN,OAAO,MAAM,CAAC,EAAE;AAAA,IAClB;AAAA,IACA,QAAQ;AAAA,MACN,OAAO,MAAM,CAAC,EAAE;AAAA,IAClB;AAAA,EACF;AACF,CAAC;","names":[]}
|