@harnessio/react-template-service-client 0.7.0 → 0.8.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 (19) hide show
  1. package/dist/fetcher/index.js +1 -1
  2. package/dist/template-service/src/services/hooks/useGetTemplatesListAccQuery.d.ts +6 -0
  3. package/dist/template-service/src/services/index.d.ts +7 -0
  4. package/dist/template-service/src/services/schemas/GovernanceStatus.d.ts +4 -0
  5. package/dist/template-service/src/services/schemas/GovernanceStatus.js +4 -0
  6. package/dist/template-service/src/services/schemas/TemplateGovernanceMetadata.d.ts +20 -0
  7. package/dist/template-service/src/services/schemas/TemplateGovernanceMetadata.js +1 -0
  8. package/dist/template-service/src/services/schemas/TemplateGovernancePolicy.d.ts +31 -0
  9. package/dist/template-service/src/services/schemas/TemplateGovernancePolicy.js +1 -0
  10. package/dist/template-service/src/services/schemas/TemplateGovernancePolicySet.d.ts +32 -0
  11. package/dist/template-service/src/services/schemas/TemplateGovernancePolicySet.js +1 -0
  12. package/dist/template-service/src/services/schemas/TemplateMetadataFilterExpression.d.ts +10 -0
  13. package/dist/template-service/src/services/schemas/TemplateMetadataFilterExpression.js +1 -0
  14. package/dist/template-service/src/services/schemas/TemplateMetadataLogicalFilter.d.ts +22 -0
  15. package/dist/template-service/src/services/schemas/TemplateMetadataLogicalFilter.js +1 -0
  16. package/dist/template-service/src/services/schemas/TemplateMetadataPropertyFilter.d.ts +12 -0
  17. package/dist/template-service/src/services/schemas/TemplateMetadataPropertyFilter.js +4 -0
  18. package/dist/template-service/src/services/schemas/TemplateResponse.d.ts +2 -0
  19. 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
  }
@@ -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;
@@ -91,18 +91,25 @@ export type { GitDetailsMetadata } from './schemas/GitDetailsMetadata';
91
91
  export type { GitFindDetails } from './schemas/GitFindDetails';
92
92
  export type { GitImportDetails } from './schemas/GitImportDetails';
93
93
  export type { GitUpdateDetails } from './schemas/GitUpdateDetails';
94
+ export type { GovernanceStatus } from './schemas/GovernanceStatus';
94
95
  export type { InputDetailsDto } from './schemas/InputDetailsDto';
95
96
  export type { NotificationRulesData } from './schemas/NotificationRulesData';
96
97
  export type { NotificationTemplateReconcileRequestBody } from './schemas/NotificationTemplateReconcileRequestBody';
97
98
  export type { NotificationTemplateValidateResponseBody } from './schemas/NotificationTemplateValidateResponseBody';
98
99
  export type { RuntimeInputDependencyDetailsDto } from './schemas/RuntimeInputDependencyDetailsDto';
99
100
  export type { TemplateCreateRequestBody } from './schemas/TemplateCreateRequestBody';
101
+ export type { TemplateGovernanceMetadata } from './schemas/TemplateGovernanceMetadata';
102
+ export type { TemplateGovernancePolicy } from './schemas/TemplateGovernancePolicy';
103
+ export type { TemplateGovernancePolicySet } from './schemas/TemplateGovernancePolicySet';
100
104
  export type { TemplateImportRequestBody } from './schemas/TemplateImportRequestBody';
101
105
  export type { TemplateImportRequestDto } from './schemas/TemplateImportRequestDto';
102
106
  export type { TemplateImportResponseBody } from './schemas/TemplateImportResponseBody';
103
107
  export type { TemplateInputSchemaDetailsResponseBody } from './schemas/TemplateInputSchemaDetailsResponseBody';
104
108
  export type { TemplateInputsSchemaRequestBody } from './schemas/TemplateInputsSchemaRequestBody';
105
109
  export type { TemplateMetaDataList } from './schemas/TemplateMetaDataList';
110
+ export type { TemplateMetadataFilterExpression } from './schemas/TemplateMetadataFilterExpression';
111
+ export type { TemplateMetadataLogicalFilter } from './schemas/TemplateMetadataLogicalFilter';
112
+ export type { TemplateMetadataPropertyFilter } from './schemas/TemplateMetadataPropertyFilter';
106
113
  export type { TemplateMetadataSummaryResponse } from './schemas/TemplateMetadataSummaryResponse';
107
114
  export type { TemplateResponse } from './schemas/TemplateResponse';
108
115
  export type { TemplateSchemaResponse } from './schemas/TemplateSchemaResponse';
@@ -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,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 {};
@@ -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
  */
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.8.0",
4
4
  "description": "Harness React template service client - Template APIs integrated with react hooks",
5
5
  "author": "Harness Inc",
6
6
  "license": "MIT",