@harnessio/react-intelligence-service-client 0.14.0 → 0.16.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 (71) hide show
  1. package/dist/intelligence-service/src/services/hooks/useCreateMemoryMutation.d.ts +20 -0
  2. package/dist/intelligence-service/src/services/hooks/useCreateMemoryMutation.js +14 -0
  3. package/dist/intelligence-service/src/services/hooks/useCreateRuleMutation.d.ts +40 -0
  4. package/dist/intelligence-service/src/services/hooks/useCreateRuleMutation.js +30 -0
  5. package/dist/intelligence-service/src/services/hooks/useDeleteMemoryMutation.d.ts +19 -0
  6. package/dist/intelligence-service/src/services/hooks/useDeleteMemoryMutation.js +14 -0
  7. package/dist/intelligence-service/src/services/hooks/useDeleteRuleMutation.d.ts +30 -11
  8. package/dist/intelligence-service/src/services/hooks/useDeleteRuleMutation.js +20 -4
  9. package/dist/intelligence-service/src/services/hooks/useGetMemoryQuery.d.ts +20 -0
  10. package/dist/intelligence-service/src/services/hooks/useGetMemoryQuery.js +14 -0
  11. package/dist/intelligence-service/src/services/hooks/useGetRuleQuery.d.ts +30 -11
  12. package/dist/intelligence-service/src/services/hooks/useGetRuleQuery.js +19 -5
  13. package/dist/intelligence-service/src/services/hooks/useGetUserSettingQuery.d.ts +20 -0
  14. package/dist/intelligence-service/src/services/hooks/useGetUserSettingQuery.js +14 -0
  15. package/dist/intelligence-service/src/services/hooks/useListMemoriesQuery.d.ts +25 -0
  16. package/dist/intelligence-service/src/services/hooks/useListMemoriesQuery.js +14 -0
  17. package/dist/intelligence-service/src/services/hooks/useListRulesQuery.d.ts +46 -12
  18. package/dist/intelligence-service/src/services/hooks/useListRulesQuery.js +20 -4
  19. package/dist/intelligence-service/src/services/hooks/useListUserSettingsQuery.d.ts +17 -0
  20. package/dist/intelligence-service/src/services/hooks/useListUserSettingsQuery.js +14 -0
  21. package/dist/intelligence-service/src/services/hooks/useUpdateMemoryMutation.d.ts +23 -0
  22. package/dist/intelligence-service/src/services/hooks/useUpdateMemoryMutation.js +14 -0
  23. package/dist/intelligence-service/src/services/hooks/useUpdateRuleMutation.d.ts +33 -13
  24. package/dist/intelligence-service/src/services/hooks/useUpdateRuleMutation.js +20 -4
  25. package/dist/intelligence-service/src/services/hooks/useUpdateUserSettingsMutation.d.ts +20 -0
  26. package/dist/intelligence-service/src/services/hooks/useUpdateUserSettingsMutation.js +14 -0
  27. package/dist/intelligence-service/src/services/index.d.ts +32 -26
  28. package/dist/intelligence-service/src/services/index.js +9 -11
  29. package/dist/intelligence-service/src/services/schemas/HandlerCreateMemoryRequest.d.ts +6 -0
  30. package/dist/intelligence-service/src/services/schemas/HandlerCreateMemoryRequest.js +4 -0
  31. package/dist/intelligence-service/src/services/schemas/HandlerGetMemoryResponse.d.ts +4 -0
  32. package/dist/intelligence-service/src/services/schemas/HandlerGetMemoryResponse.js +1 -0
  33. package/dist/intelligence-service/src/services/schemas/HandlerListMemoriesResponse.d.ts +6 -0
  34. package/dist/intelligence-service/src/services/schemas/HandlerListMemoriesResponse.js +1 -0
  35. package/dist/intelligence-service/src/services/schemas/HandlerUpdateMemoryRequest.d.ts +6 -0
  36. package/dist/intelligence-service/src/services/schemas/HandlerUpdateMemoryRequest.js +4 -0
  37. package/dist/intelligence-service/src/services/schemas/TypesMemory.d.ts +23 -0
  38. package/dist/intelligence-service/src/services/schemas/TypesMemory.js +1 -0
  39. package/dist/intelligence-service/src/services/schemas/TypesSettingValueResponse.d.ts +4 -0
  40. package/dist/intelligence-service/src/services/schemas/TypesSettingValueResponse.js +4 -0
  41. package/dist/intelligence-service/src/services/schemas/TypesType.d.ts +1 -0
  42. package/dist/intelligence-service/src/services/schemas/TypesType.js +4 -0
  43. package/dist/intelligence-service/src/services/schemas/TypesUserSettingRequest.d.ts +6 -0
  44. package/dist/intelligence-service/src/services/schemas/TypesUserSettingRequest.js +4 -0
  45. package/dist/intelligence-service/src/services/schemas/TypesUserSettingResponse.d.ts +8 -0
  46. package/dist/intelligence-service/src/services/schemas/TypesUserSettingResponse.js +4 -0
  47. package/dist/intelligence-service/src/services/schemas/TypesUserSettingUpdateResponse.d.ts +5 -0
  48. package/dist/intelligence-service/src/services/schemas/TypesUserSettingUpdateResponse.js +4 -0
  49. package/package.json +1 -1
  50. package/dist/intelligence-service/src/services/hooks/useCreateAccountRuleMutation.d.ts +0 -20
  51. package/dist/intelligence-service/src/services/hooks/useCreateAccountRuleMutation.js +0 -14
  52. package/dist/intelligence-service/src/services/hooks/useCreateOrgRuleMutation.d.ts +0 -23
  53. package/dist/intelligence-service/src/services/hooks/useCreateOrgRuleMutation.js +0 -14
  54. package/dist/intelligence-service/src/services/hooks/useCreateProjectRuleMutation.d.ts +0 -24
  55. package/dist/intelligence-service/src/services/hooks/useCreateProjectRuleMutation.js +0 -14
  56. package/dist/intelligence-service/src/services/hooks/useDeleteOrgRuleMutation.d.ts +0 -20
  57. package/dist/intelligence-service/src/services/hooks/useDeleteOrgRuleMutation.js +0 -14
  58. package/dist/intelligence-service/src/services/hooks/useDeleteProjectRuleMutation.d.ts +0 -21
  59. package/dist/intelligence-service/src/services/hooks/useDeleteProjectRuleMutation.js +0 -14
  60. package/dist/intelligence-service/src/services/hooks/useGetOrgRuleQuery.d.ts +0 -21
  61. package/dist/intelligence-service/src/services/hooks/useGetOrgRuleQuery.js +0 -14
  62. package/dist/intelligence-service/src/services/hooks/useGetProjectRuleQuery.d.ts +0 -22
  63. package/dist/intelligence-service/src/services/hooks/useGetProjectRuleQuery.js +0 -14
  64. package/dist/intelligence-service/src/services/hooks/useListOrgRulesQuery.d.ts +0 -29
  65. package/dist/intelligence-service/src/services/hooks/useListOrgRulesQuery.js +0 -14
  66. package/dist/intelligence-service/src/services/hooks/useListProjectRulesQuery.d.ts +0 -30
  67. package/dist/intelligence-service/src/services/hooks/useListProjectRulesQuery.js +0 -14
  68. package/dist/intelligence-service/src/services/hooks/useUpdateOrgRuleMutation.d.ts +0 -24
  69. package/dist/intelligence-service/src/services/hooks/useUpdateOrgRuleMutation.js +0 -14
  70. package/dist/intelligence-service/src/services/hooks/useUpdateProjectRuleMutation.d.ts +0 -25
  71. package/dist/intelligence-service/src/services/hooks/useUpdateProjectRuleMutation.js +0 -14
@@ -0,0 +1,20 @@
1
+ import { UseMutationOptions } from '@tanstack/react-query';
2
+ import type { TypesMemory } from '../schemas/TypesMemory';
3
+ import type { UsererrorError } from '../schemas/UsererrorError';
4
+ import type { HandlerCreateMemoryRequest } from '../schemas/HandlerCreateMemoryRequest';
5
+ import type { ResponseWithPagination } from '../helpers';
6
+ import { FetcherOptions } from '../../../../fetcher/index.js';
7
+ export interface CreateMemoryMutationHeaderParams {
8
+ 'harness-account': string;
9
+ }
10
+ export type CreateMemoryRequestBody = HandlerCreateMemoryRequest;
11
+ export type CreateMemoryOkResponse = ResponseWithPagination<TypesMemory>;
12
+ export type CreateMemoryErrorResponse = UsererrorError;
13
+ export interface CreateMemoryProps extends Omit<FetcherOptions<unknown, CreateMemoryRequestBody, CreateMemoryMutationHeaderParams>, 'url'> {
14
+ body: CreateMemoryRequestBody;
15
+ }
16
+ export declare function createMemory(props: CreateMemoryProps): Promise<CreateMemoryOkResponse>;
17
+ /**
18
+ * Creates a new memory entry for the authenticated user
19
+ */
20
+ export declare function useCreateMemoryMutation(options?: Omit<UseMutationOptions<CreateMemoryOkResponse, CreateMemoryErrorResponse, CreateMemoryProps>, 'mutationKey' | 'mutationFn'>): import("@tanstack/react-query").UseMutationResult<CreateMemoryOkResponse, UsererrorError, CreateMemoryProps, unknown>;
@@ -0,0 +1,14 @@
1
+ /* eslint-disable */
2
+ // This code is autogenerated using @harnessio/oats-cli.
3
+ // Please do not modify this code directly.
4
+ import { useMutation } from '@tanstack/react-query';
5
+ import { fetcher } from '../../../../fetcher/index.js';
6
+ export function createMemory(props) {
7
+ return fetcher(Object.assign({ url: `/api/v1/chat/memory`, method: 'POST' }, props));
8
+ }
9
+ /**
10
+ * Creates a new memory entry for the authenticated user
11
+ */
12
+ export function useCreateMemoryMutation(options) {
13
+ return useMutation((mutateProps) => createMemory(mutateProps), options);
14
+ }
@@ -0,0 +1,40 @@
1
+ import { UseMutationOptions } from '@tanstack/react-query';
2
+ import type { TypesRule } from '../schemas/TypesRule';
3
+ import type { UsererrorError } from '../schemas/UsererrorError';
4
+ import type { ControllerCreateRuleInput } from '../schemas/ControllerCreateRuleInput';
5
+ import type { GetPathParamsType, ResponseWithPagination } from '../helpers';
6
+ import { FetcherOptions } from '../../../../fetcher/index.js';
7
+ export interface CreateRuleAccountPathParams {
8
+ }
9
+ export interface CreateRuleAccountHeaderParams {
10
+ 'harness-account': string;
11
+ }
12
+ export type CreateRuleAccountRequestBody = ControllerCreateRuleInput;
13
+ export type CreateRuleAccountOKResponse = TypesRule;
14
+ export type CreateRuleAccountErrorResponse = UsererrorError;
15
+ export interface CreateRuleOrgPathParams {
16
+ org: string;
17
+ }
18
+ export interface CreateRuleOrgHeaderParams {
19
+ 'harness-account': string;
20
+ }
21
+ export type CreateRuleOrgRequestBody = ControllerCreateRuleInput;
22
+ export type CreateRuleOrgOKResponse = TypesRule;
23
+ export type CreateRuleOrgErrorResponse = UsererrorError;
24
+ export interface CreateRuleProjectPathParams {
25
+ org: string;
26
+ project: string;
27
+ }
28
+ export interface CreateRuleProjectHeaderParams {
29
+ 'harness-account': string;
30
+ }
31
+ export type CreateRuleProjectRequestBody = ControllerCreateRuleInput;
32
+ export type CreateRuleProjectOKResponse = TypesRule;
33
+ export type CreateRuleProjectErrorResponse = UsererrorError;
34
+ export type CreateRuleOKResponse<T> = T extends CreateRuleProjectPathParams ? ResponseWithPagination<CreateRuleProjectOKResponse> : T extends CreateRuleOrgPathParams ? ResponseWithPagination<CreateRuleOrgOKResponse> : ResponseWithPagination<CreateRuleAccountOKResponse>;
35
+ export type CreateRuleErrorResponse<T> = T extends CreateRuleProjectPathParams ? CreateRuleProjectErrorResponse : T extends CreateRuleOrgPathParams ? CreateRuleOrgErrorResponse : CreateRuleAccountErrorResponse;
36
+ export interface CreateRuleProps extends Omit<FetcherOptions<unknown, unknown>, 'url'> {
37
+ pathParams: CreateRuleAccountPathParams | CreateRuleOrgPathParams | CreateRuleProjectPathParams;
38
+ }
39
+ export declare function createRule<T extends CreateRuleProps = CreateRuleProps>(props: T): Promise<CreateRuleOKResponse<GetPathParamsType<T>>>;
40
+ export declare function useCreateRuleMutation(options?: Omit<UseMutationOptions<CreateRuleOKResponse<unknown>, CreateRuleErrorResponse<unknown>, CreateRuleProps>, 'mutationKey' | 'mutationFn'>): import("@tanstack/react-query").UseMutationResult<ResponseWithPagination<TypesRule>, UsererrorError, CreateRuleProps, unknown>;
@@ -0,0 +1,30 @@
1
+ /* eslint-disable */
2
+ // This code is autogenerated using @harnessio/oats-cli.
3
+ // Please do not modify this code directly.
4
+ import { useMutation } from '@tanstack/react-query';
5
+ import { fetcher } from '../../../../fetcher/index.js';
6
+ function isProjectPathParams(pathParams) {
7
+ return !!(pathParams.org &&
8
+ pathParams.project);
9
+ }
10
+ function isOrgPathParams(pathParams) {
11
+ return !!(pathParams.org &&
12
+ !pathParams.project);
13
+ }
14
+ export function createRule(props) {
15
+ let url = `/api/v1/rules`;
16
+ let method = 'POST';
17
+ if (isProjectPathParams(props.pathParams)) {
18
+ url = `/api/v1/orgs/${props.pathParams.org}/projects/${props.pathParams.project}/rules`;
19
+ method = 'POST';
20
+ }
21
+ else if (isOrgPathParams(props.pathParams)) {
22
+ url = `/api/v1/orgs/${props.pathParams.org}/rules`;
23
+ method = 'POST';
24
+ }
25
+ return fetcher(Object.assign({ url,
26
+ method }, props));
27
+ }
28
+ export function useCreateRuleMutation(options) {
29
+ return useMutation((mutateProps) => createRule(mutateProps), options);
30
+ }
@@ -0,0 +1,19 @@
1
+ import { UseMutationOptions } from '@tanstack/react-query';
2
+ import type { UsererrorError } from '../schemas/UsererrorError';
3
+ import type { ResponseWithPagination } from '../helpers';
4
+ import { FetcherOptions } from '../../../../fetcher/index.js';
5
+ export interface DeleteMemoryMutationPathParams {
6
+ memoryId: string;
7
+ }
8
+ export interface DeleteMemoryMutationHeaderParams {
9
+ 'harness-account': string;
10
+ }
11
+ export type DeleteMemoryOkResponse = ResponseWithPagination<unknown>;
12
+ export type DeleteMemoryErrorResponse = UsererrorError;
13
+ export interface DeleteMemoryProps extends DeleteMemoryMutationPathParams, Omit<FetcherOptions<unknown, unknown, DeleteMemoryMutationHeaderParams>, 'url'> {
14
+ }
15
+ export declare function deleteMemory(props: DeleteMemoryProps): Promise<DeleteMemoryOkResponse>;
16
+ /**
17
+ * Deletes a memory by ID
18
+ */
19
+ export declare function useDeleteMemoryMutation(options?: Omit<UseMutationOptions<DeleteMemoryOkResponse, DeleteMemoryErrorResponse, DeleteMemoryProps>, 'mutationKey' | 'mutationFn'>): import("@tanstack/react-query").UseMutationResult<DeleteMemoryOkResponse, UsererrorError, DeleteMemoryProps, unknown>;
@@ -0,0 +1,14 @@
1
+ /* eslint-disable */
2
+ // This code is autogenerated using @harnessio/oats-cli.
3
+ // Please do not modify this code directly.
4
+ import { useMutation } from '@tanstack/react-query';
5
+ import { fetcher } from '../../../../fetcher/index.js';
6
+ export function deleteMemory(props) {
7
+ return fetcher(Object.assign({ url: `/api/v1/chat/memory/${props.memoryId}`, method: 'DELETE' }, props));
8
+ }
9
+ /**
10
+ * Deletes a memory by ID
11
+ */
12
+ export function useDeleteMemoryMutation(options) {
13
+ return useMutation((mutateProps) => deleteMemory(mutateProps), options);
14
+ }
@@ -1,19 +1,38 @@
1
1
  import { UseMutationOptions } from '@tanstack/react-query';
2
2
  import type { UsererrorError } from '../schemas/UsererrorError';
3
- import type { ResponseWithPagination } from '../helpers';
3
+ import type { GetPathParamsType, ResponseWithPagination } from '../helpers';
4
4
  import { FetcherOptions } from '../../../../fetcher/index.js';
5
- export interface DeleteRuleMutationPathParams {
5
+ export interface DeleteRuleAccountPathParams {
6
6
  rule_id: string;
7
7
  }
8
- export interface DeleteRuleMutationHeaderParams {
8
+ export interface DeleteRuleAccountHeaderParams {
9
9
  'harness-account': string;
10
10
  }
11
- export type DeleteRuleOkResponse = ResponseWithPagination<unknown>;
12
- export type DeleteRuleErrorResponse = UsererrorError;
13
- export interface DeleteRuleProps extends DeleteRuleMutationPathParams, Omit<FetcherOptions<unknown, unknown, DeleteRuleMutationHeaderParams>, 'url'> {
11
+ export type DeleteRuleAccountOKResponse = unknown;
12
+ export type DeleteRuleAccountErrorResponse = UsererrorError;
13
+ export interface DeleteRuleOrgPathParams {
14
+ org: string;
15
+ rule_id: string;
16
+ }
17
+ export interface DeleteRuleOrgHeaderParams {
18
+ 'harness-account': string;
19
+ }
20
+ export type DeleteRuleOrgOKResponse = unknown;
21
+ export type DeleteRuleOrgErrorResponse = UsererrorError;
22
+ export interface DeleteRuleProjectPathParams {
23
+ org: string;
24
+ project: string;
25
+ rule_id: string;
26
+ }
27
+ export interface DeleteRuleProjectHeaderParams {
28
+ 'harness-account': string;
29
+ }
30
+ export type DeleteRuleProjectOKResponse = unknown;
31
+ export type DeleteRuleProjectErrorResponse = UsererrorError;
32
+ export type DeleteRuleOKResponse<T> = T extends DeleteRuleProjectPathParams ? ResponseWithPagination<DeleteRuleProjectOKResponse> : T extends DeleteRuleOrgPathParams ? ResponseWithPagination<DeleteRuleOrgOKResponse> : ResponseWithPagination<DeleteRuleAccountOKResponse>;
33
+ export type DeleteRuleErrorResponse<T> = T extends DeleteRuleProjectPathParams ? DeleteRuleProjectErrorResponse : T extends DeleteRuleOrgPathParams ? DeleteRuleOrgErrorResponse : DeleteRuleAccountErrorResponse;
34
+ export interface DeleteRuleProps extends Omit<FetcherOptions<unknown, unknown>, 'url'> {
35
+ pathParams: DeleteRuleAccountPathParams | DeleteRuleOrgPathParams | DeleteRuleProjectPathParams;
14
36
  }
15
- export declare function deleteRule(props: DeleteRuleProps): Promise<DeleteRuleOkResponse>;
16
- /**
17
- * Delete a rule
18
- */
19
- export declare function useDeleteRuleMutation(options?: Omit<UseMutationOptions<DeleteRuleOkResponse, DeleteRuleErrorResponse, DeleteRuleProps>, 'mutationKey' | 'mutationFn'>): import("@tanstack/react-query").UseMutationResult<DeleteRuleOkResponse, UsererrorError, DeleteRuleProps, unknown>;
37
+ export declare function deleteRule<T extends DeleteRuleProps = DeleteRuleProps>(props: T): Promise<DeleteRuleOKResponse<GetPathParamsType<T>>>;
38
+ export declare function useDeleteRuleMutation(options?: Omit<UseMutationOptions<DeleteRuleOKResponse<unknown>, DeleteRuleErrorResponse<unknown>, DeleteRuleProps>, 'mutationKey' | 'mutationFn'>): import("@tanstack/react-query").UseMutationResult<ResponseWithPagination<unknown>, UsererrorError, DeleteRuleProps, unknown>;
@@ -3,12 +3,28 @@
3
3
  // Please do not modify this code directly.
4
4
  import { useMutation } from '@tanstack/react-query';
5
5
  import { fetcher } from '../../../../fetcher/index.js';
6
+ function isProjectPathParams(pathParams) {
7
+ return !!(pathParams.org &&
8
+ pathParams.project);
9
+ }
10
+ function isOrgPathParams(pathParams) {
11
+ return !!(pathParams.org &&
12
+ !pathParams.project);
13
+ }
6
14
  export function deleteRule(props) {
7
- return fetcher(Object.assign({ url: `/api/v1/rules/${props.rule_id}`, method: 'DELETE' }, props));
15
+ let url = `/api/v1/rules/${props.pathParams.rule_id}`;
16
+ let method = 'DELETE';
17
+ if (isProjectPathParams(props.pathParams)) {
18
+ url = `/api/v1/orgs/${props.pathParams.org}/projects/${props.pathParams.project}/rules/${props.pathParams.rule_id}`;
19
+ method = 'DELETE';
20
+ }
21
+ else if (isOrgPathParams(props.pathParams)) {
22
+ url = `/api/v1/orgs/${props.pathParams.org}/rules/${props.pathParams.rule_id}`;
23
+ method = 'DELETE';
24
+ }
25
+ return fetcher(Object.assign({ url,
26
+ method }, props));
8
27
  }
9
- /**
10
- * Delete a rule
11
- */
12
28
  export function useDeleteRuleMutation(options) {
13
29
  return useMutation((mutateProps) => deleteRule(mutateProps), options);
14
30
  }
@@ -0,0 +1,20 @@
1
+ import { UseQueryOptions } from '@tanstack/react-query';
2
+ import type { HandlerGetMemoryResponse } from '../schemas/HandlerGetMemoryResponse';
3
+ import type { UsererrorError } from '../schemas/UsererrorError';
4
+ import type { ResponseWithPagination } from '../helpers';
5
+ import { FetcherOptions } from '../../../../fetcher/index.js';
6
+ export interface GetMemoryQueryPathParams {
7
+ memoryId: string;
8
+ }
9
+ export interface GetMemoryQueryHeaderParams {
10
+ 'harness-account': string;
11
+ }
12
+ export type GetMemoryOkResponse = ResponseWithPagination<HandlerGetMemoryResponse>;
13
+ export type GetMemoryErrorResponse = UsererrorError;
14
+ export interface GetMemoryProps extends GetMemoryQueryPathParams, Omit<FetcherOptions<unknown, unknown, GetMemoryQueryHeaderParams>, 'url'> {
15
+ }
16
+ export declare function getMemory(props: GetMemoryProps): Promise<GetMemoryOkResponse>;
17
+ /**
18
+ * Retrieves a specific memory by ID
19
+ */
20
+ export declare function useGetMemoryQuery(props: GetMemoryProps, options?: Omit<UseQueryOptions<GetMemoryOkResponse, GetMemoryErrorResponse>, 'queryKey' | 'queryFn'>): import("@tanstack/react-query").UseQueryResult<GetMemoryOkResponse, UsererrorError>;
@@ -0,0 +1,14 @@
1
+ /* eslint-disable */
2
+ // This code is autogenerated using @harnessio/oats-cli.
3
+ // Please do not modify this code directly.
4
+ import { useQuery } from '@tanstack/react-query';
5
+ import { fetcher } from '../../../../fetcher/index.js';
6
+ export function getMemory(props) {
7
+ return fetcher(Object.assign({ url: `/api/v1/chat/memory/${props.memoryId}`, method: 'GET' }, props));
8
+ }
9
+ /**
10
+ * Retrieves a specific memory by ID
11
+ */
12
+ export function useGetMemoryQuery(props, options) {
13
+ return useQuery(['getMemory', props.memoryId], ({ signal }) => getMemory(Object.assign(Object.assign({}, props), { signal })), options);
14
+ }
@@ -1,20 +1,39 @@
1
1
  import { UseQueryOptions } from '@tanstack/react-query';
2
2
  import type { TypesRule } from '../schemas/TypesRule';
3
3
  import type { UsererrorError } from '../schemas/UsererrorError';
4
- import type { ResponseWithPagination } from '../helpers';
4
+ import type { GetPathParamsType, ResponseWithPagination } from '../helpers';
5
5
  import { FetcherOptions } from '../../../../fetcher/index.js';
6
- export interface GetRuleQueryPathParams {
6
+ export interface GetRuleAccountPathParams {
7
7
  rule_id: string;
8
8
  }
9
- export interface GetRuleQueryHeaderParams {
9
+ export interface GetRuleAccountHeaderParams {
10
10
  'harness-account': string;
11
11
  }
12
- export type GetRuleOkResponse = ResponseWithPagination<TypesRule>;
13
- export type GetRuleErrorResponse = UsererrorError;
14
- export interface GetRuleProps extends GetRuleQueryPathParams, Omit<FetcherOptions<unknown, unknown, GetRuleQueryHeaderParams>, 'url'> {
12
+ export type GetRuleAccountOKResponse = TypesRule;
13
+ export type GetRuleAccountErrorResponse = UsererrorError;
14
+ export interface GetRuleOrgPathParams {
15
+ org: string;
16
+ rule_id: string;
17
+ }
18
+ export interface GetRuleOrgHeaderParams {
19
+ 'harness-account': string;
20
+ }
21
+ export type GetRuleOrgOKResponse = TypesRule;
22
+ export type GetRuleOrgErrorResponse = UsererrorError;
23
+ export interface GetRuleProjectPathParams {
24
+ org: string;
25
+ project: string;
26
+ rule_id: string;
27
+ }
28
+ export interface GetRuleProjectHeaderParams {
29
+ 'harness-account': string;
30
+ }
31
+ export type GetRuleProjectOKResponse = TypesRule;
32
+ export type GetRuleProjectErrorResponse = UsererrorError;
33
+ export type GetRuleOKResponse<T> = T extends GetRuleProjectPathParams ? ResponseWithPagination<GetRuleProjectOKResponse> : T extends GetRuleOrgPathParams ? ResponseWithPagination<GetRuleOrgOKResponse> : ResponseWithPagination<GetRuleAccountOKResponse>;
34
+ export type GetRuleErrorResponse<T> = T extends GetRuleProjectPathParams ? GetRuleProjectErrorResponse : T extends GetRuleOrgPathParams ? GetRuleOrgErrorResponse : GetRuleAccountErrorResponse;
35
+ export interface GetRuleProps extends Omit<FetcherOptions<unknown, unknown>, 'url'> {
36
+ pathParams: GetRuleAccountPathParams | GetRuleOrgPathParams | GetRuleProjectPathParams;
15
37
  }
16
- export declare function getRule(props: GetRuleProps): Promise<GetRuleOkResponse>;
17
- /**
18
- * Get a rule by ID
19
- */
20
- export declare function useGetRuleQuery(props: GetRuleProps, options?: Omit<UseQueryOptions<GetRuleOkResponse, GetRuleErrorResponse>, 'queryKey' | 'queryFn'>): import("@tanstack/react-query").UseQueryResult<GetRuleOkResponse, UsererrorError>;
38
+ export declare function getRule<T extends GetRuleProps = GetRuleProps>(props: T): Promise<GetRuleOKResponse<GetPathParamsType<T>>>;
39
+ export declare function useGetRuleQuery<T extends GetRuleProps = GetRuleProps>(props: T, options?: Omit<UseQueryOptions<GetRuleOKResponse<GetPathParamsType<T>>, GetRuleErrorResponse<GetPathParamsType<T>>>, 'queryKey' | 'queryFn'>): import("@tanstack/react-query").UseQueryResult<GetRuleOKResponse<GetPathParamsType<T>>, GetRuleErrorResponse<GetPathParamsType<T>>>;
@@ -3,12 +3,26 @@
3
3
  // Please do not modify this code directly.
4
4
  import { useQuery } from '@tanstack/react-query';
5
5
  import { fetcher } from '../../../../fetcher/index.js';
6
+ function isProjectPathParams(pathParams) {
7
+ return !!(pathParams.org && pathParams.project);
8
+ }
9
+ function isOrgPathParams(pathParams) {
10
+ return !!(pathParams.org && !pathParams.project);
11
+ }
6
12
  export function getRule(props) {
7
- return fetcher(Object.assign({ url: `/api/v1/rules/${props.rule_id}`, method: 'GET' }, props));
13
+ let url = `/api/v1/rules/${props.pathParams.rule_id}`;
14
+ let method = 'GET';
15
+ if (isProjectPathParams(props.pathParams)) {
16
+ url = `/api/v1/orgs/${props.pathParams.org}/projects/${props.pathParams.project}/rules/${props.pathParams.rule_id}`;
17
+ method = 'GET';
18
+ }
19
+ else if (isOrgPathParams(props.pathParams)) {
20
+ url = `/api/v1/orgs/${props.pathParams.org}/rules/${props.pathParams.rule_id}`;
21
+ method = 'GET';
22
+ }
23
+ return fetcher(Object.assign({ url,
24
+ method }, props));
8
25
  }
9
- /**
10
- * Get a rule by ID
11
- */
12
26
  export function useGetRuleQuery(props, options) {
13
- return useQuery(['getRule', props.rule_id], ({ signal }) => getRule(Object.assign(Object.assign({}, props), { signal })), options);
27
+ return useQuery(['getRule'], ({ signal }) => getRule(Object.assign(Object.assign({}, props), { signal })), options);
14
28
  }
@@ -0,0 +1,20 @@
1
+ import { UseQueryOptions } from '@tanstack/react-query';
2
+ import type { TypesSettingValueResponse } from '../schemas/TypesSettingValueResponse';
3
+ import type { UsererrorError } from '../schemas/UsererrorError';
4
+ import type { ResponseWithPagination } from '../helpers';
5
+ import { FetcherOptions } from '../../../../fetcher/index.js';
6
+ export interface GetUserSettingQueryPathParams {
7
+ identifier: string;
8
+ }
9
+ export interface GetUserSettingQueryHeaderParams {
10
+ 'harness-account': string;
11
+ }
12
+ export type GetUserSettingOkResponse = ResponseWithPagination<TypesSettingValueResponse>;
13
+ export type GetUserSettingErrorResponse = UsererrorError;
14
+ export interface GetUserSettingProps extends GetUserSettingQueryPathParams, Omit<FetcherOptions<unknown, unknown, GetUserSettingQueryHeaderParams>, 'url'> {
15
+ }
16
+ export declare function getUserSetting(props: GetUserSettingProps): Promise<GetUserSettingOkResponse>;
17
+ /**
18
+ * Retrieves a specific user setting by identifier
19
+ */
20
+ export declare function useGetUserSettingQuery(props: GetUserSettingProps, options?: Omit<UseQueryOptions<GetUserSettingOkResponse, GetUserSettingErrorResponse>, 'queryKey' | 'queryFn'>): import("@tanstack/react-query").UseQueryResult<GetUserSettingOkResponse, UsererrorError>;
@@ -0,0 +1,14 @@
1
+ /* eslint-disable */
2
+ // This code is autogenerated using @harnessio/oats-cli.
3
+ // Please do not modify this code directly.
4
+ import { useQuery } from '@tanstack/react-query';
5
+ import { fetcher } from '../../../../fetcher/index.js';
6
+ export function getUserSetting(props) {
7
+ return fetcher(Object.assign({ url: `/api/v1/user-settings/${props.identifier}`, method: 'GET' }, props));
8
+ }
9
+ /**
10
+ * Retrieves a specific user setting by identifier
11
+ */
12
+ export function useGetUserSettingQuery(props, options) {
13
+ return useQuery(['getUserSetting', props.identifier], ({ signal }) => getUserSetting(Object.assign(Object.assign({}, props), { signal })), options);
14
+ }
@@ -0,0 +1,25 @@
1
+ import { UseQueryOptions } from '@tanstack/react-query';
2
+ import type { HandlerListMemoriesResponse } from '../schemas/HandlerListMemoriesResponse';
3
+ import type { UsererrorError } from '../schemas/UsererrorError';
4
+ import type { ResponseWithPagination } from '../helpers';
5
+ import { FetcherOptions } from '../../../../fetcher/index.js';
6
+ export interface ListMemoriesQueryQueryParams {
7
+ cursor?: string;
8
+ /**
9
+ * @default 20
10
+ */
11
+ limit?: number;
12
+ }
13
+ export interface ListMemoriesQueryHeaderParams {
14
+ 'harness-account': string;
15
+ }
16
+ export type ListMemoriesOkResponse = ResponseWithPagination<HandlerListMemoriesResponse>;
17
+ export type ListMemoriesErrorResponse = UsererrorError;
18
+ export interface ListMemoriesProps extends Omit<FetcherOptions<ListMemoriesQueryQueryParams, unknown, ListMemoriesQueryHeaderParams>, 'url'> {
19
+ queryParams: ListMemoriesQueryQueryParams;
20
+ }
21
+ export declare function listMemories(props: ListMemoriesProps): Promise<ListMemoriesOkResponse>;
22
+ /**
23
+ * Returns a list of memories for the authenticated user with cursor-based pagination
24
+ */
25
+ export declare function useListMemoriesQuery(props: ListMemoriesProps, options?: Omit<UseQueryOptions<ListMemoriesOkResponse, ListMemoriesErrorResponse>, 'queryKey' | 'queryFn'>): import("@tanstack/react-query").UseQueryResult<ListMemoriesOkResponse, UsererrorError>;
@@ -0,0 +1,14 @@
1
+ /* eslint-disable */
2
+ // This code is autogenerated using @harnessio/oats-cli.
3
+ // Please do not modify this code directly.
4
+ import { useQuery } from '@tanstack/react-query';
5
+ import { fetcher } from '../../../../fetcher/index.js';
6
+ export function listMemories(props) {
7
+ return fetcher(Object.assign({ url: `/api/v1/chat/memory`, method: 'GET' }, props));
8
+ }
9
+ /**
10
+ * Returns a list of memories for the authenticated user with cursor-based pagination
11
+ */
12
+ export function useListMemoriesQuery(props, options) {
13
+ return useQuery(['listMemories', props.queryParams], ({ signal }) => listMemories(Object.assign(Object.assign({}, props), { signal })), options);
14
+ }
@@ -1,9 +1,44 @@
1
1
  import { UseQueryOptions } from '@tanstack/react-query';
2
2
  import type { TypesRule } from '../schemas/TypesRule';
3
3
  import type { UsererrorError } from '../schemas/UsererrorError';
4
- import type { ResponseWithPagination } from '../helpers';
4
+ import type { GetPathParamsType, ResponseWithPagination } from '../helpers';
5
5
  import { FetcherOptions } from '../../../../fetcher/index.js';
6
- export interface ListRulesQueryQueryParams {
6
+ export interface ListRulesAccountPathParams {
7
+ }
8
+ export interface ListRulesAccountQueryParams {
9
+ category?: string;
10
+ scope?: string;
11
+ status?: string;
12
+ source?: string;
13
+ page?: string;
14
+ limit?: string;
15
+ }
16
+ export interface ListRulesAccountHeaderParams {
17
+ 'harness-account': string;
18
+ }
19
+ export type ListRulesAccountOKResponse = TypesRule[];
20
+ export type ListRulesAccountErrorResponse = UsererrorError;
21
+ export interface ListRulesOrgPathParams {
22
+ org: string;
23
+ }
24
+ export interface ListRulesOrgQueryParams {
25
+ category?: string;
26
+ scope?: string;
27
+ status?: string;
28
+ source?: string;
29
+ page?: string;
30
+ limit?: string;
31
+ }
32
+ export interface ListRulesOrgHeaderParams {
33
+ 'harness-account': string;
34
+ }
35
+ export type ListRulesOrgOKResponse = TypesRule[];
36
+ export type ListRulesOrgErrorResponse = UsererrorError;
37
+ export interface ListRulesProjectPathParams {
38
+ org: string;
39
+ project: string;
40
+ }
41
+ export interface ListRulesProjectQueryParams {
7
42
  category?: string;
8
43
  scope?: string;
9
44
  status?: string;
@@ -11,16 +46,15 @@ export interface ListRulesQueryQueryParams {
11
46
  page?: string;
12
47
  limit?: string;
13
48
  }
14
- export interface ListRulesQueryHeaderParams {
49
+ export interface ListRulesProjectHeaderParams {
15
50
  'harness-account': string;
16
51
  }
17
- export type ListRulesOkResponse = ResponseWithPagination<TypesRule[]>;
18
- export type ListRulesErrorResponse = UsererrorError;
19
- export interface ListRulesProps extends Omit<FetcherOptions<ListRulesQueryQueryParams, unknown, ListRulesQueryHeaderParams>, 'url'> {
20
- queryParams: ListRulesQueryQueryParams;
52
+ export type ListRulesProjectOKResponse = TypesRule[];
53
+ export type ListRulesProjectErrorResponse = UsererrorError;
54
+ export type ListRulesOKResponse<T> = T extends ListRulesProjectPathParams ? ResponseWithPagination<ListRulesProjectOKResponse> : T extends ListRulesOrgPathParams ? ResponseWithPagination<ListRulesOrgOKResponse> : ResponseWithPagination<ListRulesAccountOKResponse>;
55
+ export type ListRulesErrorResponse<T> = T extends ListRulesProjectPathParams ? ListRulesProjectErrorResponse : T extends ListRulesOrgPathParams ? ListRulesOrgErrorResponse : ListRulesAccountErrorResponse;
56
+ export interface ListRulesProps extends Omit<FetcherOptions<unknown, unknown>, 'url'> {
57
+ pathParams: ListRulesAccountPathParams | ListRulesOrgPathParams | ListRulesProjectPathParams;
21
58
  }
22
- export declare function listRules(props: ListRulesProps): Promise<ListRulesOkResponse>;
23
- /**
24
- * List rules based on filters
25
- */
26
- export declare function useListRulesQuery(props: ListRulesProps, options?: Omit<UseQueryOptions<ListRulesOkResponse, ListRulesErrorResponse>, 'queryKey' | 'queryFn'>): import("@tanstack/react-query").UseQueryResult<ListRulesOkResponse, UsererrorError>;
59
+ export declare function listRules<T extends ListRulesProps = ListRulesProps>(props: T): Promise<ListRulesOKResponse<GetPathParamsType<T>>>;
60
+ export declare function useListRulesQuery<T extends ListRulesProps = ListRulesProps>(props: T, options?: Omit<UseQueryOptions<ListRulesOKResponse<GetPathParamsType<T>>, ListRulesErrorResponse<GetPathParamsType<T>>>, 'queryKey' | 'queryFn'>): import("@tanstack/react-query").UseQueryResult<ListRulesOKResponse<GetPathParamsType<T>>, ListRulesErrorResponse<GetPathParamsType<T>>>;
@@ -3,12 +3,28 @@
3
3
  // Please do not modify this code directly.
4
4
  import { useQuery } from '@tanstack/react-query';
5
5
  import { fetcher } from '../../../../fetcher/index.js';
6
+ function isProjectPathParams(pathParams) {
7
+ return !!(pathParams.org &&
8
+ pathParams.project);
9
+ }
10
+ function isOrgPathParams(pathParams) {
11
+ return !!(pathParams.org &&
12
+ !pathParams.project);
13
+ }
6
14
  export function listRules(props) {
7
- return fetcher(Object.assign({ url: `/api/v1/rules`, method: 'GET' }, props));
15
+ let url = `/api/v1/rules`;
16
+ let method = 'GET';
17
+ if (isProjectPathParams(props.pathParams)) {
18
+ url = `/api/v1/orgs/${props.pathParams.org}/projects/${props.pathParams.project}/rules`;
19
+ method = 'GET';
20
+ }
21
+ else if (isOrgPathParams(props.pathParams)) {
22
+ url = `/api/v1/orgs/${props.pathParams.org}/rules`;
23
+ method = 'GET';
24
+ }
25
+ return fetcher(Object.assign({ url,
26
+ method }, props));
8
27
  }
9
- /**
10
- * List rules based on filters
11
- */
12
28
  export function useListRulesQuery(props, options) {
13
29
  return useQuery(['listRules', props.queryParams], ({ signal }) => listRules(Object.assign(Object.assign({}, props), { signal })), options);
14
30
  }
@@ -0,0 +1,17 @@
1
+ import { UseQueryOptions } from '@tanstack/react-query';
2
+ import type { TypesUserSettingResponse } from '../schemas/TypesUserSettingResponse';
3
+ import type { UsererrorError } from '../schemas/UsererrorError';
4
+ import type { ResponseWithPagination } from '../helpers';
5
+ import { FetcherOptions } from '../../../../fetcher/index.js';
6
+ export interface ListUserSettingsQueryHeaderParams {
7
+ 'harness-account': string;
8
+ }
9
+ export type ListUserSettingsOkResponse = ResponseWithPagination<TypesUserSettingResponse[]>;
10
+ export type ListUserSettingsErrorResponse = UsererrorError;
11
+ export interface ListUserSettingsProps extends Omit<FetcherOptions<unknown, unknown, ListUserSettingsQueryHeaderParams>, 'url'> {
12
+ }
13
+ export declare function listUserSettings(props: ListUserSettingsProps): Promise<ListUserSettingsOkResponse>;
14
+ /**
15
+ * Returns all user settings for the authenticated user
16
+ */
17
+ export declare function useListUserSettingsQuery(props: ListUserSettingsProps, options?: Omit<UseQueryOptions<ListUserSettingsOkResponse, ListUserSettingsErrorResponse>, 'queryKey' | 'queryFn'>): import("@tanstack/react-query").UseQueryResult<ListUserSettingsOkResponse, UsererrorError>;
@@ -0,0 +1,14 @@
1
+ /* eslint-disable */
2
+ // This code is autogenerated using @harnessio/oats-cli.
3
+ // Please do not modify this code directly.
4
+ import { useQuery } from '@tanstack/react-query';
5
+ import { fetcher } from '../../../../fetcher/index.js';
6
+ export function listUserSettings(props) {
7
+ return fetcher(Object.assign({ url: `/api/v1/user-settings`, method: 'GET' }, props));
8
+ }
9
+ /**
10
+ * Returns all user settings for the authenticated user
11
+ */
12
+ export function useListUserSettingsQuery(props, options) {
13
+ return useQuery(['listUserSettings'], ({ signal }) => listUserSettings(Object.assign(Object.assign({}, props), { signal })), options);
14
+ }
@@ -0,0 +1,23 @@
1
+ import { UseMutationOptions } from '@tanstack/react-query';
2
+ import type { HandlerGetMemoryResponse } from '../schemas/HandlerGetMemoryResponse';
3
+ import type { UsererrorError } from '../schemas/UsererrorError';
4
+ import type { HandlerUpdateMemoryRequest } from '../schemas/HandlerUpdateMemoryRequest';
5
+ import type { ResponseWithPagination } from '../helpers';
6
+ import { FetcherOptions } from '../../../../fetcher/index.js';
7
+ export interface UpdateMemoryMutationPathParams {
8
+ memoryId: string;
9
+ }
10
+ export interface UpdateMemoryMutationHeaderParams {
11
+ 'harness-account': string;
12
+ }
13
+ export type UpdateMemoryRequestBody = HandlerUpdateMemoryRequest;
14
+ export type UpdateMemoryOkResponse = ResponseWithPagination<HandlerGetMemoryResponse>;
15
+ export type UpdateMemoryErrorResponse = UsererrorError;
16
+ export interface UpdateMemoryProps extends UpdateMemoryMutationPathParams, Omit<FetcherOptions<unknown, UpdateMemoryRequestBody, UpdateMemoryMutationHeaderParams>, 'url'> {
17
+ body: UpdateMemoryRequestBody;
18
+ }
19
+ export declare function updateMemory(props: UpdateMemoryProps): Promise<UpdateMemoryOkResponse>;
20
+ /**
21
+ * Updates an existing memory by ID
22
+ */
23
+ export declare function useUpdateMemoryMutation(options?: Omit<UseMutationOptions<UpdateMemoryOkResponse, UpdateMemoryErrorResponse, UpdateMemoryProps>, 'mutationKey' | 'mutationFn'>): import("@tanstack/react-query").UseMutationResult<UpdateMemoryOkResponse, UsererrorError, UpdateMemoryProps, unknown>;
@@ -0,0 +1,14 @@
1
+ /* eslint-disable */
2
+ // This code is autogenerated using @harnessio/oats-cli.
3
+ // Please do not modify this code directly.
4
+ import { useMutation } from '@tanstack/react-query';
5
+ import { fetcher } from '../../../../fetcher/index.js';
6
+ export function updateMemory(props) {
7
+ return fetcher(Object.assign({ url: `/api/v1/chat/memory/${props.memoryId}`, method: 'PUT' }, props));
8
+ }
9
+ /**
10
+ * Updates an existing memory by ID
11
+ */
12
+ export function useUpdateMemoryMutation(options) {
13
+ return useMutation((mutateProps) => updateMemory(mutateProps), options);
14
+ }