@rancher/shell 3.0.12-rc.4 → 3.0.12-rc.6

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 (159) hide show
  1. package/apis/intf/resources-api/resource-base.ts +42 -2
  2. package/apis/intf/resources-api/resource-instance.ts +101 -0
  3. package/apis/intf/resources-api/resources-api.ts +177 -23
  4. package/apis/intf/resources.ts +8 -6
  5. package/apis/resources/__tests__/resources-api-class.test.ts +309 -28
  6. package/apis/resources/resources-api-class.ts +232 -43
  7. package/assets/images/providers/traefik.png +0 -0
  8. package/assets/styles/global/_button.scss +1 -1
  9. package/assets/translations/en-us.yaml +49 -14
  10. package/chart/__tests__/rancher-monitoring-dashboards-index.test.ts +269 -0
  11. package/chart/rancher-monitoring-dashboards/index.vue +155 -0
  12. package/cloud-credential/__tests__/generic.test.ts +132 -0
  13. package/cloud-credential/generic.vue +33 -3
  14. package/components/ActionDropdownShell.vue +5 -3
  15. package/components/ButtonGroup.vue +26 -1
  16. package/components/CruResource.vue +51 -2
  17. package/components/EtcdInfoBanner.vue +2 -12
  18. package/components/GrafanaDashboard.vue +2 -8
  19. package/components/PromptRestore.vue +93 -32
  20. package/components/Questions/index.vue +1 -0
  21. package/components/Resource/Detail/Masthead/__tests__/index.test.ts +68 -14
  22. package/components/Resource/Detail/Masthead/index.vue +8 -3
  23. package/components/ResourceTable.vue +1 -0
  24. package/components/SortableTable/index.vue +4 -3
  25. package/components/Wizard.vue +14 -1
  26. package/components/__tests__/ButtonGroup.test.ts +56 -0
  27. package/components/__tests__/PromptRestore.test.ts +169 -19
  28. package/components/fleet/GitRepoAdvancedTab.vue +1 -0
  29. package/components/fleet/GitRepoMetadataTab.vue +5 -0
  30. package/components/fleet/HelmOpAppCoConfigTab.vue +4 -0
  31. package/components/fleet/HelmOpMetadataTab.vue +5 -0
  32. package/components/form/FileSelector.vue +39 -1
  33. package/components/form/PrivateRegistry.constants.ts +7 -0
  34. package/components/form/PrivateRegistry.vue +253 -18
  35. package/components/form/Security.vue +1 -1
  36. package/components/form/SelectOrCreateAuthSecret.vue +140 -17
  37. package/components/form/__tests__/FileSelector.test.ts +23 -0
  38. package/components/form/__tests__/PrivateRegistry.test.ts +463 -73
  39. package/components/form/__tests__/SelectOrCreateAuthSecret.test.ts +122 -0
  40. package/components/formatter/EtcdSnapshotName.vue +73 -0
  41. package/components/formatter/Translate.vue +22 -1
  42. package/components/nav/Group.vue +5 -10
  43. package/components/nav/Header.vue +8 -1
  44. package/components/nav/TopLevelMenu.vue +1 -30
  45. package/components/nav/__tests__/Group.test.ts +61 -0
  46. package/components/templates/default.vue +7 -0
  47. package/config/features.js +1 -0
  48. package/config/labels-annotations.js +3 -0
  49. package/config/product/manager.js +6 -0
  50. package/config/secret.ts +10 -0
  51. package/config/settings.ts +6 -2
  52. package/config/table-headers.js +5 -2
  53. package/config/types.js +7 -0
  54. package/core/__tests__/plugin-products-apply.test.ts +787 -0
  55. package/core/__tests__/plugin-products-extend.test.ts +189 -0
  56. package/core/__tests__/plugin-products-helpers.test.ts +81 -78
  57. package/core/__tests__/plugin-products-new.test.ts +389 -0
  58. package/core/__tests__/plugin-products-scenarios.test.ts +980 -0
  59. package/core/__tests__/plugin-products-side-menu.test.ts +1935 -0
  60. package/core/plugin-products-base.ts +201 -93
  61. package/core/plugin-products-extending.ts +1 -1
  62. package/core/plugin-products-external.ts +380 -0
  63. package/core/plugin-products-helpers.ts +28 -24
  64. package/core/plugin-products-internal.ts +207 -0
  65. package/core/plugin-products-top-level.ts +10 -5
  66. package/core/plugin-products-type-guards.ts +17 -6
  67. package/core/plugin-products.ts +5 -7
  68. package/core/plugin-types.ts +1 -389
  69. package/core/plugin.ts +10 -11
  70. package/core/types.ts +6 -202
  71. package/detail/__tests__/provisioning.cattle.io.cluster.test.ts +52 -0
  72. package/detail/pod.vue +1 -1
  73. package/detail/provisioning.cattle.io.cluster.vue +79 -5
  74. package/dialog/RotateEncryptionKeyDialog.vue +33 -9
  75. package/dialog/__tests__/RotateEncryptionKeyDialog.test.ts +78 -0
  76. package/edit/__tests__/fleet.cattle.io.gitrepo.test.ts +92 -0
  77. package/edit/__tests__/fleet.cattle.io.helmop.test.ts +101 -0
  78. package/edit/__tests__/management.cattle.io.setting.test.ts +2 -1
  79. package/edit/auth/AuthProviderWarningBanners.vue +12 -0
  80. package/edit/auth/__tests__/AuthProviderWarningBanners.test.ts +10 -1
  81. package/edit/auth/__tests__/azuread.test.ts +1 -0
  82. package/edit/auth/__tests__/github.test.ts +1 -0
  83. package/edit/auth/__tests__/oidc.test.ts +1 -0
  84. package/edit/auth/__tests__/saml.test.ts +1 -0
  85. package/edit/auth/ldap/__tests__/index.test.ts +1 -0
  86. package/edit/compliance.cattle.io.clusterscanprofile.vue +39 -41
  87. package/edit/fleet.cattle.io.gitrepo.vue +70 -16
  88. package/edit/fleet.cattle.io.helmop.vue +51 -5
  89. package/edit/helm.cattle.io.projecthelmchart.vue +1 -0
  90. package/edit/{management.cattle.io.setting.vue → management.cattle.io.setting/index.vue} +32 -9
  91. package/edit/management.cattle.io.setting/system-default-registry-pull-secrets.vue +81 -0
  92. package/edit/provisioning.cattle.io.cluster/SelectCredential.vue +3 -12
  93. package/edit/provisioning.cattle.io.cluster/__tests__/rke2.test.ts +18 -0
  94. package/edit/provisioning.cattle.io.cluster/index.vue +1 -1
  95. package/edit/provisioning.cattle.io.cluster/rke2.vue +6 -2
  96. package/edit/provisioning.cattle.io.cluster/tabs/etcd/index.vue +0 -1
  97. package/edit/provisioning.cattle.io.cluster/tabs/networking/index.vue +2 -2
  98. package/edit/provisioning.cattle.io.cluster/tabs/registries/index.vue +14 -55
  99. package/list/management.cattle.io.user.vue +24 -5
  100. package/list/utils/management.cattle.io.cluster.utils.ts +1 -1
  101. package/machine-config/__tests__/generic.test.ts +163 -0
  102. package/machine-config/components/EC2Networking.vue +31 -7
  103. package/machine-config/components/__tests__/EC2Networking.test.ts +38 -15
  104. package/machine-config/generic.vue +32 -5
  105. package/mixins/resource-fetch.js +1 -1
  106. package/models/__tests__/provisioning.cattle.io.cluster.test.ts +156 -0
  107. package/models/__tests__/rke-machine.cattle.io.vmwarevspheremachinetemplate.test.ts +22 -0
  108. package/models/__tests__/secret.test.ts +68 -1
  109. package/models/management.cattle.io.cluster.js +21 -3
  110. package/models/pod.js +25 -12
  111. package/models/provisioning.cattle.io.cluster.js +59 -9
  112. package/models/rke-machine.cattle.io.vmwarevspheremachinetemplate.js +9 -0
  113. package/models/rke.cattle.io.etcdsnapshot.js +17 -9
  114. package/models/secret.js +19 -0
  115. package/models/workload.js +12 -7
  116. package/package.json +1 -1
  117. package/pages/auth/login.vue +1 -1
  118. package/pages/c/_cluster/apps/charts/__tests__/install.test.ts +569 -81
  119. package/pages/c/_cluster/apps/charts/install.vue +143 -28
  120. package/pages/c/_cluster/auth/config/index.vue +11 -4
  121. package/pages/c/_cluster/monitoring/index.vue +6 -1
  122. package/pkg/require-asset.lib.js +25 -0
  123. package/pkg/vue.config.js +7 -0
  124. package/plugins/dashboard-store/__tests__/resource-class.test.ts +84 -0
  125. package/plugins/dashboard-store/getters.js +0 -1
  126. package/plugins/dashboard-store/resource-class.js +62 -15
  127. package/plugins/steve/__tests__/steve-class-resource-api.test.ts +147 -0
  128. package/plugins/steve/steve-class.js +43 -0
  129. package/plugins/steve/subscribe.js +11 -0
  130. package/rancher-components/Form/LabeledInput/LabeledInput.test.ts +115 -0
  131. package/rancher-components/Form/LabeledInput/LabeledInput.vue +83 -3
  132. package/rancher-components/Form/TextArea/TextAreaAutoGrow.vue +30 -0
  133. package/rancher-components/Form/TextArea/__tests__/TextAreaAutoGrow.test.ts +95 -0
  134. package/rancher-components/RcButton/index.ts +1 -1
  135. package/rancher-components/RcDropdown/RcDropdownTrigger.vue +6 -1
  136. package/store/__tests__/auth.test.ts +18 -0
  137. package/store/__tests__/features.test.ts +131 -0
  138. package/store/__tests__/growl.test.ts +374 -0
  139. package/store/__tests__/modal.test.ts +131 -0
  140. package/store/__tests__/notifications.test.ts +466 -1
  141. package/store/__tests__/slideInPanel.test.ts +88 -0
  142. package/store/__tests__/type-map.utils.test.ts +433 -0
  143. package/store/__tests__/ui-context.test.ts +255 -0
  144. package/store/auth.js +11 -1
  145. package/store/features.js +5 -0
  146. package/store/plugins.js +6 -0
  147. package/types/rancher/steve.api.ts +2 -2
  148. package/types/shell/index.d.ts +120 -0
  149. package/types/store/dashboard-store.types.ts +2 -2
  150. package/types/store/type-map.ts +262 -1
  151. package/utils/__tests__/operation-cr.test.ts +34 -0
  152. package/utils/async.ts +2 -0
  153. package/utils/grafana.js +2 -17
  154. package/utils/monitoring.js +38 -1
  155. package/utils/operation-cr.js +19 -0
  156. package/utils/require-asset.ts +7 -0
  157. package/utils/validators/__tests__/private-registry.test.ts +27 -15
  158. package/utils/validators/private-registry.ts +15 -4
  159. package/core/__tests__/plugin-products.test.ts +0 -4694
@@ -3,8 +3,9 @@ import {
3
3
  ActionFindAllArgs, ActionFindArgs,
4
4
  ActionFindMatchingArgs,
5
5
  ActionFindPageArgs,
6
- ActionFindPageResponse, ActionFindMatchingResponse
6
+ ActionFindPageResponse, ActionFindMatchingResponse,
7
7
  } from '@shell/types/store/dashboard-store.types';
8
+ import { SteveListResponse, SteveGetResponse } from '@shell/types/rancher/steve.api';
8
9
 
9
10
  /**
10
11
  * @interface
@@ -23,6 +24,30 @@ import {
23
24
  */
24
25
  export type ResourceType = K8SResourceType | string;
25
26
 
27
+ /**
28
+ * @interface
29
+ * Data object for creating a new resource. Must include a `type` property.
30
+ *
31
+ * @example
32
+ * ```ts
33
+ * import { useResources, K8S } from '@shell/apis';
34
+ *
35
+ * const resources = useResources();
36
+ *
37
+ * const newConfigMap: CreateResourceData = {
38
+ * type: K8S.CONFIG_MAP,
39
+ * metadata: { name: 'my-config', namespace: 'default' },
40
+ * data: { key: 'value' }
41
+ * };
42
+ *
43
+ * await resources.cluster.create(newConfigMap);
44
+ * ```
45
+ */
46
+ export type CreateResourceData = {
47
+ [key: string]: any,
48
+ type: ResourceType,
49
+ };
50
+
26
51
  /**
27
52
  * @interface
28
53
  * Resources API "findAll" options
@@ -87,6 +112,7 @@ export type FindFilteredLabelSelectorOptions = Omit<ActionFindMatchingArgs, 'dep
87
112
  // @internal We use an interface instead of a type alias so the documentation generator
88
113
  // eslint-disable-next-line @typescript-eslint/no-empty-interface
89
114
  export interface FindFilteredPageOptions extends ActionFindPageArgs {}
115
+ export interface FindFilteredPageOptionsTransient extends ActionFindPageArgs { transient: true }
90
116
 
91
117
  /**
92
118
  * @interface
@@ -104,4 +130,18 @@ export type FindFilteredPageResponse<T = any> = ActionFindPageResponse<T>;
104
130
  * Aligns with the response type of the underlying `findMatching` store action via `findLabelSelector`.
105
131
  * Can be either a transient response object (with data and pagination) or an array of resources.
106
132
  */
107
- export type FindFilteredLabelSelectorResponse<T = any> = ActionFindMatchingResponse<T>;
133
+ export type FindFilteredLabelSelectorResponse<T = Record<string, any>> = ActionFindMatchingResponse<T>;
134
+
135
+ /**
136
+ * @interface
137
+ * Steve API JSON response for GET requests for a resource
138
+ */
139
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
140
+ export type SteveResource<T = Record<string, any>> = T & SteveGetResponse;
141
+
142
+ /**
143
+ * @interface
144
+ * Steve API JSON response for LIST resource requests
145
+ */
146
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
147
+ export type SteveList<T = Record<string, any>> = SteveListResponse<T & SteveGetResponse>;
@@ -0,0 +1,101 @@
1
+ import { SteveResource } from '@shell/apis/intf/resources-api/resource-base';
2
+
3
+ /**
4
+ * Instance-level operations available on resources returned by the Resources API.
5
+ *
6
+ * These methods operate on a specific resource that has already been fetched.
7
+ */
8
+ export interface ResourceInstanceApi {
9
+ /**
10
+ * Applies a partial update to a resource using HTTP PATCH
11
+ * with merge-patch semantics (`application/strategic-merge-patch+json`).
12
+ *
13
+ * Only the fields provided in `data` are sent to the server — the rest of the resource
14
+ * remains unchanged. The server response is merged back into this instance.
15
+ *
16
+ * Requires edit permissions (`canEdit`).
17
+ *
18
+ * @param data - An object containing only the fields to update.
19
+ * @returns a resource instance, updated with the server response.
20
+ *
21
+ * @example
22
+ * ```ts
23
+ * import { useResources, K8S } from '@shell/apis';
24
+ *
25
+ * const resources = useResources();
26
+ * const configMap = await resources.cluster.find(K8S.CONFIG_MAP, 'default/my-config');
27
+ *
28
+ * await configMap.update({ newKey: 'newValue' });
29
+ *
30
+ * const result = configMap.newKey === 'newValue' // true
31
+
32
+ * ```
33
+ */
34
+ update(data: Record<string, any>): Promise<this>;
35
+
36
+ /**
37
+ * Performs a full replacement update of a resource using HTTP PUT.
38
+ *
39
+ * Sends the entire current state of the resource to the server.
40
+ *
41
+ * Requires edit permissions (`canEdit`).
42
+ *
43
+ * @returns a resource instance, updated with the server response.
44
+ *
45
+ * @example
46
+ * ```ts
47
+ * import { useResources, K8S } from '@shell/apis';
48
+ *
49
+ * const resources = useResources();
50
+ * const configMap = await resources.cluster.find(K8S.CONFIG_MAP, 'default/my-config');
51
+ *
52
+ * configMap.data.myKey = 'updatedValue';
53
+ * await configMap.replace();
54
+ * ```
55
+ */
56
+ replace(): Promise<this>;
57
+
58
+ /**
59
+ * Deletes a resource instance.
60
+ *
61
+ * Requires delete permissions (`canDelete`).
62
+ *
63
+ * @returns A promise that resolves when the resource has been deleted.
64
+ *
65
+ * @example
66
+ * ```ts
67
+ * import { useResources, K8S } from '@shell/apis';
68
+ *
69
+ * const resources = useResources();
70
+ * const pod = await resources.cluster.find(K8S.POD, 'default/my-pod-123');
71
+ *
72
+ * await pod.delete();
73
+ * ```
74
+ */
75
+ delete(): Promise<void>;
76
+ }
77
+
78
+ /**
79
+ * Represents a single resource instance returned from the Resources API.
80
+ *
81
+ * Provides instance-level operations such as deleting or updating a resource instance.
82
+ * The resource data (metadata, spec, status, etc.) is accessible directly on the instance.
83
+ *
84
+ * @template T - Your specific resource type. Rancher will supplement the response with additional properties and methods
85
+ * @template I - The shape of the underlying resource data (defaults to SteveResource)
86
+ *
87
+ * @example
88
+ * ```ts
89
+ * import { useResources, K8S } from '@shell/apis';
90
+ *
91
+ * const resources = useResources();
92
+ * const pod = await resources.cluster.find(K8S.POD, 'default/my-pod-123');
93
+ *
94
+ * // Access resource data directly
95
+ * console.log(pod.metadata.name);
96
+ *
97
+ * // Use instance operations
98
+ * await pod.delete();
99
+ * ```
100
+ */
101
+ export type ResourceInstance<T = any, I = SteveResource<T>> = I & ResourceInstanceApi;
@@ -1,8 +1,10 @@
1
+ import { ActionFindPageTransientResponse } from '@shell/types/store/dashboard-store.types';
1
2
  import {
2
- ResourceType, FindMethodOptions, FindAllMethodOptions, FindFilteredPageOptions, FindFilteredLabelSelectorOptions,
3
- FindFilteredPageResponse, FindFilteredLabelSelectorResponse
3
+ ResourceType, CreateResourceData, FindMethodOptions, FindAllMethodOptions, FindFilteredPageOptions, FindFilteredLabelSelectorOptions,
4
+ FindFilteredLabelSelectorResponse, SteveResource,
5
+ FindFilteredPageOptionsTransient,
4
6
  } from './resource-base';
5
- import { SteveListResponse, SteveGetResponse } from '@shell/types/rancher/steve.api';
7
+ import { ResourceInstance } from './resource-instance';
6
8
 
7
9
  /**
8
10
  * Base interface for all resource API operations.
@@ -24,8 +26,9 @@ export interface ResourcesApi {
24
26
  /**
25
27
  * Finds a specific resource by its type and ID.
26
28
  *
27
- * @template T - The type of the resource (defaults to SteveGetResponse)
28
- * @param resourceType - The type of the resource to find (use **{@link K8S}** constant). See also {@link ResourceType}.
29
+ * @template T - Your specific resource type. Rancher will supplement the response with additional properties and methods
30
+ * @template I - An override for the response type. By default this uses T and supplements the response, or by supplying a value ignores T
31
+ * @param resourceType - The type of the resource to find (examples in **{@link K8S}**). See also {@link ResourceType}.
29
32
  * @param resourceId - The unique identifier of the resource to find. If the resource is namespaced, this should be in the format `namespace/name`.
30
33
  * @param options - Optional find arguments
31
34
  * @returns The found resource item or null if not found.
@@ -43,21 +46,60 @@ export interface ResourcesApi {
43
46
  * const node = await resources.cluster.find(K8S.NODE, 'worker-1');
44
47
  * ```
45
48
  */
46
- find<T = SteveGetResponse>(
49
+ find<T = Record<string, any>, I = ResourceInstance<T>>(
47
50
  resourceType: ResourceType,
48
51
  resourceId: string,
49
52
  options?: FindMethodOptions
50
- ): Promise<T | null>;
53
+ ): Promise<I | null>;
51
54
 
52
55
  /**
53
56
  * Finds resources using pagination mode with server-side filtering, sorting, and pagination.
54
57
  *
58
+ * The response is not cached
59
+ *
55
60
  * Requires `ui-sql-cache` to be enabled.
56
61
  *
57
- * @template T - The type of the resources (defaults to SteveListResponse)
58
- * @param resourceType - The type of the resources to find (use **{@link K8S}** constant). See also {@link ResourceType}.
62
+ * @template T - Your specific resource type. Rancher will supplement the response with additional properties and methods
63
+ * @template I - An override for the response type. By default this uses T and supplements the response, or by supplying a value ignores T
64
+ * @param resourceType - The type of the resources to find (examples in **{@link K8S}**). See also {@link ResourceType}.
59
65
  * @param options - Pagination options with server-side filtering and sorting via the Steve API's pagination cache. See {@link FindFilteredPageOptions}.
60
- * @returns Response containing resource items (may be transient if requested, otherwise cached array).
66
+ * @returns Response containing resource items
67
+ * @throws Error if pagination mode is requested but `ui-sql-cache` is not enabled.
68
+ *
69
+ * @example
70
+ * ```ts
71
+ * import { useResources, K8S } from '@shell/apis';
72
+ *
73
+ * const resources = useResources();
74
+ *
75
+ * const pods = await resources.cluster.findFiltered(K8S.POD, {
76
+ * transient: true,
77
+ * pagination: {
78
+ * page: 1,
79
+ * pageSize: 10,
80
+ * filters: [],
81
+ * sort: []
82
+ * }
83
+ * });
84
+ * ```
85
+ */
86
+ findFiltered<T = Record<string, any>, I = ActionFindPageTransientResponse<ResourceInstance<T>>>(
87
+ resourceType: ResourceType,
88
+ options: FindFilteredPageOptionsTransient
89
+ ): Promise<I>;
90
+
91
+ /**
92
+ * Finds resources using pagination mode with server-side filtering, sorting, and pagination.
93
+ *
94
+ * The response is cached.
95
+ *
96
+ * Requires `ui-sql-cache` to be enabled.
97
+ *
98
+ * @template T - Your specific resource type. Rancher will supplement the response with additional properties and methods
99
+ * @template I - An override for the response type. By default this uses T and supplements the response, or by supplying a value ignores T
100
+ * @param resourceType - The type of the resources to find (examples in **{@link K8S}**). See also {@link ResourceType}.
101
+ * @param options - Pagination options with server-side filtering and sorting via the Steve API's pagination cache. See {@link FindFilteredPageOptions}.
102
+ * @returns Response containing resource items
61
103
  * @throws Error if pagination mode is requested but `ui-sql-cache` is not enabled.
62
104
  *
63
105
  * @example
@@ -76,10 +118,10 @@ export interface ResourcesApi {
76
118
  * });
77
119
  * ```
78
120
  */
79
- findFiltered<T = SteveListResponse>(
121
+ findFiltered<T = Record<string, any>, I = ResourceInstance<T>>(
80
122
  resourceType: ResourceType,
81
123
  options: FindFilteredPageOptions
82
- ): Promise<FindFilteredPageResponse<T>>;
124
+ ): Promise<I[]>;
83
125
 
84
126
  /**
85
127
  * Finds resources using label selector matching.
@@ -88,8 +130,9 @@ export interface ResourcesApi {
88
130
  * - If `ui-sql-cache` is enabled: uses server-side pagination
89
131
  * - Otherwise: uses native Kubernetes API pagination
90
132
  *
91
- * @template T - The type of the resources (defaults to SteveListResponse)
92
- * @param resourceType - The type of the resources to find (use **{@link K8S}** constant). See also {@link ResourceType}.
133
+ * @template T - Your specific resource type. Rancher will supplement the response with additional properties and methods
134
+ * @template I - An override for the response type. By default this uses T and supplements the response, or by supplying a value ignores T
135
+ * @param resourceType - The type of the resources to find (examples in **{@link K8S}**). See also {@link ResourceType}.
93
136
  * @param options - Label selector options for filtering. See {@link FindFilteredLabelSelectorOptions}.
94
137
  * @returns Response containing resource items (may be transient if requested, otherwise cached array).
95
138
  *
@@ -104,25 +147,26 @@ export interface ResourcesApi {
104
147
  * });
105
148
  * ```
106
149
  */
107
- findFiltered<T = SteveListResponse>(
150
+ findFiltered<T = Record<string, any>, I = FindFilteredLabelSelectorResponse<ResourceInstance<T>>>(
108
151
  resourceType: ResourceType,
109
152
  options: FindFilteredLabelSelectorOptions
110
- ): Promise<FindFilteredLabelSelectorResponse<T>>;
153
+ ): Promise<I>;
111
154
 
112
155
  /**
113
156
  * @internal Implementation - use one of the overloads above
114
157
  */
115
- findFiltered<T = SteveListResponse>(
158
+ findFiltered<T = Record<string, any>, I = ResourceInstance<T>>(
116
159
  resourceType: ResourceType,
117
- options: FindFilteredPageOptions | FindFilteredLabelSelectorOptions
118
- ): Promise<FindFilteredPageResponse<T> | FindFilteredLabelSelectorResponse<T>>;
160
+ options: FindFilteredPageOptions | FindFilteredPageOptionsTransient | FindFilteredLabelSelectorOptions
161
+ ): Promise<I[] | ResourceInstance<T>[] | ActionFindPageTransientResponse<ResourceInstance<T>>>;
119
162
 
120
163
  /**
121
164
  * Fetches all resources of a specific type with advanced options.
122
165
  * This method provides additional capabilities like incremental loading and namespace filtering.
123
166
  *
124
- * @template T - The type of the resources (defaults to SteveListResponse)
125
- * @param resourceType - The type of the resources to find (use **{@link K8S}** constant). See also {@link ResourceType}.
167
+ * @template T - Your specific resource type. Rancher will supplement the response with additional properties and methods
168
+ * @template I - An override for the response type. By default this uses T and supplements the response, or by supplying a value ignores T
169
+ * @param resourceType - The type of the resources to find (examples in **{@link K8S}**). See also {@link ResourceType}.
126
170
  * @param options - Optional advanced fetch options (incremental loading, namespace filtering, etc.)
127
171
  * @returns An array of resource items or an empty array if none are found.
128
172
  *
@@ -136,8 +180,118 @@ export interface ResourcesApi {
136
180
  * });
137
181
  * ```
138
182
  */
139
- findAll<T = SteveListResponse>(
183
+ findAll<T = Record<string, any>, I = ResourceInstance<T>>(
140
184
  resourceType: ResourceType,
141
185
  options?: FindAllMethodOptions
142
- ): Promise<T[]>;
186
+ ): Promise<I[]>;
187
+
188
+ /**
189
+ * Creates a new resource.
190
+ *
191
+ * The `data` object must include a `type` property identifying the resource type.
192
+ * This is a raw HTTP operation — it does not check permissions or update the store cache.
193
+ *
194
+ * @template T - Your specific resource type. Rancher will supplement the response with additional properties and methods
195
+ * @template I - An override for the response type. By default this uses T and supplements the response, or by supplying a value ignores T
196
+ * @param data - The resource data to create. Must include a `type` property (examples in **{@link K8S}**). See also {@link CreateResourceData}.
197
+ * @returns The created resource instance.
198
+ *
199
+ * @example
200
+ * ```ts
201
+ * import { useResources, K8S } from '@shell/apis';
202
+ *
203
+ * const resources = useResources();
204
+ *
205
+ * const configMap = await resources.cluster.create({
206
+ * type: K8S.CONFIG_MAP,
207
+ * metadata: { name: 'my-config', namespace: 'default' },
208
+ * data: { key: 'value' }
209
+ * });
210
+ * ```
211
+ */
212
+ create<T = Record<string, any>, I = SteveResource<T>>(
213
+ data: CreateResourceData
214
+ ): Promise<I>;
215
+
216
+ /**
217
+ * Applies a partial update to a resource using HTTP PATCH (merge-patch).
218
+ *
219
+ * Only the fields provided in `data` are sent to the server.
220
+ * This is a raw HTTP operation — it does not check permissions or update the store cache.
221
+ *
222
+ * @template T - Your specific resource type. Rancher will supplement the response with additional properties and methods
223
+ * @template I - An override for the response type. By default this uses T and supplements the response, or by supplying a value ignores T
224
+ * @param resourceType - The type of the resource (examples in **{@link K8S}**). See also {@link ResourceType}.
225
+ * @param resourceId - The unique identifier. If namespaced, use `namespace/name` format.
226
+ * @param data - An object containing only the fields to update.
227
+ * @returns The server response.
228
+ *
229
+ * @example
230
+ * ```ts
231
+ * import { useResources, K8S } from '@shell/apis';
232
+ *
233
+ * const resources = useResources();
234
+ *
235
+ * const result = await resources.cluster.update(K8S.CONFIG_MAP, 'default/my-config', {
236
+ * someField: { newKey: 'newValue' }
237
+ * });
238
+ * ```
239
+ */
240
+ update<T = Record<string, any>, I = SteveResource<T>>(
241
+ resourceType: ResourceType,
242
+ resourceId: string,
243
+ data: Record<string, any>
244
+ ): Promise<I>;
245
+
246
+ /**
247
+ * Performs a full replacement update of a resource using HTTP PUT.
248
+ *
249
+ * Runs `cleanForSave` on the data before sending.
250
+ * This is a raw HTTP operation — it does not check permissions or update the store cache.
251
+ *
252
+ * @template T - Your specific resource type. Rancher will supplement the response with additional properties and methods
253
+ * @template I - An override for the response type. By default this uses T and supplements the response, or by supplying a value ignores T
254
+ * @param resourceType - The type of the resource (examples in **{@link K8S}**). See also {@link ResourceType}.
255
+ * @param resourceId - The unique identifier. If namespaced, use `namespace/name` format.
256
+ * @param data - The complete resource data to send as the replacement.
257
+ * @returns The server response.
258
+ *
259
+ * @example
260
+ * ```ts
261
+ * import { useResources, K8S } from '@shell/apis';
262
+ *
263
+ * const resources = useResources();
264
+ * const configMapData = await resources.cluster.find(K8S.CONFIG_MAP, 'default/my-config');
265
+ * configMapData.someField = { newKey: 'newValue' };
266
+ *
267
+ * const result = await resources.cluster.replace(K8S.CONFIG_MAP, 'default/my-config', configMapData);
268
+ * ```
269
+ */
270
+ replace<T = Record<string, any>, I = SteveResource<T>>(
271
+ resourceType: ResourceType,
272
+ resourceId: string,
273
+ data: Record<string, any>
274
+ ): Promise<I>;
275
+
276
+ /**
277
+ * Deletes a resource by type and ID using HTTP DELETE.
278
+ *
279
+ * This is a raw HTTP operation — it does not check permissions or update the store cache.
280
+ *
281
+ * @param resourceType - The type of the resource (examples in **{@link K8S}**). See also {@link ResourceType}.
282
+ * @param resourceId - The unique identifier. If namespaced, use `namespace/name` format.
283
+ *
284
+ * @example
285
+ * ```ts
286
+ * import { useResources, K8S } from '@shell/apis';
287
+ *
288
+ * const resources = useResources();
289
+ *
290
+ * await resources.cluster.delete(K8S.CONFIG_MAP, 'default/my-config');
291
+ * ```
292
+ */
293
+ delete(
294
+ resourceType: ResourceType,
295
+ resourceId: string
296
+ ): Promise<void>;
143
297
  }
@@ -5,16 +5,18 @@ import { MgmtApi } from '@shell/apis/intf/resources-api/mgmt-api';
5
5
  export * from '@shell/apis/intf/resources-api/resources-api';
6
6
  export * from '@shell/apis/intf/resources-api/cluster-api';
7
7
  export * from '@shell/apis/intf/resources-api/mgmt-api';
8
- export {
9
- ResourceType, FindMethodOptions, FindAllMethodOptions, FindFilteredPageOptions, FindFilteredLabelSelectorOptions,
10
- FindFilteredPageResponse, FindFilteredLabelSelectorResponse
8
+ export type {
9
+ ResourceType, CreateResourceData, FindMethodOptions, FindAllMethodOptions, FindFilteredPageOptions, FindFilteredLabelSelectorOptions,
10
+ FindFilteredPageResponse, FindFilteredLabelSelectorResponse, SteveResource, SteveList
11
11
  } from '@shell/apis/intf/resources-api/resource-base';
12
12
  export * from '@shell/apis/intf/resources-api/resource-constants';
13
13
 
14
- export { SteveGetResponse, SteveListResponse } from '@shell/types/rancher/steve.api';
15
- export { KubeLabelSelector, KubeLabelSelectorExpression } from '@shell/types/kube/kube-api';
14
+ export * from '@shell/apis/intf/resources-api/resource-instance';
15
+
16
+ export type { KubeLabelSelector, KubeLabelSelectorExpression } from '@shell/types/kube/kube-api';
17
+ export type { PaginationSort } from '@shell/types/store/pagination.types';
16
18
  export {
17
- PaginationSort, PaginationParamFilter, PaginationParamProjectOrNamespace, PaginationFilterField
19
+ PaginationParamFilter, PaginationParamProjectOrNamespace, PaginationFilterField
18
20
  } from '@shell/types/store/pagination.types';
19
21
 
20
22
  /**