Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion packages/algoliasearch/src/builds/browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
stopABTest,
StopABTestResponse,
} from '@algolia/client-analytics';
import { version, WaitablePromise } from '@algolia/client-common';
import { AuthMode, version, WaitablePromise } from '@algolia/client-common';
import {
createRecommendationClient,
getPersonalizationStrategy,
Expand Down Expand Up @@ -201,6 +201,7 @@ export default function algoliasearch(
],
}),
userAgent: createUserAgent(version).add({ segment: 'Browser' }),
authMode: AuthMode.WithinQueryParameters,
};

return createSearchClient({
Expand Down
8 changes: 5 additions & 3 deletions packages/client-common/src/types/AuthModeType.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
export const AuthMode: Readonly<Record<string, AuthModeType>> = {
// @MAJOR: export this as individual constants, so it can be minified

export const AuthMode = {
/**
* If auth credentials should be in query parameters.
*/
Expand All @@ -8,6 +10,6 @@ export const AuthMode: Readonly<Record<string, AuthModeType>> = {
* If auth credentials should be in headers.
*/
WithinHeaders: 1,
};
} as const;

export type AuthModeType = 0 | 1;
export type AuthModeType = typeof AuthMode[keyof typeof AuthMode];
8 changes: 5 additions & 3 deletions packages/transporter/src/types/CallType.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
export const CallEnum: Readonly<Record<string, CallType>> = {
// @MAJOR: export this as individual constants, so it can be minified

export const CallEnum = {
/**
* If the host is read only.
*/
Expand All @@ -13,6 +15,6 @@ export const CallEnum: Readonly<Record<string, CallType>> = {
* If the host is both read and write.
*/
Any: 3,
};
} as const;

export type CallType = 1 | 2 | 3;
export type CallType = typeof CallEnum[keyof typeof CallEnum];