@sinequa/atomic 0.0.124 → 0.0.134
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 +762 -629
- package/dist/atomic.umd.cjs +1 -1
- package/dist/authentication/session/login.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/api-endpoints.d.ts +1 -1
- package/dist/types/api-endpoints.d.ts.map +1 -1
- package/dist/types/index.d.ts +6 -5
- package/dist/types/index.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/types/user-profile/user-profile.d.ts +31 -0
- package/dist/types/user-profile/user-profile.d.ts.map +1 -0
- 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/patch.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 +5 -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/v1/fetch-principal.d.ts +55 -0
- package/dist/web-api/v1/fetch-principal.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/dist/web-api/v2/fetch-user-profile.d.ts +50 -0
- package/dist/web-api/v2/fetch-user-profile.d.ts.map +1 -0
- package/package.json +2 -2
|
@@ -1,4 +1,14 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type ChangePasswordResponse = {
|
|
2
2
|
success: boolean;
|
|
3
|
-
|
|
3
|
+
message?: string;
|
|
4
|
+
};
|
|
5
|
+
/**
|
|
6
|
+
* Calls the V2 API to change the current user's password.
|
|
7
|
+
*
|
|
8
|
+
* @param newPassword - The new password to set.
|
|
9
|
+
* @param currentPassword - The current password, if required by the backend.
|
|
10
|
+
* @throws UnauthorizedError When the backend returns 401 (invalid current password / unauthorized).
|
|
11
|
+
* @throws ApiError For any other HTTP or transport error.
|
|
12
|
+
*/
|
|
13
|
+
export declare function fetchChangePassword(newPassword: string, currentPassword?: string): Promise<ChangePasswordResponse>;
|
|
4
14
|
//# sourceMappingURL=fetch-change-password.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetch-change-password.d.ts","sourceRoot":"","sources":["../../../src/web-api/v2/fetch-change-password.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fetch-change-password.d.ts","sourceRoot":"","sources":["../../../src/web-api/v2/fetch-change-password.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,sBAAsB,GAAG;IACnC,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAsB,mBAAmB,CACvC,WAAW,EAAE,MAAM,EACnB,eAAe,CAAC,EAAE,MAAM,GACvB,OAAO,CAAC,sBAAsB,CAAC,CAMjC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type PasswordResetEmailResponse = {
|
|
2
|
+
email?: string;
|
|
3
|
+
passwordResetTokenExpiry?: string;
|
|
4
|
+
};
|
|
5
|
+
/**
|
|
6
|
+
* Calls the V2 API to send a password reset email for the given user.
|
|
7
|
+
*
|
|
8
|
+
* @param userName - The username for which the reset email should be sent.
|
|
9
|
+
*/
|
|
10
|
+
export declare function fetchSendPasswordResetEmail(userName: string): Promise<PasswordResetEmailResponse>;
|
|
11
|
+
//# sourceMappingURL=fetch-forgot-password.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fetch-forgot-password.d.ts","sourceRoot":"","sources":["../../../src/web-api/v2/fetch-forgot-password.ts"],"names":[],"mappings":"AAOA,MAAM,MAAM,0BAA0B,GAAG;IACvC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,wBAAwB,CAAC,EAAE,MAAM,CAAC;CACnC,CAAC;AAEF;;;;GAIG;AACH,wBAAsB,2BAA2B,CAC/C,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,0BAA0B,CAAC,CAWrC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { UserProfile } from "../../types";
|
|
2
|
+
/**
|
|
3
|
+
* Fetches the user profile for the specified user ID.
|
|
4
|
+
*
|
|
5
|
+
* @param userId - The unique identifier of the user whose profile is to be fetched
|
|
6
|
+
* @returns A promise that resolves to the user's profile data
|
|
7
|
+
* @throws May throw an error if the API request fails or the user is not found
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```typescript
|
|
11
|
+
* const profile = await fetchUserProfile('user123');
|
|
12
|
+
* console.log(profile);
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
export declare function fetchUserProfile(userId: string): Promise<UserProfile>;
|
|
16
|
+
/**
|
|
17
|
+
* Creates a new user profile by sending a POST request to the API.
|
|
18
|
+
*
|
|
19
|
+
* @param userProfile - Partial user profile data to be created. Must include an id in the data property.
|
|
20
|
+
* @returns A promise that resolves to the complete UserProfile object returned by the API.
|
|
21
|
+
* @throws May throw an error if the API request fails or if the user profile data is invalid.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```typescript
|
|
25
|
+
* const newProfile = await createUserProfile({
|
|
26
|
+
* data: { id: '123', name: 'John Doe' }
|
|
27
|
+
* });
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
export declare function createUserProfile(userProfile: Partial<UserProfile>): Promise<UserProfile>;
|
|
31
|
+
/**
|
|
32
|
+
* Updates a specific property of a user profile.
|
|
33
|
+
*
|
|
34
|
+
* @param userProfile - Partial user profile object containing the data to update. Cannot include 'created' or 'modified' fields.
|
|
35
|
+
* @param category - The category of the property to update.
|
|
36
|
+
* @param propertyName - The name of the specific property to update within the category.
|
|
37
|
+
* @returns A promise that resolves to the updated UserProfile object.
|
|
38
|
+
* @throws May throw an error if the API request fails or if the user profile ID is not provided.
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```typescript
|
|
42
|
+
* const updatedProfile = await patchUserProfile(
|
|
43
|
+
* { data: { id: '123', name: 'Jane Doe' } },
|
|
44
|
+
* 'personal-info',
|
|
45
|
+
* 'name'
|
|
46
|
+
* );
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
49
|
+
export declare function patchUserProfile(userProfile: Partial<Omit<UserProfile, "created" | "modified">>, category: string, propertyName: string): Promise<UserProfile>;
|
|
50
|
+
//# sourceMappingURL=fetch-user-profile.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fetch-user-profile.d.ts","sourceRoot":"","sources":["../../../src/web-api/v2/fetch-user-profile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAG1C;;;;;;;;;;;;GAYG;AACH,wBAAsB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAG3E;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAsB,iBAAiB,CACrC,WAAW,EAAE,OAAO,CAAC,WAAW,CAAC,GAChC,OAAO,CAAC,WAAW,CAAC,CAGtB;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,gBAAgB,CACpC,WAAW,EAAE,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,SAAS,GAAG,UAAU,CAAC,CAAC,EAC/D,QAAQ,EAAE,MAAM,EAChB,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,WAAW,CAAC,CAMtB"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sinequa/atomic",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.134",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/atomic.umd.cjs",
|
|
7
7
|
"module": "./dist/atomic.js",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
]
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@biomejs/biome": "2.
|
|
42
|
+
"@biomejs/biome": "^2.3.11",
|
|
43
43
|
"@types/node": "^20.11.0",
|
|
44
44
|
"husky": "^9.1.7",
|
|
45
45
|
"jsdom": "^26.0.0",
|