@sinequa/atomic 0.0.113 → 0.0.122

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.
Files changed (65) hide show
  1. package/dist/atomic.js +741 -684
  2. package/dist/atomic.umd.cjs +1 -1
  3. package/dist/authentication/events/emit-authenticated-event.d.ts +15 -0
  4. package/dist/authentication/events/emit-authenticated-event.d.ts.map +1 -0
  5. package/dist/authentication/events/index.d.ts +2 -0
  6. package/dist/authentication/events/index.d.ts.map +1 -0
  7. package/dist/authentication/index.d.ts +4 -1
  8. package/dist/authentication/index.d.ts.map +1 -1
  9. package/dist/authentication/providers/index.d.ts +3 -0
  10. package/dist/authentication/providers/index.d.ts.map +1 -0
  11. package/dist/authentication/providers/oauth-authentication.d.ts +4 -0
  12. package/dist/authentication/providers/oauth-authentication.d.ts.map +1 -0
  13. package/dist/authentication/providers/saml-authentication.d.ts +4 -0
  14. package/dist/authentication/providers/saml-authentication.d.ts.map +1 -0
  15. package/dist/authentication/session/index.d.ts +4 -0
  16. package/dist/authentication/session/index.d.ts.map +1 -0
  17. package/dist/authentication/session/login.d.ts +9 -0
  18. package/dist/authentication/session/login.d.ts.map +1 -0
  19. package/dist/authentication/session/logout.d.ts +6 -0
  20. package/dist/authentication/session/logout.d.ts.map +1 -0
  21. package/dist/authentication/session/user-authentication.d.ts +6 -0
  22. package/dist/authentication/session/user-authentication.d.ts.map +1 -0
  23. package/dist/authentication/tokens/delete-web-token-cookie.d.ts +8 -0
  24. package/dist/authentication/tokens/delete-web-token-cookie.d.ts.map +1 -0
  25. package/dist/authentication/tokens/get-csrf-token.d.ts +9 -0
  26. package/dist/authentication/tokens/get-csrf-token.d.ts.map +1 -0
  27. package/dist/authentication/tokens/get-jwt-token.d.ts +14 -0
  28. package/dist/authentication/tokens/get-jwt-token.d.ts.map +1 -0
  29. package/dist/authentication/tokens/get-token.d.ts +6 -0
  30. package/dist/authentication/tokens/get-token.d.ts.map +1 -0
  31. package/dist/authentication/tokens/index.d.ts +6 -0
  32. package/dist/authentication/tokens/index.d.ts.map +1 -0
  33. package/dist/authentication/tokens/set-token.d.ts +6 -0
  34. package/dist/authentication/tokens/set-token.d.ts.map +1 -0
  35. package/dist/configurations/global.config.d.ts +1 -1
  36. package/dist/configurations/global.config.d.ts.map +1 -1
  37. package/dist/helpers/utils.d.ts +7 -0
  38. package/dist/helpers/utils.d.ts.map +1 -1
  39. package/dist/utils/aggregations.d.ts +1 -0
  40. package/dist/utils/aggregations.d.ts.map +1 -1
  41. package/dist/web-api/helpers/methods/del.d.ts +2 -2
  42. package/dist/web-api/helpers/methods/del.d.ts.map +1 -1
  43. package/dist/web-api/helpers/methods/get.d.ts +2 -2
  44. package/dist/web-api/helpers/methods/get.d.ts.map +1 -1
  45. package/dist/web-api/helpers/methods/patch.d.ts +2 -2
  46. package/dist/web-api/helpers/methods/patch.d.ts.map +1 -1
  47. package/dist/web-api/helpers/methods/post.d.ts +2 -2
  48. package/dist/web-api/helpers/methods/post.d.ts.map +1 -1
  49. package/dist/web-api/helpers/methods/put.d.ts +2 -2
  50. package/dist/web-api/helpers/methods/put.d.ts.map +1 -1
  51. package/dist/web-api/v1/fetch-app.d.ts +1 -1
  52. package/dist/web-api/v1/fetch-app.d.ts.map +1 -1
  53. package/dist/web-api/v2/fetch-change-password.d.ts +4 -0
  54. package/dist/web-api/v2/fetch-change-password.d.ts.map +1 -0
  55. package/package.json +14 -5
  56. package/dist/authentication/auth.d.ts +0 -59
  57. package/dist/authentication/auth.d.ts.map +0 -1
  58. package/dist/helpers/column-resolver.test.d.ts +0 -2
  59. package/dist/helpers/column-resolver.test.d.ts.map +0 -1
  60. package/dist/helpers/metadata.test.d.ts +0 -2
  61. package/dist/helpers/metadata.test.d.ts.map +0 -1
  62. package/dist/helpers/utils.test.d.ts +0 -2
  63. package/dist/helpers/utils.test.d.ts.map +0 -1
  64. package/dist/web-api/helpers/tests/helpers.test.d.ts +0 -2
  65. package/dist/web-api/helpers/tests/helpers.test.d.ts.map +0 -1
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sinequa/atomic",
3
3
  "private": false,
4
- "version": "0.0.113",
4
+ "version": "0.0.122",
5
5
  "type": "module",
6
6
  "main": "./dist/atomic.umd.cjs",
7
7
  "module": "./dist/atomic.js",
@@ -30,14 +30,23 @@
30
30
  "watch": "vite build --watch",
31
31
  "test": "vitest",
32
32
  "v:publish": "npm publish --registry https://npm.sinequa.com",
33
- "v:unpublish": "npm unpublish --registry https://npm.sinequa.com --force"
33
+ "v:unpublish": "npm unpublish --registry https://npm.sinequa.com --force",
34
+ "prepare": "husky"
35
+ },
36
+ "lint-staged": {
37
+ "*.{js,ts,html,scss,css,json}": [
38
+ "npx @biomejs/biome check --write --files-ignore-unknown=true"
39
+ ]
34
40
  },
35
41
  "devDependencies": {
42
+ "@biomejs/biome": "2.2.7",
36
43
  "@types/node": "^20.11.0",
44
+ "husky": "^9.1.7",
37
45
  "jsdom": "^26.0.0",
46
+ "lint-staged": "^16.2.6",
38
47
  "typescript": "^5.7.3",
39
- "vite": "^6.2.0",
40
- "vite-plugin-dts": "^4.5.0",
41
- "vitest": "^3.0.7"
48
+ "vite": "^6.4.1",
49
+ "vite-plugin-dts": "^4.5.4",
50
+ "vitest": "^3.2.4"
42
51
  }
43
52
  }
@@ -1,59 +0,0 @@
1
- import { Credentials } from "../types";
2
- export declare const tryOAuthAuthentication: () => Promise<{
3
- redirectUrl: string;
4
- }>;
5
- export declare const trySAMLAuthentication: () => Promise<{
6
- redirectUrl: string;
7
- }>;
8
- /**
9
- * Retrieves a JSON Web Token (JWT) using the provided credentials.
10
- *
11
- * @param credentials - An object containing the user's credentials.
12
- * @param credentials.username - The username of the user.
13
- * @param credentials.password - The password of the user.
14
- * @returns A promise that resolves to the JWT (csrfToken) if successful, or `null` if no token is returned.
15
- * @throws An error if the request to retrieve the JWT fails.
16
- *
17
- * The function sends a POST request to the `security.webtoken` endpoint with the provided credentials
18
- * and additional options. If a valid `csrfToken` is returned, it is stored using the `setToken` function.
19
- */
20
- export declare const getJWToken: (credentials: Credentials) => Promise<string | null>;
21
- /**
22
- * Deletes the JSON Web Token (JWT) cookie by sending a GET request to the backend server.
23
- * @returns {Promise<Response>} - A promise that resolves to the response from the server.
24
- */
25
- export declare const deleteWebTokenCookie: () => Promise<{
26
- methodresult: string;
27
- }>;
28
- /**
29
- * Retrieves the CSRF token from the session storage.
30
- * @returns The CSRF token.
31
- */
32
- export declare const getToken: () => any;
33
- export declare const setToken: (token: string) => void;
34
- /**
35
- * Logs in the user with the provided credentials.
36
- *
37
- * @param credentials - The user's login credentials.
38
- * @returns A promise that resolves to a boolean indicating whether the login was successful.
39
- */
40
- export declare const login: (credentials?: Credentials) => Promise<boolean>;
41
- /**
42
- * Logs out the user.
43
- * @returns {Promise<void>}
44
- */
45
- export declare const logout: () => Promise<void>;
46
- /**
47
- * Checks if the user is authenticated.
48
- * @returns {boolean} True if the user is authenticated, false otherwise.
49
- */
50
- export declare const isAuthenticated: () => boolean;
51
- /**
52
- * Retrieves the CSRF token from the backend server.
53
- * If the token is successfully retrieved, it is stored in the session storage and the authenticated$ subject is updated.
54
- * If the token is not retrieved, the user is redirected to the OAuth/SAML provider's login page.
55
- * @param authMode The authentication mode. Defaults to "oauth".
56
- * @returns A boolean indicating whether the CSRF token was successfully retrieved.
57
- */
58
- export declare const getCsrfToken: () => Promise<any>;
59
- //# sourceMappingURL=auth.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../src/authentication/auth.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAsCvC,eAAO,MAAM,sBAAsB;iBAKJ,MAAM;EA0BpC,CAAA;AAYD,eAAO,MAAM,qBAAqB;iBAKH,MAAM;EA0BpC,CAAA;AAID;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,UAAU,GAAU,aAAa,WAAW,2BAuBxD,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,oBAAoB;kBAQJ,MAAM;EAClC,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,QAAQ,WAMpB,CAAC;AACF,eAAO,MAAM,QAAQ,GAAI,OAAO,MAAM,SAAiG,CAAC;AAGxI;;;;;GAKG;AACH,eAAO,MAAM,KAAK,GAAU,cAAc,WAAW,KAAG,OAAO,CAAC,OAAO,CA4ItE,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,MAAM,qBAelB,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,eAAe,QAAO,OAAuB,CAAC;AAE3D;;;;;;GAMG;AACH,eAAO,MAAM,YAAY,oBAexB,CAAA"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=column-resolver.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"column-resolver.test.d.ts","sourceRoot":"","sources":["../../src/helpers/column-resolver.test.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=metadata.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"metadata.test.d.ts","sourceRoot":"","sources":["../../src/helpers/metadata.test.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=utils.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.test.d.ts","sourceRoot":"","sources":["../../src/helpers/utils.test.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=helpers.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"helpers.test.d.ts","sourceRoot":"","sources":["../../../../src/web-api/helpers/tests/helpers.test.ts"],"names":[],"mappings":""}