@conduit-client/service-config 5.67.0-dev1
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/LICENSE.txt +27 -0
- package/README.md +1 -0
- package/dist/main/index.js +6 -0
- package/dist/main/index.js.map +1 -0
- package/dist/types/index.d.ts +0 -0
- package/dist/types/v1/__tests__/index.spec.d.ts +1 -0
- package/dist/types/v1/__tests__/prioritized.spec.d.ts +1 -0
- package/dist/types/v1/config.d.ts +76 -0
- package/dist/types/v1/index.d.ts +2 -0
- package/dist/types/v1/prioritized.d.ts +33 -0
- package/dist/v1/index.js +167 -0
- package/dist/v1/index.js.map +1 -0
- package/package.json +45 -0
package/LICENSE.txt
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
*Attorney/Client Privileged + Confidential*
|
|
2
|
+
|
|
3
|
+
Terms of Use for Public Code (Non-OSS)
|
|
4
|
+
|
|
5
|
+
*NOTE:* Before publishing code under this license/these Terms of Use, please review https://salesforce.quip.com/WFfvAMKB18AL and confirm that you’ve completed all prerequisites described therein. *These Terms of Use may not be used or modified without input from IP and Product Legal.*
|
|
6
|
+
|
|
7
|
+
*Terms of Use*
|
|
8
|
+
|
|
9
|
+
Copyright 2022 Salesforce, Inc. All rights reserved.
|
|
10
|
+
|
|
11
|
+
These Terms of Use govern the download, installation, and/or use of this software provided by Salesforce, Inc. (“Salesforce”) (the “Software”), were last updated on April 15, 2022, ** and constitute a legally binding agreement between you and Salesforce. If you do not agree to these Terms of Use, do not install or use the Software.
|
|
12
|
+
|
|
13
|
+
Salesforce grants you a worldwide, non-exclusive, no-charge, royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, sublicense, and distribute the Software and derivative works subject to these Terms. These Terms shall be included in all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
Subject to the limited rights expressly granted hereunder, Salesforce reserves all rights, title, and interest in and to all intellectual property subsisting in the Software. No rights are granted to you hereunder other than as expressly set forth herein. Users residing in countries on the United States Office of Foreign Assets Control sanction list, or which are otherwise subject to a US export embargo, may not use the Software.
|
|
16
|
+
|
|
17
|
+
Implementation of the Software may require development work, for which you are responsible. The Software may contain bugs, errors and incompatibilities and is made available on an AS IS basis without support, updates, or service level commitments.
|
|
18
|
+
|
|
19
|
+
Salesforce reserves the right at any time to modify, suspend, or discontinue, the Software (or any part thereof) with or without notice. You agree that Salesforce shall not be liable to you or to any third party for any modification, suspension, or discontinuance.
|
|
20
|
+
|
|
21
|
+
You agree to defend Salesforce against any claim, demand, suit or proceeding made or brought against Salesforce by a third party arising out of or accruing from (a) your use of the Software, and (b) any application you develop with the Software that infringes any copyright, trademark, trade secret, trade dress, patent, or other intellectual property right of any person or defames any person or violates their rights of publicity or privacy (each a “Claim Against Salesforce”), and will indemnify Salesforce from any damages, attorney fees, and costs finally awarded against Salesforce as a result of, or for any amounts paid by Salesforce under a settlement approved by you in writing of, a Claim Against Salesforce, provided Salesforce (x) promptly gives you written notice of the Claim Against Salesforce, (y) gives you sole control of the defense and settlement of the Claim Against Salesforce (except that you may not settle any Claim Against Salesforce unless it unconditionally releases Salesforce of all liability), and (z) gives you all reasonable assistance, at your expense.
|
|
22
|
+
|
|
23
|
+
WITHOUT LIMITING THE GENERALITY OF THE FOREGOING, THE SOFTWARE IS NOT SUPPORTED AND IS PROVIDED "AS IS," WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED. IN NO EVENT SHALL SALESFORCE HAVE ANY LIABILITY FOR ANY DAMAGES, INCLUDING, BUT NOT LIMITED TO, DIRECT, INDIRECT, SPECIAL, INCIDENTAL, PUNITIVE, OR CONSEQUENTIAL DAMAGES, OR DAMAGES BASED ON LOST PROFITS, DATA, OR USE, IN CONNECTION WITH THE SOFTWARE, HOWEVER CAUSED AND WHETHER IN CONTRACT, TORT, OR UNDER ANY OTHER THEORY OF LIABILITY, WHETHER OR NOT YOU HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
|
24
|
+
|
|
25
|
+
These Terms of Use shall be governed exclusively by the internal laws of the State of California, without regard to its conflicts of laws rules. Each party hereby consents to the exclusive jurisdiction of the state and federal courts located in San Francisco County, California to adjudicate any dispute arising out of or relating to these Terms of Use and the download, installation, and/or use of the Software. Except as expressly stated herein, these Terms of Use constitute the entire agreement between the parties, and supersede all prior and contemporaneous agreements, proposals, or representations, written or oral, concerning their subject matter. No modification, amendment, or waiver of any provision of these Terms of Use shall be effective unless it is by an update to these Terms of Use that Salesforce makes available, or is in writing and signed by the party against whom the modification, amendment, or waiver is to be asserted.
|
|
26
|
+
|
|
27
|
+
_*Data Privacy*_: Salesforce may collect, process, and store device, system, and other information related to your use of the Software. This information includes, but is not limited to, IP address, user metrics, and other data (“Usage Data”). Salesforce may use Usage Data for analytics, product development, and marketing purposes. You acknowledge that files generated in conjunction with the Software may contain sensitive or confidential data, and you are solely responsible for anonymizing and protecting such data.
|
package/README.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
This software is provided as-is with no support provided.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { type DeepPartial, type DeepReadonly, type NamedService, type Result, type ServiceDescriptor } from '@conduit-client/utils';
|
|
2
|
+
export type ConfigValue = null | boolean | number | string | ConfigValue[] | {
|
|
3
|
+
[key: string]: ConfigValue;
|
|
4
|
+
};
|
|
5
|
+
export type ConfigObjectValue = Extract<ConfigValue, {
|
|
6
|
+
[key: string]: ConfigValue;
|
|
7
|
+
}>;
|
|
8
|
+
/**
|
|
9
|
+
* Validates config data. Validator functions are passed a deep-readonly reference
|
|
10
|
+
* to the prioritized config data for validation. They must NOT attempt to access
|
|
11
|
+
* config data directly from the ConfigService.
|
|
12
|
+
*
|
|
13
|
+
* @returns nothing on success, array of error messages otherwise
|
|
14
|
+
*/
|
|
15
|
+
export type ConfigValidator = (config: unknown) => Result<void, string[]>;
|
|
16
|
+
/**
|
|
17
|
+
* A ConfigService provides the ability to read, write, and validate a set
|
|
18
|
+
* of typed configuration data. The service itself has no opinion on the structure
|
|
19
|
+
* of the config data, and can project different views of the config data to different
|
|
20
|
+
* consumers simultaneously. Consumers are responsible for registering validator
|
|
21
|
+
* functions to guarantee that the actual config data at runtime matches the shape
|
|
22
|
+
* they are expecting.
|
|
23
|
+
*
|
|
24
|
+
* @typeParam ConfigData the expected shape(s) of the config data. It is expected
|
|
25
|
+
* that different consumers of a ConfigService instance will specify different
|
|
26
|
+
* ConfigData types. Each consumer is responsible for adding their own validation
|
|
27
|
+
* logic to guarantee that the runtime shape of the config matches their compile
|
|
28
|
+
* time expectations.
|
|
29
|
+
* @typeParam Priority possible priority values associated with the config data.
|
|
30
|
+
*/
|
|
31
|
+
export type ConfigService<ConfigData extends ConfigObjectValue = ConfigObjectValue, Priority extends string = 'default'> = {
|
|
32
|
+
/**
|
|
33
|
+
* Adds a validator function to the config service.
|
|
34
|
+
*
|
|
35
|
+
* @param validator Validation function to be added to the config service. The function
|
|
36
|
+
* should validate the supplied config and return an array of error messages for
|
|
37
|
+
* any issues found or an empty array for no errors. Validator functions must ignore
|
|
38
|
+
* unrecognized keys for parts of the config data for which they are not
|
|
39
|
+
* authoritative.
|
|
40
|
+
*/
|
|
41
|
+
addValidator: (validator: ConfigValidator) => void;
|
|
42
|
+
/**
|
|
43
|
+
* Runs add registered validators against the config data.
|
|
44
|
+
*
|
|
45
|
+
* @returns nothing on success, an array of error messages otherwise
|
|
46
|
+
*/
|
|
47
|
+
validate: () => Result<void, string[]>;
|
|
48
|
+
/**
|
|
49
|
+
* The config data. The ConfigService guarantees that all registered validators
|
|
50
|
+
* have accepted the config data before it is made available here. Accessing this
|
|
51
|
+
* value may cause the ConfigService to run validation; any errors returned by
|
|
52
|
+
* the validators will cause an error to be thrown.
|
|
53
|
+
*
|
|
54
|
+
* Use unsafeConfig if you need to access prioritized, unvalidated config data.
|
|
55
|
+
*/
|
|
56
|
+
readonly config: DeepReadonly<ConfigData>;
|
|
57
|
+
/**
|
|
58
|
+
* The unvalidated config data. The ConfigService does not guarantee that any
|
|
59
|
+
* validators have accepted the config data exposed here. It is prioritized and
|
|
60
|
+
* deep-readonly, but may or may not match ConfigData.
|
|
61
|
+
*
|
|
62
|
+
* Use config if you need to access validated config data.
|
|
63
|
+
*/
|
|
64
|
+
readonly unsafeConfig: unknown;
|
|
65
|
+
/**
|
|
66
|
+
* Modifies config data at the specified priority.
|
|
67
|
+
*
|
|
68
|
+
* @param priority priority at which to set the config data
|
|
69
|
+
* @param setter setter callback that will set the data
|
|
70
|
+
* @typeParam Return type of setter's return value, generally inferrable
|
|
71
|
+
* @returns whatever setter returns
|
|
72
|
+
*/
|
|
73
|
+
set: <Return>(priority: Priority, setter: (config: Exclude<DeepPartial<ConfigData>, undefined>) => Return) => Return;
|
|
74
|
+
};
|
|
75
|
+
export type ConfigServiceDescriptor<ConfigData extends ConfigObjectValue = ConfigObjectValue, Priority extends string = 'default'> = ServiceDescriptor<ConfigService<ConfigData, Priority>, 'config', '1.0'>;
|
|
76
|
+
export type NamedConfigService<ConfigData extends ConfigObjectValue = ConfigObjectValue, Priority extends string = 'default'> = NamedService<'config', ConfigService<ConfigData, Priority>>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type DeepPartial, type DeepReadonly, type Result } from '@conduit-client/utils';
|
|
2
|
+
import { type ConfigObjectValue, type ConfigService, type ConfigServiceDescriptor, type ConfigValidator, type ConfigValue } from './config';
|
|
3
|
+
/**
|
|
4
|
+
* A ConfigService implementation with prioritized config values.
|
|
5
|
+
*
|
|
6
|
+
* @typeParam ConfigData shape of config data
|
|
7
|
+
* @typeParam Priority possible priority values, expressed as a union of strings
|
|
8
|
+
*/
|
|
9
|
+
export declare class PrioritizedConfigService<ConfigData extends ConfigObjectValue = ConfigObjectValue, Priority extends string = 'default'> implements ConfigService<ConfigData, Priority> {
|
|
10
|
+
protected prioritizedConfigData: Record<Priority, ConfigObjectValue>;
|
|
11
|
+
protected validators: Array<ConfigValidator>;
|
|
12
|
+
protected validated: boolean;
|
|
13
|
+
constructor(initialConfigDatas: Record<Priority, DeepPartial<ConfigData>>);
|
|
14
|
+
addValidator(validator: ConfigValidator): void;
|
|
15
|
+
validate(): Result<void, string[]>;
|
|
16
|
+
protected readonlyObjectProxies: Map<string, {
|
|
17
|
+
[key: string]: ConfigValue;
|
|
18
|
+
}>;
|
|
19
|
+
protected buildReadonlyObjectProxy(path: string[]): ConfigObjectValue;
|
|
20
|
+
get config(): DeepReadonly<ConfigData>;
|
|
21
|
+
readonly unsafeConfig: unknown;
|
|
22
|
+
set<Return>(priority: Priority, setter: (config: Exclude<DeepPartial<ConfigData>, undefined>) => Return): Return;
|
|
23
|
+
protected valueFor(path: string[]): ConfigValue | undefined;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Builds a new ConfigServiceDescriptor.
|
|
27
|
+
*
|
|
28
|
+
* @param initialConfigDatas priority & initial config data; insertion order of
|
|
29
|
+
* the priorities is used to order them (highest priority inserted first,
|
|
30
|
+
* lowest priority last)
|
|
31
|
+
* @returns ConfigServiceDescriptor
|
|
32
|
+
*/
|
|
33
|
+
export declare function buildServiceDescriptor<ConfigData extends ConfigObjectValue = ConfigObjectValue, Priority extends string = 'default'>(initialConfigDatas: Record<Priority, DeepPartial<ConfigData>>): ConfigServiceDescriptor<ConfigData, Priority>;
|
package/dist/v1/index.js
ADDED
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) 2022, Salesforce, Inc.,
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
* For full license text, see the LICENSE.txt file
|
|
5
|
+
*/
|
|
6
|
+
/*!
|
|
7
|
+
* Copyright (c) 2022, Salesforce, Inc.,
|
|
8
|
+
* All rights reserved.
|
|
9
|
+
* For full license text, see the LICENSE.txt file
|
|
10
|
+
*/
|
|
11
|
+
const { isArray } = Array;
|
|
12
|
+
class Ok {
|
|
13
|
+
constructor(value) {
|
|
14
|
+
this.value = value;
|
|
15
|
+
}
|
|
16
|
+
isOk() {
|
|
17
|
+
return true;
|
|
18
|
+
}
|
|
19
|
+
isErr() {
|
|
20
|
+
return !this.isOk();
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
class Err {
|
|
24
|
+
constructor(error) {
|
|
25
|
+
this.error = error;
|
|
26
|
+
}
|
|
27
|
+
isOk() {
|
|
28
|
+
return false;
|
|
29
|
+
}
|
|
30
|
+
isErr() {
|
|
31
|
+
return !this.isOk();
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
const ok = (value) => new Ok(value);
|
|
35
|
+
const err = (err2) => new Err(err2);
|
|
36
|
+
function valueFor(value, path) {
|
|
37
|
+
if (path.length === 0 || path[0] === "") {
|
|
38
|
+
return value;
|
|
39
|
+
} else if (value === null || typeof value !== "object") {
|
|
40
|
+
return void 0;
|
|
41
|
+
} else if (Array.isArray(value)) {
|
|
42
|
+
const index = parseInt(path[0]);
|
|
43
|
+
if (index >= 0) {
|
|
44
|
+
return valueFor(value[index], path.slice(1));
|
|
45
|
+
}
|
|
46
|
+
return void 0;
|
|
47
|
+
} else {
|
|
48
|
+
return valueFor(value[path[0]], path.slice(1));
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
class PrioritizedConfigService {
|
|
52
|
+
constructor(initialConfigDatas) {
|
|
53
|
+
this.validators = [];
|
|
54
|
+
this.validated = false;
|
|
55
|
+
this.readonlyObjectProxies = /* @__PURE__ */ new Map();
|
|
56
|
+
this.unsafeConfig = this.buildReadonlyObjectProxy([]);
|
|
57
|
+
this.prioritizedConfigData = {};
|
|
58
|
+
for (const [p, initialConfigData] of Object.entries(initialConfigDatas)) {
|
|
59
|
+
this.prioritizedConfigData[p] = initialConfigData || {};
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
// ConfigService.addValidator
|
|
63
|
+
addValidator(validator) {
|
|
64
|
+
this.validators.push(validator);
|
|
65
|
+
this.validated = false;
|
|
66
|
+
}
|
|
67
|
+
// ConfigService.validate
|
|
68
|
+
validate() {
|
|
69
|
+
const errors = [];
|
|
70
|
+
this.validators.forEach((v) => {
|
|
71
|
+
const result = v(this.unsafeConfig);
|
|
72
|
+
if (result.isErr()) {
|
|
73
|
+
errors.push(...result.error);
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
this.validated = errors.length === 0;
|
|
77
|
+
return errors.length === 0 ? ok(void 0) : err(errors);
|
|
78
|
+
}
|
|
79
|
+
// constructs a proxy for the given non-leaf object path in the config tree
|
|
80
|
+
buildReadonlyObjectProxy(path) {
|
|
81
|
+
const key = path.join("\0");
|
|
82
|
+
let proxy = this.readonlyObjectProxies.get(key);
|
|
83
|
+
if (proxy) {
|
|
84
|
+
return proxy;
|
|
85
|
+
}
|
|
86
|
+
proxy = new Proxy(/* @__PURE__ */ Object.create(null), {
|
|
87
|
+
defineProperty: () => {
|
|
88
|
+
throw new Error("cannot (re)define properties on config");
|
|
89
|
+
},
|
|
90
|
+
deleteProperty: () => {
|
|
91
|
+
throw new Error("cannot delete properties on config");
|
|
92
|
+
},
|
|
93
|
+
get: (_, property) => {
|
|
94
|
+
const propertyPath = [...path, property];
|
|
95
|
+
const value = this.valueFor(propertyPath);
|
|
96
|
+
return typeof value === "object" && value !== null && !isArray(value) ? this.buildReadonlyObjectProxy(propertyPath) : value;
|
|
97
|
+
},
|
|
98
|
+
getOwnPropertyDescriptor: (target, property) => {
|
|
99
|
+
const propertyPath = [...path, property];
|
|
100
|
+
const value = this.valueFor(propertyPath);
|
|
101
|
+
return {
|
|
102
|
+
value: (
|
|
103
|
+
// TODO - need to wrap arrays in a Proxy as well
|
|
104
|
+
typeof value === "object" && value !== null && !isArray(value) ? this.buildReadonlyObjectProxy(propertyPath) : value
|
|
105
|
+
),
|
|
106
|
+
writable: false,
|
|
107
|
+
configurable: true,
|
|
108
|
+
enumerable: true
|
|
109
|
+
};
|
|
110
|
+
},
|
|
111
|
+
has: (_, property) => {
|
|
112
|
+
return this.valueFor([...path, property]) !== void 0;
|
|
113
|
+
},
|
|
114
|
+
ownKeys: () => {
|
|
115
|
+
const keys = [];
|
|
116
|
+
for (const v of Object.values(this.prioritizedConfigData)) {
|
|
117
|
+
const value = valueFor(v, path);
|
|
118
|
+
if (value) {
|
|
119
|
+
keys.push(...Object.keys(value));
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
return [...new Set(keys)];
|
|
123
|
+
},
|
|
124
|
+
set: () => {
|
|
125
|
+
throw new Error("cannot directly set values on config");
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
this.readonlyObjectProxies.set(key, proxy);
|
|
129
|
+
return proxy;
|
|
130
|
+
}
|
|
131
|
+
// ConfigService.config
|
|
132
|
+
get config() {
|
|
133
|
+
if (!this.validated) {
|
|
134
|
+
const result = this.validate();
|
|
135
|
+
if (result.isErr()) {
|
|
136
|
+
throw result.error.join("; ");
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
return this.unsafeConfig;
|
|
140
|
+
}
|
|
141
|
+
// ConfigService.set
|
|
142
|
+
set(priority, setter) {
|
|
143
|
+
this.validated = false;
|
|
144
|
+
return setter(this.prioritizedConfigData[priority]);
|
|
145
|
+
}
|
|
146
|
+
// returns the highest priority value for a given path, undefined if no value
|
|
147
|
+
// is defined for the path at any priority
|
|
148
|
+
valueFor(path) {
|
|
149
|
+
for (const [_, data] of Object.entries(this.prioritizedConfigData)) {
|
|
150
|
+
const value = valueFor(data, path);
|
|
151
|
+
if (value !== void 0) {
|
|
152
|
+
return value;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
function buildServiceDescriptor(initialConfigDatas) {
|
|
158
|
+
return {
|
|
159
|
+
type: "config",
|
|
160
|
+
version: "1.0",
|
|
161
|
+
service: new PrioritizedConfigService(initialConfigDatas)
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
export {
|
|
165
|
+
buildServiceDescriptor
|
|
166
|
+
};
|
|
167
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../utils/dist/index.js","../../src/v1/prioritized.ts"],"sourcesContent":["/*!\n * Copyright (c) 2022, Salesforce, Inc.,\n * All rights reserved.\n * For full license text, see the LICENSE.txt file\n */\nfunction bfs(start, predicate, getChildren) {\n const queue = [...start];\n const visited = /* @__PURE__ */ new Set([...start]);\n const matches2 = /* @__PURE__ */ new Set();\n while (queue.length) {\n const curr = queue.shift();\n if (predicate(curr)) {\n matches2.add(curr);\n }\n const children = getChildren(curr);\n for (const child of children) {\n if (!visited.has(child)) {\n visited.add(child);\n queue.push(child);\n }\n }\n }\n return matches2;\n}\nfunction lineFormatter(position, message, filePath) {\n return `${message} (${filePath}:${position.line}:${position.column})`;\n}\nclass DefaultFileParserLogger {\n constructor(services, filePath) {\n this.services = services;\n this.filePath = filePath;\n }\n trace(position, message) {\n this.services.logger.trace(this.format(position, message));\n }\n debug(position, message) {\n this.services.logger.debug(this.format(position, message));\n }\n info(position, message) {\n this.services.logger.info(this.format(position, message));\n }\n warn(position, message) {\n this.services.logger.warn(this.format(position, message));\n }\n error(position, message) {\n this.services.logger.error(this.format(position, message));\n }\n format(position, message) {\n return lineFormatter(position, message, this.filePath);\n }\n}\nfunction matches(test, s) {\n if (test === void 0) {\n return false;\n } else if (typeof test === \"string\") {\n return s === test;\n } else if (test instanceof RegExp) {\n return test.test(s);\n } else if (typeof test === \"function\") {\n return test(s);\n }\n return test.some((m) => matches(m, s));\n}\nfunction includes(incexc, s) {\n if (matches(incexc.exclude, s)) {\n return false;\n }\n if (matches(incexc.include, s)) {\n return true;\n }\n if (incexc.include) {\n return false;\n }\n return true;\n}\nconst { create, freeze, keys, entries } = Object;\nconst { hasOwnProperty } = Object.prototype;\nconst { isArray } = Array;\nconst { push, indexOf, slice } = Array.prototype;\nconst { stringify, parse } = JSON;\nconst WeakSetConstructor = WeakSet;\nconst LogLevelMap = {\n TRACE: 4,\n DEBUG: 3,\n INFO: 2,\n WARN: 1,\n ERROR: 0\n};\nclass ConsoleLogger {\n constructor(level = \"WARN\", printer = console.log, formatter = (level2, message) => `${level2}: ${message}`) {\n this.level = level;\n this.printer = printer;\n this.formatter = formatter;\n this.messages = [];\n }\n trace(message) {\n this.log(\"TRACE\", message);\n }\n debug(message) {\n this.log(\"DEBUG\", message);\n }\n info(message) {\n this.log(\"INFO\", message);\n }\n warn(message) {\n this.log(\"WARN\", message);\n }\n error(message) {\n this.log(\"ERROR\", message);\n }\n log(level, message) {\n if (LogLevelMap[level] > LogLevelMap[this.level]) {\n return;\n }\n this.printer(this.formatter(level, message));\n }\n}\nfunction loggerService(level, printer, formatter) {\n return new ConsoleLogger(level, printer, formatter);\n}\nclass Ok {\n constructor(value) {\n this.value = value;\n }\n isOk() {\n return true;\n }\n isErr() {\n return !this.isOk();\n }\n}\nclass Err {\n constructor(error) {\n this.error = error;\n }\n isOk() {\n return false;\n }\n isErr() {\n return !this.isOk();\n }\n}\nconst ok = (value) => new Ok(value);\nconst err = (err2) => new Err(err2);\nclass DataNotFoundError extends Error {\n constructor(message) {\n super(message);\n this.name = \"DataNotFoundError\";\n }\n}\nclass DataIncompleteError extends Error {\n constructor(message, partialData) {\n super(message);\n this.partialData = partialData;\n this.name = \"DataIncompleteError\";\n }\n}\nfunction isDataNotFoundError(error) {\n return error instanceof DataNotFoundError || error.name === \"DataNotFoundError\";\n}\nfunction isDataIncompleteError(error) {\n return error instanceof DataIncompleteError || error.name === \"DataIncompleteError\";\n}\nfunction isCacheHitOrError(value) {\n if (value.isErr() && (isDataIncompleteError(value.error) || isDataNotFoundError(value.error))) {\n return false;\n }\n return true;\n}\nfunction isCacheMiss(value) {\n return !isCacheHitOrError(value);\n}\nfunction isResult(value) {\n return value != null && typeof value === \"object\" && \"isOk\" in value && \"isErr\" in value && typeof value.isOk === \"function\" && typeof value.isErr === \"function\" && (value.isOk() === true && value.isErr() === false && \"value\" in value || value.isOk() === false && value.isErr() === true && \"error\" in value);\n}\nfunction setOverlaps(setA, setB) {\n for (const element of setA) {\n if (setB.has(element)) {\n return true;\n }\n }\n return false;\n}\nfunction setDifference(setA, setB) {\n const differenceSet = /* @__PURE__ */ new Set();\n for (const element of setA) {\n if (!setB.has(element)) {\n differenceSet.add(element);\n }\n }\n return differenceSet;\n}\nfunction addAllToSet(targetSet, sourceSet) {\n for (const element of sourceSet) {\n targetSet.add(element);\n }\n}\nconst toTypeScriptSafeIdentifier = (s) => s.length >= 1 ? s[0].replace(/[^$_\\p{ID_Start}]/u, \"_\") + s.slice(1).replace(/[^$\\u200c\\u200d\\p{ID_Continue}]/gu, \"_\") : \"\";\nfunction isSubscribable(obj) {\n return typeof obj === \"object\" && obj !== null && \"subscribe\" in obj && typeof obj.subscribe === \"function\" && \"refresh\" in obj && typeof obj.refresh === \"function\";\n}\nfunction isSubscribableResult(x) {\n if (!isResult(x)) {\n return false;\n }\n return isSubscribable(x.isOk() ? x.value : x.error);\n}\nfunction buildSubscribableResult(result, subscribe, refresh) {\n if (result.isOk()) {\n return ok({ data: result.value, subscribe, refresh });\n } else {\n return err({ failure: result.error, subscribe, refresh });\n }\n}\nfunction resolvedPromiseLike(result) {\n if (isPromiseLike(result)) {\n return result.then((nextResult) => nextResult);\n }\n return {\n then: (onFulfilled, _onRejected) => {\n try {\n return resolvedPromiseLike(onFulfilled(result));\n } catch (e) {\n if (onFulfilled === void 0) {\n return resolvedPromiseLike(result);\n }\n return rejectedPromiseLike(e);\n }\n }\n };\n}\nfunction rejectedPromiseLike(reason) {\n if (isPromiseLike(reason)) {\n return reason.then((nextResult) => nextResult);\n }\n return {\n then: (_onFulfilled, onRejected) => {\n if (typeof onRejected === \"function\") {\n try {\n return resolvedPromiseLike(onRejected(reason));\n } catch (e) {\n return rejectedPromiseLike(e);\n }\n }\n return rejectedPromiseLike(reason);\n }\n };\n}\nfunction isPromiseLike(x) {\n return typeof (x == null ? void 0 : x.then) === \"function\";\n}\nfunction racesync(values) {\n for (const value of values) {\n let settled = void 0;\n if (isPromiseLike(value)) {\n value.then(\n (_) => {\n settled = value;\n },\n (_) => {\n settled = value;\n }\n );\n } else {\n settled = resolvedPromiseLike(value);\n }\n if (settled !== void 0) {\n return settled;\n }\n }\n return Promise.race(values);\n}\nfunction withResolvers() {\n let resolve, reject;\n const promise = new Promise((res, rej) => {\n resolve = res;\n reject = rej;\n });\n return { promise, resolve, reject };\n}\nfunction deepEquals(x, y) {\n if (x === void 0) {\n return y === void 0;\n } else if (x === null) {\n return y === null;\n } else if (y === null) {\n return x === null;\n } else if (isArray(x)) {\n if (!isArray(y) || x.length !== y.length) {\n return false;\n }\n for (let i = 0; i < x.length; ++i) {\n if (!deepEquals(x[i], y[i])) {\n return false;\n }\n }\n return true;\n } else if (typeof x === \"object\") {\n if (typeof y !== \"object\") {\n return false;\n }\n const xkeys = Object.keys(x);\n const ykeys = Object.keys(y);\n if (xkeys.length !== ykeys.length) {\n return false;\n }\n for (let i = 0; i < xkeys.length; ++i) {\n const key = xkeys[i];\n if (!deepEquals(x[key], y[key])) {\n return false;\n }\n }\n return true;\n }\n return x === y;\n}\nfunction stableJSONStringify(node) {\n if (node && node.toJSON && typeof node.toJSON === \"function\") {\n node = node.toJSON();\n }\n if (node === void 0) {\n return;\n }\n if (typeof node === \"number\") {\n return isFinite(node) ? \"\" + node : \"null\";\n }\n if (typeof node !== \"object\") {\n return stringify(node);\n }\n let i;\n let out;\n if (isArray(node)) {\n out = \"[\";\n for (i = 0; i < node.length; i++) {\n if (i) {\n out += \",\";\n }\n out += stableJSONStringify(node[i]) || \"null\";\n }\n return out + \"]\";\n }\n if (node === null) {\n return \"null\";\n }\n const objKeys = keys(node).sort();\n out = \"\";\n for (i = 0; i < objKeys.length; i++) {\n const key = objKeys[i];\n const value = stableJSONStringify(node[key]);\n if (!value) {\n continue;\n }\n if (out) {\n out += \",\";\n }\n out += stringify(key) + \":\" + value;\n }\n return \"{\" + out + \"}\";\n}\nfunction toError(x) {\n if (x instanceof Error) {\n return x;\n }\n return new Error(typeof x === \"string\" ? x : JSON.stringify(x));\n}\nfunction deepCopy(x) {\n const stringified = stringify(x);\n return stringified ? parse(stringified) : void 0;\n}\nfunction readableStreamToAsyncIterable(stream) {\n if (stream.locked) {\n return err(new Error(\"ReadableStream is already locked\"));\n }\n if (Symbol.asyncIterator in stream) {\n return ok(stream);\n }\n const reader = stream.getReader();\n return ok({\n [Symbol.asyncIterator]: () => ({\n next: async () => {\n try {\n const result = await reader.read();\n if (result.done) {\n try {\n reader.releaseLock();\n } catch {\n }\n return { done: true, value: void 0 };\n }\n return {\n done: false,\n value: result.value\n };\n } catch (e) {\n try {\n reader.releaseLock();\n } catch {\n }\n throw e;\n }\n },\n return: async (value) => {\n try {\n await reader.cancel();\n } catch {\n }\n try {\n reader.releaseLock();\n } catch {\n }\n return { done: true, value };\n },\n throw: async (exception) => {\n try {\n await reader.cancel();\n } catch {\n }\n try {\n reader.releaseLock();\n } catch {\n }\n throw exception;\n }\n })\n });\n}\nfunction satisfies(provided, requested) {\n const providedN = provided.split(\".\").map((s) => parseInt(s));\n const requestedN = requested.split(\".\").map((s) => parseInt(s));\n return providedN[0] === requestedN[0] && providedN[1] >= requestedN[1];\n}\nfunction stringIsVersion(s) {\n const versionParts = s.split(\".\");\n return (versionParts.length === 2 || versionParts.length === 3) && versionParts.every((part) => part.match(/^\\d+$/));\n}\nvar HttpStatusCode = /* @__PURE__ */ ((HttpStatusCode2) => {\n HttpStatusCode2[HttpStatusCode2[\"Ok\"] = 200] = \"Ok\";\n HttpStatusCode2[HttpStatusCode2[\"Created\"] = 201] = \"Created\";\n HttpStatusCode2[HttpStatusCode2[\"NoContent\"] = 204] = \"NoContent\";\n HttpStatusCode2[HttpStatusCode2[\"NotModified\"] = 304] = \"NotModified\";\n HttpStatusCode2[HttpStatusCode2[\"BadRequest\"] = 400] = \"BadRequest\";\n HttpStatusCode2[HttpStatusCode2[\"Unauthorized\"] = 401] = \"Unauthorized\";\n HttpStatusCode2[HttpStatusCode2[\"Forbidden\"] = 403] = \"Forbidden\";\n HttpStatusCode2[HttpStatusCode2[\"NotFound\"] = 404] = \"NotFound\";\n HttpStatusCode2[HttpStatusCode2[\"ServerError\"] = 500] = \"ServerError\";\n HttpStatusCode2[HttpStatusCode2[\"GatewayTimeout\"] = 504] = \"GatewayTimeout\";\n return HttpStatusCode2;\n})(HttpStatusCode || {});\nfunction getFetchResponseFromAuraError(err2) {\n if (err2.data !== void 0 && err2.data.statusCode !== void 0) {\n let data = {};\n data = err2.data;\n if (err2.id !== void 0) {\n data.id = err2.id;\n }\n return new FetchResponse(data.statusCode, data);\n }\n return new FetchResponse(500, {\n error: err2.message\n });\n}\nasync function coerceResponseToFetchResponse(response) {\n const { status } = response;\n const responseHeaders = {};\n response.headers.forEach((value, key) => {\n responseHeaders[key] = value;\n });\n let responseBody = null;\n if (status !== 204) {\n const contentType = responseHeaders[\"content-type\"];\n responseBody = contentType && contentType.startsWith(\"application/json\") ? await response.json() : await response.text();\n }\n return new FetchResponse(status, responseBody, responseHeaders);\n}\nfunction getStatusText(status) {\n switch (status) {\n case 200:\n return \"OK\";\n case 201:\n return \"Created\";\n case 304:\n return \"Not Modified\";\n case 400:\n return \"Bad Request\";\n case 404:\n return \"Not Found\";\n case 500:\n return \"Server Error\";\n default:\n return `Unexpected HTTP Status Code: ${status}`;\n }\n}\nclass FetchResponse extends Error {\n constructor(status, body, headers) {\n super();\n this.status = status;\n this.body = body;\n this.headers = headers || {};\n this.ok = status >= 200 && this.status <= 299;\n this.statusText = getStatusText(status);\n }\n}\nconst deeplyFrozen = new WeakSetConstructor();\nfunction deepFreeze(value) {\n if (typeof value !== \"object\" || value === null || deeplyFrozen.has(value)) {\n return;\n }\n deeplyFrozen.add(value);\n if (isArray(value)) {\n for (let i = 0, len = value.length; i < len; i += 1) {\n deepFreeze(value[i]);\n }\n } else {\n const keys$1 = keys(value);\n for (let i = 0, len = keys$1.length; i < len; i += 1) {\n deepFreeze(value[keys$1[i]]);\n }\n }\n freeze(value);\n}\nfunction isScalar(value) {\n return typeof value === \"string\" || typeof value === \"number\" || typeof value === \"boolean\" || value === null || value === void 0;\n}\nfunction isScalarObject(value) {\n return Object.values(value).every((value2) => isScalar(value2));\n}\nfunction isScalarArray(value) {\n return value.every((item) => isScalar(item));\n}\nfunction encodeQueryParam(paramName, value, explode) {\n switch (typeof value) {\n case \"string\":\n return [`${paramName}=${encodeURIComponent(value)}`];\n case \"number\":\n case \"boolean\":\n return [`${paramName}=${value}`];\n case \"object\":\n if (value === null) {\n return [];\n }\n if (isArray(value)) {\n if (!isScalarArray(value)) {\n throw new Error(`Unsupported non-scalar array type for ${paramName}`);\n }\n if (explode) {\n return value.map(\n (item) => `${paramName}=${item ? encodeURIComponent(item) : item}`\n );\n }\n return [\n `${paramName}=${value.map((item) => item ? encodeURIComponent(item) : item).join(\",\")}`\n ];\n }\n if (!isScalarObject(value)) {\n throw new Error(`Unsupported non-scalar object type for ${paramName}`);\n }\n if (explode) {\n return entries(value).map(\n ([key, value2]) => `${key}=${value2 ? encodeURIComponent(value2) : value2}`\n );\n }\n return [\n `${paramName}=${entries(value).flat().map((item) => item ? encodeURIComponent(item) : item).join(\",\")}`\n ];\n default:\n return [];\n }\n}\nclass InternalError extends Error {\n constructor(data) {\n super();\n this.data = data;\n this.type = \"internal\";\n }\n}\nclass UserVisibleError extends Error {\n constructor(data) {\n super();\n this.data = data;\n this.type = \"user-visible\";\n }\n}\nfunction applyDecorators(baseCommand, decorators, options) {\n if (!decorators || decorators.length === 0) {\n return baseCommand;\n }\n return decorators.reduce((command, decorator) => decorator(command, options), baseCommand);\n}\nexport {\n isArray as ArrayIsArray,\n indexOf as ArrayPrototypeIndexOf,\n push as ArrayPrototypePush,\n slice as ArrayPrototypeSlice,\n ConsoleLogger,\n DataIncompleteError,\n DataNotFoundError,\n DefaultFileParserLogger,\n Err,\n FetchResponse,\n HttpStatusCode,\n InternalError,\n parse as JSONParse,\n stringify as JSONStringify,\n LogLevelMap,\n create as ObjectCreate,\n entries as ObjectEntries,\n freeze as ObjectFreeze,\n keys as ObjectKeys,\n hasOwnProperty as ObjectPrototypeHasOwnProperty,\n Ok,\n UserVisibleError,\n WeakSetConstructor,\n addAllToSet,\n applyDecorators,\n bfs,\n buildSubscribableResult,\n coerceResponseToFetchResponse,\n deepCopy,\n deepEquals,\n deepFreeze,\n encodeQueryParam,\n err,\n getFetchResponseFromAuraError,\n includes,\n isCacheHitOrError,\n isCacheMiss,\n isDataIncompleteError,\n isDataNotFoundError,\n isPromiseLike,\n isResult,\n isSubscribable,\n isSubscribableResult,\n lineFormatter,\n loggerService,\n ok,\n racesync,\n readableStreamToAsyncIterable,\n rejectedPromiseLike,\n resolvedPromiseLike,\n satisfies,\n setDifference,\n setOverlaps,\n stableJSONStringify,\n stringIsVersion,\n toError,\n toTypeScriptSafeIdentifier,\n withResolvers\n};\n//# sourceMappingURL=index.js.map\n","import {\n ArrayIsArray,\n type DeepPartial,\n type DeepReadonly,\n err,\n ok,\n type Result,\n} from '@conduit-client/utils';\nimport {\n type ConfigObjectValue,\n type ConfigService,\n type ConfigServiceDescriptor,\n type ConfigValidator,\n type ConfigValue,\n} from './config';\n\n/**\n * Calculates the result of evaluating a given path against a ConfigValue.\n *\n * @param value starting value\n * @param path path relative to value\n * @returns result of evaluating path against value, undefined if path is not\n * present in value\n */\nfunction valueFor(value: ConfigValue, path: string[]): ConfigValue | undefined {\n if (path.length === 0 || path[0] === '') {\n return value;\n } else if (value === null || typeof value !== 'object') {\n return undefined;\n } else if (Array.isArray(value)) {\n const index = parseInt(path[0]);\n if (index >= 0) {\n return valueFor(value[index], path.slice(1));\n }\n return undefined;\n } else {\n return valueFor(value[path[0]], path.slice(1));\n }\n}\n\n/**\n * A ConfigService implementation with prioritized config values.\n *\n * @typeParam ConfigData shape of config data\n * @typeParam Priority possible priority values, expressed as a union of strings\n */\nexport class PrioritizedConfigService<\n ConfigData extends ConfigObjectValue = ConfigObjectValue,\n Priority extends string = 'default',\n> implements ConfigService<ConfigData, Priority>\n{\n // Map of priority => config data that has been set at that priority. Insertion\n // order of the entries MUST match priority order (highest priority inserted\n // first, lowest priority last).\n // Note that the values here are actually closer to\n // Extract<DeepPartial<ConfigData>, ConfigObjectValue>, but the recursiveness of\n // that type is more than TypeScript can deal with so we simplify it to\n // ConfigObjectValue.\n protected prioritizedConfigData: Record<Priority, ConfigObjectValue>;\n\n // registered validator functions\n protected validators: Array<ConfigValidator> = [];\n\n // has validation run since the most recent data was set?\n protected validated = false;\n\n constructor(initialConfigDatas: Record<Priority, DeepPartial<ConfigData>>) {\n this.prioritizedConfigData = {} as Record<Priority, ConfigData>;\n\n for (const [p, initialConfigData] of Object.entries(initialConfigDatas)) {\n this.prioritizedConfigData[p as Priority] = (initialConfigData || {}) as ConfigData;\n }\n }\n\n // ConfigService.addValidator\n addValidator(validator: ConfigValidator): void {\n this.validators.push(validator);\n this.validated = false;\n }\n\n // ConfigService.validate\n validate(): Result<void, string[]> {\n const errors: string[] = [];\n\n this.validators.forEach((v) => {\n const result = v(this.unsafeConfig);\n if (result.isErr()) {\n errors.push(...result.error);\n }\n });\n\n this.validated = errors.length === 0;\n\n return errors.length === 0 ? ok(undefined) : err(errors);\n }\n\n // proxies for non-leaf nodes in the config tree\n protected readonlyObjectProxies = new Map<string, ConfigObjectValue>();\n\n // constructs a proxy for the given non-leaf object path in the config tree\n protected buildReadonlyObjectProxy(path: string[]): ConfigObjectValue {\n const key = path.join('\\0');\n let proxy = this.readonlyObjectProxies.get(key);\n\n if (proxy) {\n return proxy;\n }\n\n proxy = new Proxy(Object.create(null), {\n defineProperty: () => {\n throw new Error('cannot (re)define properties on config');\n },\n deleteProperty: () => {\n throw new Error('cannot delete properties on config');\n },\n get: (_, property: string) => {\n const propertyPath = [...path, property];\n const value = this.valueFor(propertyPath);\n // TODO - need to wrap arrays in a Proxy as well\n return typeof value === 'object' && value !== null && !ArrayIsArray(value)\n ? this.buildReadonlyObjectProxy(propertyPath)\n : value;\n },\n getOwnPropertyDescriptor: (target, property: string) => {\n const propertyPath = [...path, property];\n const value = this.valueFor(propertyPath);\n\n return {\n value:\n // TODO - need to wrap arrays in a Proxy as well\n typeof value === 'object' && value !== null && !ArrayIsArray(value)\n ? this.buildReadonlyObjectProxy(propertyPath)\n : value,\n writable: false,\n configurable: true,\n enumerable: true,\n };\n },\n has: (_, property: string) => {\n return this.valueFor([...path, property]) !== undefined;\n },\n ownKeys: () => {\n const keys: string[] = [];\n for (const v of Object.values(this.prioritizedConfigData) as ConfigData[]) {\n const value = valueFor(v, path);\n if (value) {\n keys.push(...Object.keys(value));\n }\n }\n return [...new Set(keys)];\n },\n set: () => {\n throw new Error('cannot directly set values on config');\n },\n });\n\n this.readonlyObjectProxies.set(key, proxy!);\n return proxy!;\n }\n\n // ConfigService.config\n get config() {\n if (!this.validated) {\n const result = this.validate();\n if (result.isErr()) {\n throw result.error.join('; ');\n }\n }\n\n return this.unsafeConfig as DeepReadonly<ConfigData>;\n }\n\n // ConfigService.unsafeConfig\n // cast to unknown is needed because DeepReadonly's recursiveness confuses TypeScript\n readonly unsafeConfig = this.buildReadonlyObjectProxy([]) as unknown;\n\n // ConfigService.set\n set<Return>(\n priority: Priority,\n setter: (config: Exclude<DeepPartial<ConfigData>, undefined>) => Return\n ): Return {\n this.validated = false;\n return setter(this.prioritizedConfigData[priority] as any);\n }\n\n // returns the highest priority value for a given path, undefined if no value\n // is defined for the path at any priority\n protected valueFor(path: string[]): ConfigValue | undefined {\n for (const [_, data] of Object.entries(this.prioritizedConfigData) as Array<\n [Priority, ConfigData]\n >) {\n const value = valueFor(data, path);\n if (value !== undefined) {\n return value;\n }\n }\n }\n}\n\n/**\n * Builds a new ConfigServiceDescriptor.\n *\n * @param initialConfigDatas priority & initial config data; insertion order of\n * the priorities is used to order them (highest priority inserted first,\n * lowest priority last)\n * @returns ConfigServiceDescriptor\n */\nexport function buildServiceDescriptor<\n ConfigData extends ConfigObjectValue = ConfigObjectValue,\n Priority extends string = 'default',\n>(\n initialConfigDatas: Record<Priority, DeepPartial<ConfigData>>\n): ConfigServiceDescriptor<ConfigData, Priority> {\n return {\n type: 'config',\n version: '1.0',\n service: new PrioritizedConfigService<ConfigData, Priority>(initialConfigDatas),\n };\n}\n"],"names":["ArrayIsArray"],"mappings":"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"}
|
package/package.json
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@conduit-client/service-config",
|
|
3
|
+
"version": "5.67.0-dev1",
|
|
4
|
+
"private": false,
|
|
5
|
+
"description": "OneStore Cache Service definition",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/salesforce-experience-platform-emu/onestore.git",
|
|
10
|
+
"directory": "packages/@conduit-client/services/config"
|
|
11
|
+
},
|
|
12
|
+
"license": "SEE LICENSE IN LICENSE.txt",
|
|
13
|
+
"exports": {
|
|
14
|
+
"./v1": {
|
|
15
|
+
"import": "./dist/v1/index.js",
|
|
16
|
+
"types": "./dist/types/v1/index.d.ts",
|
|
17
|
+
"require": "./dist/v1/index.js"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"main": "dist/index.js",
|
|
21
|
+
"module": "./dist/main/index.js",
|
|
22
|
+
"types": "dist/types/index.d.ts",
|
|
23
|
+
"files": [
|
|
24
|
+
"dist/"
|
|
25
|
+
],
|
|
26
|
+
"scripts": {
|
|
27
|
+
"build": "vite build && tsc --build --emitDeclarationOnly",
|
|
28
|
+
"clean": "rm -rf dist",
|
|
29
|
+
"test": "vitest run",
|
|
30
|
+
"test:size": "size-limit",
|
|
31
|
+
"watch": "npm run build --watch"
|
|
32
|
+
},
|
|
33
|
+
"dependencies": {
|
|
34
|
+
"@conduit-client/utils": "5.67.0-dev1"
|
|
35
|
+
},
|
|
36
|
+
"volta": {
|
|
37
|
+
"extends": "../../../../package.json"
|
|
38
|
+
},
|
|
39
|
+
"size-limit": [
|
|
40
|
+
{
|
|
41
|
+
"path": "./dist/v1/index.js",
|
|
42
|
+
"limit": "1.6 kB"
|
|
43
|
+
}
|
|
44
|
+
]
|
|
45
|
+
}
|