@api-client/core 0.20.3 → 0.20.5
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/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@api-client/core",
|
|
3
3
|
"description": "The API Client's core client library. Works in NodeJS and in a ES enabled browser.",
|
|
4
|
-
"version": "0.20.
|
|
4
|
+
"version": "0.20.5",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"exports": {
|
|
7
7
|
"./browser.js": {
|
|
@@ -139,11 +139,11 @@
|
|
|
139
139
|
"get-port": "^7.0.0",
|
|
140
140
|
"globals": "^17.0.0",
|
|
141
141
|
"husky": "^9.0.11",
|
|
142
|
-
"lint-staged": "^
|
|
142
|
+
"lint-staged": "^17.0.2",
|
|
143
143
|
"oauth2-mock-server": "^8.0.0",
|
|
144
144
|
"prettier": "^3.5.1",
|
|
145
145
|
"schema-org-json-schemas": "^2.1.4",
|
|
146
|
-
"sinon": "^
|
|
146
|
+
"sinon": "^22.0.0",
|
|
147
147
|
"ts-node-maintained": "^10.9.5",
|
|
148
148
|
"typescript": "^6.0.2",
|
|
149
149
|
"typescript-eslint": "^8.24.1"
|
package/src/modeling/types.ts
CHANGED
|
@@ -127,6 +127,43 @@ export interface SchemaDefaultValue {
|
|
|
127
127
|
* It is always a string and it has to be casted to the property's data type.
|
|
128
128
|
*/
|
|
129
129
|
value: string | FunctionValue
|
|
130
|
+
/**
|
|
131
|
+
* When the `value` is a function, the `config` property is used to configure the function.
|
|
132
|
+
* The type of the config depends on the function and the property data type.
|
|
133
|
+
*/
|
|
134
|
+
config?: FunctionGeneratorConfig
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* A union of all possible function generator configurations.
|
|
139
|
+
*/
|
|
140
|
+
export type FunctionGeneratorConfig = StringDefaultRandomGenerator
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Configuration for the `random` function for string properties.
|
|
144
|
+
*/
|
|
145
|
+
export interface StringDefaultRandomGenerator {
|
|
146
|
+
/**
|
|
147
|
+
* When set to true, the random string will have a fixed length defined by the `length` property.
|
|
148
|
+
* Otherwise, the length will be a random number between the property's schema `minimum` and `maximum`.
|
|
149
|
+
*/
|
|
150
|
+
isFixed?: boolean
|
|
151
|
+
/**
|
|
152
|
+
* The fixed length of the random string.
|
|
153
|
+
*
|
|
154
|
+
* The `isFixed` must be `true` to use this property.
|
|
155
|
+
*/
|
|
156
|
+
length?: number
|
|
157
|
+
/**
|
|
158
|
+
* The prefix to add to the random string.
|
|
159
|
+
* The prefix adds to the length of the random string.
|
|
160
|
+
*/
|
|
161
|
+
prefix?: string
|
|
162
|
+
/**
|
|
163
|
+
* The suffix to add to the random string.
|
|
164
|
+
* The suffix adds to the length of the random string.
|
|
165
|
+
*/
|
|
166
|
+
suffix?: string
|
|
130
167
|
}
|
|
131
168
|
|
|
132
169
|
/**
|