@sinequa/atomic 2.2.0 → 2.3.0

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 (170) hide show
  1. package/README.md +28 -1
  2. package/dist/atomic.cjs +1 -1
  3. package/dist/atomic.js +2 -2
  4. package/dist/authentication/constants.d.ts +20 -0
  5. package/dist/authentication/constants.d.ts.map +1 -1
  6. package/dist/authentication/events/auth-events.d.ts +71 -0
  7. package/dist/authentication/events/auth-events.d.ts.map +1 -0
  8. package/dist/authentication/events/emit-authenticated-event.d.ts +9 -0
  9. package/dist/authentication/events/emit-authenticated-event.d.ts.map +1 -1
  10. package/dist/authentication/events/index.d.ts +1 -0
  11. package/dist/authentication/events/index.d.ts.map +1 -1
  12. package/dist/authentication/index.d.ts +3 -3
  13. package/dist/authentication/index.d.ts.map +1 -1
  14. package/dist/authentication/providers/oauth-authentication.d.ts +10 -1
  15. package/dist/authentication/providers/oauth-authentication.d.ts.map +1 -1
  16. package/dist/authentication/providers/redirect-to-identity-provider.d.ts +34 -0
  17. package/dist/authentication/providers/redirect-to-identity-provider.d.ts.map +1 -0
  18. package/dist/authentication/providers/saml-authentication.d.ts +10 -1
  19. package/dist/authentication/providers/saml-authentication.d.ts.map +1 -1
  20. package/dist/authentication/session/auth-mode-marker.d.ts +7 -0
  21. package/dist/authentication/session/auth-mode-marker.d.ts.map +1 -1
  22. package/dist/authentication/session/auth-state.d.ts +6 -1
  23. package/dist/authentication/session/auth-state.d.ts.map +1 -1
  24. package/dist/authentication/session/detect-auth-mode.d.ts +2 -1
  25. package/dist/authentication/session/detect-auth-mode.d.ts.map +1 -1
  26. package/dist/authentication/session/has-session.d.ts +26 -0
  27. package/dist/authentication/session/has-session.d.ts.map +1 -0
  28. package/dist/authentication/session/index.d.ts +2 -0
  29. package/dist/authentication/session/index.d.ts.map +1 -1
  30. package/dist/authentication/session/login.d.ts +12 -7
  31. package/dist/authentication/session/login.d.ts.map +1 -1
  32. package/dist/authentication/session/logout.d.ts +13 -2
  33. package/dist/authentication/session/logout.d.ts.map +1 -1
  34. package/dist/authentication/session/redirect-guard.d.ts +18 -0
  35. package/dist/authentication/session/redirect-guard.d.ts.map +1 -0
  36. package/dist/authentication/session/try-auto-authentication.d.ts +5 -2
  37. package/dist/authentication/session/try-auto-authentication.d.ts.map +1 -1
  38. package/dist/authentication/session/user-authentication.d.ts +7 -2
  39. package/dist/authentication/session/user-authentication.d.ts.map +1 -1
  40. package/dist/authentication/tokens/delete-web-token-cookie.d.ts +10 -5
  41. package/dist/authentication/tokens/delete-web-token-cookie.d.ts.map +1 -1
  42. package/dist/authentication/tokens/get-csrf-token.d.ts +4 -1
  43. package/dist/authentication/tokens/get-csrf-token.d.ts.map +1 -1
  44. package/dist/authentication/tokens/get-jwt-token.d.ts +29 -5
  45. package/dist/authentication/tokens/get-jwt-token.d.ts.map +1 -1
  46. package/dist/authentication/tokens/get-token.d.ts +7 -1
  47. package/dist/authentication/tokens/get-token.d.ts.map +1 -1
  48. package/dist/authentication/tokens/index.d.ts +1 -1
  49. package/dist/authentication/tokens/index.d.ts.map +1 -1
  50. package/dist/authentication/tokens/set-token.d.ts +7 -1
  51. package/dist/authentication/tokens/set-token.d.ts.map +1 -1
  52. package/dist/client/atomic-context.d.ts +61 -0
  53. package/dist/client/atomic-context.d.ts.map +1 -0
  54. package/dist/client/create-api.d.ts +109 -0
  55. package/dist/client/create-api.d.ts.map +1 -0
  56. package/dist/client/create-atomic-client.d.ts +138 -0
  57. package/dist/client/create-atomic-client.d.ts.map +1 -0
  58. package/dist/client/http-adapter.d.ts +30 -0
  59. package/dist/client/http-adapter.d.ts.map +1 -0
  60. package/dist/client/index.d.ts +5 -0
  61. package/dist/client/index.d.ts.map +1 -0
  62. package/dist/configurations/auth-mode.d.ts +51 -1
  63. package/dist/configurations/auth-mode.d.ts.map +1 -1
  64. package/dist/configurations/auth-options.d.ts +78 -0
  65. package/dist/configurations/auth-options.d.ts.map +1 -0
  66. package/dist/configurations/global.config.d.ts +23 -3
  67. package/dist/configurations/global.config.d.ts.map +1 -1
  68. package/dist/configurations/index.d.ts +1 -0
  69. package/dist/configurations/index.d.ts.map +1 -1
  70. package/dist/helpers/filters.d.ts +24 -0
  71. package/dist/helpers/filters.d.ts.map +1 -1
  72. package/dist/helpers/index.d.ts +1 -0
  73. package/dist/helpers/index.d.ts.map +1 -1
  74. package/dist/helpers/pagination.d.ts +23 -0
  75. package/dist/helpers/pagination.d.ts.map +1 -0
  76. package/dist/helpers/ts-helper.d.ts +6 -0
  77. package/dist/helpers/ts-helper.d.ts.map +1 -1
  78. package/dist/index.d.ts +1 -0
  79. package/dist/index.d.ts.map +1 -1
  80. package/dist/polyfills/storage.d.ts +12 -3
  81. package/dist/polyfills/storage.d.ts.map +1 -1
  82. package/dist/spfx/index.cjs +1 -1
  83. package/dist/spfx/index.d.ts +1 -0
  84. package/dist/spfx/index.d.ts.map +1 -1
  85. package/dist/spfx/index.js +2 -2
  86. package/dist/src-1RUu1uXc.cjs +1 -0
  87. package/dist/src-DFuZeDvd.js +2198 -0
  88. package/dist/types/search/Result.d.ts +36 -2
  89. package/dist/types/search/Result.d.ts.map +1 -1
  90. package/dist/types/search/index.d.ts +1 -1
  91. package/dist/types/search/index.d.ts.map +1 -1
  92. package/dist/utils/logger.d.ts +27 -16
  93. package/dist/utils/logger.d.ts.map +1 -1
  94. package/dist/web-api/helpers/aad-http-client-manager.d.ts +8 -0
  95. package/dist/web-api/helpers/aad-http-client-manager.d.ts.map +1 -1
  96. package/dist/web-api/helpers/create-headers.d.ts +9 -0
  97. package/dist/web-api/helpers/create-headers.d.ts.map +1 -1
  98. package/dist/web-api/helpers/errors/api-error.d.ts.map +1 -1
  99. package/dist/web-api/helpers/handle-response.d.ts +17 -1
  100. package/dist/web-api/helpers/handle-response.d.ts.map +1 -1
  101. package/dist/web-api/helpers/index.d.ts +1 -1
  102. package/dist/web-api/helpers/index.d.ts.map +1 -1
  103. package/dist/web-api/helpers/methods/del.d.ts +13 -11
  104. package/dist/web-api/helpers/methods/del.d.ts.map +1 -1
  105. package/dist/web-api/helpers/methods/get.d.ts +6 -12
  106. package/dist/web-api/helpers/methods/get.d.ts.map +1 -1
  107. package/dist/web-api/helpers/methods/patch.d.ts +6 -7
  108. package/dist/web-api/helpers/methods/patch.d.ts.map +1 -1
  109. package/dist/web-api/helpers/methods/post.d.ts +6 -8
  110. package/dist/web-api/helpers/methods/post.d.ts.map +1 -1
  111. package/dist/web-api/helpers/methods/put.d.ts +6 -7
  112. package/dist/web-api/helpers/methods/put.d.ts.map +1 -1
  113. package/dist/web-api/helpers/methods/send-request.d.ts +24 -0
  114. package/dist/web-api/helpers/methods/send-request.d.ts.map +1 -0
  115. package/dist/web-api/helpers/request-options.d.ts +35 -12
  116. package/dist/web-api/helpers/request-options.d.ts.map +1 -1
  117. package/dist/web-api/helpers/utils/build-request-url.d.ts +12 -0
  118. package/dist/web-api/helpers/utils/build-request-url.d.ts.map +1 -0
  119. package/dist/web-api/helpers/utils/{date-utils..d.ts → date-utils.d.ts} +1 -1
  120. package/dist/web-api/helpers/utils/date-utils.d.ts.map +1 -0
  121. package/dist/web-api/helpers/utils/resolve-no-auto-authentication.d.ts +9 -0
  122. package/dist/web-api/helpers/utils/resolve-no-auto-authentication.d.ts.map +1 -1
  123. package/dist/web-api/helpers/utils/with-retry.d.ts +10 -5
  124. package/dist/web-api/helpers/utils/with-retry.d.ts.map +1 -1
  125. package/dist/web-api/v1/fetch-aggregation.d.ts +2 -1
  126. package/dist/web-api/v1/fetch-aggregation.d.ts.map +1 -1
  127. package/dist/web-api/v1/fetch-app.d.ts +12 -5
  128. package/dist/web-api/v1/fetch-app.d.ts.map +1 -1
  129. package/dist/web-api/v1/fetch-audit.d.ts +2 -1
  130. package/dist/web-api/v1/fetch-audit.d.ts.map +1 -1
  131. package/dist/web-api/v1/fetch-dataset.d.ts +4 -3
  132. package/dist/web-api/v1/fetch-dataset.d.ts.map +1 -1
  133. package/dist/web-api/v1/fetch-labels.d.ts +9 -8
  134. package/dist/web-api/v1/fetch-labels.d.ts.map +1 -1
  135. package/dist/web-api/v1/fetch-preview.d.ts +2 -1
  136. package/dist/web-api/v1/fetch-preview.d.ts.map +1 -1
  137. package/dist/web-api/v1/fetch-principal.d.ts +8 -4
  138. package/dist/web-api/v1/fetch-principal.d.ts.map +1 -1
  139. package/dist/web-api/v1/fetch-query-export.d.ts +2 -1
  140. package/dist/web-api/v1/fetch-query-export.d.ts.map +1 -1
  141. package/dist/web-api/v1/fetch-query-intent.d.ts +2 -1
  142. package/dist/web-api/v1/fetch-query-intent.d.ts.map +1 -1
  143. package/dist/web-api/v1/fetch-query.d.ts +3 -2
  144. package/dist/web-api/v1/fetch-query.d.ts.map +1 -1
  145. package/dist/web-api/v1/fetch-security-principal.d.ts +2 -1
  146. package/dist/web-api/v1/fetch-security-principal.d.ts.map +1 -1
  147. package/dist/web-api/v1/fetch-similar-documents.d.ts +2 -1
  148. package/dist/web-api/v1/fetch-similar-documents.d.ts.map +1 -1
  149. package/dist/web-api/v1/fetch-sponsored-links.d.ts +2 -1
  150. package/dist/web-api/v1/fetch-sponsored-links.d.ts.map +1 -1
  151. package/dist/web-api/v1/fetch-suggest.d.ts +4 -3
  152. package/dist/web-api/v1/fetch-suggest.d.ts.map +1 -1
  153. package/dist/web-api/v1/fetch-text-chunk.d.ts +2 -1
  154. package/dist/web-api/v1/fetch-text-chunk.d.ts.map +1 -1
  155. package/dist/web-api/v1/fetch-user-settings.d.ts +5 -4
  156. package/dist/web-api/v1/fetch-user-settings.d.ts.map +1 -1
  157. package/dist/web-api/v2/fetch-change-password.d.ts +2 -1
  158. package/dist/web-api/v2/fetch-change-password.d.ts.map +1 -1
  159. package/dist/web-api/v2/fetch-document-upload-container.d.ts +8 -7
  160. package/dist/web-api/v2/fetch-document-upload-container.d.ts.map +1 -1
  161. package/dist/web-api/v2/fetch-forgot-password.d.ts +2 -1
  162. package/dist/web-api/v2/fetch-forgot-password.d.ts.map +1 -1
  163. package/dist/web-api/v2/fetch-user-profile.d.ts +5 -4
  164. package/dist/web-api/v2/fetch-user-profile.d.ts.map +1 -1
  165. package/dist/web-api/v2/fetch-version.d.ts +2 -1
  166. package/dist/web-api/v2/fetch-version.d.ts.map +1 -1
  167. package/package.json +1 -1
  168. package/dist/src-BCIlSfZp.js +0 -1923
  169. package/dist/src-Dg2926V9.cjs +0 -1
  170. package/dist/web-api/helpers/utils/date-utils..d.ts.map +0 -1
@@ -1,3 +1,4 @@
1
+ import { type AtomicContext } from "../../client/atomic-context";
1
2
  export type PasswordResetEmailResponse = {
2
3
  email?: string;
3
4
  passwordResetTokenExpiry?: string;
@@ -7,5 +8,5 @@ export type PasswordResetEmailResponse = {
7
8
  *
8
9
  * @param userName - The username for which the reset email should be sent.
9
10
  */
10
- export declare function fetchSendPasswordResetEmail(userName: string): Promise<PasswordResetEmailResponse>;
11
+ export declare function fetchSendPasswordResetEmail(userName: string, ctx?: AtomicContext): Promise<PasswordResetEmailResponse>;
11
12
  //# sourceMappingURL=fetch-forgot-password.d.ts.map
@@ -1 +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"}
1
+ {"version":3,"file":"fetch-forgot-password.d.ts","sourceRoot":"","sources":["../../../src/web-api/v2/fetch-forgot-password.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAEnB,MAAM,6BAA6B,CAAC;AAQrC,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,EAChB,GAAG,GAAE,aAA8B,GAClC,OAAO,CAAC,0BAA0B,CAAC,CAWrC"}
@@ -1,3 +1,4 @@
1
+ import { type AtomicContext } from "../../client/atomic-context";
1
2
  import { UserProfile } from "../../types";
2
3
  /**
3
4
  * Fetches the user profile for the specified user ID.
@@ -12,7 +13,7 @@ import { UserProfile } from "../../types";
12
13
  * console.log(profile);
13
14
  * ```
14
15
  */
15
- export declare function fetchUserProfile(userId: string): Promise<UserProfile>;
16
+ export declare function fetchUserProfile(userId: string, ctx?: AtomicContext): Promise<UserProfile>;
16
17
  /**
17
18
  * Creates a new user profile by sending a POST request to the API.
18
19
  *
@@ -27,7 +28,7 @@ export declare function fetchUserProfile(userId: string): Promise<UserProfile>;
27
28
  * });
28
29
  * ```
29
30
  */
30
- export declare function createUserProfile(userProfile: Partial<UserProfile>): Promise<UserProfile>;
31
+ export declare function createUserProfile(userProfile: Partial<UserProfile>, ctx?: AtomicContext): Promise<UserProfile>;
31
32
  /**
32
33
  * Updates a specific property of a user profile.
33
34
  *
@@ -46,7 +47,7 @@ export declare function createUserProfile(userProfile: Partial<UserProfile>): Pr
46
47
  * );
47
48
  * ```
48
49
  */
49
- export declare function patchUserProfile(userProfile: Partial<Omit<UserProfile, "created" | "modified">>, category: string, propertyName: string): Promise<UserProfile>;
50
+ export declare function patchUserProfile(userProfile: Partial<Omit<UserProfile, "created" | "modified">>, category: string, propertyName: string, ctx?: AtomicContext): Promise<UserProfile>;
50
51
  /**
51
52
  * Deletes a specific property of a user profile.
52
53
  *
@@ -65,5 +66,5 @@ export declare function patchUserProfile(userProfile: Partial<Omit<UserProfile,
65
66
  * );
66
67
  * ```
67
68
  */
68
- export declare function deleteUserProfileProperty(userProfile: Partial<Omit<UserProfile, "created" | "modified">>, category: string, propertyName: string): Promise<boolean>;
69
+ export declare function deleteUserProfileProperty(userProfile: Partial<Omit<UserProfile, "created" | "modified">>, category: string, propertyName: string, ctx?: AtomicContext): Promise<boolean>;
69
70
  //# sourceMappingURL=fetch-user-profile.d.ts.map
@@ -1 +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;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,yBAAyB,CAC7C,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,OAAO,CAAC,CASlB"}
1
+ {"version":3,"file":"fetch-user-profile.d.ts","sourceRoot":"","sources":["../../../src/web-api/v2/fetch-user-profile.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAEnB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAM1C;;;;;;;;;;;;GAYG;AACH,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,MAAM,EACd,GAAG,GAAE,aAA8B,GAClC,OAAO,CAAC,WAAW,CAAC,CAMtB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAsB,iBAAiB,CACrC,WAAW,EAAE,OAAO,CAAC,WAAW,CAAC,EACjC,GAAG,GAAE,aAA8B,GAClC,OAAO,CAAC,WAAW,CAAC,CAOtB;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,EACpB,GAAG,GAAE,aAA8B,GAClC,OAAO,CAAC,WAAW,CAAC,CAOtB;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,yBAAyB,CAC7C,WAAW,EAAE,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,SAAS,GAAG,UAAU,CAAC,CAAC,EAC/D,QAAQ,EAAE,MAAM,EAChB,YAAY,EAAE,MAAM,EACpB,GAAG,GAAE,aAA8B,GAClC,OAAO,CAAC,OAAO,CAAC,CAUlB"}
@@ -1,6 +1,7 @@
1
+ import { type AtomicContext } from "../../client/atomic-context";
1
2
  export type VersionResponse = {
2
3
  serverVersion: string;
3
4
  features: Record<string, boolean>[];
4
5
  };
5
- export declare function fetchVersion(): Promise<VersionResponse>;
6
+ export declare function fetchVersion(ctx?: AtomicContext): Promise<VersionResponse>;
6
7
  //# sourceMappingURL=fetch-version.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"fetch-version.d.ts","sourceRoot":"","sources":["../../../src/web-api/v2/fetch-version.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,eAAe,GAAG;IAC5B,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;CACrC,CAAC;AAEF,wBAAsB,YAAY,6BAGjC"}
1
+ {"version":3,"file":"fetch-version.d.ts","sourceRoot":"","sources":["../../../src/web-api/v2/fetch-version.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAEnB,MAAM,6BAA6B,CAAC;AAGrC,MAAM,MAAM,eAAe,GAAG;IAC5B,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;CACrC,CAAC;AAEF,wBAAsB,YAAY,CAAC,GAAG,GAAE,aAA8B,4BAGrE"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sinequa/atomic",
3
3
  "private": false,
4
- "version": "2.2.0",
4
+ "version": "2.3.0",
5
5
  "type": "module",
6
6
  "main": "./dist/atomic.cjs",
7
7
  "module": "./dist/atomic.js",