@minecraft/server-admin 1.0.0-beta.00001b37

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/.eslintrc.json ADDED
@@ -0,0 +1,23 @@
1
+ {
2
+ "env": {
3
+ "browser": true,
4
+ "es2021": true
5
+ },
6
+ "extends": [
7
+ "eslint:recommended",
8
+ "plugin:@typescript-eslint/recommended"
9
+ ],
10
+ "overrides": [
11
+ ],
12
+ "parser": "@typescript-eslint/parser",
13
+ "parserOptions": {
14
+ "ecmaVersion": "latest",
15
+ "sourceType": "module"
16
+ },
17
+ "plugins": [
18
+ "@typescript-eslint"
19
+ ],
20
+ "rules": {
21
+ "@typescript-eslint/no-explicit-any": "off"
22
+ }
23
+ }
package/README.md ADDED
@@ -0,0 +1,9 @@
1
+ # `@minecraft/server-admin`
2
+
3
+ Contains types related to administering a Bedrock Dedicated Server. These types allow for the configuration of variables and secrets in JSON files in the Bedrock Dedicated Server folder. These types cannot be used on Minecraft clients.
4
+
5
+ ## **NOTE: This version of this module is still in pre-release. It may change or it may be removed in future releases.**
6
+
7
+ See full documentation for this module here:
8
+
9
+ https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/@minecraft/server-admin/@minecraft/server-admin
package/index.d.ts ADDED
@@ -0,0 +1,81 @@
1
+ // Type definitions for Minecraft Bedrock Edition script APIs
2
+ // Project: https://docs.microsoft.com/minecraft/creator/
3
+ // Definitions by: Jake Shirley <https://github.com/JakeShirley>
4
+ // Mike Ammerlaan <https://github.com/mammerla>
5
+
6
+ /* *****************************************************************************
7
+ Copyright (c) Microsoft Corporation.
8
+ ***************************************************************************** */
9
+ /**
10
+ * @packageDocumentation
11
+ * Contains types related to administering a Bedrock Dedicated
12
+ * Server. These types allow for the configuration of variables
13
+ * and secrets in JSON files in the Bedrock Dedicated Server
14
+ * folder. These types cannot be used on Minecraft clients.
15
+ *
16
+ * Manifest Details
17
+ * ```json
18
+ * {
19
+ * "module_name": "@minecraft/server-admin",
20
+ * "version": "1.0.0-beta.00001b37"
21
+ * }
22
+ * ```
23
+ *
24
+ */
25
+ /**
26
+ * This represents a placeholder object that represents a
27
+ * secret string. The contents of that string are not available
28
+ * to script; this object is just a placeholder.
29
+ */
30
+ // tslint:disable-next-line:no-unnecessary-class
31
+ export class SecretString {
32
+ constructor(value: string);
33
+ }
34
+ /**
35
+ * A collection of server secrets defined in dedicated server
36
+ * configuration.
37
+ */
38
+ export class ServerSecrets {
39
+ /**
40
+ * A list of available, configured server secrets.
41
+ */
42
+ readonly names: string[];
43
+ /**
44
+ * @remarks
45
+ * Returns a SecretString that is a placeholder for a secret
46
+ * configured in a JSON file. In certain objects, like an
47
+ * HttpHeader, this Secret is resolved at the time of execution
48
+ * but is not made available to the script environment.
49
+ * @param name
50
+ */
51
+ get(name: string): SecretString;
52
+ protected constructor();
53
+ }
54
+ /**
55
+ * A collection of server variables defined in dedicated server
56
+ * configuration.
57
+ */
58
+ export class ServerVariables {
59
+ /**
60
+ * A list of available, configured server variables.
61
+ */
62
+ readonly names: string[];
63
+ /**
64
+ * @remarks
65
+ * Returns the value of variable that has been configured in a
66
+ * dedicated server configuration JSON file.
67
+ * @param name
68
+ */
69
+ get(name: string): any;
70
+ protected constructor();
71
+ }
72
+ /**
73
+ * A globally available object that returns a list of
74
+ * dedicated-server configured secrets.
75
+ */
76
+ export const secrets: ServerSecrets;
77
+ /**
78
+ * A globally available object that returns a list of
79
+ * dedicated-server configured variables.
80
+ */
81
+ export const variables: ServerVariables;
package/package.json ADDED
@@ -0,0 +1,16 @@
1
+ {
2
+ "name": "@minecraft/server-admin",
3
+ "version": "1.0.0-beta.00001b37",
4
+ "description": "",
5
+ "contributors": [
6
+ {
7
+ "name": "Jake Shirley",
8
+ "email": "jake@xbox.com"
9
+ },
10
+ {
11
+ "name": "Mike Ammerlaan",
12
+ "email": "mikeam@microsoft.com"
13
+ }
14
+ ],
15
+ "license": "MIT"
16
+ }
package/tests.ts ADDED
@@ -0,0 +1,3 @@
1
+ import * as serverAdmin from '@minecraft/server-admin';
2
+
3
+ serverAdmin.secrets.get('authtoken');
package/tsconfig.json ADDED
@@ -0,0 +1,20 @@
1
+ {
2
+ "compilerOptions": {
3
+ "module": "commonjs",
4
+ "lib": ["es6"],
5
+ "target": "es6",
6
+ "forceConsistentCasingInFileNames": true,
7
+ "noEmit": true,
8
+ "noImplicitAny": true,
9
+ "noImplicitThis": true,
10
+ "strictFunctionTypes": true,
11
+ "strictNullChecks": true,
12
+ "baseUrl": "../",
13
+ "typeRoots": ["../"],
14
+ "types": []
15
+ },
16
+ "files": [
17
+ "index.d.ts",
18
+ "tests.ts"
19
+ ]
20
+ }