@harnessio/react-sei-panorama-service-client 0.10.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 (42) hide show
  1. package/README.md +39 -0
  2. package/dist/fetcher/index.d.ts +17 -0
  3. package/dist/fetcher/index.js +65 -0
  4. package/dist/sei-panorama-service/src/index.d.ts +6 -0
  5. package/dist/sei-panorama-service/src/index.js +10 -0
  6. package/dist/sei-panorama-service/src/services/helpers.d.ts +14 -0
  7. package/dist/sei-panorama-service/src/services/helpers.js +1 -0
  8. package/dist/sei-panorama-service/src/services/hooks/useGetCategoriesTreeMutation.d.ts +22 -0
  9. package/dist/sei-panorama-service/src/services/hooks/useGetCategoriesTreeMutation.js +14 -0
  10. package/dist/sei-panorama-service/src/services/hooks/useGetChangeFailureRateMutation.d.ts +19 -0
  11. package/dist/sei-panorama-service/src/services/hooks/useGetChangeFailureRateMutation.js +11 -0
  12. package/dist/sei-panorama-service/src/services/hooks/useGetDeploymentFrequencyMutation.d.ts +19 -0
  13. package/dist/sei-panorama-service/src/services/hooks/useGetDeploymentFrequencyMutation.js +11 -0
  14. package/dist/sei-panorama-service/src/services/hooks/useGetLeadTimeMutation.d.ts +19 -0
  15. package/dist/sei-panorama-service/src/services/hooks/useGetLeadTimeMutation.js +11 -0
  16. package/dist/sei-panorama-service/src/services/hooks/useGetMeanTimeRestoreMutation.d.ts +19 -0
  17. package/dist/sei-panorama-service/src/services/hooks/useGetMeanTimeRestoreMutation.js +11 -0
  18. package/dist/sei-panorama-service/src/services/hooks/useGetMeanTimeRestore_1_1_1_1Mutation.d.ts +19 -0
  19. package/dist/sei-panorama-service/src/services/hooks/useGetMeanTimeRestore_1_1_1_1Mutation.js +11 -0
  20. package/dist/sei-panorama-service/src/services/hooks/useGetTeamCollectionsTree_1Mutation.d.ts +19 -0
  21. package/dist/sei-panorama-service/src/services/hooks/useGetTeamCollectionsTree_1Mutation.js +11 -0
  22. package/dist/sei-panorama-service/src/services/hooks/useGetTeamCollectionsTree_2Mutation.d.ts +23 -0
  23. package/dist/sei-panorama-service/src/services/hooks/useGetTeamCollectionsTree_2Mutation.js +14 -0
  24. package/dist/sei-panorama-service/src/services/hooks/useGetTeamTreeQuery.d.ts +17 -0
  25. package/dist/sei-panorama-service/src/services/hooks/useGetTeamTreeQuery.js +11 -0
  26. package/dist/sei-panorama-service/src/services/hooks/useGetTeamTree_1Query.d.ts +17 -0
  27. package/dist/sei-panorama-service/src/services/hooks/useGetTeamTree_1Query.js +11 -0
  28. package/dist/sei-panorama-service/src/services/index.d.ts +27 -0
  29. package/dist/sei-panorama-service/src/services/index.js +10 -0
  30. package/dist/sei-panorama-service/src/services/schemas/Category.d.ts +4 -0
  31. package/dist/sei-panorama-service/src/services/schemas/Category.js +4 -0
  32. package/dist/sei-panorama-service/src/services/schemas/DataPoint.d.ts +7 -0
  33. package/dist/sei-panorama-service/src/services/schemas/DataPoint.js +4 -0
  34. package/dist/sei-panorama-service/src/services/schemas/DoraMetric.d.ts +31 -0
  35. package/dist/sei-panorama-service/src/services/schemas/DoraMetric.js +1 -0
  36. package/dist/sei-panorama-service/src/services/schemas/DoraRequest.d.ts +24 -0
  37. package/dist/sei-panorama-service/src/services/schemas/DoraRequest.js +4 -0
  38. package/dist/sei-panorama-service/src/services/schemas/Team.d.ts +5 -0
  39. package/dist/sei-panorama-service/src/services/schemas/Team.js +4 -0
  40. package/dist/sei-panorama-service/src/services/schemas/TeamCollectionRequest.d.ts +22 -0
  41. package/dist/sei-panorama-service/src/services/schemas/TeamCollectionRequest.js +4 -0
  42. package/package.json +31 -0
package/README.md ADDED
@@ -0,0 +1,39 @@
1
+ # React SEI Panorama Service Client(WIP)
2
+
3
+ **OpenAPI -> OA**
4
+
5
+ **TypeScript -> TS**
6
+
7
+ **OpenAPI + TypeScript -> OATS**
8
+
9
+ This React API client will store a collection of Harness SEI Panorama Service APIs and Interfaces contracts generated from Open API Spec using `OATS CLI` internally.
10
+ APIs are using hooks from `@tanstack/react-query`
11
+
12
+ ## Steps To Generate API Client build as dist folder
13
+
14
+ ```
15
+ yarn build
16
+ ```
17
+
18
+ ## For NextGen UI adoption : SEIPanoramaServiceAPIClient should be initialized
19
+
20
+ Before using API Client, it must be initilaized with required `ClientCallbacks`.
21
+
22
+ Example:
23
+
24
+ ```
25
+ new SEIPanoramaServiceAPIClient({
26
+ getHeaders: () => {
27
+ return { token: SessionToken.getToken(), 'Harness-Account': accountId }
28
+ }}
29
+ ```
30
+
31
+ ## Versioning
32
+
33
+ ![@harnessio/react-sei-panorama-service-client](https://img.shields.io/npm/v/@harnessio/react-sei-panorama-service-client.svg?style=flat-square)
34
+
35
+ Once development phase is completed, this repo will have changes and versioning driven by API spec only.
36
+
37
+ ## License
38
+
39
+ [MIT](./LICENSE.md). Copyright(c) [Harness Inc](https://harness.io)
@@ -0,0 +1,17 @@
1
+ import type { IStringifyOptions } from 'qs';
2
+ export interface FetcherOptions<TQueryParams = never, TBody = never, THeaderParams = HeadersInit> extends Omit<RequestInit, 'body' | 'headers'> {
3
+ url: string;
4
+ queryParams?: TQueryParams extends never ? undefined : TQueryParams;
5
+ body?: TBody extends never ? undefined : TBody;
6
+ stringifyQueryParamsOptions?: IStringifyOptions;
7
+ headers?: THeaderParams;
8
+ }
9
+ export interface ClientCallbacks {
10
+ responseInterceptor?: (response: Response) => Response;
11
+ requestInterceptor?: (request: Request) => Request;
12
+ urlInterceptor?: (url: string) => string;
13
+ getRequestHeaders?: () => Record<string, any>;
14
+ }
15
+ export declare function setupClient(callbacks: ClientCallbacks): void;
16
+ export declare const updateClientHeaders: (headers: Record<string, any>) => void;
17
+ export declare function fetcher<TResponse = unknown, TQueryParams = never, TBody = never, THeaderParams = HeadersInit>(options: FetcherOptions<TQueryParams, TBody, THeaderParams>): Promise<TResponse>;
@@ -0,0 +1,65 @@
1
+ import { __awaiter, __rest } from "tslib";
2
+ import { stringify } from 'qs';
3
+ const JSON_CONTENT_TYPES = ['application/json'];
4
+ let APIClientInitialized = false;
5
+ let fetcherCallbacks;
6
+ let customHeaders = {
7
+ 'Content-Type': JSON_CONTENT_TYPES[0],
8
+ };
9
+ export function setupClient(callbacks) {
10
+ fetcherCallbacks = callbacks;
11
+ customHeaders = Object.assign(Object.assign({}, customHeaders), ((fetcherCallbacks === null || fetcherCallbacks === void 0 ? void 0 : fetcherCallbacks.getRequestHeaders) ? fetcherCallbacks === null || fetcherCallbacks === void 0 ? void 0 : fetcherCallbacks.getRequestHeaders() : {}));
12
+ APIClientInitialized = true;
13
+ }
14
+ export const updateClientHeaders = (headers) => {
15
+ customHeaders = Object.assign(Object.assign({}, customHeaders), headers);
16
+ };
17
+ export function fetcher(options) {
18
+ var _a, _b;
19
+ return __awaiter(this, void 0, void 0, function* () {
20
+ // If not initialized throw error even without making request
21
+ if (!APIClientInitialized) {
22
+ throw { reason: 'HarnessReactAPIClient has not been initialized' };
23
+ }
24
+ const { stringifyQueryParamsOptions, headers, body, url, queryParams = { account: customHeaders['Harness-Account'] } } = options, rest = __rest(options, ["stringifyQueryParamsOptions", "headers", "body", "url", "queryParams"]);
25
+ const token = customHeaders.token;
26
+ let finalUrl = url;
27
+ if (queryParams) {
28
+ finalUrl += stringify(queryParams, Object.assign(Object.assign({}, stringifyQueryParamsOptions), { addQueryPrefix: true }));
29
+ }
30
+ if (fetcherCallbacks === null || fetcherCallbacks === void 0 ? void 0 : fetcherCallbacks.urlInterceptor) {
31
+ finalUrl = (_a = fetcherCallbacks === null || fetcherCallbacks === void 0 ? void 0 : fetcherCallbacks.urlInterceptor) === null || _a === void 0 ? void 0 : _a.call(fetcherCallbacks, finalUrl);
32
+ }
33
+ let request = new Request(finalUrl, Object.assign({ headers: Object.assign(Object.assign({ Authorization: `Bearer ${token}` }, headers), customHeaders), body: body ? JSON.stringify(body) : undefined }, rest));
34
+ if (fetcherCallbacks === null || fetcherCallbacks === void 0 ? void 0 : fetcherCallbacks.requestInterceptor) {
35
+ request = fetcherCallbacks.requestInterceptor(request.clone());
36
+ }
37
+ let response = yield fetch(request);
38
+ if (fetcherCallbacks === null || fetcherCallbacks === void 0 ? void 0 : fetcherCallbacks.responseInterceptor) {
39
+ response = (_b = fetcherCallbacks === null || fetcherCallbacks === void 0 ? void 0 : fetcherCallbacks.responseInterceptor) === null || _b === void 0 ? void 0 : _b.call(fetcherCallbacks, response.clone());
40
+ }
41
+ const contentType = response.headers.get('Content-Type');
42
+ let total, pageSize, pageNumber, pageCount, pagination;
43
+ try {
44
+ total = response.headers.get('x-total-elements');
45
+ pageSize = response.headers.get('x-page-size');
46
+ pageNumber = response.headers.get('x-page-number');
47
+ pagination = total || pageSize || pageNumber;
48
+ if (pagination) {
49
+ total = Number(total);
50
+ pageSize = Number(pageSize);
51
+ pageCount = Math.ceil(total / pageSize);
52
+ pageNumber = Number(pageNumber);
53
+ }
54
+ }
55
+ catch (e) {
56
+ throw new Error('HarnessReactAPIClient: An error occurred while parsing pagination headers. ' + e);
57
+ }
58
+ const asJson = contentType && JSON_CONTENT_TYPES.some((h) => contentType.startsWith(h));
59
+ const data = yield (asJson ? response.json() : response.text());
60
+ if (response.ok) {
61
+ return Object.assign({ content: data }, (pagination ? { pagination: { total, pageCount, pageSize, pageNumber } } : {}));
62
+ }
63
+ throw data;
64
+ });
65
+ }
@@ -0,0 +1,6 @@
1
+ import { ClientCallbacks } from '../../fetcher';
2
+ export * from './services/index';
3
+ export declare class SEIPanoramaServiceAPIClient {
4
+ updateHeaders: (headers: Record<string, any>) => void;
5
+ constructor(callbacks: ClientCallbacks);
6
+ }
@@ -0,0 +1,10 @@
1
+ import { setupClient, updateClientHeaders } from '../../fetcher';
2
+ export * from './services/index';
3
+ export class SEIPanoramaServiceAPIClient {
4
+ constructor(callbacks) {
5
+ setupClient(callbacks);
6
+ this.updateHeaders = (headers) => {
7
+ updateClientHeaders(headers);
8
+ };
9
+ }
10
+ }
@@ -0,0 +1,14 @@
1
+ export type GetPathParamsType<T> = T extends {
2
+ pathParams: infer R;
3
+ } ? R : never;
4
+ export interface ResponseWithPagination<T> {
5
+ content: T;
6
+ pagination?: {
7
+ total?: number;
8
+ pageSize?: number;
9
+ pageCount?: number;
10
+ pageNumber?: number;
11
+ };
12
+ }
13
+ export type WithOptional<TInput, Tkeys extends keyof TInput> = Omit<TInput, Tkeys> & Partial<Pick<TInput, Tkeys>>;
14
+ export type PickPartial<TInput, Tkeys extends keyof TInput> = Pick<Partial<TInput>, Tkeys>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,22 @@
1
+ import { UseMutationOptions } from '@tanstack/react-query';
2
+ import type { Category } from '../schemas/Category';
3
+ import type { TeamCollectionRequest } from '../schemas/TeamCollectionRequest';
4
+ import type { ResponseWithPagination } from '../helpers';
5
+ import { FetcherOptions } from '../../../../fetcher/index.js';
6
+ export interface GetCategoriesTreeMutationQueryParams {
7
+ company: string;
8
+ projectIdentifier: string;
9
+ orgIdentifier?: string;
10
+ }
11
+ export type GetCategoriesTreeRequestBody = TeamCollectionRequest;
12
+ export type GetCategoriesTreeOkResponse = ResponseWithPagination<Category[]>;
13
+ export type GetCategoriesTreeErrorResponse = unknown;
14
+ export interface GetCategoriesTreeProps extends Omit<FetcherOptions<GetCategoriesTreeMutationQueryParams, GetCategoriesTreeRequestBody>, 'url'> {
15
+ queryParams: GetCategoriesTreeMutationQueryParams;
16
+ body: GetCategoriesTreeRequestBody;
17
+ }
18
+ export declare function getCategoriesTree(props: GetCategoriesTreeProps): Promise<GetCategoriesTreeOkResponse>;
19
+ /**
20
+ * Get categories by passing a worskpace id into the filter
21
+ */
22
+ export declare function useGetCategoriesTreeMutation(options?: Omit<UseMutationOptions<GetCategoriesTreeOkResponse, GetCategoriesTreeErrorResponse, GetCategoriesTreeProps>, 'mutationKey' | 'mutationFn'>): import("@tanstack/react-query").UseMutationResult<GetCategoriesTreeOkResponse, unknown, GetCategoriesTreeProps, 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 getCategoriesTree(props) {
7
+ return fetcher(Object.assign({ url: `/v2/collections/categories`, method: 'POST' }, props));
8
+ }
9
+ /**
10
+ * Get categories by passing a worskpace id into the filter
11
+ */
12
+ export function useGetCategoriesTreeMutation(options) {
13
+ return useMutation((mutateProps) => getCategoriesTree(mutateProps), options);
14
+ }
@@ -0,0 +1,19 @@
1
+ import { UseMutationOptions } from '@tanstack/react-query';
2
+ import type { DoraMetric } from '../schemas/DoraMetric';
3
+ import type { DoraRequest } from '../schemas/DoraRequest';
4
+ import type { ResponseWithPagination } from '../helpers';
5
+ import { FetcherOptions } from '../../../../fetcher/index.js';
6
+ export interface GetChangeFailureRateMutationQueryParams {
7
+ company: string;
8
+ projectIdentifier: string;
9
+ orgIdentifier: string;
10
+ }
11
+ export type GetChangeFailureRateRequestBody = DoraRequest;
12
+ export type GetChangeFailureRateOkResponse = ResponseWithPagination<DoraMetric>;
13
+ export type GetChangeFailureRateErrorResponse = unknown;
14
+ export interface GetChangeFailureRateProps extends Omit<FetcherOptions<GetChangeFailureRateMutationQueryParams, GetChangeFailureRateRequestBody>, 'url'> {
15
+ queryParams: GetChangeFailureRateMutationQueryParams;
16
+ body: GetChangeFailureRateRequestBody;
17
+ }
18
+ export declare function getChangeFailureRate(props: GetChangeFailureRateProps): Promise<GetChangeFailureRateOkResponse>;
19
+ export declare function useGetChangeFailureRateMutation(options?: Omit<UseMutationOptions<GetChangeFailureRateOkResponse, GetChangeFailureRateErrorResponse, GetChangeFailureRateProps>, 'mutationKey' | 'mutationFn'>): import("@tanstack/react-query").UseMutationResult<GetChangeFailureRateOkResponse, unknown, GetChangeFailureRateProps, unknown>;
@@ -0,0 +1,11 @@
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 getChangeFailureRate(props) {
7
+ return fetcher(Object.assign({ url: `/v2/efficiency/dora/changefailurerates`, method: 'POST' }, props));
8
+ }
9
+ export function useGetChangeFailureRateMutation(options) {
10
+ return useMutation((mutateProps) => getChangeFailureRate(mutateProps), options);
11
+ }
@@ -0,0 +1,19 @@
1
+ import { UseMutationOptions } from '@tanstack/react-query';
2
+ import type { DoraMetric } from '../schemas/DoraMetric';
3
+ import type { DoraRequest } from '../schemas/DoraRequest';
4
+ import type { ResponseWithPagination } from '../helpers';
5
+ import { FetcherOptions } from '../../../../fetcher/index.js';
6
+ export interface GetDeploymentFrequencyMutationQueryParams {
7
+ company: string;
8
+ projectIdentifier: string;
9
+ orgIdentifier: string;
10
+ }
11
+ export type GetDeploymentFrequencyRequestBody = DoraRequest;
12
+ export type GetDeploymentFrequencyOkResponse = ResponseWithPagination<DoraMetric>;
13
+ export type GetDeploymentFrequencyErrorResponse = unknown;
14
+ export interface GetDeploymentFrequencyProps extends Omit<FetcherOptions<GetDeploymentFrequencyMutationQueryParams, GetDeploymentFrequencyRequestBody>, 'url'> {
15
+ queryParams: GetDeploymentFrequencyMutationQueryParams;
16
+ body: GetDeploymentFrequencyRequestBody;
17
+ }
18
+ export declare function getDeploymentFrequency(props: GetDeploymentFrequencyProps): Promise<GetDeploymentFrequencyOkResponse>;
19
+ export declare function useGetDeploymentFrequencyMutation(options?: Omit<UseMutationOptions<GetDeploymentFrequencyOkResponse, GetDeploymentFrequencyErrorResponse, GetDeploymentFrequencyProps>, 'mutationKey' | 'mutationFn'>): import("@tanstack/react-query").UseMutationResult<GetDeploymentFrequencyOkResponse, unknown, GetDeploymentFrequencyProps, unknown>;
@@ -0,0 +1,11 @@
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 getDeploymentFrequency(props) {
7
+ return fetcher(Object.assign({ url: `/v2/efficiency/dora/deploymentfrequency`, method: 'POST' }, props));
8
+ }
9
+ export function useGetDeploymentFrequencyMutation(options) {
10
+ return useMutation((mutateProps) => getDeploymentFrequency(mutateProps), options);
11
+ }
@@ -0,0 +1,19 @@
1
+ import { UseMutationOptions } from '@tanstack/react-query';
2
+ import type { DoraMetric } from '../schemas/DoraMetric';
3
+ import type { DoraRequest } from '../schemas/DoraRequest';
4
+ import type { ResponseWithPagination } from '../helpers';
5
+ import { FetcherOptions } from '../../../../fetcher/index.js';
6
+ export interface GetLeadTimeMutationQueryParams {
7
+ company: string;
8
+ projectIdentifier: string;
9
+ orgIdentifier: string;
10
+ }
11
+ export type GetLeadTimeRequestBody = DoraRequest;
12
+ export type GetLeadTimeOkResponse = ResponseWithPagination<DoraMetric>;
13
+ export type GetLeadTimeErrorResponse = unknown;
14
+ export interface GetLeadTimeProps extends Omit<FetcherOptions<GetLeadTimeMutationQueryParams, GetLeadTimeRequestBody>, 'url'> {
15
+ queryParams: GetLeadTimeMutationQueryParams;
16
+ body: GetLeadTimeRequestBody;
17
+ }
18
+ export declare function getLeadTime(props: GetLeadTimeProps): Promise<GetLeadTimeOkResponse>;
19
+ export declare function useGetLeadTimeMutation(options?: Omit<UseMutationOptions<GetLeadTimeOkResponse, GetLeadTimeErrorResponse, GetLeadTimeProps>, 'mutationKey' | 'mutationFn'>): import("@tanstack/react-query").UseMutationResult<GetLeadTimeOkResponse, unknown, GetLeadTimeProps, unknown>;
@@ -0,0 +1,11 @@
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 getLeadTime(props) {
7
+ return fetcher(Object.assign({ url: `/v2/efficiency/dora/leadtime`, method: 'POST' }, props));
8
+ }
9
+ export function useGetLeadTimeMutation(options) {
10
+ return useMutation((mutateProps) => getLeadTime(mutateProps), options);
11
+ }
@@ -0,0 +1,19 @@
1
+ import { UseMutationOptions } from '@tanstack/react-query';
2
+ import type { DoraMetric } from '../schemas/DoraMetric';
3
+ import type { DoraRequest } from '../schemas/DoraRequest';
4
+ import type { ResponseWithPagination } from '../helpers';
5
+ import { FetcherOptions } from '../../../../fetcher/index.js';
6
+ export interface GetMeanTimeRestoreMutationQueryParams {
7
+ company: string;
8
+ projectIdentifier: string;
9
+ orgIdentifier: string;
10
+ }
11
+ export type GetMeanTimeRestoreRequestBody = DoraRequest;
12
+ export type GetMeanTimeRestoreOkResponse = ResponseWithPagination<DoraMetric>;
13
+ export type GetMeanTimeRestoreErrorResponse = unknown;
14
+ export interface GetMeanTimeRestoreProps extends Omit<FetcherOptions<GetMeanTimeRestoreMutationQueryParams, GetMeanTimeRestoreRequestBody>, 'url'> {
15
+ queryParams: GetMeanTimeRestoreMutationQueryParams;
16
+ body: GetMeanTimeRestoreRequestBody;
17
+ }
18
+ export declare function getMeanTimeRestore(props: GetMeanTimeRestoreProps): Promise<GetMeanTimeRestoreOkResponse>;
19
+ export declare function useGetMeanTimeRestoreMutation(options?: Omit<UseMutationOptions<GetMeanTimeRestoreOkResponse, GetMeanTimeRestoreErrorResponse, GetMeanTimeRestoreProps>, 'mutationKey' | 'mutationFn'>): import("@tanstack/react-query").UseMutationResult<GetMeanTimeRestoreOkResponse, unknown, GetMeanTimeRestoreProps, unknown>;
@@ -0,0 +1,11 @@
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 getMeanTimeRestore(props) {
7
+ return fetcher(Object.assign({ url: `/v2/efficiency/dora/meantimerestore`, method: 'POST' }, props));
8
+ }
9
+ export function useGetMeanTimeRestoreMutation(options) {
10
+ return useMutation((mutateProps) => getMeanTimeRestore(mutateProps), options);
11
+ }
@@ -0,0 +1,19 @@
1
+ import { UseMutationOptions } from '@tanstack/react-query';
2
+ import type { DoraMetric } from '../schemas/DoraMetric';
3
+ import type { DoraRequest } from '../schemas/DoraRequest';
4
+ import type { ResponseWithPagination } from '../helpers';
5
+ import { FetcherOptions } from '../../../../fetcher/index.js';
6
+ export interface GetMeanTimeRestore_1_1_1_1MutationQueryParams {
7
+ company: string;
8
+ projectIdentifier: string;
9
+ orgIdentifier: string;
10
+ }
11
+ export type GetMeanTimeRestore_1_1_1_1RequestBody = DoraRequest;
12
+ export type GetMeanTimeRestore_1_1_1_1OkResponse = ResponseWithPagination<DoraMetric>;
13
+ export type GetMeanTimeRestore_1_1_1_1ErrorResponse = unknown;
14
+ export interface GetMeanTimeRestore_1_1_1_1Props extends Omit<FetcherOptions<GetMeanTimeRestore_1_1_1_1MutationQueryParams, GetMeanTimeRestore_1_1_1_1RequestBody>, 'url'> {
15
+ queryParams: GetMeanTimeRestore_1_1_1_1MutationQueryParams;
16
+ body: GetMeanTimeRestore_1_1_1_1RequestBody;
17
+ }
18
+ export declare function getMeanTimeRestore_1_1_1_1(props: GetMeanTimeRestore_1_1_1_1Props): Promise<GetMeanTimeRestore_1_1_1_1OkResponse>;
19
+ export declare function useGetMeanTimeRestore_1_1_1_1Mutation(options?: Omit<UseMutationOptions<GetMeanTimeRestore_1_1_1_1OkResponse, GetMeanTimeRestore_1_1_1_1ErrorResponse, GetMeanTimeRestore_1_1_1_1Props>, 'mutationKey' | 'mutationFn'>): import("@tanstack/react-query").UseMutationResult<GetMeanTimeRestore_1_1_1_1OkResponse, unknown, GetMeanTimeRestore_1_1_1_1Props, unknown>;
@@ -0,0 +1,11 @@
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 getMeanTimeRestore_1_1_1_1(props) {
7
+ return fetcher(Object.assign({ url: `/v2/efficiency/dora`, method: 'POST' }, props));
8
+ }
9
+ export function useGetMeanTimeRestore_1_1_1_1Mutation(options) {
10
+ return useMutation((mutateProps) => getMeanTimeRestore_1_1_1_1(mutateProps), options);
11
+ }
@@ -0,0 +1,19 @@
1
+ import { UseMutationOptions } from '@tanstack/react-query';
2
+ import type { Team } from '../schemas/Team';
3
+ import type { TeamCollectionRequest } from '../schemas/TeamCollectionRequest';
4
+ import type { ResponseWithPagination } from '../helpers';
5
+ import { FetcherOptions } from '../../../../fetcher/index.js';
6
+ export interface GetTeamCollectionsTree_1MutationQueryParams {
7
+ company: string;
8
+ projectIdentifier: string;
9
+ orgIdentifier?: string;
10
+ }
11
+ export type GetTeamCollectionsTree_1RequestBody = TeamCollectionRequest;
12
+ export type GetTeamCollectionsTree_1OkResponse = ResponseWithPagination<Team[]>;
13
+ export type GetTeamCollectionsTree_1ErrorResponse = unknown;
14
+ export interface GetTeamCollectionsTree_1Props extends Omit<FetcherOptions<GetTeamCollectionsTree_1MutationQueryParams, GetTeamCollectionsTree_1RequestBody>, 'url'> {
15
+ queryParams: GetTeamCollectionsTree_1MutationQueryParams;
16
+ body: GetTeamCollectionsTree_1RequestBody;
17
+ }
18
+ export declare function getTeamCollectionsTree_1(props: GetTeamCollectionsTree_1Props): Promise<GetTeamCollectionsTree_1OkResponse>;
19
+ export declare function useGetTeamCollectionsTree_1Mutation(options?: Omit<UseMutationOptions<GetTeamCollectionsTree_1OkResponse, GetTeamCollectionsTree_1ErrorResponse, GetTeamCollectionsTree_1Props>, 'mutationKey' | 'mutationFn'>): import("@tanstack/react-query").UseMutationResult<GetTeamCollectionsTree_1OkResponse, unknown, GetTeamCollectionsTree_1Props, unknown>;
@@ -0,0 +1,11 @@
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 getTeamCollectionsTree_1(props) {
7
+ return fetcher(Object.assign({ url: `/v2/collections/teams`, method: 'POST' }, props));
8
+ }
9
+ export function useGetTeamCollectionsTree_1Mutation(options) {
10
+ return useMutation((mutateProps) => getTeamCollectionsTree_1(mutateProps), options);
11
+ }
@@ -0,0 +1,23 @@
1
+ import { UseMutationOptions } from '@tanstack/react-query';
2
+ import type { Category } from '../schemas/Category';
3
+ import type { Team } from '../schemas/Team';
4
+ import type { TeamCollectionRequest } from '../schemas/TeamCollectionRequest';
5
+ import type { ResponseWithPagination } from '../helpers';
6
+ import { FetcherOptions } from '../../../../fetcher/index.js';
7
+ export interface GetTeamCollectionsTree_2MutationQueryParams {
8
+ company: string;
9
+ projectIdentifier: string;
10
+ orgIdentifier?: string;
11
+ }
12
+ export type GetTeamCollectionsTree_2RequestBody = TeamCollectionRequest;
13
+ export type GetTeamCollectionsTree_2OkResponse = ResponseWithPagination<Category[] & Team[]>;
14
+ export type GetTeamCollectionsTree_2ErrorResponse = unknown;
15
+ export interface GetTeamCollectionsTree_2Props extends Omit<FetcherOptions<GetTeamCollectionsTree_2MutationQueryParams, GetTeamCollectionsTree_2RequestBody>, 'url'> {
16
+ queryParams: GetTeamCollectionsTree_2MutationQueryParams;
17
+ body: GetTeamCollectionsTree_2RequestBody;
18
+ }
19
+ export declare function getTeamCollectionsTree_2(props: GetTeamCollectionsTree_2Props): Promise<GetTeamCollectionsTree_2OkResponse>;
20
+ /**
21
+ * Get categories by passing a worskpace id into the filter
22
+ */
23
+ export declare function useGetTeamCollectionsTree_2Mutation(options?: Omit<UseMutationOptions<GetTeamCollectionsTree_2OkResponse, GetTeamCollectionsTree_2ErrorResponse, GetTeamCollectionsTree_2Props>, 'mutationKey' | 'mutationFn'>): import("@tanstack/react-query").UseMutationResult<GetTeamCollectionsTree_2OkResponse, unknown, GetTeamCollectionsTree_2Props, 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 getTeamCollectionsTree_2(props) {
7
+ return fetcher(Object.assign({ url: `/v2/collections`, method: 'POST' }, props));
8
+ }
9
+ /**
10
+ * Get categories by passing a worskpace id into the filter
11
+ */
12
+ export function useGetTeamCollectionsTree_2Mutation(options) {
13
+ return useMutation((mutateProps) => getTeamCollectionsTree_2(mutateProps), options);
14
+ }
@@ -0,0 +1,17 @@
1
+ import { UseQueryOptions } from '@tanstack/react-query';
2
+ import type { Team } from '../schemas/Team';
3
+ import type { ResponseWithPagination } from '../helpers';
4
+ import { FetcherOptions } from '../../../../fetcher/index.js';
5
+ export interface GetTeamTreeQueryQueryParams {
6
+ select?: string;
7
+ filter?: string;
8
+ offset?: string;
9
+ limit?: string;
10
+ }
11
+ export type GetTeamTreeOkResponse = ResponseWithPagination<Team[]>;
12
+ export type GetTeamTreeErrorResponse = unknown;
13
+ export interface GetTeamTreeProps extends Omit<FetcherOptions<GetTeamTreeQueryQueryParams, unknown>, 'url'> {
14
+ queryParams: GetTeamTreeQueryQueryParams;
15
+ }
16
+ export declare function getTeamTree(props: GetTeamTreeProps): Promise<GetTeamTreeOkResponse>;
17
+ export declare function useGetTeamTreeQuery(props: GetTeamTreeProps, options?: Omit<UseQueryOptions<GetTeamTreeOkResponse, GetTeamTreeErrorResponse>, 'queryKey' | 'queryFn'>): import("@tanstack/react-query").UseQueryResult<GetTeamTreeOkResponse, unknown>;
@@ -0,0 +1,11 @@
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 getTeamTree(props) {
7
+ return fetcher(Object.assign({ url: `/v2/teams/`, method: 'GET' }, props));
8
+ }
9
+ export function useGetTeamTreeQuery(props, options) {
10
+ return useQuery(['getTeamTree', props.queryParams], ({ signal }) => getTeamTree(Object.assign(Object.assign({}, props), { signal })), options);
11
+ }
@@ -0,0 +1,17 @@
1
+ import { UseQueryOptions } from '@tanstack/react-query';
2
+ import type { Team } from '../schemas/Team';
3
+ import type { ResponseWithPagination } from '../helpers';
4
+ import { FetcherOptions } from '../../../../fetcher/index.js';
5
+ export interface GetTeamTree_1QueryQueryParams {
6
+ select?: string;
7
+ filter?: string;
8
+ offset?: string;
9
+ limit?: string;
10
+ }
11
+ export type GetTeamTree_1OkResponse = ResponseWithPagination<Team[]>;
12
+ export type GetTeamTree_1ErrorResponse = unknown;
13
+ export interface GetTeamTree_1Props extends Omit<FetcherOptions<GetTeamTree_1QueryQueryParams, unknown>, 'url'> {
14
+ queryParams: GetTeamTree_1QueryQueryParams;
15
+ }
16
+ export declare function getTeamTree_1(props: GetTeamTree_1Props): Promise<GetTeamTree_1OkResponse>;
17
+ export declare function useGetTeamTree_1Query(props: GetTeamTree_1Props, options?: Omit<UseQueryOptions<GetTeamTree_1OkResponse, GetTeamTree_1ErrorResponse>, 'queryKey' | 'queryFn'>): import("@tanstack/react-query").UseQueryResult<GetTeamTree_1OkResponse, unknown>;
@@ -0,0 +1,11 @@
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 getTeamTree_1(props) {
7
+ return fetcher(Object.assign({ url: `/v2/teams`, method: 'GET' }, props));
8
+ }
9
+ export function useGetTeamTree_1Query(props, options) {
10
+ return useQuery(['getTeamTree_1', props.queryParams], ({ signal }) => getTeamTree_1(Object.assign(Object.assign({}, props), { signal })), options);
11
+ }
@@ -0,0 +1,27 @@
1
+ export type { GetPathParamsType, ResponseWithPagination } from './helpers';
2
+ export type { GetCategoriesTreeErrorResponse, GetCategoriesTreeMutationQueryParams, GetCategoriesTreeOkResponse, GetCategoriesTreeProps, GetCategoriesTreeRequestBody, } from './hooks/useGetCategoriesTreeMutation';
3
+ export { getCategoriesTree, useGetCategoriesTreeMutation, } from './hooks/useGetCategoriesTreeMutation';
4
+ export type { GetChangeFailureRateErrorResponse, GetChangeFailureRateMutationQueryParams, GetChangeFailureRateOkResponse, GetChangeFailureRateProps, GetChangeFailureRateRequestBody, } from './hooks/useGetChangeFailureRateMutation';
5
+ export { getChangeFailureRate, useGetChangeFailureRateMutation, } from './hooks/useGetChangeFailureRateMutation';
6
+ export type { GetDeploymentFrequencyErrorResponse, GetDeploymentFrequencyMutationQueryParams, GetDeploymentFrequencyOkResponse, GetDeploymentFrequencyProps, GetDeploymentFrequencyRequestBody, } from './hooks/useGetDeploymentFrequencyMutation';
7
+ export { getDeploymentFrequency, useGetDeploymentFrequencyMutation, } from './hooks/useGetDeploymentFrequencyMutation';
8
+ export type { GetLeadTimeErrorResponse, GetLeadTimeMutationQueryParams, GetLeadTimeOkResponse, GetLeadTimeProps, GetLeadTimeRequestBody, } from './hooks/useGetLeadTimeMutation';
9
+ export { getLeadTime, useGetLeadTimeMutation } from './hooks/useGetLeadTimeMutation';
10
+ export type { GetMeanTimeRestoreErrorResponse, GetMeanTimeRestoreMutationQueryParams, GetMeanTimeRestoreOkResponse, GetMeanTimeRestoreProps, GetMeanTimeRestoreRequestBody, } from './hooks/useGetMeanTimeRestoreMutation';
11
+ export { getMeanTimeRestore, useGetMeanTimeRestoreMutation, } from './hooks/useGetMeanTimeRestoreMutation';
12
+ export type { GetMeanTimeRestore_1_1_1_1ErrorResponse, GetMeanTimeRestore_1_1_1_1MutationQueryParams, GetMeanTimeRestore_1_1_1_1OkResponse, GetMeanTimeRestore_1_1_1_1Props, GetMeanTimeRestore_1_1_1_1RequestBody, } from './hooks/useGetMeanTimeRestore_1_1_1_1Mutation';
13
+ export { getMeanTimeRestore_1_1_1_1, useGetMeanTimeRestore_1_1_1_1Mutation, } from './hooks/useGetMeanTimeRestore_1_1_1_1Mutation';
14
+ export type { GetTeamCollectionsTree_1ErrorResponse, GetTeamCollectionsTree_1MutationQueryParams, GetTeamCollectionsTree_1OkResponse, GetTeamCollectionsTree_1Props, GetTeamCollectionsTree_1RequestBody, } from './hooks/useGetTeamCollectionsTree_1Mutation';
15
+ export { getTeamCollectionsTree_1, useGetTeamCollectionsTree_1Mutation, } from './hooks/useGetTeamCollectionsTree_1Mutation';
16
+ export type { GetTeamCollectionsTree_2ErrorResponse, GetTeamCollectionsTree_2MutationQueryParams, GetTeamCollectionsTree_2OkResponse, GetTeamCollectionsTree_2Props, GetTeamCollectionsTree_2RequestBody, } from './hooks/useGetTeamCollectionsTree_2Mutation';
17
+ export { getTeamCollectionsTree_2, useGetTeamCollectionsTree_2Mutation, } from './hooks/useGetTeamCollectionsTree_2Mutation';
18
+ export type { GetTeamTreeErrorResponse, GetTeamTreeOkResponse, GetTeamTreeProps, GetTeamTreeQueryQueryParams, } from './hooks/useGetTeamTreeQuery';
19
+ export { getTeamTree, useGetTeamTreeQuery } from './hooks/useGetTeamTreeQuery';
20
+ export type { GetTeamTree_1ErrorResponse, GetTeamTree_1OkResponse, GetTeamTree_1Props, GetTeamTree_1QueryQueryParams, } from './hooks/useGetTeamTree_1Query';
21
+ export { getTeamTree_1, useGetTeamTree_1Query } from './hooks/useGetTeamTree_1Query';
22
+ export type { Category } from './schemas/Category';
23
+ export type { DataPoint } from './schemas/DataPoint';
24
+ export type { DoraMetric } from './schemas/DoraMetric';
25
+ export type { DoraRequest } from './schemas/DoraRequest';
26
+ export type { Team } from './schemas/Team';
27
+ export type { TeamCollectionRequest } from './schemas/TeamCollectionRequest';
@@ -0,0 +1,10 @@
1
+ export { getCategoriesTree, useGetCategoriesTreeMutation, } from './hooks/useGetCategoriesTreeMutation';
2
+ export { getChangeFailureRate, useGetChangeFailureRateMutation, } from './hooks/useGetChangeFailureRateMutation';
3
+ export { getDeploymentFrequency, useGetDeploymentFrequencyMutation, } from './hooks/useGetDeploymentFrequencyMutation';
4
+ export { getLeadTime, useGetLeadTimeMutation } from './hooks/useGetLeadTimeMutation';
5
+ export { getMeanTimeRestore, useGetMeanTimeRestoreMutation, } from './hooks/useGetMeanTimeRestoreMutation';
6
+ export { getMeanTimeRestore_1_1_1_1, useGetMeanTimeRestore_1_1_1_1Mutation, } from './hooks/useGetMeanTimeRestore_1_1_1_1Mutation';
7
+ export { getTeamCollectionsTree_1, useGetTeamCollectionsTree_1Mutation, } from './hooks/useGetTeamCollectionsTree_1Mutation';
8
+ export { getTeamCollectionsTree_2, useGetTeamCollectionsTree_2Mutation, } from './hooks/useGetTeamCollectionsTree_2Mutation';
9
+ export { getTeamTree, useGetTeamTreeQuery } from './hooks/useGetTeamTreeQuery';
10
+ export { getTeamTree_1, useGetTeamTree_1Query } from './hooks/useGetTeamTree_1Query';
@@ -0,0 +1,4 @@
1
+ export interface Category {
2
+ id?: string;
3
+ name?: string;
4
+ }
@@ -0,0 +1,4 @@
1
+ /* eslint-disable */
2
+ // This code is autogenerated using @harnessio/oats-cli.
3
+ // Please do not modify this code directly.
4
+ export {};
@@ -0,0 +1,7 @@
1
+ export interface DataPoint {
2
+ /**
3
+ * @format double
4
+ */
5
+ value?: number;
6
+ x_axis_label?: string;
7
+ }
@@ -0,0 +1,4 @@
1
+ /* eslint-disable */
2
+ // This code is autogenerated using @harnessio/oats-cli.
3
+ // Please do not modify this code directly.
4
+ export {};
@@ -0,0 +1,31 @@
1
+ import type { DataPoint } from '../schemas/DataPoint';
2
+ export interface DoraMetric {
3
+ /**
4
+ * @format int32
5
+ */
6
+ benchmarkScore?: number;
7
+ /**
8
+ * @format int32
9
+ */
10
+ benchmark_score?: number;
11
+ dataPoints?: DataPoint[];
12
+ data_points?: DataPoint[];
13
+ /**
14
+ * @format double
15
+ */
16
+ overallPercentage?: number;
17
+ overallRating?: string;
18
+ /**
19
+ * @format int32
20
+ */
21
+ overallTime?: number;
22
+ /**
23
+ * @format double
24
+ */
25
+ overall_percentage?: number;
26
+ overall_rating?: string;
27
+ /**
28
+ * @format int32
29
+ */
30
+ overall_time?: number;
31
+ }
@@ -0,0 +1,24 @@
1
+ export interface DoraRequest {
2
+ collection_id?: string;
3
+ date_range?: string;
4
+ /**
5
+ * Filter your result set - eg: filter:{categoryId: ["60d8e808-5070-48bb-9002-2f1fcf659820"]}
6
+ */
7
+ filter?: string;
8
+ /**
9
+ * integer value to indicate which page should be loaded. If blank then no pagination
10
+ * @format int32
11
+ */
12
+ page?: number;
13
+ /**
14
+ * integer value to indicate how many records to be loaded per page. If blank then no pagination
15
+ * @format int32
16
+ */
17
+ page_size?: number;
18
+ select?: string;
19
+ /**
20
+ * Total number of records available
21
+ * @format int64
22
+ */
23
+ total_count?: number;
24
+ }
@@ -0,0 +1,4 @@
1
+ /* eslint-disable */
2
+ // This code is autogenerated using @harnessio/oats-cli.
3
+ // Please do not modify this code directly.
4
+ export {};
@@ -0,0 +1,5 @@
1
+ export interface Team {
2
+ children?: Team[];
3
+ id?: string;
4
+ name?: string;
5
+ }
@@ -0,0 +1,4 @@
1
+ /* eslint-disable */
2
+ // This code is autogenerated using @harnessio/oats-cli.
3
+ // Please do not modify this code directly.
4
+ export {};
@@ -0,0 +1,22 @@
1
+ export interface TeamCollectionRequest {
2
+ /**
3
+ * Filter your result set - eg: filter:{categoryId: ["60d8e808-5070-48bb-9002-2f1fcf659820"]}
4
+ */
5
+ filter?: string;
6
+ /**
7
+ * integer value to indicate which page should be loaded. If blank then no pagination
8
+ * @format int32
9
+ */
10
+ page?: number;
11
+ /**
12
+ * integer value to indicate how many records to be loaded per page. If blank then no pagination
13
+ * @format int32
14
+ */
15
+ page_size?: number;
16
+ select?: string;
17
+ /**
18
+ * Total number of records available
19
+ * @format int64
20
+ */
21
+ total_count?: number;
22
+ }
@@ -0,0 +1,4 @@
1
+ /* eslint-disable */
2
+ // This code is autogenerated using @harnessio/oats-cli.
3
+ // Please do not modify this code directly.
4
+ export {};
package/package.json ADDED
@@ -0,0 +1,31 @@
1
+ {
2
+ "name": "@harnessio/react-sei-panorama-service-client",
3
+ "version": "0.10.0",
4
+ "description": "Harness React sei panorama service client - SEI Panorama APIs integrated with react hooks for Panorama project",
5
+ "author": "Harness Inc",
6
+ "license": "MIT",
7
+ "source": "src/sei-panorama-service/src/index.ts",
8
+ "main": "./dist/sei-panorama-service/src/index.js",
9
+ "exports": {
10
+ ".": "./dist/sei-panorama-service/src/index.js"
11
+ },
12
+ "types": "./dist/sei-panorama-service/src/index.d.ts",
13
+ "files": [
14
+ "dist/*"
15
+ ],
16
+ "homepage": "https://github.com/harness/react-api-client",
17
+ "repository": {
18
+ "type": "git",
19
+ "url": "https://github.com/harness/react-api-client.git"
20
+ },
21
+ "bugs": {
22
+ "url": "https://github.com/harness/react-api-client/issues"
23
+ },
24
+ "keywords": [],
25
+ "scripts": {
26
+ "prebuild": "rimraf dist",
27
+ "build": "yarn generate && tsc",
28
+ "generate": "oats import --config='./oats.config.ts'",
29
+ "fmt": "prettier --write ./index.ts"
30
+ }
31
+ }