@fgv/ts-res 5.1.0-2 → 5.1.0-4

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.
Files changed (50) hide show
  1. package/dist/packlets/config/common.js +78 -0
  2. package/dist/packlets/config/configInitFactory.js +258 -0
  3. package/dist/packlets/config/convert.js +56 -0
  4. package/dist/packlets/config/index.browser.js +34 -0
  5. package/dist/packlets/config/index.js +28 -0
  6. package/dist/packlets/config/json.js +23 -0
  7. package/dist/packlets/config/predefined/default.js +138 -0
  8. package/dist/packlets/config/predefined/extended.js +190 -0
  9. package/dist/packlets/config/predefined/index.js +25 -0
  10. package/dist/packlets/config/systemConfiguration.js +147 -0
  11. package/dist/packlets/qualifier-types/config/convert.js +124 -0
  12. package/dist/packlets/qualifier-types/config/index.js +25 -0
  13. package/dist/packlets/qualifier-types/config/json.js +32 -0
  14. package/dist/packlets/resource-types/config/convert.js +35 -0
  15. package/dist/packlets/resource-types/config/index.js +25 -0
  16. package/dist/packlets/resource-types/config/json.js +23 -0
  17. package/dist/tsdoc-metadata.json +1 -1
  18. package/lib/packlets/config/common.d.ts +35 -0
  19. package/lib/packlets/config/common.js +97 -0
  20. package/lib/packlets/config/configInitFactory.d.ts +217 -0
  21. package/lib/packlets/config/configInitFactory.js +303 -0
  22. package/lib/packlets/config/convert.d.ts +23 -0
  23. package/lib/packlets/config/convert.js +93 -0
  24. package/lib/packlets/config/index.browser.d.ts +7 -0
  25. package/lib/packlets/config/index.browser.js +74 -0
  26. package/lib/packlets/config/index.d.ts +7 -0
  27. package/lib/packlets/config/index.js +68 -0
  28. package/lib/packlets/config/json.d.ts +20 -0
  29. package/lib/packlets/config/json.js +24 -0
  30. package/lib/packlets/config/predefined/default.d.ts +57 -0
  31. package/lib/packlets/config/predefined/default.js +141 -0
  32. package/lib/packlets/config/predefined/extended.d.ts +25 -0
  33. package/lib/packlets/config/predefined/extended.js +193 -0
  34. package/lib/packlets/config/predefined/index.d.ts +4 -0
  35. package/lib/packlets/config/predefined/index.js +62 -0
  36. package/lib/packlets/config/systemConfiguration.d.ts +94 -0
  37. package/lib/packlets/config/systemConfiguration.js +152 -0
  38. package/lib/packlets/qualifier-types/config/convert.d.ts +65 -0
  39. package/lib/packlets/qualifier-types/config/convert.js +161 -0
  40. package/lib/packlets/qualifier-types/config/index.d.ts +4 -0
  41. package/lib/packlets/qualifier-types/config/index.js +64 -0
  42. package/lib/packlets/qualifier-types/config/json.d.ts +91 -0
  43. package/lib/packlets/qualifier-types/config/json.js +35 -0
  44. package/lib/packlets/resource-types/config/convert.d.ts +8 -0
  45. package/lib/packlets/resource-types/config/convert.js +38 -0
  46. package/lib/packlets/resource-types/config/index.d.ts +4 -0
  47. package/lib/packlets/resource-types/config/index.js +64 -0
  48. package/lib/packlets/resource-types/config/json.d.ts +11 -0
  49. package/lib/packlets/resource-types/config/json.js +24 -0
  50. package/package.json +28 -26
@@ -0,0 +1,190 @@
1
+ /*
2
+ * Copyright (c) 2025 Erik Fortune
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ * of this software and associated documentation files (the "Software"), to deal
6
+ * in the Software without restriction, including without limitation the rights
7
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ * copies of the Software, and to permit persons to whom the Software is
9
+ * furnished to do so, subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in all
12
+ * copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ * SOFTWARE.
21
+ */
22
+ /**
23
+ * Example extended qualifier types.
24
+ * @public
25
+ */
26
+ export const ExtendedQualifierTypes = [
27
+ {
28
+ name: 'language',
29
+ systemType: 'language',
30
+ configuration: {
31
+ allowContextList: true
32
+ }
33
+ },
34
+ {
35
+ name: 'territory',
36
+ systemType: 'territory',
37
+ configuration: {
38
+ allowContextList: false,
39
+ acceptLowercase: false
40
+ }
41
+ },
42
+ {
43
+ name: 'role',
44
+ systemType: 'literal',
45
+ configuration: {
46
+ enumeratedValues: ['admin', 'agent', 'user', 'guest']
47
+ }
48
+ },
49
+ {
50
+ name: 'environment',
51
+ systemType: 'literal',
52
+ configuration: {
53
+ enumeratedValues: ['production', 'integration', 'development', 'test', 'ephemeral']
54
+ }
55
+ },
56
+ {
57
+ name: 'currency',
58
+ systemType: 'literal',
59
+ configuration: {
60
+ caseSensitive: true,
61
+ enumeratedValues: ['USD', 'EUR', 'GBP', 'JPY', 'CNY']
62
+ }
63
+ },
64
+ {
65
+ name: 'market',
66
+ systemType: 'literal',
67
+ configuration: {
68
+ enumeratedValues: [
69
+ 'world',
70
+ 'americas',
71
+ 'europe',
72
+ 'asia',
73
+ 'oceania',
74
+ 'africa',
75
+ 'middle-east',
76
+ 'latin-america',
77
+ 'caribbean',
78
+ 'central-america',
79
+ 'south-america',
80
+ 'north-america',
81
+ 'nordics',
82
+ 'baltic',
83
+ 'balkans',
84
+ 'eastern-europe',
85
+ 'western-europe',
86
+ 'central-europe',
87
+ 'eastern-africa',
88
+ 'western-africa',
89
+ 'central-africa',
90
+ 'north-africa',
91
+ 'south-africa',
92
+ 'middle-africa',
93
+ 'southeast-asia'
94
+ ],
95
+ hierarchy: {
96
+ americas: 'world',
97
+ europe: 'world',
98
+ asia: 'world',
99
+ oceania: 'world',
100
+ africa: 'world',
101
+ 'middle-east': 'world',
102
+ 'latin-america': 'americas',
103
+ caribbean: 'americas',
104
+ 'central-america': 'americas',
105
+ 'south-america': 'americas',
106
+ 'north-america': 'americas',
107
+ nordics: 'europe',
108
+ baltic: 'europe',
109
+ balkans: 'europe',
110
+ 'eastern-europe': 'europe',
111
+ 'western-europe': 'europe',
112
+ 'central-europe': 'europe',
113
+ 'eastern-africa': 'africa',
114
+ 'western-africa': 'africa',
115
+ 'central-africa': 'africa',
116
+ 'north-africa': 'africa',
117
+ 'south-africa': 'africa',
118
+ 'middle-africa': 'africa',
119
+ 'southeast-asia': 'asia'
120
+ }
121
+ }
122
+ }
123
+ ];
124
+ /**
125
+ * Example extended qualifiers.
126
+ * @public
127
+ */
128
+ export const ExtendedQualifiers = [
129
+ {
130
+ name: 'homeTerritory',
131
+ token: 'home',
132
+ typeName: 'territory',
133
+ defaultPriority: 900
134
+ },
135
+ {
136
+ name: 'currentTerritory',
137
+ token: 'geo',
138
+ typeName: 'territory',
139
+ defaultPriority: 850
140
+ },
141
+ {
142
+ name: 'language',
143
+ token: 'lang',
144
+ typeName: 'language',
145
+ defaultPriority: 800
146
+ },
147
+ {
148
+ name: 'market',
149
+ typeName: 'market',
150
+ defaultPriority: 750
151
+ },
152
+ {
153
+ name: 'role',
154
+ typeName: 'role',
155
+ defaultPriority: 700
156
+ },
157
+ {
158
+ name: 'environment',
159
+ token: 'env',
160
+ typeName: 'environment',
161
+ defaultPriority: 650
162
+ },
163
+ {
164
+ name: 'currency',
165
+ typeName: 'currency',
166
+ defaultPriority: 600
167
+ }
168
+ ];
169
+ /**
170
+ * Example resource types.
171
+ * @public
172
+ */
173
+ export const ExtendedResourceTypes = [
174
+ {
175
+ name: 'json',
176
+ typeName: 'json'
177
+ }
178
+ ];
179
+ /**
180
+ * An example system configuration demonstrating various configuration options.
181
+ * @public
182
+ */
183
+ export const ExtendedSystemConfiguration = {
184
+ name: 'extended-example',
185
+ description: 'An example system configuration demonstrating various configuration options',
186
+ qualifierTypes: [...ExtendedQualifierTypes],
187
+ qualifiers: [...ExtendedQualifiers],
188
+ resourceTypes: [...ExtendedResourceTypes]
189
+ };
190
+ //# sourceMappingURL=extended.js.map
@@ -0,0 +1,25 @@
1
+ /*
2
+ * Copyright (c) 2025 Erik Fortune
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ * of this software and associated documentation files (the "Software"), to deal
6
+ * in the Software without restriction, including without limitation the rights
7
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ * copies of the Software, and to permit persons to whom the Software is
9
+ * furnished to do so, subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in all
12
+ * copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ * SOFTWARE.
21
+ */
22
+ import * as Default from './default';
23
+ import * as Example from './extended';
24
+ export { Default, Example };
25
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,147 @@
1
+ /*
2
+ * Copyright (c) 2025 Erik Fortune
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ * of this software and associated documentation files (the "Software"), to deal
6
+ * in the Software without restriction, including without limitation the rights
7
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ * copies of the Software, and to permit persons to whom the Software is
9
+ * furnished to do so, subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in all
12
+ * copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ * SOFTWARE.
21
+ */
22
+ import { captureResult, mapResults, fail, succeed, omit } from '@fgv/ts-utils';
23
+ import { QualifierTypeCollector } from '../qualifier-types';
24
+ import { QualifierCollector } from '../qualifiers';
25
+ import { ResourceTypeCollector } from '../resource-types';
26
+ import { systemConfiguration } from './convert';
27
+ import { JsonFile, sanitizeJsonObject } from '@fgv/ts-json-base';
28
+ import { BuiltInQualifierTypeFactory, BuiltInResourceTypeFactory } from './configInitFactory';
29
+ /**
30
+ * Creates a copy of the provided {@link Config.Model.ISystemConfiguration | system configuration}
31
+ * with updated qualifier default values.
32
+ * @param config - The base {@link Config.Model.ISystemConfiguration | system configuration} to copy.
33
+ * @param qualifierDefaultValues - Map of qualifier names to default values. Use `null` to remove existing values.
34
+ * @returns `Success` with the updated {@link Config.Model.ISystemConfiguration | system configuration}
35
+ * if successful, `Failure` with an error message otherwise.
36
+ * @public
37
+ */
38
+ export function updateSystemConfigurationQualifierDefaultValues(config, qualifierDefaultValues // eslint-disable-line @rushstack/no-new-null
39
+ ) {
40
+ // Create a copy of the config
41
+ return sanitizeJsonObject(config).onSuccess((updatedConfig) => {
42
+ // Create a map of existing qualifier names for validation
43
+ const existingQualifierNames = new Set(updatedConfig.qualifiers.map((q) => q.name));
44
+ // Validate that all specified qualifiers exist in the configuration
45
+ for (const qualifierName of Object.keys(qualifierDefaultValues)) {
46
+ if (!existingQualifierNames.has(qualifierName)) {
47
+ return fail(`Qualifier '${qualifierName}' not found in system configuration`);
48
+ }
49
+ }
50
+ // Update qualifier default values
51
+ updatedConfig.qualifiers = updatedConfig.qualifiers.map((qualifier) => {
52
+ if (qualifier.name in qualifierDefaultValues) {
53
+ const newDefaultValue = qualifierDefaultValues[qualifier.name];
54
+ // Create a copy of the qualifier
55
+ const updatedQualifier = Object.assign({}, qualifier);
56
+ if (newDefaultValue === null) {
57
+ // Remove the default value
58
+ delete updatedQualifier.defaultValue;
59
+ }
60
+ else {
61
+ // Set the new default value
62
+ updatedQualifier.defaultValue = newDefaultValue;
63
+ }
64
+ return updatedQualifier;
65
+ }
66
+ return qualifier;
67
+ });
68
+ return succeed(updatedConfig);
69
+ });
70
+ }
71
+ /**
72
+ * A system configuration for both runtime or build.
73
+ * @public
74
+ */
75
+ export class SystemConfiguration {
76
+ /**
77
+ * The name of this system configuration.
78
+ */
79
+ get name() {
80
+ return this._config.name;
81
+ }
82
+ /**
83
+ * The description of this system configuration.
84
+ */
85
+ get description() {
86
+ return this._config.description;
87
+ }
88
+ /**
89
+ * Constructs a new instance of a {@link Config.SystemConfiguration | SystemConfiguration} from the
90
+ * supplied {@link Config.Model.ISystemConfiguration | system configuration}.
91
+ * @param config - The {@link Config.Model.ISystemConfiguration | system configuration} to use.
92
+ * @public
93
+ */
94
+ constructor(config, initParams) {
95
+ var _a, _b;
96
+ this._config = config;
97
+ const qualifierTypeFactory = (_a = initParams === null || initParams === void 0 ? void 0 : initParams.qualifierTypeFactory) !== null && _a !== void 0 ? _a : new BuiltInQualifierTypeFactory();
98
+ const resourceTypeFactory = (_b = initParams === null || initParams === void 0 ? void 0 : initParams.resourceTypeFactory) !== null && _b !== void 0 ? _b : new BuiltInResourceTypeFactory();
99
+ this.qualifierTypes = QualifierTypeCollector.create({
100
+ qualifierTypes: mapResults(config.qualifierTypes.map((tc) => qualifierTypeFactory.create(tc))).orThrow()
101
+ }).orThrow();
102
+ this.qualifiers = QualifierCollector.create({
103
+ qualifierTypes: this.qualifierTypes,
104
+ qualifiers: config.qualifiers
105
+ }).orThrow();
106
+ this.resourceTypes = ResourceTypeCollector.create({
107
+ resourceTypes: mapResults(config.resourceTypes.map((rt) => resourceTypeFactory.create(rt))).orThrow()
108
+ }).orThrow();
109
+ }
110
+ /**
111
+ * Creates a new {@link Config.SystemConfiguration | SystemConfiguration} from the supplied
112
+ * {@link Config.Model.ISystemConfiguration | system configuration}.
113
+ * @param config - The {@link Config.Model.ISystemConfiguration | system configuration} to use.
114
+ * @param initParams - Optional {@link Config.ISystemConfigurationInitParams | initialization parameters}.
115
+ * @returns `Success` with the new {@link Config.SystemConfiguration | SystemConfiguration}
116
+ * if successful, `Failure` with an error message otherwise.
117
+ * @public
118
+ */
119
+ static create(config, initParams) {
120
+ if (initParams === null || initParams === void 0 ? void 0 : initParams.qualifierDefaultValues) {
121
+ /* c8 ignore next 9 - functional code tested but coverage intermittently missed */
122
+ return updateSystemConfigurationQualifierDefaultValues(config, initParams.qualifierDefaultValues).onSuccess((updatedConfig) => captureResult(() => new SystemConfiguration(updatedConfig, omit(initParams, ['qualifierDefaultValues']))));
123
+ }
124
+ return captureResult(() => new SystemConfiguration(config, initParams));
125
+ }
126
+ /**
127
+ * Loads a {@link Config.SystemConfiguration | SystemConfiguration} from a file.
128
+ * @param path - The path to the file to load.
129
+ * @returns `Success` with the {@link Config.SystemConfiguration | SystemConfiguration}
130
+ * if successful, `Failure` with an error message otherwise.
131
+ * @public
132
+ */
133
+ static loadFromFile(path, initParams) {
134
+ return JsonFile.convertJsonFileSync(path, systemConfiguration).onSuccess((config) => SystemConfiguration.create(config, initParams));
135
+ }
136
+ /**
137
+ * Returns the {@link Config.Model.ISystemConfiguration | system configuration} that this
138
+ * {@link Config.SystemConfiguration | SystemConfiguration} was created from.
139
+ * @returns `Success` with the {@link Config.Model.ISystemConfiguration | system configuration}
140
+ * if successful, `Failure` with an error message otherwise.
141
+ * @public
142
+ */
143
+ getConfig() {
144
+ return systemConfiguration.convert(this._config);
145
+ }
146
+ }
147
+ //# sourceMappingURL=systemConfiguration.js.map
@@ -0,0 +1,124 @@
1
+ /*
2
+ * Copyright (c) 2025 Erik Fortune
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ * of this software and associated documentation files (the "Software"), to deal
6
+ * in the Software without restriction, including without limitation the rights
7
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ * copies of the Software, and to permit persons to whom the Software is
9
+ * furnished to do so, subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in all
12
+ * copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ * SOFTWARE.
21
+ */
22
+ /* eslint-disable @rushstack/typedef-var */
23
+ import { Converters } from '@fgv/ts-utils';
24
+ import * as Common from '../../common';
25
+ import { Converters as JsonConverters } from '@fgv/ts-json-base';
26
+ /**
27
+ * A `Converter` for {@link QualifierTypes.Config.ILanguageQualifierTypeConfig | LanguageQualifierTypeConfig} objects.
28
+ * @returns A `Converter` for {@link QualifierTypes.Config.ILanguageQualifierTypeConfig | LanguageQualifierTypeConfig} objects.
29
+ * @public
30
+ */
31
+ export const languageQualifierTypeConfig = Converters.strictObject({
32
+ allowContextList: Converters.boolean.optional()
33
+ });
34
+ /**
35
+ * A `Converter` for {@link QualifierTypes.Config.ITerritoryQualifierTypeConfig | TerritoryQualifierTypeConfig} objects.
36
+ * @returns A `Converter` for {@link QualifierTypes.Config.ITerritoryQualifierTypeConfig | TerritoryQualifierTypeConfig} objects.
37
+ * @public
38
+ */
39
+ export const territoryQualifierTypeConfig = Converters.strictObject({
40
+ allowContextList: Converters.boolean,
41
+ acceptLowercase: Converters.boolean.optional(),
42
+ allowedTerritories: Converters.arrayOf(Converters.string).optional(),
43
+ hierarchy: Converters.recordOf(Converters.string).optional()
44
+ });
45
+ /**
46
+ * A `Converter` for {@link QualifierTypes.Config.ILiteralQualifierTypeConfig | LiteralQualifierTypeConfig} objects.
47
+ * @returns A `Converter` for {@link QualifierTypes.Config.ILiteralQualifierTypeConfig | LiteralQualifierTypeConfig} objects.
48
+ * @public
49
+ */
50
+ export const literalQualifierTypeConfig = Converters.strictObject({
51
+ allowContextList: Converters.boolean.optional(),
52
+ caseSensitive: Converters.boolean.optional(),
53
+ enumeratedValues: Converters.arrayOf(Converters.string).optional(),
54
+ hierarchy: Converters.recordOf(Converters.string).optional()
55
+ });
56
+ /**
57
+ * A `Converter` for {@link QualifierTypes.Config.ISystemLanguageQualifierTypeConfig | SystemLanguageQualifierTypeConfig} objects.
58
+ * @returns A `Converter` for {@link QualifierTypes.Config.ISystemLanguageQualifierTypeConfig | SystemLanguageQualifierTypeConfig} objects.
59
+ * @public
60
+ */
61
+ export const systemLanguageQualifierTypeConfig = Converters.strictObject({
62
+ name: Converters.string,
63
+ systemType: Converters.literal('language'),
64
+ configuration: languageQualifierTypeConfig.optional()
65
+ });
66
+ /**
67
+ * A `Converter` for {@link QualifierTypes.Config.ISystemTerritoryQualifierTypeConfig | SystemTerritoryQualifierTypeConfig} objects.
68
+ * @returns A `Converter` for {@link QualifierTypes.Config.ISystemTerritoryQualifierTypeConfig | SystemTerritoryQualifierTypeConfig} objects.
69
+ * @public
70
+ */
71
+ export const systemTerritoryQualifierTypeConfig = Converters.strictObject({
72
+ name: Converters.string,
73
+ systemType: Converters.literal('territory'),
74
+ configuration: territoryQualifierTypeConfig.optional()
75
+ });
76
+ /**
77
+ * A `Converter` for {@link QualifierTypes.Config.ISystemLiteralQualifierTypeConfig | SystemLiteralQualifierTypeConfig} objects.
78
+ * @returns A `Converter` for {@link QualifierTypes.Config.ISystemLiteralQualifierTypeConfig | SystemLiteralQualifierTypeConfig} objects.
79
+ * @public
80
+ */
81
+ export const systemLiteralQualifierTypeConfig = Converters.strictObject({
82
+ name: Converters.string,
83
+ systemType: Converters.literal('literal'),
84
+ configuration: literalQualifierTypeConfig.optional()
85
+ });
86
+ /**
87
+ * A `Converter` for {@link QualifierTypes.Config.ISystemQualifierTypeConfig | SystemQualifierTypeConfig} objects.
88
+ * @returns A `Converter` for {@link QualifierTypes.Config.ISystemQualifierTypeConfig | SystemQualifierTypeConfig} objects.
89
+ * @public
90
+ */
91
+ export const systemQualifierTypeConfig = Converters.discriminatedObject('systemType', {
92
+ language: systemLanguageQualifierTypeConfig,
93
+ territory: systemTerritoryQualifierTypeConfig,
94
+ literal: systemLiteralQualifierTypeConfig
95
+ });
96
+ /**
97
+ * A `Converter` for {@link QualifierTypes.Config.IQualifierTypeConfig | QualifierTypeConfig} objects.
98
+ * @returns A `Converter` for {@link QualifierTypes.Config.IQualifierTypeConfig | QualifierTypeConfig} objects.
99
+ * @param config - A `Converter` for the configuration object.
100
+ * @public
101
+ */
102
+ export function qualifierTypeConfig(config) {
103
+ return Converters.strictObject({
104
+ name: Common.Convert.qualifierTypeName,
105
+ systemType: Common.Convert.qualifierTypeName,
106
+ configuration: config.optional()
107
+ });
108
+ }
109
+ /**
110
+ * A `Converter` for {@link QualifierTypes.Config.IQualifierTypeConfig | QualifierTypeConfig} objects.
111
+ * @returns A `Converter` for {@link QualifierTypes.Config.IQualifierTypeConfig | QualifierTypeConfig} objects.
112
+ * @public
113
+ */
114
+ export const jsonQualifierTypeConfig = qualifierTypeConfig(JsonConverters.jsonObject);
115
+ /**
116
+ * A `Converter` for {@link QualifierTypes.Config.IAnyQualifierTypeConfig | AnyQualifierTypeConfig} objects.
117
+ * @returns A `Converter` for {@link QualifierTypes.Config.IAnyQualifierTypeConfig | AnyQualifierTypeConfig} objects.
118
+ * @public
119
+ */
120
+ export const anyQualifierTypeConfig = Converters.oneOf([
121
+ jsonQualifierTypeConfig,
122
+ systemQualifierTypeConfig
123
+ ]);
124
+ //# sourceMappingURL=convert.js.map
@@ -0,0 +1,25 @@
1
+ /*
2
+ * Copyright (c) 2025 Erik Fortune
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ * of this software and associated documentation files (the "Software"), to deal
6
+ * in the Software without restriction, including without limitation the rights
7
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ * copies of the Software, and to permit persons to whom the Software is
9
+ * furnished to do so, subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in all
12
+ * copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ * SOFTWARE.
21
+ */
22
+ import * as Convert from './convert';
23
+ export * from './json';
24
+ export { Convert };
25
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,32 @@
1
+ /*
2
+ * Copyright (c) 2025 Erik Fortune
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ * of this software and associated documentation files (the "Software"), to deal
6
+ * in the Software without restriction, including without limitation the rights
7
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ * copies of the Software, and to permit persons to whom the Software is
9
+ * furnished to do so, subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in all
12
+ * copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ * SOFTWARE.
21
+ */
22
+ /**
23
+ * Checks if a {@link QualifierTypes.Config.IAnyQualifierTypeConfig | qualifier type configuration} is a
24
+ * {@link QualifierTypes.Config.ISystemQualifierTypeConfig | system qualifier type configuration}.
25
+ * @param config - The {@link QualifierTypes.Config.IAnyQualifierTypeConfig | qualifier type configuration} to check.
26
+ * @returns `true` if the configuration is a system qualifier type configuration, `false` otherwise.
27
+ * @public
28
+ */
29
+ export function isSystemQualifierTypeConfig(config) {
30
+ return (config.systemType === 'language' || config.systemType === 'territory' || config.systemType === 'literal');
31
+ }
32
+ //# sourceMappingURL=json.js.map
@@ -0,0 +1,35 @@
1
+ /*
2
+ * Copyright (c) 2025 Erik Fortune
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ * of this software and associated documentation files (the "Software"), to deal
6
+ * in the Software without restriction, including without limitation the rights
7
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ * copies of the Software, and to permit persons to whom the Software is
9
+ * furnished to do so, subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in all
12
+ * copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ * SOFTWARE.
21
+ */
22
+ /* eslint-disable @rushstack/typedef-var */
23
+ import { Converters } from '@fgv/ts-utils';
24
+ import { Converters as JsonConverters } from '@fgv/ts-json-base';
25
+ /**
26
+ * A `Converter` for {@link ResourceTypes.Config.IResourceTypeConfig | ResourceTypeConfig} objects.
27
+ * @returns A `Converter` for {@link ResourceTypes.Config.IResourceTypeConfig | ResourceTypeConfig} objects.
28
+ * @public
29
+ */
30
+ export const resourceTypeConfig = Converters.strictObject({
31
+ name: Converters.string,
32
+ typeName: Converters.string,
33
+ template: JsonConverters.jsonObject.optional()
34
+ });
35
+ //# sourceMappingURL=convert.js.map
@@ -0,0 +1,25 @@
1
+ /*
2
+ * Copyright (c) 2025 Erik Fortune
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ * of this software and associated documentation files (the "Software"), to deal
6
+ * in the Software without restriction, including without limitation the rights
7
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ * copies of the Software, and to permit persons to whom the Software is
9
+ * furnished to do so, subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in all
12
+ * copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ * SOFTWARE.
21
+ */
22
+ import * as Convert from './convert';
23
+ export * from './json';
24
+ export { Convert };
25
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,23 @@
1
+ /*
2
+ * Copyright (c) 2025 Erik Fortune
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ * of this software and associated documentation files (the "Software"), to deal
6
+ * in the Software without restriction, including without limitation the rights
7
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ * copies of the Software, and to permit persons to whom the Software is
9
+ * furnished to do so, subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in all
12
+ * copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ * SOFTWARE.
21
+ */
22
+ export {};
23
+ //# sourceMappingURL=json.js.map
@@ -5,7 +5,7 @@
5
5
  "toolPackages": [
6
6
  {
7
7
  "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.57.6"
8
+ "packageVersion": "7.57.7"
9
9
  }
10
10
  ]
11
11
  }