@twin.org/core 0.0.2-next.8 → 0.0.2
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 +1 -9
- package/dist/es/encoding/base32.js +75 -0
- package/dist/es/encoding/base32.js.map +1 -0
- package/dist/es/encoding/base58.js +124 -0
- package/dist/es/encoding/base58.js.map +1 -0
- package/dist/es/encoding/base64.js +231 -0
- package/dist/es/encoding/base64.js.map +1 -0
- package/dist/es/encoding/base64Url.js +42 -0
- package/dist/es/encoding/base64Url.js.map +1 -0
- package/dist/es/errors/alreadyExistsError.js +22 -0
- package/dist/es/errors/alreadyExistsError.js.map +1 -0
- package/dist/es/errors/baseError.js +257 -0
- package/dist/es/errors/baseError.js.map +1 -0
- package/dist/es/errors/conflictError.js +23 -0
- package/dist/es/errors/conflictError.js.map +1 -0
- package/dist/es/errors/generalError.js +21 -0
- package/dist/es/errors/generalError.js.map +1 -0
- package/dist/es/errors/guardError.js +27 -0
- package/dist/es/errors/guardError.js.map +1 -0
- package/dist/es/errors/notFoundError.js +22 -0
- package/dist/es/errors/notFoundError.js.map +1 -0
- package/dist/es/errors/notImplementedError.js +24 -0
- package/dist/es/errors/notImplementedError.js.map +1 -0
- package/dist/es/errors/notSupportedError.js +21 -0
- package/dist/es/errors/notSupportedError.js.map +1 -0
- package/dist/es/errors/unauthorizedError.js +21 -0
- package/dist/es/errors/unauthorizedError.js.map +1 -0
- package/dist/es/errors/unprocessableError.js +21 -0
- package/dist/es/errors/unprocessableError.js.map +1 -0
- package/dist/es/errors/validationError.js +23 -0
- package/dist/es/errors/validationError.js.map +1 -0
- package/dist/es/factories/componentFactory.js +9 -0
- package/dist/es/factories/componentFactory.js.map +1 -0
- package/dist/es/factories/factory.js +297 -0
- package/dist/es/factories/factory.js.map +1 -0
- package/dist/es/helpers/arrayHelper.js +46 -0
- package/dist/es/helpers/arrayHelper.js.map +1 -0
- package/dist/es/helpers/envHelper.js +39 -0
- package/dist/es/helpers/envHelper.js.map +1 -0
- package/dist/es/helpers/errorHelper.js +100 -0
- package/dist/es/helpers/errorHelper.js.map +1 -0
- package/dist/es/helpers/filenameHelper.js +32 -0
- package/dist/es/helpers/filenameHelper.js.map +1 -0
- package/dist/es/helpers/hexHelper.js +45 -0
- package/dist/es/helpers/hexHelper.js.map +1 -0
- package/dist/es/helpers/jsonHelper.js +163 -0
- package/dist/es/helpers/jsonHelper.js.map +1 -0
- package/dist/es/helpers/numberHelper.js +30 -0
- package/dist/es/helpers/numberHelper.js.map +1 -0
- package/dist/es/helpers/objectHelper.js +309 -0
- package/dist/es/helpers/objectHelper.js.map +1 -0
- package/dist/es/helpers/randomHelper.js +66 -0
- package/dist/es/helpers/randomHelper.js.map +1 -0
- package/dist/es/helpers/stringHelper.js +252 -0
- package/dist/es/helpers/stringHelper.js.map +1 -0
- package/dist/es/helpers/uint8ArrayHelper.js +26 -0
- package/dist/es/helpers/uint8ArrayHelper.js.map +1 -0
- package/dist/es/index.js +60 -0
- package/dist/es/index.js.map +1 -0
- package/dist/es/models/IComponent.js +2 -0
- package/dist/es/models/IComponent.js.map +1 -0
- package/dist/es/models/IError.js +4 -0
- package/dist/es/models/IError.js.map +1 -0
- package/dist/es/models/IHealth.js +2 -0
- package/dist/es/models/IHealth.js.map +1 -0
- package/dist/es/models/II18nShared.js +2 -0
- package/dist/es/models/II18nShared.js.map +1 -0
- package/dist/es/models/IKeyValue.js +2 -0
- package/dist/es/models/IKeyValue.js.map +1 -0
- package/dist/es/models/ILabelledValue.js +2 -0
- package/dist/es/models/ILabelledValue.js.map +1 -0
- package/dist/es/models/ILocale.js +2 -0
- package/dist/es/models/ILocale.js.map +1 -0
- package/dist/es/models/ILocaleDictionary.js +4 -0
- package/dist/es/models/ILocaleDictionary.js.map +1 -0
- package/dist/es/models/ILocalesIndex.js +2 -0
- package/dist/es/models/ILocalesIndex.js.map +1 -0
- package/dist/es/models/IPatchOperation.js +4 -0
- package/dist/es/models/IPatchOperation.js.map +1 -0
- package/dist/es/models/IUrlParts.js +4 -0
- package/dist/es/models/IUrlParts.js.map +1 -0
- package/dist/es/models/IValidationFailure.js +2 -0
- package/dist/es/models/IValidationFailure.js.map +1 -0
- package/dist/es/models/coerceType.js +49 -0
- package/dist/es/models/coerceType.js.map +1 -0
- package/dist/es/models/compressionType.js +17 -0
- package/dist/es/models/compressionType.js.map +1 -0
- package/dist/es/models/healthStatus.js +21 -0
- package/dist/es/models/healthStatus.js.map +1 -0
- package/dist/es/types/bitString.js +98 -0
- package/dist/es/types/bitString.js.map +1 -0
- package/dist/es/types/objectOrArray.js +2 -0
- package/dist/es/types/objectOrArray.js.map +1 -0
- package/dist/es/types/singleOccurrenceArray.js +2 -0
- package/dist/es/types/singleOccurrenceArray.js.map +1 -0
- package/dist/es/types/url.js +144 -0
- package/dist/es/types/url.js.map +1 -0
- package/dist/es/types/urn.js +211 -0
- package/dist/es/types/urn.js.map +1 -0
- package/dist/es/utils/asyncCache.js +206 -0
- package/dist/es/utils/asyncCache.js.map +1 -0
- package/dist/es/utils/coerce.js +269 -0
- package/dist/es/utils/coerce.js.map +1 -0
- package/dist/es/utils/compression.js +49 -0
- package/dist/es/utils/compression.js.map +1 -0
- package/dist/es/utils/converter.js +256 -0
- package/dist/es/utils/converter.js.map +1 -0
- package/dist/es/utils/guards.js +385 -0
- package/dist/es/utils/guards.js.map +1 -0
- package/dist/es/utils/i18n.js +243 -0
- package/dist/es/utils/i18n.js.map +1 -0
- package/dist/es/utils/is.js +367 -0
- package/dist/es/utils/is.js.map +1 -0
- package/dist/es/utils/sharedStore.js +48 -0
- package/dist/es/utils/sharedStore.js.map +1 -0
- package/dist/es/utils/validation.js +774 -0
- package/dist/es/utils/validation.js.map +1 -0
- package/dist/types/encoding/base32.d.ts +5 -1
- package/dist/types/encoding/base58.d.ts +4 -0
- package/dist/types/encoding/base64.d.ts +4 -0
- package/dist/types/encoding/base64Url.d.ts +4 -0
- package/dist/types/errors/alreadyExistsError.d.ts +6 -3
- package/dist/types/errors/baseError.d.ts +2 -2
- package/dist/types/errors/conflictError.d.ts +6 -3
- package/dist/types/errors/generalError.d.ts +2 -2
- package/dist/types/errors/guardError.d.ts +2 -2
- package/dist/types/errors/notFoundError.d.ts +6 -3
- package/dist/types/errors/notImplementedError.d.ts +6 -2
- package/dist/types/errors/notSupportedError.d.ts +6 -3
- package/dist/types/errors/unauthorizedError.d.ts +7 -4
- package/dist/types/errors/unprocessableError.d.ts +2 -2
- package/dist/types/errors/validationError.d.ts +2 -2
- package/dist/types/factories/componentFactory.d.ts +2 -2
- package/dist/types/factories/factory.d.ts +27 -1
- package/dist/types/helpers/arrayHelper.d.ts +1 -8
- package/dist/types/helpers/errorHelper.d.ts +1 -1
- package/dist/types/helpers/jsonHelper.d.ts +5 -1
- package/dist/types/helpers/numberHelper.d.ts +17 -0
- package/dist/types/helpers/objectHelper.d.ts +24 -6
- package/dist/types/helpers/randomHelper.d.ts +16 -0
- package/dist/types/helpers/stringHelper.d.ts +12 -6
- package/dist/types/index.d.ts +57 -53
- package/dist/types/models/IComponent.d.ts +18 -7
- package/dist/types/models/IError.d.ts +1 -1
- package/dist/types/models/IHealth.d.ts +32 -0
- package/dist/types/models/ILocalesIndex.d.ts +1 -1
- package/dist/types/models/IValidationFailure.d.ts +0 -4
- package/dist/types/models/healthStatus.d.ts +21 -0
- package/dist/types/types/bitString.d.ts +4 -0
- package/dist/types/types/singleOccurrenceArray.d.ts +9 -0
- package/dist/types/types/url.d.ts +8 -3
- package/dist/types/types/urn.d.ts +7 -2
- package/dist/types/utils/asyncCache.d.ts +7 -0
- package/dist/types/utils/coerce.d.ts +1 -1
- package/dist/types/utils/compression.d.ts +5 -1
- package/dist/types/utils/guards.d.ts +11 -3
- package/dist/types/utils/i18n.d.ts +16 -1
- package/dist/types/utils/is.d.ts +8 -1
- package/dist/types/utils/validation.d.ts +1 -1
- package/docs/changelog.md +1240 -130
- package/docs/examples.md +308 -1
- package/docs/reference/classes/AlreadyExistsError.md +43 -39
- package/docs/reference/classes/ArrayHelper.md +10 -44
- package/docs/reference/classes/AsyncCache.md +12 -12
- package/docs/reference/classes/Base32.md +11 -3
- package/docs/reference/classes/Base58.md +10 -2
- package/docs/reference/classes/Base64.md +11 -3
- package/docs/reference/classes/Base64Url.md +10 -2
- package/docs/reference/classes/BaseError.md +37 -37
- package/docs/reference/classes/BitString.md +13 -5
- package/docs/reference/classes/Coerce.md +31 -31
- package/docs/reference/classes/Compression.md +10 -2
- package/docs/reference/classes/ConflictError.md +43 -39
- package/docs/reference/classes/Converter.md +18 -18
- package/docs/reference/classes/EnvHelper.md +1 -1
- package/docs/reference/classes/ErrorHelper.md +5 -5
- package/docs/reference/classes/Factory.md +122 -20
- package/docs/reference/classes/FilenameHelper.md +1 -1
- package/docs/reference/classes/GeneralError.md +38 -38
- package/docs/reference/classes/GuardError.md +38 -38
- package/docs/reference/classes/Guards.md +80 -34
- package/docs/reference/classes/HexHelper.md +6 -6
- package/docs/reference/classes/I18n.md +66 -14
- package/docs/reference/classes/Is.md +77 -43
- package/docs/reference/classes/JsonHelper.md +17 -9
- package/docs/reference/classes/NotFoundError.md +43 -39
- package/docs/reference/classes/NotImplementedError.md +48 -38
- package/docs/reference/classes/NotSupportedError.md +43 -39
- package/docs/reference/classes/NumberHelper.md +55 -0
- package/docs/reference/classes/ObjectHelper.md +163 -51
- package/docs/reference/classes/RandomHelper.md +53 -1
- package/docs/reference/classes/SharedStore.md +5 -5
- package/docs/reference/classes/StringHelper.md +52 -30
- package/docs/reference/classes/Uint8ArrayHelper.md +1 -1
- package/docs/reference/classes/UnauthorizedError.md +44 -40
- package/docs/reference/classes/UnprocessableError.md +38 -38
- package/docs/reference/classes/Url.md +24 -10
- package/docs/reference/classes/Urn.md +42 -28
- package/docs/reference/classes/Validation.md +27 -27
- package/docs/reference/classes/ValidationError.md +37 -37
- package/docs/reference/index.md +6 -0
- package/docs/reference/interfaces/IComponent.md +57 -27
- package/docs/reference/interfaces/IError.md +11 -11
- package/docs/reference/interfaces/IHealth.md +55 -0
- package/docs/reference/interfaces/II18nShared.md +4 -4
- package/docs/reference/interfaces/IKeyValue.md +2 -2
- package/docs/reference/interfaces/ILabelledValue.md +2 -2
- package/docs/reference/interfaces/ILocale.md +2 -2
- package/docs/reference/interfaces/ILocaleDictionary.md +1 -1
- package/docs/reference/interfaces/ILocalesIndex.md +1 -1
- package/docs/reference/interfaces/IPatchOperation.md +6 -6
- package/docs/reference/interfaces/IUrlParts.md +9 -9
- package/docs/reference/interfaces/IValidationFailure.md +4 -12
- package/docs/reference/type-aliases/HealthStatus.md +5 -0
- package/docs/reference/type-aliases/SingleOccurrenceArray.md +15 -0
- package/docs/reference/type-aliases/SingleOccurrenceArrayDepthHelper.md +19 -0
- package/docs/reference/variables/CoerceType.md +10 -10
- package/docs/reference/variables/CompressionType.md +2 -2
- package/docs/reference/variables/HealthStatus.md +25 -0
- package/locales/.validate-ignore +1 -0
- package/locales/en.json +9 -7
- package/package.json +24 -12
- package/dist/cjs/index.cjs +0 -5175
- package/dist/esm/index.mjs +0 -5133
- /package/dist/types/{models → types}/objectOrArray.d.ts +0 -0
|
@@ -12,9 +12,17 @@ Class to help with random generation.
|
|
|
12
12
|
|
|
13
13
|
`RandomHelper`
|
|
14
14
|
|
|
15
|
+
## Properties
|
|
16
|
+
|
|
17
|
+
### CLASS\_NAME {#class_name}
|
|
18
|
+
|
|
19
|
+
> `readonly` `static` **CLASS\_NAME**: `string`
|
|
20
|
+
|
|
21
|
+
Runtime name for the class.
|
|
22
|
+
|
|
15
23
|
## Methods
|
|
16
24
|
|
|
17
|
-
### generate()
|
|
25
|
+
### generate() {#generate}
|
|
18
26
|
|
|
19
27
|
> `static` **generate**(`length`): `Uint8Array`
|
|
20
28
|
|
|
@@ -33,3 +41,47 @@ The length of buffer to create.
|
|
|
33
41
|
`Uint8Array`
|
|
34
42
|
|
|
35
43
|
The random array.
|
|
44
|
+
|
|
45
|
+
***
|
|
46
|
+
|
|
47
|
+
### generateUuidV7() {#generateuuidv7}
|
|
48
|
+
|
|
49
|
+
> `static` **generateUuidV7**(`format?`): `string`
|
|
50
|
+
|
|
51
|
+
Generate a new UUIDv7.
|
|
52
|
+
|
|
53
|
+
#### Parameters
|
|
54
|
+
|
|
55
|
+
##### format?
|
|
56
|
+
|
|
57
|
+
`"standard"` \| `"compact"`
|
|
58
|
+
|
|
59
|
+
The format of the UUIDv7 string.
|
|
60
|
+
|
|
61
|
+
#### Returns
|
|
62
|
+
|
|
63
|
+
`string`
|
|
64
|
+
|
|
65
|
+
The UUIDv7 string.
|
|
66
|
+
|
|
67
|
+
***
|
|
68
|
+
|
|
69
|
+
### uuidV7ExtractTimestamp() {#uuidv7extracttimestamp}
|
|
70
|
+
|
|
71
|
+
> `static` **uuidV7ExtractTimestamp**(`uuid`): `number`
|
|
72
|
+
|
|
73
|
+
Extract the unix timestamp (ms) from a UUIDv7.
|
|
74
|
+
|
|
75
|
+
#### Parameters
|
|
76
|
+
|
|
77
|
+
##### uuid
|
|
78
|
+
|
|
79
|
+
`string`
|
|
80
|
+
|
|
81
|
+
The UUIDv7 string.
|
|
82
|
+
|
|
83
|
+
#### Returns
|
|
84
|
+
|
|
85
|
+
`number`
|
|
86
|
+
|
|
87
|
+
The unix timestamp in milliseconds.
|
|
@@ -15,9 +15,9 @@ instance loads of a packages.
|
|
|
15
15
|
|
|
16
16
|
## Methods
|
|
17
17
|
|
|
18
|
-
### get()
|
|
18
|
+
### get() {#get}
|
|
19
19
|
|
|
20
|
-
> `static` **get**\<`T`\>(`prop`): `
|
|
20
|
+
> `static` **get**\<`T`\>(`prop`): `T` \| `undefined`
|
|
21
21
|
|
|
22
22
|
Get a property from the shared store.
|
|
23
23
|
|
|
@@ -37,13 +37,13 @@ The name of the property to get.
|
|
|
37
37
|
|
|
38
38
|
#### Returns
|
|
39
39
|
|
|
40
|
-
`
|
|
40
|
+
`T` \| `undefined`
|
|
41
41
|
|
|
42
42
|
The property if it exists.
|
|
43
43
|
|
|
44
44
|
***
|
|
45
45
|
|
|
46
|
-
### set()
|
|
46
|
+
### set() {#set}
|
|
47
47
|
|
|
48
48
|
> `static` **set**\<`T`\>(`prop`, `value`): `void`
|
|
49
49
|
|
|
@@ -75,7 +75,7 @@ The value to set.
|
|
|
75
75
|
|
|
76
76
|
***
|
|
77
77
|
|
|
78
|
-
### remove()
|
|
78
|
+
### remove() {#remove}
|
|
79
79
|
|
|
80
80
|
> `static` **remove**(`prop`): `void`
|
|
81
81
|
|
|
@@ -14,53 +14,75 @@ Class to help with string.
|
|
|
14
14
|
|
|
15
15
|
## Methods
|
|
16
16
|
|
|
17
|
-
### trimTrailingSlashes()
|
|
17
|
+
### trimTrailingSlashes() {#trimtrailingslashes}
|
|
18
18
|
|
|
19
19
|
> `static` **trimTrailingSlashes**(`value`): `string`
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
Implementation signature for trimTrailingSlashes.
|
|
22
22
|
|
|
23
23
|
#### Parameters
|
|
24
24
|
|
|
25
25
|
##### value
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
`string`
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
The value to trim.
|
|
30
30
|
|
|
31
31
|
#### Returns
|
|
32
32
|
|
|
33
33
|
`string`
|
|
34
34
|
|
|
35
|
-
The trimmed
|
|
35
|
+
The trimmed string or the original.
|
|
36
36
|
|
|
37
37
|
***
|
|
38
38
|
|
|
39
|
-
### trimLeadingSlashes()
|
|
39
|
+
### trimLeadingSlashes() {#trimleadingslashes}
|
|
40
40
|
|
|
41
41
|
> `static` **trimLeadingSlashes**(`value`): `string`
|
|
42
42
|
|
|
43
|
-
|
|
43
|
+
Implementation signature for trimLeadingSlashes.
|
|
44
44
|
|
|
45
45
|
#### Parameters
|
|
46
46
|
|
|
47
47
|
##### value
|
|
48
48
|
|
|
49
|
+
`string`
|
|
50
|
+
|
|
49
51
|
The value to trim.
|
|
50
52
|
|
|
51
|
-
|
|
53
|
+
#### Returns
|
|
54
|
+
|
|
55
|
+
`string`
|
|
56
|
+
|
|
57
|
+
The trimmed string or the original.
|
|
58
|
+
|
|
59
|
+
***
|
|
60
|
+
|
|
61
|
+
### trimLeadingAndTrailingSlashes() {#trimleadingandtrailingslashes}
|
|
62
|
+
|
|
63
|
+
> `static` **trimLeadingAndTrailingSlashes**(`value`): `string`
|
|
64
|
+
|
|
65
|
+
Trim both leading and trailing slashes from a string.
|
|
66
|
+
|
|
67
|
+
#### Parameters
|
|
68
|
+
|
|
69
|
+
##### value
|
|
70
|
+
|
|
71
|
+
`string`
|
|
72
|
+
|
|
73
|
+
The value to trim.
|
|
52
74
|
|
|
53
75
|
#### Returns
|
|
54
76
|
|
|
55
77
|
`string`
|
|
56
78
|
|
|
57
|
-
The trimmed
|
|
79
|
+
The trimmed string or the original.
|
|
58
80
|
|
|
59
81
|
***
|
|
60
82
|
|
|
61
|
-
### kebabCase()
|
|
83
|
+
### kebabCase() {#kebabcase}
|
|
62
84
|
|
|
63
|
-
> `static` **kebabCase**(`input`, `stripInterfacePrefix
|
|
85
|
+
> `static` **kebabCase**(`input`, `stripInterfacePrefix?`): `string`
|
|
64
86
|
|
|
65
87
|
Convert the input string to kebab case.
|
|
66
88
|
|
|
@@ -72,7 +94,7 @@ Convert the input string to kebab case.
|
|
|
72
94
|
|
|
73
95
|
The input to convert.
|
|
74
96
|
|
|
75
|
-
##### stripInterfacePrefix
|
|
97
|
+
##### stripInterfacePrefix?
|
|
76
98
|
|
|
77
99
|
`boolean` = `true`
|
|
78
100
|
|
|
@@ -86,9 +108,9 @@ The kebab case version of the input.
|
|
|
86
108
|
|
|
87
109
|
***
|
|
88
110
|
|
|
89
|
-
### snakeCase()
|
|
111
|
+
### snakeCase() {#snakecase}
|
|
90
112
|
|
|
91
|
-
> `static` **snakeCase**(`input`, `stripInterfacePrefix
|
|
113
|
+
> `static` **snakeCase**(`input`, `stripInterfacePrefix?`): `string`
|
|
92
114
|
|
|
93
115
|
Convert the input string to snake case.
|
|
94
116
|
|
|
@@ -100,7 +122,7 @@ Convert the input string to snake case.
|
|
|
100
122
|
|
|
101
123
|
The input to convert.
|
|
102
124
|
|
|
103
|
-
##### stripInterfacePrefix
|
|
125
|
+
##### stripInterfacePrefix?
|
|
104
126
|
|
|
105
127
|
`boolean` = `true`
|
|
106
128
|
|
|
@@ -114,9 +136,9 @@ The snake case version of the input.
|
|
|
114
136
|
|
|
115
137
|
***
|
|
116
138
|
|
|
117
|
-
### titleCase()
|
|
139
|
+
### titleCase() {#titlecase}
|
|
118
140
|
|
|
119
|
-
> `static` **titleCase**(`input`, `stripInterfacePrefix
|
|
141
|
+
> `static` **titleCase**(`input`, `stripInterfacePrefix?`): `string`
|
|
120
142
|
|
|
121
143
|
Title case all the words.
|
|
122
144
|
|
|
@@ -128,7 +150,7 @@ Title case all the words.
|
|
|
128
150
|
|
|
129
151
|
The input to convert.
|
|
130
152
|
|
|
131
|
-
##### stripInterfacePrefix
|
|
153
|
+
##### stripInterfacePrefix?
|
|
132
154
|
|
|
133
155
|
`boolean` = `true`
|
|
134
156
|
|
|
@@ -142,9 +164,9 @@ The title case version of the input.
|
|
|
142
164
|
|
|
143
165
|
***
|
|
144
166
|
|
|
145
|
-
### pascalCase()
|
|
167
|
+
### pascalCase() {#pascalcase}
|
|
146
168
|
|
|
147
|
-
> `static` **pascalCase**(`input`, `stripInterfacePrefix
|
|
169
|
+
> `static` **pascalCase**(`input`, `stripInterfacePrefix?`): `string`
|
|
148
170
|
|
|
149
171
|
Pascal case all the words.
|
|
150
172
|
|
|
@@ -156,7 +178,7 @@ Pascal case all the words.
|
|
|
156
178
|
|
|
157
179
|
The input to convert.
|
|
158
180
|
|
|
159
|
-
##### stripInterfacePrefix
|
|
181
|
+
##### stripInterfacePrefix?
|
|
160
182
|
|
|
161
183
|
`boolean` = `true`
|
|
162
184
|
|
|
@@ -170,9 +192,9 @@ The pascal case version of the input.
|
|
|
170
192
|
|
|
171
193
|
***
|
|
172
194
|
|
|
173
|
-
### camelCase()
|
|
195
|
+
### camelCase() {#camelcase}
|
|
174
196
|
|
|
175
|
-
> `static` **camelCase**(`input`, `stripInterfacePrefix
|
|
197
|
+
> `static` **camelCase**(`input`, `stripInterfacePrefix?`): `string`
|
|
176
198
|
|
|
177
199
|
Camel case all the words.
|
|
178
200
|
|
|
@@ -184,7 +206,7 @@ Camel case all the words.
|
|
|
184
206
|
|
|
185
207
|
The input to convert.
|
|
186
208
|
|
|
187
|
-
##### stripInterfacePrefix
|
|
209
|
+
##### stripInterfacePrefix?
|
|
188
210
|
|
|
189
211
|
`boolean` = `true`
|
|
190
212
|
|
|
@@ -198,9 +220,9 @@ The camel case version of the input.
|
|
|
198
220
|
|
|
199
221
|
***
|
|
200
222
|
|
|
201
|
-
### wordPath()
|
|
223
|
+
### wordPath() {#wordpath}
|
|
202
224
|
|
|
203
|
-
> `static` **wordPath**(`input`, `stripInterfacePrefix
|
|
225
|
+
> `static` **wordPath**(`input`, `stripInterfacePrefix?`): `string`
|
|
204
226
|
|
|
205
227
|
Convert the words to a path.
|
|
206
228
|
|
|
@@ -212,7 +234,7 @@ Convert the words to a path.
|
|
|
212
234
|
|
|
213
235
|
The input to convert.
|
|
214
236
|
|
|
215
|
-
##### stripInterfacePrefix
|
|
237
|
+
##### stripInterfacePrefix?
|
|
216
238
|
|
|
217
239
|
`boolean` = `true`
|
|
218
240
|
|
|
@@ -226,7 +248,7 @@ The path version of the input.
|
|
|
226
248
|
|
|
227
249
|
***
|
|
228
250
|
|
|
229
|
-
### stripPrefix()
|
|
251
|
+
### stripPrefix() {#stripprefix}
|
|
230
252
|
|
|
231
253
|
> `static` **stripPrefix**(`input`): `string`
|
|
232
254
|
|
|
@@ -248,7 +270,7 @@ The input with any interface prefix stripped.
|
|
|
248
270
|
|
|
249
271
|
***
|
|
250
272
|
|
|
251
|
-
### words()
|
|
273
|
+
### words() {#words}
|
|
252
274
|
|
|
253
275
|
> `static` **words**(`input`): `string`[]
|
|
254
276
|
|
|
@@ -270,7 +292,7 @@ The string split into words.
|
|
|
270
292
|
|
|
271
293
|
***
|
|
272
294
|
|
|
273
|
-
### isUtf8()
|
|
295
|
+
### isUtf8() {#isutf8}
|
|
274
296
|
|
|
275
297
|
> `static` **isUtf8**(`data`): `boolean`
|
|
276
298
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Class: UnauthorizedError
|
|
2
2
|
|
|
3
|
-
Class to handle errors which are triggered by access not being
|
|
3
|
+
Class to handle errors which are triggered by access not being authorized.
|
|
4
4
|
|
|
5
5
|
## Extends
|
|
6
6
|
|
|
@@ -10,7 +10,7 @@ Class to handle errors which are triggered by access not being unauthorized.
|
|
|
10
10
|
|
|
11
11
|
### Constructor
|
|
12
12
|
|
|
13
|
-
> **new UnauthorizedError**(`source`, `message`, `cause?`): `UnauthorizedError`
|
|
13
|
+
> **new UnauthorizedError**(`source`, `message`, `properties?`, `cause?`): `UnauthorizedError`
|
|
14
14
|
|
|
15
15
|
Create a new instance of UnauthorizedError.
|
|
16
16
|
|
|
@@ -26,7 +26,11 @@ The source of the error.
|
|
|
26
26
|
|
|
27
27
|
`string`
|
|
28
28
|
|
|
29
|
-
The message as
|
|
29
|
+
The message as an i18n key.
|
|
30
|
+
|
|
31
|
+
##### properties?
|
|
32
|
+
|
|
33
|
+
Any additional information for the error.
|
|
30
34
|
|
|
31
35
|
##### cause?
|
|
32
36
|
|
|
@@ -44,9 +48,9 @@ The cause of the error if we have wrapped another error.
|
|
|
44
48
|
|
|
45
49
|
## Properties
|
|
46
50
|
|
|
47
|
-
### source?
|
|
51
|
+
### source? {#source}
|
|
48
52
|
|
|
49
|
-
> `optional` **source
|
|
53
|
+
> `optional` **source?**: `string`
|
|
50
54
|
|
|
51
55
|
The source of the error.
|
|
52
56
|
|
|
@@ -56,9 +60,9 @@ The source of the error.
|
|
|
56
60
|
|
|
57
61
|
***
|
|
58
62
|
|
|
59
|
-
### properties?
|
|
63
|
+
### properties? {#properties}
|
|
60
64
|
|
|
61
|
-
> `optional` **properties
|
|
65
|
+
> `optional` **properties?**: `object`
|
|
62
66
|
|
|
63
67
|
Any additional information for the error.
|
|
64
68
|
|
|
@@ -72,9 +76,9 @@ Any additional information for the error.
|
|
|
72
76
|
|
|
73
77
|
***
|
|
74
78
|
|
|
75
|
-
### cause?
|
|
79
|
+
### cause? {#cause}
|
|
76
80
|
|
|
77
|
-
> `optional` **cause
|
|
81
|
+
> `optional` **cause?**: [`IError`](../interfaces/IError.md)
|
|
78
82
|
|
|
79
83
|
The cause of the error.
|
|
80
84
|
|
|
@@ -84,7 +88,7 @@ The cause of the error.
|
|
|
84
88
|
|
|
85
89
|
***
|
|
86
90
|
|
|
87
|
-
### CLASS\_NAME
|
|
91
|
+
### CLASS\_NAME {#class_name}
|
|
88
92
|
|
|
89
93
|
> `readonly` `static` **CLASS\_NAME**: `string`
|
|
90
94
|
|
|
@@ -92,7 +96,7 @@ Runtime name for the class.
|
|
|
92
96
|
|
|
93
97
|
## Methods
|
|
94
98
|
|
|
95
|
-
### fromError()
|
|
99
|
+
### fromError() {#fromerror}
|
|
96
100
|
|
|
97
101
|
> `static` **fromError**(`err`): [`BaseError`](BaseError.md)
|
|
98
102
|
|
|
@@ -118,7 +122,7 @@ The new instance.
|
|
|
118
122
|
|
|
119
123
|
***
|
|
120
124
|
|
|
121
|
-
### flatten()
|
|
125
|
+
### flatten() {#flatten}
|
|
122
126
|
|
|
123
127
|
> `static` **flatten**(`err`): [`IError`](../interfaces/IError.md)[]
|
|
124
128
|
|
|
@@ -144,9 +148,9 @@ The list of all internal errors.
|
|
|
144
148
|
|
|
145
149
|
***
|
|
146
150
|
|
|
147
|
-
### expand()
|
|
151
|
+
### expand() {#expand}
|
|
148
152
|
|
|
149
|
-
> `static` **expand**(`errors`):
|
|
153
|
+
> `static` **expand**(`errors`): [`IError`](../interfaces/IError.md) \| `undefined`
|
|
150
154
|
|
|
151
155
|
Expand an error tree.
|
|
152
156
|
|
|
@@ -154,13 +158,13 @@ Expand an error tree.
|
|
|
154
158
|
|
|
155
159
|
##### errors
|
|
156
160
|
|
|
157
|
-
|
|
161
|
+
[`IError`](../interfaces/IError.md)[] \| `undefined`
|
|
158
162
|
|
|
159
|
-
|
|
163
|
+
The list of errors to expand.
|
|
160
164
|
|
|
161
165
|
#### Returns
|
|
162
166
|
|
|
163
|
-
|
|
167
|
+
[`IError`](../interfaces/IError.md) \| `undefined`
|
|
164
168
|
|
|
165
169
|
The first level error.
|
|
166
170
|
|
|
@@ -170,7 +174,7 @@ The first level error.
|
|
|
170
174
|
|
|
171
175
|
***
|
|
172
176
|
|
|
173
|
-
### isErrorName()
|
|
177
|
+
### isErrorName() {#iserrorname}
|
|
174
178
|
|
|
175
179
|
> `static` **isErrorName**(`error`, `name`): `error is BaseError`
|
|
176
180
|
|
|
@@ -186,9 +190,9 @@ The error to test.
|
|
|
186
190
|
|
|
187
191
|
##### name
|
|
188
192
|
|
|
189
|
-
|
|
193
|
+
`string` \| `RegExp`
|
|
190
194
|
|
|
191
|
-
|
|
195
|
+
The name to check for.
|
|
192
196
|
|
|
193
197
|
#### Returns
|
|
194
198
|
|
|
@@ -202,7 +206,7 @@ True if the error has the name.
|
|
|
202
206
|
|
|
203
207
|
***
|
|
204
208
|
|
|
205
|
-
### isErrorMessage()
|
|
209
|
+
### isErrorMessage() {#iserrormessage}
|
|
206
210
|
|
|
207
211
|
> `static` **isErrorMessage**(`error`, `message`): `error is BaseError`
|
|
208
212
|
|
|
@@ -218,9 +222,9 @@ The error to test.
|
|
|
218
222
|
|
|
219
223
|
##### message
|
|
220
224
|
|
|
221
|
-
|
|
225
|
+
`string` \| `RegExp`
|
|
222
226
|
|
|
223
|
-
|
|
227
|
+
The message to check for.
|
|
224
228
|
|
|
225
229
|
#### Returns
|
|
226
230
|
|
|
@@ -234,7 +238,7 @@ True if the error has the name.
|
|
|
234
238
|
|
|
235
239
|
***
|
|
236
240
|
|
|
237
|
-
### isErrorCode()
|
|
241
|
+
### isErrorCode() {#iserrorcode}
|
|
238
242
|
|
|
239
243
|
> `static` **isErrorCode**(`error`, `code`): `boolean`
|
|
240
244
|
|
|
@@ -250,9 +254,9 @@ The error to test.
|
|
|
250
254
|
|
|
251
255
|
##### code
|
|
252
256
|
|
|
253
|
-
|
|
257
|
+
`string` \| `RegExp`
|
|
254
258
|
|
|
255
|
-
|
|
259
|
+
The code to check for.
|
|
256
260
|
|
|
257
261
|
#### Returns
|
|
258
262
|
|
|
@@ -266,7 +270,7 @@ True if the error has the code.
|
|
|
266
270
|
|
|
267
271
|
***
|
|
268
272
|
|
|
269
|
-
### someErrorName()
|
|
273
|
+
### someErrorName() {#someerrorname}
|
|
270
274
|
|
|
271
275
|
> `static` **someErrorName**(`error`, `name`): `error is BaseError`
|
|
272
276
|
|
|
@@ -282,9 +286,9 @@ The error to test.
|
|
|
282
286
|
|
|
283
287
|
##### name
|
|
284
288
|
|
|
285
|
-
|
|
289
|
+
`string` \| `RegExp`
|
|
286
290
|
|
|
287
|
-
|
|
291
|
+
The name to check for.
|
|
288
292
|
|
|
289
293
|
#### Returns
|
|
290
294
|
|
|
@@ -298,7 +302,7 @@ True if the error has the name.
|
|
|
298
302
|
|
|
299
303
|
***
|
|
300
304
|
|
|
301
|
-
### someErrorMessage()
|
|
305
|
+
### someErrorMessage() {#someerrormessage}
|
|
302
306
|
|
|
303
307
|
> `static` **someErrorMessage**(`error`, `message`): `error is BaseError`
|
|
304
308
|
|
|
@@ -314,9 +318,9 @@ The error to test.
|
|
|
314
318
|
|
|
315
319
|
##### message
|
|
316
320
|
|
|
317
|
-
|
|
321
|
+
`string` \| `RegExp`
|
|
318
322
|
|
|
319
|
-
|
|
323
|
+
The message to check for.
|
|
320
324
|
|
|
321
325
|
#### Returns
|
|
322
326
|
|
|
@@ -330,7 +334,7 @@ True if the error has the name.
|
|
|
330
334
|
|
|
331
335
|
***
|
|
332
336
|
|
|
333
|
-
### someErrorClass()
|
|
337
|
+
### someErrorClass() {#someerrorclass}
|
|
334
338
|
|
|
335
339
|
> `static` **someErrorClass**(`error`, `cls`): `error is BaseError`
|
|
336
340
|
|
|
@@ -362,7 +366,7 @@ True if the error has the specific class.
|
|
|
362
366
|
|
|
363
367
|
***
|
|
364
368
|
|
|
365
|
-
### someErrorCode()
|
|
369
|
+
### someErrorCode() {#someerrorcode}
|
|
366
370
|
|
|
367
371
|
> `static` **someErrorCode**(`error`, `code`): `error is BaseError`
|
|
368
372
|
|
|
@@ -378,9 +382,9 @@ The error to test.
|
|
|
378
382
|
|
|
379
383
|
##### code
|
|
380
384
|
|
|
381
|
-
|
|
385
|
+
`string` \| `RegExp`
|
|
382
386
|
|
|
383
|
-
|
|
387
|
+
The code to check for.
|
|
384
388
|
|
|
385
389
|
#### Returns
|
|
386
390
|
|
|
@@ -394,7 +398,7 @@ True if the error has the name.
|
|
|
394
398
|
|
|
395
399
|
***
|
|
396
400
|
|
|
397
|
-
### isEmpty()
|
|
401
|
+
### isEmpty() {#isempty}
|
|
398
402
|
|
|
399
403
|
> `static` **isEmpty**(`err`): `boolean`
|
|
400
404
|
|
|
@@ -420,7 +424,7 @@ True if the error is empty.
|
|
|
420
424
|
|
|
421
425
|
***
|
|
422
426
|
|
|
423
|
-
### isAggregateError()
|
|
427
|
+
### isAggregateError() {#isaggregateerror}
|
|
424
428
|
|
|
425
429
|
> `static` **isAggregateError**(`err`): `err is AggregateError`
|
|
426
430
|
|
|
@@ -446,7 +450,7 @@ True if the error is an aggregate error.
|
|
|
446
450
|
|
|
447
451
|
***
|
|
448
452
|
|
|
449
|
-
### fromAggregate()
|
|
453
|
+
### fromAggregate() {#fromaggregate}
|
|
450
454
|
|
|
451
455
|
> `static` **fromAggregate**(`err`, `includeStackTrace?`): [`IError`](../interfaces/IError.md)[]
|
|
452
456
|
|
|
@@ -478,7 +482,7 @@ The array of errors.
|
|
|
478
482
|
|
|
479
483
|
***
|
|
480
484
|
|
|
481
|
-
### toJsonObject()
|
|
485
|
+
### toJsonObject() {#tojsonobject}
|
|
482
486
|
|
|
483
487
|
> **toJsonObject**(`includeStackTrace?`): [`IError`](../interfaces/IError.md)
|
|
484
488
|
|