@sinequa/atomic 0.0.123 → 0.0.129
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 +188 -36
- package/dist/atomic.js +826 -646
- package/dist/atomic.umd.cjs +1 -1
- package/dist/authentication/session/login.d.ts.map +1 -1
- package/dist/helpers/columns.d.ts +27 -0
- package/dist/helpers/columns.d.ts.map +1 -0
- package/dist/helpers/index.d.ts +5 -4
- package/dist/helpers/index.d.ts.map +1 -1
- package/dist/helpers/metadata.d.ts +32 -0
- package/dist/helpers/metadata.d.ts.map +1 -1
- package/dist/types/aggregations/AggregationItem.d.ts +4 -0
- package/dist/types/aggregations/AggregationItem.d.ts.map +1 -1
- package/dist/types/config/CCApp.d.ts +3 -1
- package/dist/types/config/CCApp.d.ts.map +1 -1
- package/dist/types/principal/Principal.d.ts +2 -0
- package/dist/types/principal/Principal.d.ts.map +1 -1
- package/dist/utils/notification.d.ts +6 -1
- package/dist/utils/notification.d.ts.map +1 -1
- package/dist/web-api/helpers/handle-response.d.ts +1 -1
- package/dist/web-api/helpers/handle-response.d.ts.map +1 -1
- package/dist/web-api/helpers/index.d.ts +9 -8
- package/dist/web-api/helpers/index.d.ts.map +1 -1
- package/dist/web-api/helpers/methods/post.d.ts.map +1 -1
- package/dist/web-api/helpers/utils/date-utils..d.ts +14 -0
- package/dist/web-api/helpers/utils/date-utils..d.ts.map +1 -0
- package/dist/web-api/index.d.ts +4 -2
- package/dist/web-api/index.d.ts.map +1 -1
- package/dist/web-api/v1/fetch-app.d.ts.map +1 -1
- package/dist/web-api/v2/fetch-change-password.d.ts +12 -2
- package/dist/web-api/v2/fetch-change-password.d.ts.map +1 -1
- package/dist/web-api/v2/fetch-forgot-password.d.ts +11 -0
- package/dist/web-api/v2/fetch-forgot-password.d.ts.map +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,67 +1,219 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
1
3
|
# @sinequa/atomic
|
|
2
4
|
|
|
3
5
|

|
|
4
6
|

|
|
7
|
+

|
|
8
|
+
|
|
9
|
+
**A comprehensive TypeScript library for building modern search applications with [Sinequa](https://www.sinequa.com/)**
|
|
10
|
+
|
|
11
|
+
[Documentation](https://sinequa.github.io/sba-mint/atomic/intro) • [Changelog](./changelogs) • [API Reference](https://sinequa.github.io/sba-mint/atomic/api/app)
|
|
5
12
|
|
|
6
|
-
|
|
13
|
+
</div>
|
|
7
14
|
|
|
8
15
|
---
|
|
9
16
|
|
|
10
|
-
##
|
|
17
|
+
## 📦 Installation
|
|
11
18
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
- [Documentation](#documentation)
|
|
16
|
-
- [License](#license)
|
|
19
|
+
```bash
|
|
20
|
+
npm install @sinequa/atomic
|
|
21
|
+
```
|
|
17
22
|
|
|
18
|
-
|
|
23
|
+
## 🚀 Quick Start
|
|
19
24
|
|
|
20
|
-
|
|
25
|
+
```typescript
|
|
26
|
+
import {
|
|
27
|
+
fetchQuery,
|
|
28
|
+
fetchAggregation,
|
|
29
|
+
isAuthenticated,
|
|
30
|
+
login
|
|
31
|
+
} from '@sinequa/atomic';
|
|
21
32
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
- **Type Definitions**: Strongly-typed interfaces for API endpoints and data structures.
|
|
27
|
-
- ...and many more functions to help you build with Sinequa.
|
|
33
|
+
// Check authentication status
|
|
34
|
+
if (!isAuthenticated()) {
|
|
35
|
+
await login({ username: 'user', password: 'pass' });
|
|
36
|
+
}
|
|
28
37
|
|
|
29
|
-
|
|
38
|
+
// Perform a search query
|
|
39
|
+
const results = await fetchQuery({
|
|
40
|
+
query: 'example search',
|
|
41
|
+
pageSize: 10
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
// Fetch aggregation data
|
|
45
|
+
const aggregations = await fetchAggregation({
|
|
46
|
+
aggregation: 'category',
|
|
47
|
+
query: 'example'
|
|
48
|
+
});
|
|
49
|
+
```
|
|
30
50
|
|
|
31
|
-
|
|
51
|
+
## ✨ Key Features
|
|
32
52
|
|
|
33
|
-
|
|
53
|
+
### 🔐 Authentication & Security
|
|
34
54
|
|
|
35
|
-
|
|
36
|
-
|
|
55
|
+
- **OAuth & SAML Support**: Seamless integration with enterprise authentication providers
|
|
56
|
+
- **JWT Token Management**: Automatic token handling and refresh
|
|
57
|
+
- **CSRF Protection**: Built-in security measures
|
|
58
|
+
- **Credential-Based Authentication**: Direct username/password authentication
|
|
59
|
+
- **User Session Management**: Complete login/logout flow with user impersonation controls
|
|
60
|
+
|
|
61
|
+
### 🌐 Web API Integration
|
|
62
|
+
|
|
63
|
+
- **Type-Safe API Calls**: Strongly-typed interfaces for all Sinequa APIs
|
|
64
|
+
- **Comprehensive Endpoints**: Support for search, aggregations, datasets, preview, and more
|
|
65
|
+
- **Error Handling**: Robust error management with fallback mechanisms
|
|
66
|
+
- **Response Processing**: Automatic parsing and validation of API responses
|
|
67
|
+
|
|
68
|
+
### 🛠️ Utilities & Helpers
|
|
69
|
+
|
|
70
|
+
- **Metadata Processing**: Parse and extract metadata with value pairs
|
|
71
|
+
- **Column Management**: Generate engine-specific column configurations
|
|
72
|
+
- **Date Utilities**: Advanced date formatting and manipulation
|
|
73
|
+
- **Query Parameters**: URL query string handling
|
|
74
|
+
- **Logger**: Structured logging with multiple levels
|
|
75
|
+
- **Notification System**: User notification management
|
|
76
|
+
|
|
77
|
+
### 📊 Data Management
|
|
78
|
+
|
|
79
|
+
- **Aggregation Handling**: Visual selection tracking and data aggregation
|
|
80
|
+
- **Filter Configuration**: Configurable included/excluded filters
|
|
81
|
+
- **Type Definitions**: Complete TypeScript types for all data structures
|
|
82
|
+
- **Password Management**: Expired and forgotten password flows
|
|
83
|
+
|
|
84
|
+
## 📚 Core Modules
|
|
85
|
+
|
|
86
|
+
### Authentication
|
|
87
|
+
|
|
88
|
+
```typescript
|
|
89
|
+
import {
|
|
90
|
+
login,
|
|
91
|
+
logout,
|
|
92
|
+
isAuthenticated,
|
|
93
|
+
getToken,
|
|
94
|
+
setToken,
|
|
95
|
+
tryOAuthAuthentication,
|
|
96
|
+
trySAMLAuthentication
|
|
97
|
+
} from '@sinequa/atomic';
|
|
37
98
|
```
|
|
38
99
|
|
|
39
|
-
|
|
100
|
+
### Web APIs
|
|
101
|
+
|
|
102
|
+
```typescript
|
|
103
|
+
import {
|
|
104
|
+
fetchApp,
|
|
105
|
+
fetchQuery,
|
|
106
|
+
fetchAggregation,
|
|
107
|
+
fetchDatasets,
|
|
108
|
+
fetchPreview,
|
|
109
|
+
fetchPrincipal,
|
|
110
|
+
fetchSimilarDocuments,
|
|
111
|
+
fetchSponsoredLinks,
|
|
112
|
+
fetchSuggest,
|
|
113
|
+
fetchUserSettings
|
|
114
|
+
} from '@sinequa/atomic';
|
|
115
|
+
```
|
|
40
116
|
|
|
41
|
-
|
|
117
|
+
### Helpers
|
|
118
|
+
|
|
119
|
+
```typescript
|
|
120
|
+
import {
|
|
121
|
+
getMetadata,
|
|
122
|
+
getMetadataWithValues,
|
|
123
|
+
makeColumn,
|
|
124
|
+
resolveToColumnName,
|
|
125
|
+
escapeExpr,
|
|
126
|
+
guid,
|
|
127
|
+
isObject,
|
|
128
|
+
isString
|
|
129
|
+
} from '@sinequa/atomic';
|
|
130
|
+
```
|
|
42
131
|
|
|
43
|
-
|
|
132
|
+
### Utilities
|
|
133
|
+
|
|
134
|
+
```typescript
|
|
135
|
+
import {
|
|
136
|
+
bisect,
|
|
137
|
+
formatDate,
|
|
138
|
+
parseDate,
|
|
139
|
+
logger,
|
|
140
|
+
queryParamsToString,
|
|
141
|
+
syslang
|
|
142
|
+
} from '@sinequa/atomic';
|
|
143
|
+
```
|
|
44
144
|
|
|
45
|
-
|
|
46
|
-
import { fetchQuery, fetchAggregation, isAuthenticated } from '@sinequa/atomic';
|
|
145
|
+
## 🔄 Recent Updates (v0.0.125 - v0.0.129)
|
|
47
146
|
|
|
48
|
-
|
|
49
|
-
const data = await fetchQuery({ query: 'example' });
|
|
147
|
+
### 🎉 New Features
|
|
50
148
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
149
|
+
- ✅ Credential-based authentication with automatic SSO bypass
|
|
150
|
+
- ✅ Enhanced metadata parsing with comma-separated string support
|
|
151
|
+
- ✅ Forgotten password and expired password handling
|
|
152
|
+
- ✅ Visual selection tracking for aggregation items
|
|
153
|
+
- ✅ Configurable filter bar with inclusion/exclusion options
|
|
154
|
+
|
|
155
|
+
### 🔒 Security Enhancements
|
|
156
|
+
|
|
157
|
+
- 🛡️ Fixed user impersonation vulnerability during credential-based login
|
|
158
|
+
- 🔐 JWT tokens now correctly reflect actual user identity
|
|
159
|
+
|
|
160
|
+
### 🐛 Bug Fixes & Improvements
|
|
161
|
+
|
|
162
|
+
- ⚡ Enhanced error handling with fallback message fields
|
|
163
|
+
- 📝 Improved type safety across all modules
|
|
164
|
+
- 🧪 Added 560+ new test cases for better reliability
|
|
165
|
+
- 🗂️ Reorganized test structure for better maintainability
|
|
166
|
+
|
|
167
|
+
### 📖 Documentation
|
|
168
|
+
|
|
169
|
+
- 📚 Comprehensive JSDoc examples for all major functions
|
|
170
|
+
- 📝 Enhanced inline code documentation
|
|
171
|
+
- 🔗 API reference documentation
|
|
172
|
+
|
|
173
|
+
[View Full Changelog](./changelogs/CHANGELOG_v0.0.124_to_v0.0.129.md)
|
|
174
|
+
|
|
175
|
+
## 🧪 Testing
|
|
176
|
+
|
|
177
|
+
This package includes comprehensive test coverage with 560+ test cases:
|
|
178
|
+
|
|
179
|
+
```bash
|
|
180
|
+
npm test
|
|
55
181
|
```
|
|
56
182
|
|
|
57
|
-
|
|
183
|
+
Test coverage includes:
|
|
58
184
|
|
|
59
|
-
|
|
185
|
+
- Authentication flows (OAuth, SAML, credentials)
|
|
186
|
+
- API endpoint integration
|
|
187
|
+
- Error handling scenarios
|
|
188
|
+
- Metadata parsing and processing
|
|
189
|
+
- Date utilities and formatters
|
|
60
190
|
|
|
61
|
-
|
|
191
|
+
## 📖 Documentation
|
|
62
192
|
|
|
63
|
-
|
|
193
|
+
- **Getting Started**: [Introduction Guide](https://sinequa.github.io/sba-mint/atomic/intro)
|
|
194
|
+
- **API Reference**: [Complete API Documentation](https://sinequa.github.io/sba-mint/atomic/api)
|
|
195
|
+
- **Authentication**: [Auth Documentation](https://sinequa.github.io/sba-mint/atomic/authentication)
|
|
196
|
+
- **Examples**: Check the `/docs` folder for detailed examples
|
|
197
|
+
|
|
198
|
+
## 🤝 Contributing
|
|
64
199
|
|
|
65
|
-
|
|
200
|
+
We welcome contributions! Please ensure:
|
|
201
|
+
|
|
202
|
+
- ✅ All tests pass
|
|
203
|
+
- ✅ Code follows the existing style (Biome linting)
|
|
204
|
+
- ✅ New features include tests and documentation
|
|
205
|
+
- ✅ Commit messages follow conventional commits
|
|
206
|
+
|
|
207
|
+
## 📄 License
|
|
66
208
|
|
|
67
209
|
This project is licensed under the MIT License. See the [LICENSE](./LICENSE) file for details.
|
|
210
|
+
|
|
211
|
+
---
|
|
212
|
+
|
|
213
|
+
<div align="center">
|
|
214
|
+
|
|
215
|
+
**Built with ❤️ for the Sinequa Community**
|
|
216
|
+
|
|
217
|
+
[Documentation](https://sinequa.github.io/sba-mint/atomic/intro) • [Report Bug](https://github.com/Product/sba-atomic-js/issues) • [Request Feature](https://github.com/Product/sba-atomic-js/issues)
|
|
218
|
+
|
|
219
|
+
</div>
|