@sankhyalabs/core-docs 2.3.4 → 2.3.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/README.md +57 -0
- package/classes/ApplicationContext.md +76 -0
- package/classes/ArrayUtils.md +89 -0
- package/classes/AuthorizedServiceCaller.md +76 -0
- package/classes/Change.md +168 -0
- package/classes/DataUnit.md +1394 -0
- package/classes/DataUnitAction.md +96 -0
- package/classes/DateUtils.md +190 -0
- package/classes/ElementIDUtils.md +243 -0
- package/classes/ErrorException.md +204 -0
- package/classes/ErrorTracking.md +54 -0
- package/classes/FloatingManager.md +384 -0
- package/classes/HttpProvider.md +96 -0
- package/classes/MaskFormatter-1.md +336 -0
- package/classes/NumberUtils.md +188 -0
- package/classes/ObjectUtils.md +81 -0
- package/classes/ReadyUtil.md +103 -0
- package/classes/RequestMetadata.md +84 -0
- package/classes/SkwHttpProvider.md +109 -0
- package/classes/StringUtils.md +381 -0
- package/classes/TimeFormatter.md +98 -0
- package/classes/UserAgentUtils.md +48 -0
- package/classes/WaitingChangeException.md +192 -0
- package/classes/WarningException.md +204 -0
- package/enums/Action.md +250 -0
- package/enums/ChangeOperation.md +52 -0
- package/enums/DataType.md +63 -0
- package/enums/DependencyType.md +41 -0
- package/enums/SortMode.md +30 -0
- package/enums/UserInterface.md +195 -0
- package/interfaces/DUActionInterceptor.md +29 -0
- package/interfaces/ExecutionContext.md +58 -0
- package/interfaces/FieldDescriptor.md +129 -0
- package/interfaces/Filter.md +41 -0
- package/interfaces/IElementIDInfo.md +30 -0
- package/interfaces/LoadDataRequest.md +63 -0
- package/interfaces/LoadDataResponse.md +30 -0
- package/interfaces/PageRequest.md +41 -0
- package/interfaces/PaginationInfo.md +63 -0
- package/interfaces/QuickFilter.md +30 -0
- package/interfaces/Record.md +40 -0
- package/interfaces/SavedRecord.md +55 -0
- package/interfaces/Sort.md +41 -0
- package/interfaces/SortingProvider.md +29 -0
- package/interfaces/UnitMetadata.md +41 -0
- package/interfaces/WaitingChange.md +41 -0
- package/modules/MaskFormatter.md +37 -0
- package/modules.md +63 -0
- package/package.json +1 -1
package/README.md
ADDED
@@ -0,0 +1,57 @@
|
|
1
|
+
@sankhyalabs/core / [Exports](modules.md)
|
2
|
+
|
3
|
+
# @sankhyalabs/core
|
4
|
+
|
5
|
+
### Intro
|
6
|
+
Esse projeto é responsavél por disponibilizar utilitários JavaScript comuns entre vários projetos.
|
7
|
+
|
8
|
+
# Como usar
|
9
|
+
|
10
|
+
```sh
|
11
|
+
$ npm install @sankhyalabs/core
|
12
|
+
```
|
13
|
+
|
14
|
+
```ts
|
15
|
+
import { StringUtils } from '@sankhyalabs/core'
|
16
|
+
|
17
|
+
function test(){
|
18
|
+
alert(StringUtils.isEmpty(''));
|
19
|
+
}
|
20
|
+
```
|
21
|
+
# Executar testes
|
22
|
+
```sh
|
23
|
+
$ npm t
|
24
|
+
```
|
25
|
+
# Como contribuir
|
26
|
+
- Criar uma branch com nome sugestivo para o problema/melhoria.
|
27
|
+
- Dentro do projeto criar uma pasta chamada "change_proposal" dentro dessa pasta deverá existir um exemplo do caso de uso/problema que você está resolvendo.
|
28
|
+
- Realizar as alterações.
|
29
|
+
- Criar caso de teste para o problema que você está resolvendo.
|
30
|
+
- Fazer commit na branch.
|
31
|
+
- Abrir MR para master, na descrição do MR, colocar a seguinte documentação :arrow_down:
|
32
|
+
|
33
|
+
##### Tipo de problema:
|
34
|
+
- [ ] Hotfix
|
35
|
+
- [ ] Feature
|
36
|
+
##### Ambiente simulação:
|
37
|
+
- [ ] Teste/Desenvolvimento
|
38
|
+
- [ ] Produçãp
|
39
|
+
|
40
|
+
##### Nome do projeto de origem (core, flow, wms...):
|
41
|
+
|
42
|
+
##### Descrição do problema:
|
43
|
+
|
44
|
+
##### Num.OS de origem(caso exista):
|
45
|
+
|
46
|
+
#
|
47
|
+
#
|
48
|
+
#
|
49
|
+
#
|
50
|
+
|
51
|
+
### Build em ambiente de desenvolvimento
|
52
|
+
|
53
|
+
```sh
|
54
|
+
$ npm run build --watch
|
55
|
+
```
|
56
|
+
|
57
|
+
Veja mais informações em nossa [Wiki](https://git.sankhya.com.br/sankhyalabs/sankhyacore/-/wikis/Diretrizes-de-Codifica%C3%A7%C3%A3o)
|
@@ -0,0 +1,76 @@
|
|
1
|
+
[@sankhyalabs/core](../README.md) / [Exports](../modules.md) / ApplicationContext
|
2
|
+
|
3
|
+
# Class: ApplicationContext
|
4
|
+
|
5
|
+
## Table of contents
|
6
|
+
|
7
|
+
### Constructors
|
8
|
+
|
9
|
+
- [constructor](ApplicationContext.md#constructor)
|
10
|
+
|
11
|
+
### Methods
|
12
|
+
|
13
|
+
- [getContextValue](ApplicationContext.md#getcontextvalue)
|
14
|
+
- [getCtx](ApplicationContext.md#getctx)
|
15
|
+
- [setContextValue](ApplicationContext.md#setcontextvalue)
|
16
|
+
|
17
|
+
## Constructors
|
18
|
+
|
19
|
+
### constructor
|
20
|
+
|
21
|
+
• **new ApplicationContext**()
|
22
|
+
|
23
|
+
## Methods
|
24
|
+
|
25
|
+
### getContextValue
|
26
|
+
|
27
|
+
▸ `Static` **getContextValue**(`key`): `any`
|
28
|
+
|
29
|
+
#### Parameters
|
30
|
+
|
31
|
+
| Name | Type |
|
32
|
+
| :------ | :------ |
|
33
|
+
| `key` | `string` |
|
34
|
+
|
35
|
+
#### Returns
|
36
|
+
|
37
|
+
`any`
|
38
|
+
|
39
|
+
#### Defined in
|
40
|
+
|
41
|
+
src/utils/ApplicationContext.ts:3
|
42
|
+
|
43
|
+
___
|
44
|
+
|
45
|
+
### getCtx
|
46
|
+
|
47
|
+
▸ `Static` `Private` **getCtx**(): `any`
|
48
|
+
|
49
|
+
#### Returns
|
50
|
+
|
51
|
+
`any`
|
52
|
+
|
53
|
+
#### Defined in
|
54
|
+
|
55
|
+
src/utils/ApplicationContext.ts:11
|
56
|
+
|
57
|
+
___
|
58
|
+
|
59
|
+
### setContextValue
|
60
|
+
|
61
|
+
▸ `Static` **setContextValue**(`key`, `value`): `any`
|
62
|
+
|
63
|
+
#### Parameters
|
64
|
+
|
65
|
+
| Name | Type |
|
66
|
+
| :------ | :------ |
|
67
|
+
| `key` | `string` |
|
68
|
+
| `value` | `any` |
|
69
|
+
|
70
|
+
#### Returns
|
71
|
+
|
72
|
+
`any`
|
73
|
+
|
74
|
+
#### Defined in
|
75
|
+
|
76
|
+
src/utils/ApplicationContext.ts:7
|
@@ -0,0 +1,89 @@
|
|
1
|
+
[@sankhyalabs/core](../README.md) / [Exports](../modules.md) / ArrayUtils
|
2
|
+
|
3
|
+
# Class: ArrayUtils
|
4
|
+
|
5
|
+
## Table of contents
|
6
|
+
|
7
|
+
### Constructors
|
8
|
+
|
9
|
+
- [constructor](ArrayUtils.md#constructor)
|
10
|
+
|
11
|
+
### Methods
|
12
|
+
|
13
|
+
- [applyStringFilter](ArrayUtils.md#applystringfilter)
|
14
|
+
- [normalizeSearchString](ArrayUtils.md#normalizesearchstring)
|
15
|
+
- [sortAlphabetically](ArrayUtils.md#sortalphabetically)
|
16
|
+
|
17
|
+
## Constructors
|
18
|
+
|
19
|
+
### constructor
|
20
|
+
|
21
|
+
• **new ArrayUtils**()
|
22
|
+
|
23
|
+
## Methods
|
24
|
+
|
25
|
+
### applyStringFilter
|
26
|
+
|
27
|
+
▸ `Static` **applyStringFilter**(`argument`, `originalArray`, `alphabeticalSorting?`, `fieldName?`): `any`[]
|
28
|
+
|
29
|
+
Filtra um array a partir de um critério textual.
|
30
|
+
|
31
|
+
#### Parameters
|
32
|
+
|
33
|
+
| Name | Type | Default value | Description |
|
34
|
+
| :------ | :------ | :------ | :------ |
|
35
|
+
| `argument` | `string` | `undefined` | Texto a ser usado no filtro |
|
36
|
+
| `originalArray` | `any`[] | `undefined` | Array no formato original |
|
37
|
+
| `alphabeticalSorting` | `boolean` | `true` | Determina se o resultado deve ser ordenado ou mantido na ordem original. Por padrão ordena. |
|
38
|
+
| `fieldName` | `string` | `"label"` | Caso o objeto deva ser filtrado por um campo diferente de "label", pode-se usar esse parâmetro |
|
39
|
+
|
40
|
+
#### Returns
|
41
|
+
|
42
|
+
`any`[]
|
43
|
+
|
44
|
+
Um array filtrado e ordenado conforme necessidade. Se "argument" for omitido, ou nulo, o array original é retornado.
|
45
|
+
|
46
|
+
#### Defined in
|
47
|
+
|
48
|
+
src/utils/ArrayUtils.ts:13
|
49
|
+
|
50
|
+
___
|
51
|
+
|
52
|
+
### normalizeSearchString
|
53
|
+
|
54
|
+
▸ `Static` `Private` **normalizeSearchString**(`original`): `string`
|
55
|
+
|
56
|
+
#### Parameters
|
57
|
+
|
58
|
+
| Name | Type |
|
59
|
+
| :------ | :------ |
|
60
|
+
| `original` | `string` |
|
61
|
+
|
62
|
+
#### Returns
|
63
|
+
|
64
|
+
`string`
|
65
|
+
|
66
|
+
#### Defined in
|
67
|
+
|
68
|
+
src/utils/ArrayUtils.ts:25
|
69
|
+
|
70
|
+
___
|
71
|
+
|
72
|
+
### sortAlphabetically
|
73
|
+
|
74
|
+
▸ `Static` **sortAlphabetically**(`originalArray`, `fieldName?`): `any`[]
|
75
|
+
|
76
|
+
#### Parameters
|
77
|
+
|
78
|
+
| Name | Type | Default value |
|
79
|
+
| :------ | :------ | :------ |
|
80
|
+
| `originalArray` | `any`[] | `undefined` |
|
81
|
+
| `fieldName` | `string` | `"label"` |
|
82
|
+
|
83
|
+
#### Returns
|
84
|
+
|
85
|
+
`any`[]
|
86
|
+
|
87
|
+
#### Defined in
|
88
|
+
|
89
|
+
src/utils/ArrayUtils.ts:29
|
@@ -0,0 +1,76 @@
|
|
1
|
+
[@sankhyalabs/core](../README.md) / [Exports](../modules.md) / AuthorizedServiceCaller
|
2
|
+
|
3
|
+
# Class: AuthorizedServiceCaller
|
4
|
+
|
5
|
+
## Table of contents
|
6
|
+
|
7
|
+
### Constructors
|
8
|
+
|
9
|
+
- [constructor](AuthorizedServiceCaller.md#constructor)
|
10
|
+
|
11
|
+
### Properties
|
12
|
+
|
13
|
+
- [serverURL](AuthorizedServiceCaller.md#serverurl)
|
14
|
+
- [unauthorizedPath](AuthorizedServiceCaller.md#unauthorizedpath)
|
15
|
+
|
16
|
+
### Methods
|
17
|
+
|
18
|
+
- [requestService](AuthorizedServiceCaller.md#requestservice)
|
19
|
+
|
20
|
+
## Constructors
|
21
|
+
|
22
|
+
### constructor
|
23
|
+
|
24
|
+
• **new AuthorizedServiceCaller**(`serverURL`, `unauthorizedPath`)
|
25
|
+
|
26
|
+
#### Parameters
|
27
|
+
|
28
|
+
| Name | Type |
|
29
|
+
| :------ | :------ |
|
30
|
+
| `serverURL` | `string` |
|
31
|
+
| `unauthorizedPath` | `string` |
|
32
|
+
|
33
|
+
#### Defined in
|
34
|
+
|
35
|
+
src/http/AuthorizedServiceCaller.ts:6
|
36
|
+
|
37
|
+
## Properties
|
38
|
+
|
39
|
+
### serverURL
|
40
|
+
|
41
|
+
• `Private` **serverURL**: `string` = `"http://192.168.1.218:8503"`
|
42
|
+
|
43
|
+
#### Defined in
|
44
|
+
|
45
|
+
src/http/AuthorizedServiceCaller.ts:3
|
46
|
+
|
47
|
+
___
|
48
|
+
|
49
|
+
### unauthorizedPath
|
50
|
+
|
51
|
+
• `Private` **unauthorizedPath**: `string` = `"/"`
|
52
|
+
|
53
|
+
#### Defined in
|
54
|
+
|
55
|
+
src/http/AuthorizedServiceCaller.ts:4
|
56
|
+
|
57
|
+
## Methods
|
58
|
+
|
59
|
+
### requestService
|
60
|
+
|
61
|
+
▸ **requestService**(`request`, `callback?`): `Promise`<`void` \| `Response`\>
|
62
|
+
|
63
|
+
#### Parameters
|
64
|
+
|
65
|
+
| Name | Type |
|
66
|
+
| :------ | :------ |
|
67
|
+
| `request` | `AuthorizedRequest` |
|
68
|
+
| `callback?` | `Function` |
|
69
|
+
|
70
|
+
#### Returns
|
71
|
+
|
72
|
+
`Promise`<`void` \| `Response`\>
|
73
|
+
|
74
|
+
#### Defined in
|
75
|
+
|
76
|
+
src/http/AuthorizedServiceCaller.ts:12
|
@@ -0,0 +1,168 @@
|
|
1
|
+
[@sankhyalabs/core](../README.md) / [Exports](../modules.md) / Change
|
2
|
+
|
3
|
+
# Class: Change
|
4
|
+
|
5
|
+
## Table of contents
|
6
|
+
|
7
|
+
### Constructors
|
8
|
+
|
9
|
+
- [constructor](Change.md#constructor)
|
10
|
+
|
11
|
+
### Properties
|
12
|
+
|
13
|
+
- [\_operation](Change.md#_operation)
|
14
|
+
- [dataUnit](Change.md#dataunit)
|
15
|
+
- [record](Change.md#record)
|
16
|
+
- [sourceId](Change.md#sourceid)
|
17
|
+
- [updatingFields](Change.md#updatingfields)
|
18
|
+
|
19
|
+
### Accessors
|
20
|
+
|
21
|
+
- [operation](Change.md#operation)
|
22
|
+
|
23
|
+
### Methods
|
24
|
+
|
25
|
+
- [isCopy](Change.md#iscopy)
|
26
|
+
- [isDelete](Change.md#isdelete)
|
27
|
+
- [isInsert](Change.md#isinsert)
|
28
|
+
- [isUpdate](Change.md#isupdate)
|
29
|
+
|
30
|
+
## Constructors
|
31
|
+
|
32
|
+
### constructor
|
33
|
+
|
34
|
+
• **new Change**(`dataUnit`, `record`, `updates`, `operation`, `sourceId?`)
|
35
|
+
|
36
|
+
#### Parameters
|
37
|
+
|
38
|
+
| Name | Type |
|
39
|
+
| :------ | :------ |
|
40
|
+
| `dataUnit` | `string` |
|
41
|
+
| `record` | [`Record`](../interfaces/Record.md) |
|
42
|
+
| `updates` | `any` |
|
43
|
+
| `operation` | [`ChangeOperation`](../enums/ChangeOperation.md) |
|
44
|
+
| `sourceId?` | `string` |
|
45
|
+
|
46
|
+
#### Defined in
|
47
|
+
|
48
|
+
src/dataunit/DataUnit.ts:584
|
49
|
+
|
50
|
+
## Properties
|
51
|
+
|
52
|
+
### \_operation
|
53
|
+
|
54
|
+
• `Private` **\_operation**: [`ChangeOperation`](../enums/ChangeOperation.md)
|
55
|
+
|
56
|
+
#### Defined in
|
57
|
+
|
58
|
+
src/dataunit/DataUnit.ts:582
|
59
|
+
|
60
|
+
___
|
61
|
+
|
62
|
+
### dataUnit
|
63
|
+
|
64
|
+
• **dataUnit**: `string`
|
65
|
+
|
66
|
+
#### Defined in
|
67
|
+
|
68
|
+
src/dataunit/DataUnit.ts:577
|
69
|
+
|
70
|
+
___
|
71
|
+
|
72
|
+
### record
|
73
|
+
|
74
|
+
• **record**: [`Record`](../interfaces/Record.md)
|
75
|
+
|
76
|
+
#### Defined in
|
77
|
+
|
78
|
+
src/dataunit/DataUnit.ts:578
|
79
|
+
|
80
|
+
___
|
81
|
+
|
82
|
+
### sourceId
|
83
|
+
|
84
|
+
• **sourceId**: `undefined` \| `string`
|
85
|
+
|
86
|
+
#### Defined in
|
87
|
+
|
88
|
+
src/dataunit/DataUnit.ts:579
|
89
|
+
|
90
|
+
___
|
91
|
+
|
92
|
+
### updatingFields
|
93
|
+
|
94
|
+
• **updatingFields**: `any`
|
95
|
+
|
96
|
+
#### Defined in
|
97
|
+
|
98
|
+
src/dataunit/DataUnit.ts:580
|
99
|
+
|
100
|
+
## Accessors
|
101
|
+
|
102
|
+
### operation
|
103
|
+
|
104
|
+
• `get` **operation**(): `string`
|
105
|
+
|
106
|
+
#### Returns
|
107
|
+
|
108
|
+
`string`
|
109
|
+
|
110
|
+
#### Defined in
|
111
|
+
|
112
|
+
src/dataunit/DataUnit.ts:592
|
113
|
+
|
114
|
+
## Methods
|
115
|
+
|
116
|
+
### isCopy
|
117
|
+
|
118
|
+
▸ **isCopy**(): `boolean`
|
119
|
+
|
120
|
+
#### Returns
|
121
|
+
|
122
|
+
`boolean`
|
123
|
+
|
124
|
+
#### Defined in
|
125
|
+
|
126
|
+
src/dataunit/DataUnit.ts:600
|
127
|
+
|
128
|
+
___
|
129
|
+
|
130
|
+
### isDelete
|
131
|
+
|
132
|
+
▸ **isDelete**(): `boolean`
|
133
|
+
|
134
|
+
#### Returns
|
135
|
+
|
136
|
+
`boolean`
|
137
|
+
|
138
|
+
#### Defined in
|
139
|
+
|
140
|
+
src/dataunit/DataUnit.ts:604
|
141
|
+
|
142
|
+
___
|
143
|
+
|
144
|
+
### isInsert
|
145
|
+
|
146
|
+
▸ **isInsert**(): `boolean`
|
147
|
+
|
148
|
+
#### Returns
|
149
|
+
|
150
|
+
`boolean`
|
151
|
+
|
152
|
+
#### Defined in
|
153
|
+
|
154
|
+
src/dataunit/DataUnit.ts:596
|
155
|
+
|
156
|
+
___
|
157
|
+
|
158
|
+
### isUpdate
|
159
|
+
|
160
|
+
▸ **isUpdate**(): `boolean`
|
161
|
+
|
162
|
+
#### Returns
|
163
|
+
|
164
|
+
`boolean`
|
165
|
+
|
166
|
+
#### Defined in
|
167
|
+
|
168
|
+
src/dataunit/DataUnit.ts:608
|