@highstate/common 0.12.0 → 0.12.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.
@@ -12,6 +12,7 @@
12
12
  "./dist/units/server-patch/index.js": 2212294583,
13
13
  "./dist/units/databases/existing-mariadb/index.js": 2212294583,
14
14
  "./dist/units/databases/existing-postgresql/index.js": 2212294583,
15
- "./dist/units/databases/existing-mongodb/index.js": 2212294583
15
+ "./dist/units/databases/existing-mongodb/index.js": 2212294583,
16
+ "./dist/units/databases/existing-redis/index.js": 2212294583
16
17
  }
17
18
  }
@@ -0,0 +1,19 @@
1
+ import { parseEndpoints } from '../../../chunk-WFWXDYUX.js';
2
+ import { databases } from '@highstate/library';
3
+ import { forUnit } from '@highstate/pulumi';
4
+
5
+ var { args, inputs, outputs } = forUnit(databases.existingRedis);
6
+ var redisDatabase = args.database === void 0 ? void 0 : Number.parseInt(args.database, 10);
7
+ if (redisDatabase !== void 0 && Number.isNaN(redisDatabase)) {
8
+ throw new Error(`Invalid Redis database number "${args.database}"`);
9
+ }
10
+ var existing_redis_default = outputs({
11
+ redis: {
12
+ endpoints: parseEndpoints(args.endpoints, inputs.endpoints),
13
+ database: redisDatabase ?? 0
14
+ }
15
+ });
16
+
17
+ export { existing_redis_default as default };
18
+ //# sourceMappingURL=index.js.map
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/units/databases/existing-redis/index.ts"],"names":[],"mappings":";;;;AAIA,IAAM,EAAE,IAAA,EAAM,MAAA,EAAQ,SAAQ,GAAI,OAAA,CAAQ,UAAU,aAAa,CAAA;AAEjE,IAAM,aAAA,GAAgB,KAAK,QAAA,KAAa,MAAA,GAAY,SAAY,MAAA,CAAO,QAAA,CAAS,IAAA,CAAK,QAAA,EAAU,EAAE,CAAA;AAEjG,IAAI,aAAA,KAAkB,MAAA,IAAa,MAAA,CAAO,KAAA,CAAM,aAAa,CAAA,EAAG;AAC9D,EAAA,MAAM,IAAI,KAAA,CAAM,CAAA,+BAAA,EAAkC,IAAA,CAAK,QAAQ,CAAA,CAAA,CAAG,CAAA;AACpE;AAEA,IAAO,yBAAQ,OAAA,CAAQ;AAAA,EACrB,KAAA,EAAO;AAAA,IACL,SAAA,EAAW,cAAA,CAAe,IAAA,CAAK,SAAA,EAAW,OAAO,SAAS,CAAA;AAAA,IAC1D,UAAU,aAAA,IAAiB;AAAA;AAE/B,CAAC","file":"index.js","sourcesContent":["import { databases } from \"@highstate/library\"\nimport { forUnit } from \"@highstate/pulumi\"\nimport { parseEndpoints } from \"../../../shared\"\n\nconst { args, inputs, outputs } = forUnit(databases.existingRedis)\n\nconst redisDatabase = args.database === undefined ? undefined : Number.parseInt(args.database, 10)\n\nif (redisDatabase !== undefined && Number.isNaN(redisDatabase)) {\n throw new Error(`Invalid Redis database number \"${args.database}\"`)\n}\n\nexport default outputs({\n redis: {\n endpoints: parseEndpoints(args.endpoints, inputs.endpoints),\n database: redisDatabase ?? 0,\n },\n})\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@highstate/common",
3
- "version": "0.12.0",
3
+ "version": "0.12.1",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist",
@@ -59,6 +59,10 @@
59
59
  "./units/databases/existing-mongodb": {
60
60
  "mode": "manual",
61
61
  "version": "1"
62
+ },
63
+ "./units/databases/existing-redis": {
64
+ "mode": "manual",
65
+ "version": "1"
62
66
  }
63
67
  }
64
68
  },
@@ -78,7 +82,8 @@
78
82
  "./units/server-patch": "./dist/units/server-patch/index.js",
79
83
  "./units/databases/existing-mariadb": "./dist/units/databases/existing-mariadb/index.js",
80
84
  "./units/databases/existing-postgresql": "./dist/units/databases/existing-postgresql/index.js",
81
- "./units/databases/existing-mongodb": "./dist/units/databases/existing-mongodb/index.js"
85
+ "./units/databases/existing-mongodb": "./dist/units/databases/existing-mongodb/index.js",
86
+ "./units/databases/existing-redis": "./dist/units/databases/existing-redis/index.js"
82
87
  },
83
88
  "publishConfig": {
84
89
  "access": "public"
@@ -0,0 +1,18 @@
1
+ import { databases } from "@highstate/library"
2
+ import { forUnit } from "@highstate/pulumi"
3
+ import { parseEndpoints } from "../../../shared"
4
+
5
+ const { args, inputs, outputs } = forUnit(databases.existingRedis)
6
+
7
+ const redisDatabase = args.database === undefined ? undefined : Number.parseInt(args.database, 10)
8
+
9
+ if (redisDatabase !== undefined && Number.isNaN(redisDatabase)) {
10
+ throw new Error(`Invalid Redis database number "${args.database}"`)
11
+ }
12
+
13
+ export default outputs({
14
+ redis: {
15
+ endpoints: parseEndpoints(args.endpoints, inputs.endpoints),
16
+ database: redisDatabase ?? 0,
17
+ },
18
+ })
@@ -0,0 +1,15 @@
1
+ import { databases } from "@highstate/library"
2
+ import { forUnit } from "@highstate/pulumi"
3
+ import { parseEndpoints } from "../../../shared"
4
+
5
+ const { args, secrets, inputs, outputs } = forUnit(databases.existingS3)
6
+
7
+ export default outputs({
8
+ s3: {
9
+ endpoints: parseEndpoints(args.endpoints, inputs.endpoints),
10
+ region: args.region,
11
+ accessKey: args.accessKey,
12
+ secretKey: secrets.secretKey,
13
+ buckets: args.buckets,
14
+ },
15
+ })