@harnessio/react-template-service-client 0.7.0 → 0.9.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 (39) hide show
  1. package/dist/fetcher/index.js +1 -1
  2. package/dist/template-service/src/services/hooks/useDeleteEntityTemplateReferencesMutation.d.ts +34 -0
  3. package/dist/template-service/src/services/hooks/useDeleteEntityTemplateReferencesMutation.js +14 -0
  4. package/dist/template-service/src/services/hooks/useGetEntityTemplateReferencesQuery.d.ts +37 -0
  5. package/dist/template-service/src/services/hooks/useGetEntityTemplateReferencesQuery.js +14 -0
  6. package/dist/template-service/src/services/hooks/useGetTemplatesListAccQuery.d.ts +6 -0
  7. package/dist/template-service/src/services/index.d.ts +18 -0
  8. package/dist/template-service/src/services/index.js +2 -0
  9. package/dist/template-service/src/services/requestBodies/TemplateReferenceRequestBodyRequestBody.d.ts +2 -0
  10. package/dist/template-service/src/services/requestBodies/TemplateReferenceRequestBodyRequestBody.js +1 -0
  11. package/dist/template-service/src/services/requestBodies/UpsertEntityTemplateReferencesRequestBodyRequestBody.d.ts +2 -0
  12. package/dist/template-service/src/services/requestBodies/UpsertEntityTemplateReferencesRequestBodyRequestBody.js +1 -0
  13. package/dist/template-service/src/services/responses/EntityTemplateReferencesResponseResponse.d.ts +2 -0
  14. package/dist/template-service/src/services/responses/EntityTemplateReferencesResponseResponse.js +1 -0
  15. package/dist/template-service/src/services/schemas/EntityGitDetails.d.ts +21 -1
  16. package/dist/template-service/src/services/schemas/EntityTemplateReferencesResponse.d.ts +10 -0
  17. package/dist/template-service/src/services/schemas/EntityTemplateReferencesResponse.js +1 -0
  18. package/dist/template-service/src/services/schemas/GovernanceStatus.d.ts +4 -0
  19. package/dist/template-service/src/services/schemas/GovernanceStatus.js +4 -0
  20. package/dist/template-service/src/services/schemas/ReferencedTemplateMetadata.d.ts +65 -0
  21. package/dist/template-service/src/services/schemas/ReferencedTemplateMetadata.js +4 -0
  22. package/dist/template-service/src/services/schemas/TemplateGovernanceMetadata.d.ts +20 -0
  23. package/dist/template-service/src/services/schemas/TemplateGovernanceMetadata.js +1 -0
  24. package/dist/template-service/src/services/schemas/TemplateGovernancePolicy.d.ts +31 -0
  25. package/dist/template-service/src/services/schemas/TemplateGovernancePolicy.js +1 -0
  26. package/dist/template-service/src/services/schemas/TemplateGovernancePolicySet.d.ts +32 -0
  27. package/dist/template-service/src/services/schemas/TemplateGovernancePolicySet.js +1 -0
  28. package/dist/template-service/src/services/schemas/TemplateMetadataFilterExpression.d.ts +10 -0
  29. package/dist/template-service/src/services/schemas/TemplateMetadataFilterExpression.js +1 -0
  30. package/dist/template-service/src/services/schemas/TemplateMetadataLogicalFilter.d.ts +22 -0
  31. package/dist/template-service/src/services/schemas/TemplateMetadataLogicalFilter.js +1 -0
  32. package/dist/template-service/src/services/schemas/TemplateMetadataPropertyFilter.d.ts +12 -0
  33. package/dist/template-service/src/services/schemas/TemplateMetadataPropertyFilter.js +4 -0
  34. package/dist/template-service/src/services/schemas/TemplateReferenceRequest.d.ts +18 -0
  35. package/dist/template-service/src/services/schemas/TemplateReferenceRequest.js +1 -0
  36. package/dist/template-service/src/services/schemas/TemplateResponse.d.ts +2 -0
  37. package/dist/template-service/src/services/schemas/UpsertEntityTemplateReferencesRequestBody.d.ts +15 -0
  38. package/dist/template-service/src/services/schemas/UpsertEntityTemplateReferencesRequestBody.js +1 -0
  39. package/package.json +1 -1
@@ -30,7 +30,7 @@ export function fetcher(options) {
30
30
  if (fetcherCallbacks === null || fetcherCallbacks === void 0 ? void 0 : fetcherCallbacks.urlInterceptor) {
31
31
  finalUrl = (_a = fetcherCallbacks === null || fetcherCallbacks === void 0 ? void 0 : fetcherCallbacks.urlInterceptor) === null || _a === void 0 ? void 0 : _a.call(fetcherCallbacks, finalUrl);
32
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));
33
+ let request = new Request(finalUrl, Object.assign({ headers: Object.assign(Object.assign(Object.assign({}, (token ? { Authorization: `Bearer ${token}` } : {})), headers), customHeaders), body: body ? JSON.stringify(body) : undefined }, rest));
34
34
  if (fetcherCallbacks === null || fetcherCallbacks === void 0 ? void 0 : fetcherCallbacks.requestInterceptor) {
35
35
  request = fetcherCallbacks.requestInterceptor(request.clone());
36
36
  }
@@ -0,0 +1,34 @@
1
+ import { UseMutationOptions } from '@tanstack/react-query';
2
+ import type { ResponseWithPagination } from '../helpers';
3
+ import { FetcherOptions } from '../../../../fetcher/index.js';
4
+ export interface DeleteEntityTemplateReferencesMutationQueryParams {
5
+ org?: string;
6
+ project?: string;
7
+ identifier: string;
8
+ entity_type: 'PIPELINE' | 'TEMPLATE';
9
+ repo_identifier?: string;
10
+ branch_name?: string;
11
+ file_path?: string;
12
+ object_id?: string;
13
+ repo_name?: string;
14
+ commit_id?: string;
15
+ file_url?: string;
16
+ repo_url?: string;
17
+ root_folder?: string;
18
+ parent_entity_connector_ref?: string;
19
+ parent_entity_repo_name?: string;
20
+ is_harness_code_repo?: boolean;
21
+ }
22
+ export interface DeleteEntityTemplateReferencesMutationHeaderParams {
23
+ 'Harness-Account'?: string;
24
+ }
25
+ export type DeleteEntityTemplateReferencesOkResponse = ResponseWithPagination<unknown>;
26
+ export type DeleteEntityTemplateReferencesErrorResponse = unknown;
27
+ export interface DeleteEntityTemplateReferencesProps extends Omit<FetcherOptions<DeleteEntityTemplateReferencesMutationQueryParams, unknown, DeleteEntityTemplateReferencesMutationHeaderParams>, 'url'> {
28
+ queryParams: DeleteEntityTemplateReferencesMutationQueryParams;
29
+ }
30
+ export declare function deleteEntityTemplateReferences(props: DeleteEntityTemplateReferencesProps): Promise<DeleteEntityTemplateReferencesOkResponse>;
31
+ /**
32
+ * Deletes template references for a pipeline or template entity. Called by pipeline-service or template-service internally.
33
+ */
34
+ export declare function useDeleteEntityTemplateReferencesMutation(options?: Omit<UseMutationOptions<DeleteEntityTemplateReferencesOkResponse, DeleteEntityTemplateReferencesErrorResponse, DeleteEntityTemplateReferencesProps>, 'mutationKey' | 'mutationFn'>): import("@tanstack/react-query").UseMutationResult<DeleteEntityTemplateReferencesOkResponse, unknown, DeleteEntityTemplateReferencesProps, 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 deleteEntityTemplateReferences(props) {
7
+ return fetcher(Object.assign({ url: `/v1/entity-template-references`, method: 'DELETE' }, props));
8
+ }
9
+ /**
10
+ * Deletes template references for a pipeline or template entity. Called by pipeline-service or template-service internally.
11
+ */
12
+ export function useDeleteEntityTemplateReferencesMutation(options) {
13
+ return useMutation((mutateProps) => deleteEntityTemplateReferences(mutateProps), options);
14
+ }
@@ -0,0 +1,37 @@
1
+ import { UseQueryOptions } from '@tanstack/react-query';
2
+ import type { EntityTemplateReferencesResponseResponse } from '../responses/EntityTemplateReferencesResponseResponse';
3
+ import type { ResponseWithPagination } from '../helpers';
4
+ import { FetcherOptions } from '../../../../fetcher/index.js';
5
+ export interface GetEntityTemplateReferencesQueryPathParams {
6
+ identifier: string;
7
+ }
8
+ export interface GetEntityTemplateReferencesQueryQueryParams {
9
+ org?: string;
10
+ project?: string;
11
+ entity_type: 'PIPELINE' | 'TEMPLATE';
12
+ repo_identifier?: string;
13
+ branch_name?: string;
14
+ file_path?: string;
15
+ object_id?: string;
16
+ repo_name?: string;
17
+ commit_id?: string;
18
+ file_url?: string;
19
+ repo_url?: string;
20
+ root_folder?: string;
21
+ parent_entity_connector_ref?: string;
22
+ parent_entity_repo_name?: string;
23
+ is_harness_code_repo?: boolean;
24
+ }
25
+ export interface GetEntityTemplateReferencesQueryHeaderParams {
26
+ 'Harness-Account'?: string;
27
+ }
28
+ export type GetEntityTemplateReferencesOkResponse = ResponseWithPagination<EntityTemplateReferencesResponseResponse>;
29
+ export type GetEntityTemplateReferencesErrorResponse = unknown;
30
+ export interface GetEntityTemplateReferencesProps extends GetEntityTemplateReferencesQueryPathParams, Omit<FetcherOptions<GetEntityTemplateReferencesQueryQueryParams, unknown, GetEntityTemplateReferencesQueryHeaderParams>, 'url'> {
31
+ queryParams: GetEntityTemplateReferencesQueryQueryParams;
32
+ }
33
+ export declare function getEntityTemplateReferences(props: GetEntityTemplateReferencesProps): Promise<GetEntityTemplateReferencesOkResponse>;
34
+ /**
35
+ * Retrieves template references for a pipeline or template entity. Called by UI.
36
+ */
37
+ export declare function useGetEntityTemplateReferencesQuery(props: GetEntityTemplateReferencesProps, options?: Omit<UseQueryOptions<GetEntityTemplateReferencesOkResponse, GetEntityTemplateReferencesErrorResponse>, 'queryKey' | 'queryFn'>): import("@tanstack/react-query").UseQueryResult<GetEntityTemplateReferencesOkResponse, 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 { useQuery } from '@tanstack/react-query';
5
+ import { fetcher } from '../../../../fetcher/index.js';
6
+ export function getEntityTemplateReferences(props) {
7
+ return fetcher(Object.assign({ url: `/v1/entity-template-references/${props.identifier}`, method: 'GET' }, props));
8
+ }
9
+ /**
10
+ * Retrieves template references for a pipeline or template entity. Called by UI.
11
+ */
12
+ export function useGetEntityTemplateReferencesQuery(props, options) {
13
+ return useQuery(['get-entity-template-references', props.identifier, props.queryParams], ({ signal }) => getEntityTemplateReferences(Object.assign(Object.assign({}, props), { signal })), options);
14
+ }
@@ -22,6 +22,12 @@ export interface GetTemplatesListAccQueryQueryParams {
22
22
  entity_types?: Array<'CustomDeployment' | 'MonitoredService' | 'Pipeline' | 'SecretManager' | 'Stage' | 'Step' | 'StepGroup'>;
23
23
  child_types?: string[];
24
24
  global_template?: boolean;
25
+ /**
26
+ * JSON-encoded TemplateMetadataFilterExpression object for filtering templates by metadata.
27
+ * Supports nested AND/OR operations on filterMetadata properties.
28
+ *
29
+ */
30
+ metadata_filter?: string;
25
31
  }
26
32
  export interface GetTemplatesListAccQueryHeaderParams {
27
33
  'Harness-Account'?: string;
@@ -5,6 +5,8 @@ export type { CreateTemplatesOrgErrorResponse, CreateTemplatesOrgMutationPathPar
5
5
  export { createTemplatesOrg, useCreateTemplatesOrgMutation, } from './hooks/useCreateTemplatesOrgMutation';
6
6
  export type { CreateTemplatesProjectErrorResponse, CreateTemplatesProjectMutationPathParams, CreateTemplatesProjectOkResponse, CreateTemplatesProjectProps, CreateTemplatesProjectRequestBody, } from './hooks/useCreateTemplatesProjectMutation';
7
7
  export { createTemplatesProject, useCreateTemplatesProjectMutation, } from './hooks/useCreateTemplatesProjectMutation';
8
+ export type { DeleteEntityTemplateReferencesErrorResponse, DeleteEntityTemplateReferencesMutationQueryParams, DeleteEntityTemplateReferencesOkResponse, DeleteEntityTemplateReferencesProps, } from './hooks/useDeleteEntityTemplateReferencesMutation';
9
+ export { deleteEntityTemplateReferences, useDeleteEntityTemplateReferencesMutation, } from './hooks/useDeleteEntityTemplateReferencesMutation';
8
10
  export type { DeleteTemplateAccErrorResponse, DeleteTemplateAccMutationPathParams, DeleteTemplateAccMutationQueryParams, DeleteTemplateAccOkResponse, DeleteTemplateAccProps, } from './hooks/useDeleteTemplateAccMutation';
9
11
  export { deleteTemplateAcc, useDeleteTemplateAccMutation, } from './hooks/useDeleteTemplateAccMutation';
10
12
  export type { DeleteTemplateOrgErrorResponse, DeleteTemplateOrgMutationPathParams, DeleteTemplateOrgMutationQueryParams, DeleteTemplateOrgOkResponse, DeleteTemplateOrgProps, } from './hooks/useDeleteTemplateOrgMutation';
@@ -13,6 +15,8 @@ export type { DeleteTemplateProjectErrorResponse, DeleteTemplateProjectMutationP
13
15
  export { deleteTemplateProject, useDeleteTemplateProjectMutation, } from './hooks/useDeleteTemplateProjectMutation';
14
16
  export type { GetAccTemplatesInputsSchemaErrorResponse, GetAccTemplatesInputsSchemaOkResponse, GetAccTemplatesInputsSchemaProps, GetAccTemplatesInputsSchemaQueryPathParams, } from './hooks/useGetAccTemplatesInputsSchemaQuery';
15
17
  export { getAccTemplatesInputsSchema, useGetAccTemplatesInputsSchemaQuery, } from './hooks/useGetAccTemplatesInputsSchemaQuery';
18
+ export type { GetEntityTemplateReferencesErrorResponse, GetEntityTemplateReferencesOkResponse, GetEntityTemplateReferencesProps, GetEntityTemplateReferencesQueryPathParams, GetEntityTemplateReferencesQueryQueryParams, } from './hooks/useGetEntityTemplateReferencesQuery';
19
+ export { getEntityTemplateReferences, useGetEntityTemplateReferencesQuery, } from './hooks/useGetEntityTemplateReferencesQuery';
16
20
  export type { GetInputsSchemaErrorResponse, GetInputsSchemaMutationQueryParams, GetInputsSchemaOkResponse, GetInputsSchemaProps, GetInputsSchemaRequestBody, } from './hooks/useGetInputsSchemaMutation';
17
21
  export { getInputsSchema, useGetInputsSchemaMutation } from './hooks/useGetInputsSchemaMutation';
18
22
  export type { GetOrgTemplatesInputsSchemaErrorResponse, GetOrgTemplatesInputsSchemaOkResponse, GetOrgTemplatesInputsSchemaProps, GetOrgTemplatesInputsSchemaQueryPathParams, } from './hooks/useGetOrgTemplatesInputsSchemaQuery';
@@ -72,8 +76,11 @@ export type { TemplateCreateBodyRequestBody } from './requestBodies/TemplateCrea
72
76
  export type { TemplateFetchBodyRequestBody } from './requestBodies/TemplateFetchBodyRequestBody';
73
77
  export type { TemplateImportRequestBodyRequestBody } from './requestBodies/TemplateImportRequestBodyRequestBody';
74
78
  export type { TemplateInputsSchemaRequestBodyRequestBody } from './requestBodies/TemplateInputsSchemaRequestBodyRequestBody';
79
+ export type { TemplateReferenceRequestBodyRequestBody } from './requestBodies/TemplateReferenceRequestBodyRequestBody';
75
80
  export type { TemplateUpdateBodyRequestBody } from './requestBodies/TemplateUpdateBodyRequestBody';
76
81
  export type { TemplateUpdateGitMetadataRequestBodyRequestBody } from './requestBodies/TemplateUpdateGitMetadataRequestBodyRequestBody';
82
+ export type { UpsertEntityTemplateReferencesRequestBodyRequestBody } from './requestBodies/UpsertEntityTemplateReferencesRequestBodyRequestBody';
83
+ export type { EntityTemplateReferencesResponseResponse } from './responses/EntityTemplateReferencesResponseResponse';
77
84
  export type { NotificationTemplateValidateResponseBodyResponse } from './responses/NotificationTemplateValidateResponseBodyResponse';
78
85
  export type { TemplateImportResponseBodyResponse } from './responses/TemplateImportResponseBodyResponse';
79
86
  export type { TemplateInputSchemaDetailsResponseBodyResponse } from './responses/TemplateInputSchemaDetailsResponseBodyResponse';
@@ -85,25 +92,35 @@ export type { TemplateUpdateStableResponseResponse } from './responses/TemplateU
85
92
  export type { TemplateWithInputsResponseResponse } from './responses/TemplateWithInputsResponseResponse';
86
93
  export type { UnresolvedNotificationRulesResponseBodyResponse } from './responses/UnresolvedNotificationRulesResponseBodyResponse';
87
94
  export type { EntityGitDetails } from './schemas/EntityGitDetails';
95
+ export type { EntityTemplateReferencesResponse } from './schemas/EntityTemplateReferencesResponse';
88
96
  export type { FixedValueFieldDependencyDetailsDto } from './schemas/FixedValueFieldDependencyDetailsDto';
89
97
  export type { GitCreateDetails } from './schemas/GitCreateDetails';
90
98
  export type { GitDetailsMetadata } from './schemas/GitDetailsMetadata';
91
99
  export type { GitFindDetails } from './schemas/GitFindDetails';
92
100
  export type { GitImportDetails } from './schemas/GitImportDetails';
93
101
  export type { GitUpdateDetails } from './schemas/GitUpdateDetails';
102
+ export type { GovernanceStatus } from './schemas/GovernanceStatus';
94
103
  export type { InputDetailsDto } from './schemas/InputDetailsDto';
95
104
  export type { NotificationRulesData } from './schemas/NotificationRulesData';
96
105
  export type { NotificationTemplateReconcileRequestBody } from './schemas/NotificationTemplateReconcileRequestBody';
97
106
  export type { NotificationTemplateValidateResponseBody } from './schemas/NotificationTemplateValidateResponseBody';
107
+ export type { ReferencedTemplateMetadata } from './schemas/ReferencedTemplateMetadata';
98
108
  export type { RuntimeInputDependencyDetailsDto } from './schemas/RuntimeInputDependencyDetailsDto';
99
109
  export type { TemplateCreateRequestBody } from './schemas/TemplateCreateRequestBody';
110
+ export type { TemplateGovernanceMetadata } from './schemas/TemplateGovernanceMetadata';
111
+ export type { TemplateGovernancePolicy } from './schemas/TemplateGovernancePolicy';
112
+ export type { TemplateGovernancePolicySet } from './schemas/TemplateGovernancePolicySet';
100
113
  export type { TemplateImportRequestBody } from './schemas/TemplateImportRequestBody';
101
114
  export type { TemplateImportRequestDto } from './schemas/TemplateImportRequestDto';
102
115
  export type { TemplateImportResponseBody } from './schemas/TemplateImportResponseBody';
103
116
  export type { TemplateInputSchemaDetailsResponseBody } from './schemas/TemplateInputSchemaDetailsResponseBody';
104
117
  export type { TemplateInputsSchemaRequestBody } from './schemas/TemplateInputsSchemaRequestBody';
105
118
  export type { TemplateMetaDataList } from './schemas/TemplateMetaDataList';
119
+ export type { TemplateMetadataFilterExpression } from './schemas/TemplateMetadataFilterExpression';
120
+ export type { TemplateMetadataLogicalFilter } from './schemas/TemplateMetadataLogicalFilter';
121
+ export type { TemplateMetadataPropertyFilter } from './schemas/TemplateMetadataPropertyFilter';
106
122
  export type { TemplateMetadataSummaryResponse } from './schemas/TemplateMetadataSummaryResponse';
123
+ export type { TemplateReferenceRequest } from './schemas/TemplateReferenceRequest';
107
124
  export type { TemplateResponse } from './schemas/TemplateResponse';
108
125
  export type { TemplateSchemaResponse } from './schemas/TemplateSchemaResponse';
109
126
  export type { TemplateUpdateGitMetadataRequest } from './schemas/TemplateUpdateGitMetadataRequest';
@@ -114,5 +131,6 @@ export type { TemplateYamlInputDetailsDto } from './schemas/TemplateYamlInputDet
114
131
  export type { TemplateYamlInputDto } from './schemas/TemplateYamlInputDto';
115
132
  export type { TemplateYamlInputMetadataDto } from './schemas/TemplateYamlInputMetadataDto';
116
133
  export type { UnresolvedNotificationRulesResponseBody } from './schemas/UnresolvedNotificationRulesResponseBody';
134
+ export type { UpsertEntityTemplateReferencesRequestBody } from './schemas/UpsertEntityTemplateReferencesRequestBody';
117
135
  export type { YamlInputDependencyDetailsDto } from './schemas/YamlInputDependencyDetailsDto';
118
136
  export type { YamlInputType } from './schemas/YamlInputType';
@@ -1,10 +1,12 @@
1
1
  export { createTemplatesAcc, useCreateTemplatesAccMutation, } from './hooks/useCreateTemplatesAccMutation';
2
2
  export { createTemplatesOrg, useCreateTemplatesOrgMutation, } from './hooks/useCreateTemplatesOrgMutation';
3
3
  export { createTemplatesProject, useCreateTemplatesProjectMutation, } from './hooks/useCreateTemplatesProjectMutation';
4
+ export { deleteEntityTemplateReferences, useDeleteEntityTemplateReferencesMutation, } from './hooks/useDeleteEntityTemplateReferencesMutation';
4
5
  export { deleteTemplateAcc, useDeleteTemplateAccMutation, } from './hooks/useDeleteTemplateAccMutation';
5
6
  export { deleteTemplateOrg, useDeleteTemplateOrgMutation, } from './hooks/useDeleteTemplateOrgMutation';
6
7
  export { deleteTemplateProject, useDeleteTemplateProjectMutation, } from './hooks/useDeleteTemplateProjectMutation';
7
8
  export { getAccTemplatesInputsSchema, useGetAccTemplatesInputsSchemaQuery, } from './hooks/useGetAccTemplatesInputsSchemaQuery';
9
+ export { getEntityTemplateReferences, useGetEntityTemplateReferencesQuery, } from './hooks/useGetEntityTemplateReferencesQuery';
8
10
  export { getInputsSchema, useGetInputsSchemaMutation } from './hooks/useGetInputsSchemaMutation';
9
11
  export { getOrgTemplatesInputsSchema, useGetOrgTemplatesInputsSchemaQuery, } from './hooks/useGetOrgTemplatesInputsSchemaQuery';
10
12
  export { getProjectTemplatesInputsSchema, useGetProjectTemplatesInputsSchemaQuery, } from './hooks/useGetProjectTemplatesInputsSchemaQuery';
@@ -0,0 +1,2 @@
1
+ import type { TemplateReferenceRequest } from '../schemas/TemplateReferenceRequest';
2
+ export type TemplateReferenceRequestBodyRequestBody = TemplateReferenceRequest;
@@ -0,0 +1,2 @@
1
+ import type { UpsertEntityTemplateReferencesRequestBody } from '../schemas/UpsertEntityTemplateReferencesRequestBody';
2
+ export type UpsertEntityTemplateReferencesRequestBodyRequestBody = UpsertEntityTemplateReferencesRequestBody;
@@ -0,0 +1,2 @@
1
+ import type { EntityTemplateReferencesResponse } from '../schemas/EntityTemplateReferencesResponse';
2
+ export type EntityTemplateReferencesResponseResponse = EntityTemplateReferencesResponse;
@@ -19,9 +19,25 @@ export interface EntityGitDetails {
19
19
  */
20
20
  file_url?: string;
21
21
  /**
22
- * Entity identifier
22
+ * Is harness code repo entity
23
+ */
24
+ is_harness_code_repo?: boolean;
25
+ /**
26
+ * Object Id of the Entity
23
27
  */
24
28
  object_id?: string;
29
+ /**
30
+ * Connector Reference of parent entity
31
+ */
32
+ parent_entity_connector_ref?: string;
33
+ /**
34
+ * Repo name of parent entity
35
+ */
36
+ parent_entity_repo_name?: string;
37
+ /**
38
+ * Git Sync Config Id
39
+ */
40
+ repo_identifier?: string;
25
41
  /**
26
42
  * Name of the repository.
27
43
  */
@@ -30,4 +46,8 @@ export interface EntityGitDetails {
30
46
  * Repository URL of the Entity.
31
47
  */
32
48
  repo_url?: string;
49
+ /**
50
+ * Root Folder Path of the Entity
51
+ */
52
+ root_folder?: string;
33
53
  }
@@ -0,0 +1,10 @@
1
+ import type { ReferencedTemplateMetadata } from '../schemas/ReferencedTemplateMetadata';
2
+ /**
3
+ * Response body containing template references for an entity
4
+ */
5
+ export interface EntityTemplateReferencesResponse {
6
+ /**
7
+ * List of referenced template metadata
8
+ */
9
+ referenced_templates?: ReferencedTemplateMetadata[];
10
+ }
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Governance Status
3
+ */
4
+ export type GovernanceStatus = 'ERROR' | 'PASS' | 'WARNING';
@@ -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,65 @@
1
+ /**
2
+ * Metadata for a referenced template, including UI display information and reference details.
3
+ */
4
+ export interface ReferencedTemplateMetadata {
5
+ /**
6
+ * Account identifier
7
+ */
8
+ account_id?: string;
9
+ /**
10
+ * Git branch name (for remote templates)
11
+ */
12
+ branch?: string | null;
13
+ /**
14
+ * Template description
15
+ */
16
+ description?: string | null;
17
+ /**
18
+ * File path in repository (for remote templates)
19
+ */
20
+ file_path?: string | null;
21
+ /**
22
+ * Template icon identifier
23
+ */
24
+ icon?: string | null;
25
+ /**
26
+ * Template icon name
27
+ */
28
+ icon_name?: string | null;
29
+ /**
30
+ * Template icon URL
31
+ */
32
+ icon_url?: string | null;
33
+ /**
34
+ * Template name
35
+ */
36
+ name?: string | null;
37
+ /**
38
+ * Organization identifier (null for account-level)
39
+ */
40
+ org_identifier?: string | null;
41
+ /**
42
+ * Project identifier (null for account/org-level)
43
+ */
44
+ project_identifier?: string | null;
45
+ /**
46
+ * Type of template reference
47
+ */
48
+ reference_type?: 'GLOBAL' | 'INLINE' | 'REMOTE';
49
+ /**
50
+ * Git repository identifier (for remote templates)
51
+ */
52
+ repo_identifier?: string | null;
53
+ /**
54
+ * Identifier of the referenced template
55
+ */
56
+ template_identifier?: string;
57
+ /**
58
+ * Template scope
59
+ */
60
+ template_scope?: 'ACCOUNT' | 'ORG' | 'PROJECT';
61
+ /**
62
+ * Version label of the referenced template (optional, null for stable versions)
63
+ */
64
+ version_label?: string | null;
65
+ }
@@ -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,20 @@
1
+ import type { TemplateGovernancePolicySet } from '../schemas/TemplateGovernancePolicySet';
2
+ import type { GovernanceStatus } from '../schemas/GovernanceStatus';
3
+ /**
4
+ * Governance Error Details for Template Operations
5
+ */
6
+ export interface TemplateGovernanceMetadata {
7
+ /**
8
+ * Indicate whether the action is denied or not based on Governance rules
9
+ */
10
+ deny?: boolean;
11
+ /**
12
+ * Governance Message
13
+ */
14
+ message?: string;
15
+ /**
16
+ * List of Policy Sets
17
+ */
18
+ policy_sets?: TemplateGovernancePolicySet[];
19
+ status?: GovernanceStatus;
20
+ }
@@ -0,0 +1,31 @@
1
+ import type { GovernanceStatus } from '../schemas/GovernanceStatus';
2
+ /**
3
+ * Contains Details about Policy
4
+ */
5
+ export interface TemplateGovernancePolicy {
6
+ /**
7
+ * Deny messages
8
+ */
9
+ deny_messages?: string[];
10
+ /**
11
+ * Error message in Policy Evaluation
12
+ */
13
+ evaluation_error?: string;
14
+ /**
15
+ * Policy Identifier
16
+ */
17
+ identifier?: string;
18
+ /**
19
+ * Policy Name
20
+ */
21
+ name?: string;
22
+ /**
23
+ * Organization identifier where the Policy is defined
24
+ */
25
+ org?: string;
26
+ /**
27
+ * Project Identifier where the Policy is defined
28
+ */
29
+ project?: string;
30
+ status?: GovernanceStatus;
31
+ }
@@ -0,0 +1,32 @@
1
+ import type { TemplateGovernancePolicy } from '../schemas/TemplateGovernancePolicy';
2
+ import type { GovernanceStatus } from '../schemas/GovernanceStatus';
3
+ /**
4
+ * Contains Policy Set Detail
5
+ */
6
+ export interface TemplateGovernancePolicySet {
7
+ /**
8
+ * Deny messages
9
+ */
10
+ deny_messages?: string[];
11
+ /**
12
+ * Identifer of the Policy Set
13
+ */
14
+ identifier?: string;
15
+ /**
16
+ * Name of the Policy Set
17
+ */
18
+ name?: string;
19
+ /**
20
+ * Organization Identifier where the Policy Set is defined
21
+ */
22
+ org?: string;
23
+ /**
24
+ * List of policies defined inside Policy Set
25
+ */
26
+ policies?: TemplateGovernancePolicy[];
27
+ /**
28
+ * Project Identifier where the Policy Set is defined
29
+ */
30
+ project?: string;
31
+ status?: GovernanceStatus;
32
+ }
@@ -0,0 +1,10 @@
1
+ import type { TemplateMetadataPropertyFilter } from '../schemas/TemplateMetadataPropertyFilter';
2
+ import type { TemplateMetadataLogicalFilter } from '../schemas/TemplateMetadataLogicalFilter';
3
+ /**
4
+ * Filter expression for template metadata filtering. Supports nested AND/OR operations on filterMetadata properties.
5
+ * Type is automatically inferred from the structure:
6
+ * - If it has "property" and "values" fields, it's a property filter
7
+ * - If it has "and" or "or" fields, it's a logical filter
8
+ *
9
+ */
10
+ export type TemplateMetadataFilterExpression = TemplateMetadataPropertyFilter & TemplateMetadataLogicalFilter;
@@ -0,0 +1,22 @@
1
+ import type { TemplateMetadataFilterExpression } from '../schemas/TemplateMetadataFilterExpression';
2
+ /**
3
+ * Logical filter combining multiple filter expressions with AND/OR operations.
4
+ * Exactly one of 'and' or 'or' must be specified.
5
+ * Type is inferred from the presence of "and" or "or" fields.
6
+ *
7
+ * @example {"or":[{"and":[{"module":["cd","ci"]},{"strategy":["k8"]}]},{"module":["CI"]}]}
8
+ */
9
+ export interface TemplateMetadataLogicalFilter {
10
+ /**
11
+ * List of filter expressions combined with AND operation. All must match.
12
+ * Cannot be used together with 'or'.
13
+ *
14
+ */
15
+ and?: TemplateMetadataFilterExpression[];
16
+ /**
17
+ * List of filter expressions combined with OR operation. At least one must match.
18
+ * Cannot be used together with 'and'.
19
+ *
20
+ */
21
+ or?: TemplateMetadataFilterExpression[];
22
+ }
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Property-based filter for template metadata. Matches templates where the specified property
3
+ * contains any of the provided values in filterMetadata.
4
+ * Format: {"propertyName": ["value1", "value2", ...]}
5
+ * The key is the property name, the value is an array of allowed values.
6
+ * Type is inferred from the structure (not having "and" or "or" keys).
7
+ *
8
+ * @example {"module":["ci","cd"]}
9
+ */
10
+ export interface TemplateMetadataPropertyFilter {
11
+ [key: string]: string[];
12
+ }
@@ -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,18 @@
1
+ import type { EntityGitDetails } from '../schemas/EntityGitDetails';
2
+ /**
3
+ * Request body for extracting template references from entity YAML
4
+ */
5
+ export interface TemplateReferenceRequest {
6
+ /**
7
+ * Git details for the entity
8
+ */
9
+ git_details?: EntityGitDetails;
10
+ /**
11
+ * YAML content of the entity (pipeline or template)
12
+ */
13
+ yaml: string;
14
+ /**
15
+ * YAML version, should be one of '0' or '1'
16
+ */
17
+ yaml_version?: string | null;
18
+ }
@@ -1,4 +1,5 @@
1
1
  import type { EntityGitDetails } from '../schemas/EntityGitDetails';
2
+ import type { TemplateGovernanceMetadata } from '../schemas/TemplateGovernanceMetadata';
2
3
  /**
3
4
  * Default response when a template is returned
4
5
  */
@@ -25,6 +26,7 @@ export interface TemplateResponse {
25
26
  */
26
27
  entity_type?: 'CustomDeployment' | 'MonitoredService' | 'Pipeline' | 'SecretManager' | 'Stage' | 'Step' | 'StepGroup';
27
28
  git_details?: EntityGitDetails;
29
+ governance_metadata?: TemplateGovernanceMetadata;
28
30
  /**
29
31
  * Template identifier
30
32
  */
@@ -0,0 +1,15 @@
1
+ import type { EntityGitDetails } from '../schemas/EntityGitDetails';
2
+ import type { ReferencedTemplateMetadata } from '../schemas/ReferencedTemplateMetadata';
3
+ /**
4
+ * Request body for upserting entity template references
5
+ */
6
+ export interface UpsertEntityTemplateReferencesRequestBody {
7
+ /**
8
+ * Git details for the entity
9
+ */
10
+ git_details?: EntityGitDetails;
11
+ /**
12
+ * List of referenced template metadata
13
+ */
14
+ referenced_templates?: ReferencedTemplateMetadata[];
15
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@harnessio/react-template-service-client",
3
- "version": "0.7.0",
3
+ "version": "0.9.0",
4
4
  "description": "Harness React template service client - Template APIs integrated with react hooks",
5
5
  "author": "Harness Inc",
6
6
  "license": "MIT",