@stack-spot/portal-network 0.184.0 → 0.185.0-beta.1

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 (142) hide show
  1. package/CHANGELOG.md +2444 -2412
  2. package/dist/api/account.js +1 -1
  3. package/dist/api/agent-tools.js +1 -1
  4. package/dist/api/agent.js +1 -1
  5. package/dist/api/ai.js +1 -1
  6. package/dist/api/apiManagement.js +1 -1
  7. package/dist/api/apiRuntime.js +1 -1
  8. package/dist/api/cloudAccount.js +1 -1
  9. package/dist/api/cloudPlatform.js +1 -1
  10. package/dist/api/cloudPlatformHorizon.js +1 -1
  11. package/dist/api/cloudRuntimes.js +1 -1
  12. package/dist/api/cloudServices.js +1 -1
  13. package/dist/api/codeShift.d.ts +63 -4
  14. package/dist/api/codeShift.d.ts.map +1 -1
  15. package/dist/api/codeShift.js +14 -1
  16. package/dist/api/codeShift.js.map +1 -1
  17. package/dist/api/content.js +1 -1
  18. package/dist/api/dataIntegration.js +1 -1
  19. package/dist/api/discover.js +1 -1
  20. package/dist/api/genAiInference.js +1 -1
  21. package/dist/api/insights.js +1 -1
  22. package/dist/api/notification.js +1 -1
  23. package/dist/api/secrets.js +1 -1
  24. package/dist/api/serviceCatalog.js +1 -1
  25. package/dist/api/workspace-ai.js +1 -1
  26. package/dist/api/workspace.js +1 -1
  27. package/dist/api/workspaceManager.js +1 -1
  28. package/dist/api/workspaceSearchEngine.js +1 -1
  29. package/dist/client/ai.d.ts.map +1 -1
  30. package/dist/client/ai.js +84 -14
  31. package/dist/client/ai.js.map +1 -1
  32. package/dist/client/code-shift.d.ts +30 -0
  33. package/dist/client/code-shift.d.ts.map +1 -1
  34. package/dist/client/code-shift.js +37 -1
  35. package/dist/client/code-shift.js.map +1 -1
  36. package/dist/client/types.d.ts +26 -6
  37. package/dist/client/types.d.ts.map +1 -1
  38. package/package.json +7 -7
  39. package/readme.md +1 -1
  40. package/scripts/generate-apis.ts +134 -134
  41. package/src/api/account.ts +8368 -8367
  42. package/src/api/agent-tools.ts +2172 -2169
  43. package/src/api/agent.ts +1085 -1083
  44. package/src/api/ai.ts +3388 -3388
  45. package/src/api/apiManagement.ts +570 -570
  46. package/src/api/apiRuntime.ts +2103 -2103
  47. package/src/api/cloudAccount.ts +1239 -1239
  48. package/src/api/cloudPlatform.ts +927 -927
  49. package/src/api/cloudPlatformHorizon.ts +2655 -2655
  50. package/src/api/cloudRuntimes.ts +2043 -2043
  51. package/src/api/cloudServices.ts +1445 -1445
  52. package/src/api/codeShift.ts +3567 -3481
  53. package/src/api/content.ts +9785 -9785
  54. package/src/api/dataIntegration.ts +1657 -1657
  55. package/src/api/discover.ts +435 -435
  56. package/src/api/eventBus.ts +171 -171
  57. package/src/api/genAiInference.ts +603 -603
  58. package/src/api/insights.ts +310 -310
  59. package/src/api/notification.ts +336 -334
  60. package/src/api/secrets.ts +342 -342
  61. package/src/api/serviceCatalog.ts +2908 -2908
  62. package/src/api/workflows.ts +1669 -1669
  63. package/src/api/workspace-ai.ts +677 -677
  64. package/src/api/workspace.ts +5889 -5889
  65. package/src/api/workspaceManager.ts +2951 -2951
  66. package/src/api/workspaceSearchEngine.ts +153 -153
  67. package/src/api-addresses.ts +120 -120
  68. package/src/apis-itau.json +225 -225
  69. package/src/apis.json +225 -225
  70. package/src/client/account.ts +902 -902
  71. package/src/client/agent-tools.ts +210 -210
  72. package/src/client/agent.ts +81 -81
  73. package/src/client/ai.ts +469 -395
  74. package/src/client/api-management.ts +40 -40
  75. package/src/client/cloud-account.ts +70 -70
  76. package/src/client/cloud-platform-horizon.ts +113 -113
  77. package/src/client/cloud-platform.ts +163 -163
  78. package/src/client/cloud-runtimes.ts +129 -129
  79. package/src/client/cloud-services.ts +94 -94
  80. package/src/client/code-shift.ts +371 -349
  81. package/src/client/content.ts +538 -538
  82. package/src/client/data-integration.ts +191 -191
  83. package/src/client/discover.ts +89 -89
  84. package/src/client/event-bus.ts +84 -84
  85. package/src/client/gen-ai-inference.ts +65 -65
  86. package/src/client/insights.ts +28 -28
  87. package/src/client/notification.ts +32 -32
  88. package/src/client/runtime-manager.ts +76 -76
  89. package/src/client/secrets.ts +60 -60
  90. package/src/client/types.ts +398 -377
  91. package/src/client/workflow.ts +83 -83
  92. package/src/client/workspace-ai.ts +191 -191
  93. package/src/client/workspace-manager.ts +564 -564
  94. package/src/client/workspace-search.ts +39 -39
  95. package/src/client/workspace.ts +480 -480
  96. package/src/error/DefaultAPIError.ts +151 -151
  97. package/src/error/FileUploadError.ts +18 -18
  98. package/src/error/IgnoredErrorCodes.ts +3 -3
  99. package/src/error/StackspotAPIError.ts +101 -101
  100. package/src/error/StreamCanceledError.ts +10 -10
  101. package/src/error/StreamError.ts +7 -7
  102. package/src/error/StreamJsonError.ts +10 -10
  103. package/src/error/dictionary/account.ts +58 -58
  104. package/src/error/dictionary/action-details.ts +20 -20
  105. package/src/error/dictionary/action.ts +211 -211
  106. package/src/error/dictionary/agent-tools.ts +75 -75
  107. package/src/error/dictionary/ai-inference.ts +28 -28
  108. package/src/error/dictionary/base.ts +22 -22
  109. package/src/error/dictionary/cloud-platform.ts +82 -82
  110. package/src/error/dictionary/cnt-fields.ts +14 -14
  111. package/src/error/dictionary/cnt.ts +103 -103
  112. package/src/error/dictionary/code-shift.ts +12 -12
  113. package/src/error/dictionary/rte.ts +24 -24
  114. package/src/error/dictionary/rtm.ts +10 -10
  115. package/src/error/dictionary/secrets.ts +14 -14
  116. package/src/error/dictionary/workspace-ai.ts +10 -10
  117. package/src/error/dictionary/workspace-details.ts +15 -15
  118. package/src/error/dictionary/workspace-fields.ts +10 -10
  119. package/src/error/dictionary/workspace.ts +209 -209
  120. package/src/error/types.ts +21 -21
  121. package/src/index.ts +43 -43
  122. package/src/network/AutoInfiniteQuery.ts +115 -115
  123. package/src/network/AutoMutation.ts +27 -27
  124. package/src/network/AutoOperation.ts +73 -73
  125. package/src/network/AutoQuery.ts +75 -75
  126. package/src/network/ManualInfiniteQuery.ts +95 -95
  127. package/src/network/ManualMutation.ts +40 -40
  128. package/src/network/ManualOperation.ts +52 -52
  129. package/src/network/ManualQuery.ts +82 -82
  130. package/src/network/NetworkClient.ts +167 -167
  131. package/src/network/ReactQueryNetworkClient.ts +312 -312
  132. package/src/network/react-query-client.ts +14 -14
  133. package/src/network/types.ts +294 -294
  134. package/src/types.ts +1 -1
  135. package/src/utils/StreamedArray.tsx +146 -146
  136. package/src/utils/StreamedJson.tsx +166 -166
  137. package/src/utils/remove-authorization-param.ts +6 -6
  138. package/src/utils/string.ts +19 -19
  139. package/src/utils/use-extended-list.ts +80 -80
  140. package/src/utils/use-streamed-array.ts +17 -17
  141. package/tsconfig.build.json +4 -4
  142. package/tsconfig.json +10 -10
@@ -1,94 +1,94 @@
1
- import { HttpError } from '@oazapfts/runtime'
2
- import {
3
- BillingAccountSummaryResponse,
4
- defaults, downloadCsvFiles, enableGuardrail, getAlerts, getAllocationCostCsv, getAllocationCostFilters, getAllTags,
5
- getCostOverview, getGuardrails, getInstanceDetails, listBillingAccounts, listInstances, listServices,
6
- processAllocationCostRequest,
7
- } from '../api/cloudServices'
8
- import { DefaultAPIError } from '../error/DefaultAPIError'
9
- import { StackspotAPIError } from '../error/StackspotAPIError'
10
- import { ReactQueryNetworkClient } from '../network/ReactQueryNetworkClient'
11
- import { CostAllocationResult, CostAllocationVariables, FixedManagedService, FixVariables, OazapftsFunction, ReplaceResult } from './types'
12
- import { getApiAddresses } from '../api-addresses'
13
-
14
- class CloudServicesClient extends ReactQueryNetworkClient {
15
- constructor() {
16
- super(getApiAddresses().cloudServices.url, defaults)
17
- }
18
-
19
- protected buildStackSpotError(error: HttpError): StackspotAPIError {
20
- return new DefaultAPIError(error.data, error.status, { en: {}, pt: {} }, error.headers)
21
- }
22
-
23
- /**
24
- * Gets overview of costs over the current month, last month and last 3 months.
25
- */
26
- costOverview = this.query(getCostOverview as unknown as FixVariables<typeof getCostOverview, { sortOrder?: 'asc' | 'desc' }>)
27
- /**
28
- * Gets a CSV file with the data of `costOverview`.
29
- */
30
- downloadCostOverviewCSV = this.mutation(downloadCsvFiles)
31
- /**
32
- * Gets the alerts in a workspace and environment (paginated).
33
- */
34
- alerts = this.infiniteQuery(getAlerts, {
35
- accumulator: 'data',
36
- defaultVariables: { pageSize: 40 },
37
- initialPageParam: 1,
38
- getNextPageParam: ({ lastPage }) => lastPage.nextPage,
39
- })
40
- /**
41
- * Lists instances of a particular service resource running in a workspace.
42
- */
43
- allInstancesOfResource = this.query(listInstances)
44
- /**
45
- * Lists all managed services.
46
- */
47
- allServices = this.query(listServices as unknown as ReplaceResult<typeof listServices, FixedManagedService[]>)
48
- /**
49
- * Gets the description of an instance.
50
- */
51
- // we need a manual query here because the backend returns application/json in error responses and application/yaml in successful
52
- // responses. Oazapfts will handle the request as JSON whenever at least one of the response types is JSON, which I think is wrong, but
53
- // it is what it is. This manual query changes the accept header to */* and the return type to string, which is the fallback when Oazapfts
54
- // can't parse what it expects to be a json.
55
- instance = this.query({
56
- name: 'instance',
57
- request: (signal, variables: Parameters<typeof getInstanceDetails>[0]) => {
58
- return getInstanceDetails(variables, { signal, headers: { 'accept': '*/*' }}) as unknown as Promise<string>
59
- },
60
- permission: this.createPermissionFunctionFor(getInstanceDetails),
61
- })
62
- /**
63
- * Gets all Guard Rails.
64
- */
65
- guardRails = this.query(getGuardrails)
66
- /**
67
- * Enables a Guard Rail in any level
68
- */
69
- enableGuardRail = this.mutation(enableGuardrail)
70
- /**
71
- * Retrieves cost and usage metrics for the current account.
72
- */
73
- costAllocation = this.query(
74
- processAllocationCostRequest as unknown as OazapftsFunction<CostAllocationVariables, CostAllocationResult>,
75
- )
76
- /**
77
- * Lists the filters related to the given type.
78
- */
79
- costAllocationFilters = this.query(getAllocationCostFilters)
80
- /**
81
- * Gets a CSV file with the data of `costAllocation`.
82
- */
83
- downloadCostAllocationCSV = this.query(getAllocationCostCsv)
84
- /**
85
- * Lists all tags.
86
- */
87
- allTags = this.query(getAllTags)
88
- /**
89
- * Retrieves a summary for each billing account of the account with the id passed as parameter.
90
- */
91
- billingAccounts = this.query(listBillingAccounts as unknown as ReplaceResult<typeof listBillingAccounts, BillingAccountSummaryResponse[]>)
92
- }
93
-
94
- export const cloudServicesClient = new CloudServicesClient()
1
+ import { HttpError } from '@oazapfts/runtime'
2
+ import {
3
+ BillingAccountSummaryResponse,
4
+ defaults, downloadCsvFiles, enableGuardrail, getAlerts, getAllocationCostCsv, getAllocationCostFilters, getAllTags,
5
+ getCostOverview, getGuardrails, getInstanceDetails, listBillingAccounts, listInstances, listServices,
6
+ processAllocationCostRequest,
7
+ } from '../api/cloudServices'
8
+ import { DefaultAPIError } from '../error/DefaultAPIError'
9
+ import { StackspotAPIError } from '../error/StackspotAPIError'
10
+ import { ReactQueryNetworkClient } from '../network/ReactQueryNetworkClient'
11
+ import { CostAllocationResult, CostAllocationVariables, FixedManagedService, FixVariables, OazapftsFunction, ReplaceResult } from './types'
12
+ import { getApiAddresses } from '../api-addresses'
13
+
14
+ class CloudServicesClient extends ReactQueryNetworkClient {
15
+ constructor() {
16
+ super(getApiAddresses().cloudServices.url, defaults)
17
+ }
18
+
19
+ protected buildStackSpotError(error: HttpError): StackspotAPIError {
20
+ return new DefaultAPIError(error.data, error.status, { en: {}, pt: {} }, error.headers)
21
+ }
22
+
23
+ /**
24
+ * Gets overview of costs over the current month, last month and last 3 months.
25
+ */
26
+ costOverview = this.query(getCostOverview as unknown as FixVariables<typeof getCostOverview, { sortOrder?: 'asc' | 'desc' }>)
27
+ /**
28
+ * Gets a CSV file with the data of `costOverview`.
29
+ */
30
+ downloadCostOverviewCSV = this.mutation(downloadCsvFiles)
31
+ /**
32
+ * Gets the alerts in a workspace and environment (paginated).
33
+ */
34
+ alerts = this.infiniteQuery(getAlerts, {
35
+ accumulator: 'data',
36
+ defaultVariables: { pageSize: 40 },
37
+ initialPageParam: 1,
38
+ getNextPageParam: ({ lastPage }) => lastPage.nextPage,
39
+ })
40
+ /**
41
+ * Lists instances of a particular service resource running in a workspace.
42
+ */
43
+ allInstancesOfResource = this.query(listInstances)
44
+ /**
45
+ * Lists all managed services.
46
+ */
47
+ allServices = this.query(listServices as unknown as ReplaceResult<typeof listServices, FixedManagedService[]>)
48
+ /**
49
+ * Gets the description of an instance.
50
+ */
51
+ // we need a manual query here because the backend returns application/json in error responses and application/yaml in successful
52
+ // responses. Oazapfts will handle the request as JSON whenever at least one of the response types is JSON, which I think is wrong, but
53
+ // it is what it is. This manual query changes the accept header to */* and the return type to string, which is the fallback when Oazapfts
54
+ // can't parse what it expects to be a json.
55
+ instance = this.query({
56
+ name: 'instance',
57
+ request: (signal, variables: Parameters<typeof getInstanceDetails>[0]) => {
58
+ return getInstanceDetails(variables, { signal, headers: { 'accept': '*/*' }}) as unknown as Promise<string>
59
+ },
60
+ permission: this.createPermissionFunctionFor(getInstanceDetails),
61
+ })
62
+ /**
63
+ * Gets all Guard Rails.
64
+ */
65
+ guardRails = this.query(getGuardrails)
66
+ /**
67
+ * Enables a Guard Rail in any level
68
+ */
69
+ enableGuardRail = this.mutation(enableGuardrail)
70
+ /**
71
+ * Retrieves cost and usage metrics for the current account.
72
+ */
73
+ costAllocation = this.query(
74
+ processAllocationCostRequest as unknown as OazapftsFunction<CostAllocationVariables, CostAllocationResult>,
75
+ )
76
+ /**
77
+ * Lists the filters related to the given type.
78
+ */
79
+ costAllocationFilters = this.query(getAllocationCostFilters)
80
+ /**
81
+ * Gets a CSV file with the data of `costAllocation`.
82
+ */
83
+ downloadCostAllocationCSV = this.query(getAllocationCostCsv)
84
+ /**
85
+ * Lists all tags.
86
+ */
87
+ allTags = this.query(getAllTags)
88
+ /**
89
+ * Retrieves a summary for each billing account of the account with the id passed as parameter.
90
+ */
91
+ billingAccounts = this.query(listBillingAccounts as unknown as ReplaceResult<typeof listBillingAccounts, BillingAccountSummaryResponse[]>)
92
+ }
93
+
94
+ export const cloudServicesClient = new CloudServicesClient()