@deafwave/osrs-botmaker-config-manager 0.2.6
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/README.md +54 -0
- package/dist/data/config-scope.d.ts +31 -0
- package/dist/data/config-scope.js +302 -0
- package/dist/data/group/aliases.d.ts +4 -0
- package/dist/data/group/aliases.js +17 -0
- package/dist/data/group/booleans.d.ts +2 -0
- package/dist/data/group/booleans.js +5 -0
- package/dist/data/group/json.d.ts +2 -0
- package/dist/data/group/json.js +5 -0
- package/dist/data/group/keys.d.ts +4 -0
- package/dist/data/group/keys.js +10 -0
- package/dist/data/group/number-arrays.d.ts +2 -0
- package/dist/data/group/number-arrays.js +5 -0
- package/dist/data/group/numbers.d.ts +4 -0
- package/dist/data/group/numbers.js +7 -0
- package/dist/data/group/string-arrays.d.ts +2 -0
- package/dist/data/group/string-arrays.js +5 -0
- package/dist/data/group/strings.d.ts +4 -0
- package/dist/data/group/strings.js +26 -0
- package/dist/data/group/summary.d.ts +1 -0
- package/dist/data/group/summary.js +30 -0
- package/dist/data/profile/booleans.d.ts +5 -0
- package/dist/data/profile/booleans.js +11 -0
- package/dist/data/profile/config.d.ts +5 -0
- package/dist/data/profile/config.js +23 -0
- package/dist/data/profile/json.d.ts +2 -0
- package/dist/data/profile/json.js +5 -0
- package/dist/data/profile/keys.d.ts +5 -0
- package/dist/data/profile/keys.js +41 -0
- package/dist/data/profile/number-arrays.d.ts +2 -0
- package/dist/data/profile/number-arrays.js +5 -0
- package/dist/data/profile/numbers.d.ts +7 -0
- package/dist/data/profile/numbers.js +15 -0
- package/dist/data/profile/string-arrays.d.ts +2 -0
- package/dist/data/profile/string-arrays.js +5 -0
- package/dist/data/profile/strings.d.ts +6 -0
- package/dist/data/profile/strings.js +43 -0
- package/dist/data/shared/accessors.d.ts +35 -0
- package/dist/data/shared/accessors.js +95 -0
- package/dist/data/shared/normalize-config-value.d.ts +1 -0
- package/dist/data/shared/normalize-config-value.js +6 -0
- package/dist/data/shared/parse-boolean.d.ts +1 -0
- package/dist/data/shared/parse-boolean.js +13 -0
- package/dist/data/shared/parse-number.d.ts +3 -0
- package/dist/data/shared/parse-number.js +20 -0
- package/dist/data/shared/profile-group.d.ts +3 -0
- package/dist/data/shared/profile-group.js +13 -0
- package/dist/data/shared/set-rs-profile-configuration.d.ts +5 -0
- package/dist/data/shared/set-rs-profile-configuration.js +7 -0
- package/dist/data/shared/split-csv.d.ts +1 -0
- package/dist/data/shared/split-csv.js +4 -0
- package/dist/data/shared/storage.d.ts +10 -0
- package/dist/data/shared/storage.js +58 -0
- package/dist/data/shared/string-array-codec.d.ts +2 -0
- package/dist/data/shared/string-array-codec.js +19 -0
- package/dist/data/shared/string-array.d.ts +2 -0
- package/dist/data/shared/string-array.js +14 -0
- package/dist/data/shared/types.d.ts +4 -0
- package/dist/data/shared/types.js +1 -0
- package/dist/data/shared/write-config.d.ts +2 -0
- package/dist/data/shared/write-config.js +6 -0
- package/dist/data/storage.d.ts +14 -0
- package/dist/data/storage.js +62 -0
- package/dist/index.d.ts +42 -0
- package/dist/index.js +56 -0
- package/dist/index.npm.d.ts +41 -0
- package/dist/index.npm.js +10 -0
- package/package.json +81 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { getGroupValue, setGroupValue } from './data/group/aliases.js';
|
|
2
|
+
import { getGroupBoolean } from './data/group/booleans.js';
|
|
3
|
+
import { getGroupJson } from './data/group/json.js';
|
|
4
|
+
import { getGroupKeys, unsetGroupValue } from './data/group/keys.js';
|
|
5
|
+
import { getGroupNumberArray } from './data/group/number-arrays.js';
|
|
6
|
+
import { getGroupFloat, getGroupInt, getGroupNumber } from './data/group/numbers.js';
|
|
7
|
+
import { getGroupStringArray } from './data/group/string-arrays.js';
|
|
8
|
+
import { getGroupString } from './data/group/strings.js';
|
|
9
|
+
import { logGroupConfigSummary } from './data/group/summary.js';
|
|
10
|
+
import { getProfileBoolean, getProfileBooleanForProfileKey } from './data/profile/booleans.js';
|
|
11
|
+
import { getProfileValue, setProfileValue, unsetProfileValue } from './data/profile/config.js';
|
|
12
|
+
import { getProfileJson } from './data/profile/json.js';
|
|
13
|
+
import { getProfileConfigKeys, getProfileGroupName, getProfileKey, getProfileKeysForGroup, logProfileConfigSummary } from './data/profile/keys.js';
|
|
14
|
+
import { getProfileNumberArray } from './data/profile/number-arrays.js';
|
|
15
|
+
import { getProfileFloat, getProfileInt, getProfileIntForProfileKey, getProfileNumber } from './data/profile/numbers.js';
|
|
16
|
+
import { getProfileStringArray } from './data/profile/string-arrays.js';
|
|
17
|
+
import { getProfileString, getProfileStringForProfileKey } from './data/profile/strings.js';
|
|
18
|
+
export const group = {
|
|
19
|
+
get: getGroupValue,
|
|
20
|
+
getBoolean: getGroupBoolean,
|
|
21
|
+
getFloat: getGroupFloat,
|
|
22
|
+
getInt: getGroupInt,
|
|
23
|
+
getJson: getGroupJson,
|
|
24
|
+
getKeys: getGroupKeys,
|
|
25
|
+
getNumber: getGroupNumber,
|
|
26
|
+
getNumberArray: getGroupNumberArray,
|
|
27
|
+
getString: getGroupString,
|
|
28
|
+
getStringArray: getGroupStringArray,
|
|
29
|
+
logSummary: logGroupConfigSummary,
|
|
30
|
+
set: setGroupValue,
|
|
31
|
+
unset: unsetGroupValue,
|
|
32
|
+
};
|
|
33
|
+
export const profile = {
|
|
34
|
+
get: getProfileValue,
|
|
35
|
+
getBoolean: getProfileBoolean,
|
|
36
|
+
getBooleanForProfileKey: getProfileBooleanForProfileKey,
|
|
37
|
+
getConfigKeys: getProfileConfigKeys,
|
|
38
|
+
getFloat: getProfileFloat,
|
|
39
|
+
getGroupName: getProfileGroupName,
|
|
40
|
+
getInt: getProfileInt,
|
|
41
|
+
getIntForProfileKey: getProfileIntForProfileKey,
|
|
42
|
+
getJson: getProfileJson,
|
|
43
|
+
getKey: getProfileKey,
|
|
44
|
+
getKeysForGroup: getProfileKeysForGroup,
|
|
45
|
+
getNumber: getProfileNumber,
|
|
46
|
+
getNumberArray: getProfileNumberArray,
|
|
47
|
+
getString: getProfileString,
|
|
48
|
+
getStringArray: getProfileStringArray,
|
|
49
|
+
getStringForProfileKey: getProfileStringForProfileKey,
|
|
50
|
+
logSummary: logProfileConfigSummary,
|
|
51
|
+
set: setProfileValue,
|
|
52
|
+
unset: unsetProfileValue,
|
|
53
|
+
};
|
|
54
|
+
export { sendConfig } from './data/group/keys.js';
|
|
55
|
+
export { createConfigScope, logConfigValues } from './data/config-scope.js';
|
|
56
|
+
export { getStoredBoolean, getStoredInt, getStoredString, setStoredBoolean, setStoredInt, setStoredString } from './data/storage.js';
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export declare const config: {
|
|
2
|
+
group: {
|
|
3
|
+
get: (groupName: string, key: string) => import("./data/group/aliases.js").ConfigAliasValue;
|
|
4
|
+
getBoolean: (groupName: string, key: string, fallback?: boolean | undefined) => boolean;
|
|
5
|
+
getFloat: (groupName: string, key: string, fallback?: number | undefined) => number;
|
|
6
|
+
getInt: (groupName: string, key: string, fallback?: number | undefined) => number;
|
|
7
|
+
getJson: <T>(groupName: string, key: string, fallback: T) => T;
|
|
8
|
+
getKeys: (prefix: string) => string[];
|
|
9
|
+
getNumber: (groupName: string, key: string, fallback?: number | undefined) => number;
|
|
10
|
+
getNumberArray: (groupName: string, key: string, fallback?: number[] | undefined) => number[];
|
|
11
|
+
getString: (groupName: string, key: string, fallback?: string) => string;
|
|
12
|
+
getStringArray: (groupName: string, key: string, fallback?: string[] | undefined) => string[];
|
|
13
|
+
logSummary: (groupName: string) => void;
|
|
14
|
+
set: (groupName: string, key: string, value: unknown, options?: import("./index.js").ConfigWriteOptions | undefined) => void;
|
|
15
|
+
unset: (groupName: string, key: string, options?: import("./index.js").ConfigWriteOptions | undefined) => void;
|
|
16
|
+
};
|
|
17
|
+
profile: {
|
|
18
|
+
get: (groupName: string, key: string) => import("./data/profile/config.js").ProfileConfigAliasValue;
|
|
19
|
+
getBoolean: (groupName: string, key: string, fallback?: boolean | undefined) => boolean;
|
|
20
|
+
getBooleanForProfileKey: (groupName: string, profileKey: string, key: string, fallback?: boolean) => boolean;
|
|
21
|
+
getConfigKeys: (groupName: string, keyPrefix?: string) => string[];
|
|
22
|
+
getFloat: (groupName: string, key: string, fallback?: number | undefined) => number;
|
|
23
|
+
getGroupName: (groupName: string, profileKey: string) => string;
|
|
24
|
+
getInt: (groupName: string, key: string, fallback?: number | undefined) => number;
|
|
25
|
+
getIntForProfileKey: (groupName: string, profileKey: string, key: string, fallback?: number) => number;
|
|
26
|
+
getJson: <T>(groupName: string, key: string, fallback: T) => T;
|
|
27
|
+
getKey: () => string;
|
|
28
|
+
getKeysForGroup: (groupName: string) => string[];
|
|
29
|
+
getNumber: (groupName: string, key: string, fallback?: number | undefined) => number;
|
|
30
|
+
getNumberArray: (groupName: string, key: string, fallback?: number[] | undefined) => number[];
|
|
31
|
+
getString: (groupName: string, key: string, fallback?: string) => string;
|
|
32
|
+
getStringArray: (groupName: string, key: string, fallback?: string[] | undefined) => string[];
|
|
33
|
+
getStringForProfileKey: (groupName: string, profileKey: string, key: string, fallback?: string) => string;
|
|
34
|
+
logSummary: (groupName: string) => void;
|
|
35
|
+
set: (groupName: string, key: string, value: unknown, options?: import("./index.js").ConfigWriteOptions | undefined) => void;
|
|
36
|
+
unset: (groupName: string, key: string, options?: import("./index.js").ConfigWriteOptions | undefined) => void;
|
|
37
|
+
};
|
|
38
|
+
createConfigScope: (options: import("./index.js").ConfigScopeOptions) => import("./index.js").ConfigScope;
|
|
39
|
+
logConfigValues: ({ action, group, getAllValues, keyPrefix }: import("./index.js").LogConfigValuesOptions) => Record<string, string>;
|
|
40
|
+
sendConfig: () => void;
|
|
41
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { createConfigScope, logConfigValues } from './data/config-scope.js';
|
|
2
|
+
import { sendConfig } from './data/group/keys.js';
|
|
3
|
+
import { group, profile } from './index.js';
|
|
4
|
+
export const config = {
|
|
5
|
+
group,
|
|
6
|
+
profile,
|
|
7
|
+
createConfigScope,
|
|
8
|
+
logConfigValues,
|
|
9
|
+
sendConfig,
|
|
10
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@deafwave/osrs-botmaker-config-manager",
|
|
3
|
+
"version": "0.2.6",
|
|
4
|
+
"author": {
|
|
5
|
+
"name": "CodySimonds65",
|
|
6
|
+
"url": "https://github.com/CodySimonds65"
|
|
7
|
+
},
|
|
8
|
+
"description": "Config manager helpers for osrs-botmaker runtimes",
|
|
9
|
+
"license": "Apache-2.0",
|
|
10
|
+
"type": "module",
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "https://github.com/deafwave/osrs-botmaker-config-manager"
|
|
14
|
+
},
|
|
15
|
+
"bugs": {
|
|
16
|
+
"url": "https://github.com/deafwave/osrs-botmaker-config-manager/issues"
|
|
17
|
+
},
|
|
18
|
+
"homepage": "https://github.com/deafwave/osrs-botmaker-config-manager#readme",
|
|
19
|
+
"contributors": [
|
|
20
|
+
{
|
|
21
|
+
"name": "Chandler Ferry",
|
|
22
|
+
"url": "https://github.com/ChandlerFerry"
|
|
23
|
+
}
|
|
24
|
+
],
|
|
25
|
+
"publishConfig": {
|
|
26
|
+
"access": "public",
|
|
27
|
+
"registry": "https://registry.npmjs.org"
|
|
28
|
+
},
|
|
29
|
+
"main": "./dist/index.js",
|
|
30
|
+
"types": "./dist/index.d.ts",
|
|
31
|
+
"exports": {
|
|
32
|
+
".": {
|
|
33
|
+
"types": "./dist/index.d.ts",
|
|
34
|
+
"default": "./dist/index.js"
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"files": [
|
|
38
|
+
"dist"
|
|
39
|
+
],
|
|
40
|
+
"scripts": {
|
|
41
|
+
"build": "tsc -p tsconfig.json",
|
|
42
|
+
"test": "jest",
|
|
43
|
+
"lint": "eslint .",
|
|
44
|
+
"lint:fix": "eslint . --fix"
|
|
45
|
+
},
|
|
46
|
+
"peerDependencies": {
|
|
47
|
+
"@deafwave/osrs-botmaker-types": "^0.7.34"
|
|
48
|
+
},
|
|
49
|
+
"devDependencies": {
|
|
50
|
+
"@eslint/eslintrc": "^2.1.1",
|
|
51
|
+
"@eslint/js": "~8.48.0",
|
|
52
|
+
"@tsconfig/node20": "^20.1.2",
|
|
53
|
+
"@tsconfig/strictest": "^2.0.3",
|
|
54
|
+
"@types/eslint": "^8.56.5",
|
|
55
|
+
"@types/eslint__js": "^8.42.3",
|
|
56
|
+
"@types/fs-extra": "^11.0.4",
|
|
57
|
+
"@types/jest": "^29.5.14",
|
|
58
|
+
"@types/node": "^24.3.1",
|
|
59
|
+
"@typescript-eslint/eslint-plugin": "^7.1.1",
|
|
60
|
+
"@typescript-eslint/parser": "^7.1.1",
|
|
61
|
+
"chalk": "^4.1.0",
|
|
62
|
+
"cpy-cli": "^5.0.0",
|
|
63
|
+
"eslint": "^8.57.0",
|
|
64
|
+
"eslint-config-prettier": "^9.1.0",
|
|
65
|
+
"eslint-import-resolver-typescript": "^3.6.1",
|
|
66
|
+
"eslint-plugin-import": "^2.29.1",
|
|
67
|
+
"eslint-plugin-jest": "^27.9.0",
|
|
68
|
+
"eslint-plugin-unicorn": "^51.0.1",
|
|
69
|
+
"fs-extra": "^11.2.0",
|
|
70
|
+
"jest": "^30.0.0",
|
|
71
|
+
"jsonc-eslint-parser": "^2.4.0",
|
|
72
|
+
"prettier": "^3.2.5",
|
|
73
|
+
"prettier-eslint": "^16.3.0",
|
|
74
|
+
"ts-jest": "^29.4.0",
|
|
75
|
+
"ts-patch": "^3.3.0",
|
|
76
|
+
"tsx": "^4.7.1",
|
|
77
|
+
"typescript": "5.2.2",
|
|
78
|
+
"typescript-eslint": "^7.1.1",
|
|
79
|
+
"typescript-transform-paths": "^3.5.5"
|
|
80
|
+
}
|
|
81
|
+
}
|