axhub-sdk 0.3.0 → 0.4.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 87c5676568c02cbf7dd18a197c0f44931632dcf9e22facb4911b066fdd7ceb6d
4
- data.tar.gz: 8a1558e6f13a915c471efdaacff64d856a4616e25a875e88c51193faf10d3204
3
+ metadata.gz: 338b89a2961c6685ebe9d57f8a9958c3136b3d145f73cf6ad4c367f3bca06a41
4
+ data.tar.gz: 978b7257981e4cd3f571087734340c61da67df9d800c7d1290adb83f1cb227f4
5
5
  SHA512:
6
- metadata.gz: 783981a17b4e57b815ae92c33a867953ad05151c1cfb4266f5c258531c4b9461eaa34f4e0be6b10711a03dcfabd1fbb64e7d48835f06ee4388722de72463413a
7
- data.tar.gz: eae4cb33b36bb93274710c0510915251d9824b950bc7213b374d2d9d449a1931300321a026afb2f48de7df843a99b202828b1b4b08199cfc84d7ca1e0bb9bdb3
6
+ metadata.gz: 271af688bbd700b2d44ddd34a6b4b51e8df64f46b0a8227aae51ad39a35502f6587ba3ba700c33d535555aa8f4ce92a4e0b387fc24648a134772644c1bc87be6
7
+ data.tar.gz: 5ec2ba139a45b27158963cd6d726c18f00df0271e0662aef0bfb59f705f59b6ed2df001cfcfa1163c380fdedf1ac901c94fbd2cf4376cb58657c357449adfa81
data/README.md CHANGED
@@ -5,7 +5,7 @@ AX Hub Ruby SDK for `https://api.axhub.ai`. It gives agents a dependency-light c
5
5
  ## Install
6
6
 
7
7
  ```bash
8
- gem install axhub-sdk -v 0.2.0
8
+ gem install axhub-sdk -v 0.4.0
9
9
  ```
10
10
 
11
11
  Local development:
@@ -51,7 +51,7 @@ app = client.apps.create(
51
51
  name: 'Agent Ruby README QA',
52
52
  visibility: 'private',
53
53
  auth_mode: 'anonymous',
54
- resource_tier: 'S',
54
+ resource_preset: 'S',
55
55
  deploy_method: 'docker',
56
56
  subdomain: slug
57
57
  )
@@ -93,16 +93,6 @@ module AxHub
93
93
  Data._reject_legacy_page_options(after, before, direction, @table_name)
94
94
  resolved_page = Data._resolve_offset_page(cursor, page, @table_name)
95
95
  per_page = Data._clamp_per_page(page_size.nil? ? limit : page_size)
96
- # The AxHub data ring rejects an unfiltered list with HTTP 400
97
- # ("최소 1개의 WHERE 필터가 필요해요") as a deliberate mass-scan guard —
98
- # confirmed live 2026-06, mirrored by the `axhub data` CLI. Checked after
99
- # cursor/page validation so a malformed cursor still surfaces first.
100
- if where.nil?
101
- raise ValidationError.new(
102
- 'AxHub data list requires at least one WHERE filter (the backend rejects unfiltered scans). Pass `where:`.',
103
- 'where_required'
104
- )
105
- end
106
96
  query = Data.serialize_where(where).dup
107
97
  query['per_page'] = per_page unless per_page.nil?
108
98
  query['page'] = resolved_page if resolved_page != 1
@@ -110,7 +100,7 @@ module AxHub
110
100
  query['sort'] = sort if sort && sort != ''
111
101
  serialized_select = Data.serialize_select(select)
112
102
  query['_select'] = serialized_select unless serialized_select.nil?
113
- raw = @client.request_raw('GET', _path, query: query) || {}
103
+ raw = Data.map_where_required('list') { @client.request_raw('GET', _path, query: query) } || {}
114
104
  items = Data.project_rows(raw['items'] || [], select)
115
105
  # mirrors node: current_page falls back to the requested page, has_next
116
106
  # reads the backend `has_more` flag verbatim, has_prev derives client-side.
@@ -140,14 +130,7 @@ module AxHub
140
130
  end
141
131
 
142
132
  def count(where: nil)
143
- # Same mass-scan guard as list() the backend 400s an unfiltered count.
144
- if where.nil?
145
- raise ValidationError.new(
146
- 'AxHub data count requires at least one WHERE filter (the backend rejects unfiltered scans). Pass `where:`.',
147
- 'where_required'
148
- )
149
- end
150
- raw = @client.request_raw('GET', "#{_path}/_count", query: Data.serialize_where(where)) || {}
133
+ raw = Data.map_where_required('count') { @client.request_raw('GET', "#{_path}/_count", query: Data.serialize_where(where)) } || {}
151
134
  raw['count']
152
135
  end
153
136
 
@@ -44,5 +44,25 @@ module AxHub
44
44
  super(category: 'internal', code: 'scan_limit_exceeded', message: message, status: 0, retryable: false, request_id: request_id)
45
45
  end
46
46
  end
47
+ # The backend 400s an unfiltered list/count on NON-owner-scoped tables
48
+ # ("최소 1개의 WHERE 필터가 필요해요") but ACCEPTS it on owner-scoped tables
49
+ # (rows auto-scope to the caller) — both confirmed live 2026-06. A client
50
+ # pre-check cannot tell them apart (0.3.0 regression), so the request goes
51
+ # through and only the backend 400 is normalized.
52
+ def self.map_where_required(op)
53
+ yield
54
+ rescue StandardError => e
55
+ code = e.respond_to?(:code) ? e.code : nil
56
+ status = e.respond_to?(:status) ? e.status : nil
57
+ if code.to_s == 'required' && status.to_i == 400
58
+ raise ValidationError.new(
59
+ "AxHub data #{op} requires at least one WHERE filter on this table " \
60
+ '(the backend rejects unfiltered scans on non-owner-scoped tables). Pass `where:`.',
61
+ 'where_required'
62
+ )
63
+ end
64
+ raise
65
+ end
66
+
47
67
  end
48
68
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module AxHub
4
- VERSION = '0.3.0'
4
+ VERSION = '0.4.0'
5
5
  end
data/lib/axhub_sdk.rb CHANGED
@@ -17,6 +17,7 @@ module AxHub
17
17
  end
18
18
  ROUTES = [
19
19
  { 'method' => "GET", 'path' => "/.well-known/jwks.json", 'tag' => "Auth", 'operationId' => "authGetWellKnownJwksJson" },
20
+ { 'method' => "GET", 'path' => "/.well-known/oauth-authorization-server", 'tag' => "Auth", 'operationId' => "authGetWellKnownOauthAuthorizationServer" },
20
21
  { 'method' => "GET", 'path' => "/.well-known/openid-configuration", 'tag' => "Auth", 'operationId' => "authGetWellKnownOpenidConfiguration" },
21
22
  { 'method' => "GET", 'path' => "/api/v1/admin/templates", 'tag' => "Apps", 'operationId' => "appsGetApiV1AdminTemplates" },
22
23
  { 'method' => "POST", 'path' => "/api/v1/admin/templates", 'tag' => "Apps", 'operationId' => "appsPostApiV1AdminTemplates" },
@@ -73,9 +74,7 @@ module AxHub
73
74
  { 'method' => "GET", 'path' => "/api/v1/apps/{appID}/tables/column-types", 'tag' => "Schema", 'operationId' => "schemaGetApiV1AppsByAppIDTablesColumnTypes" },
74
75
  { 'method' => "GET", 'path' => "/api/v1/apps/discover", 'tag' => "Apps", 'operationId' => "appsGetApiV1AppsDiscover" },
75
76
  { 'method' => "GET", 'path' => "/api/v1/apps/search", 'tag' => "Apps", 'operationId' => "appsGetApiV1AppsSearch" },
76
- { 'method' => "GET", 'path' => "/api/v1/catalog/kinds", 'tag' => "Gateway", 'operationId' => "gatewayGetApiV1CatalogKinds" },
77
77
  { 'method' => "DELETE", 'path' => "/api/v1/comments/{commentID}", 'tag' => "Apps", 'operationId' => "appsDeleteApiV1CommentsByCommentID" },
78
- { 'method' => "GET", 'path' => "/api/v1/engines", 'tag' => "Gateway", 'operationId' => "gatewayGetApiV1Engines" },
79
78
  { 'method' => "GET", 'path' => "/api/v1/github/accounts", 'tag' => "deploy", 'operationId' => "deployGetApiV1GithubAccounts" },
80
79
  { 'method' => "GET", 'path' => "/api/v1/github/installations/{installationID}/repositories", 'tag' => "deploy", 'operationId' => "deployGetApiV1GithubInstallationsByInstallationIDRepositories" },
81
80
  { 'method' => "GET", 'path' => "/api/v1/invite-links/{token}", 'tag' => "Tenants", 'operationId' => "tenantsGetApiV1InviteLinksByToken" },
@@ -90,6 +89,7 @@ module AxHub
90
89
  { 'method' => "DELETE", 'path' => "/api/v1/me/personal-access-tokens/{patID}", 'tag' => "Schema", 'operationId' => "schemaDeleteApiV1MePersonalAccessTokensByPatID" },
91
90
  { 'method' => "GET", 'path' => "/api/v1/oauth-clients/{clientID}", 'tag' => "Auth", 'operationId' => "authGetApiV1OauthClientsByClientID" },
92
91
  { 'method' => "DELETE", 'path' => "/api/v1/oauth/clients/{clientID}/grants/me", 'tag' => "Auth", 'operationId' => "authDeleteApiV1OauthClientsByClientIDGrantsMe" },
92
+ { 'method' => "GET", 'path' => "/api/v1/resource-presets", 'tag' => "Apps", 'operationId' => "appsGetApiV1ResourcePresets" },
93
93
  { 'method' => "GET", 'path' => "/api/v1/review-requests/{rrID}", 'tag' => "Apps", 'operationId' => "appsGetApiV1ReviewRequestsByRrID" },
94
94
  { 'method' => "POST", 'path' => "/api/v1/review-requests/{rrID}/approve", 'tag' => "Apps", 'operationId' => "appsPostApiV1ReviewRequestsByRrIDApprove" },
95
95
  { 'method' => "POST", 'path' => "/api/v1/review-requests/{rrID}/reject", 'tag' => "Apps", 'operationId' => "appsPostApiV1ReviewRequestsByRrIDReject" },
@@ -111,10 +111,6 @@ module AxHub
111
111
  { 'method' => "GET", 'path' => "/api/v1/tenants/{tenantID}/audit-events/{eventID}", 'tag' => "Audit", 'operationId' => "auditGetApiV1TenantsByTenantIDAuditEventsByEventID" },
112
112
  { 'method' => "POST", 'path' => "/api/v1/tenants/{tenantID}/audit-events/anonymize", 'tag' => "Audit", 'operationId' => "auditPostApiV1TenantsByTenantIDAuditEventsAnonymize" },
113
113
  { 'method' => "GET", 'path' => "/api/v1/tenants/{tenantID}/audit-events/integrity-check", 'tag' => "Audit", 'operationId' => "auditGetApiV1TenantsByTenantIDAuditEventsIntegrityCheck" },
114
- { 'method' => "GET", 'path' => "/api/v1/tenants/{tenantID}/catalog/connectors", 'tag' => "Gateway", 'operationId' => "gatewayGetApiV1TenantsByTenantIDCatalogConnectors" },
115
- { 'method' => "GET", 'path' => "/api/v1/tenants/{tenantID}/catalog/resources", 'tag' => "Gateway", 'operationId' => "gatewayGetApiV1TenantsByTenantIDCatalogResources" },
116
- { 'method' => "GET", 'path' => "/api/v1/tenants/{tenantID}/catalog/resources/{connector}/{path}", 'tag' => "Gateway", 'operationId' => "gatewayGetApiV1TenantsByTenantIDCatalogResourcesByConnectorByPath" },
117
- { 'method' => "POST", 'path' => "/api/v1/tenants/{tenantID}/catalog/resources/{connector}/{path}", 'tag' => "Gateway", 'operationId' => "gatewayPostApiV1TenantsByTenantIDCatalogResourcesByConnectorByPath" },
118
114
  { 'method' => "GET", 'path' => "/api/v1/tenants/{tenantID}/categories", 'tag' => "Apps", 'operationId' => "appsGetApiV1TenantsByTenantIDCategories" },
119
115
  { 'method' => "POST", 'path' => "/api/v1/tenants/{tenantID}/categories", 'tag' => "Apps", 'operationId' => "appsPostApiV1TenantsByTenantIDCategories" },
120
116
  { 'method' => "DELETE", 'path' => "/api/v1/tenants/{tenantID}/categories/{categoryID}", 'tag' => "Apps", 'operationId' => "appsDeleteApiV1TenantsByTenantIDCategoriesByCategoryID" },
@@ -123,28 +119,36 @@ module AxHub
123
119
  { 'method' => "GET", 'path' => "/api/v1/tenants/{tenantID}/connectors", 'tag' => "Gateway", 'operationId' => "gatewayGetApiV1TenantsByTenantIDConnectors" },
124
120
  { 'method' => "POST", 'path' => "/api/v1/tenants/{tenantID}/connectors", 'tag' => "Gateway", 'operationId' => "gatewayPostApiV1TenantsByTenantIDConnectors" },
125
121
  { 'method' => "DELETE", 'path' => "/api/v1/tenants/{tenantID}/connectors/{connectorID}", 'tag' => "Gateway", 'operationId' => "gatewayDeleteApiV1TenantsByTenantIDConnectorsByConnectorID" },
122
+ { 'method' => "GET", 'path' => "/api/v1/tenants/{tenantID}/connectors/{connectorID}", 'tag' => "Gateway", 'operationId' => "gatewayGetApiV1TenantsByTenantIDConnectorsByConnectorID" },
126
123
  { 'method' => "PATCH", 'path' => "/api/v1/tenants/{tenantID}/connectors/{connectorID}", 'tag' => "Gateway", 'operationId' => "gatewayPatchApiV1TenantsByTenantIDConnectorsByConnectorID" },
127
- { 'method' => "POST", 'path' => "/api/v1/tenants/{tenantID}/connectors/{connectorID}/credentials", 'tag' => "Gateway", 'operationId' => "gatewayPostApiV1TenantsByTenantIDConnectorsByConnectorIDCredentials" },
128
- { 'method' => "GET", 'path' => "/api/v1/tenants/{tenantID}/connectors/{connectorID}/discover", 'tag' => "Gateway", 'operationId' => "gatewayGetApiV1TenantsByTenantIDConnectorsByConnectorIDDiscover" },
124
+ { 'method' => "POST", 'path' => "/api/v1/tenants/{tenantID}/connectors/{connectorID}/test-connection", 'tag' => "Gateway", 'operationId' => "gatewayPostApiV1TenantsByTenantIDConnectorsByConnectorIDTestConnection" },
129
125
  { 'method' => "GET", 'path' => "/api/v1/tenants/{tenantID}/cost/by-app", 'tag' => "Cost", 'operationId' => "costGetApiV1TenantsByTenantIDCostByApp" },
130
126
  { 'method' => "GET", 'path' => "/api/v1/tenants/{tenantID}/cost/by-cost-center", 'tag' => "Cost", 'operationId' => "costGetApiV1TenantsByTenantIDCostByCostCenter" },
131
127
  { 'method' => "GET", 'path' => "/api/v1/tenants/{tenantID}/cost/export", 'tag' => "Cost", 'operationId' => "costGetApiV1TenantsByTenantIDCostExport" },
128
+ { 'method' => "GET", 'path' => "/api/v1/tenants/{tenantID}/cost/months", 'tag' => "Cost", 'operationId' => "costGetApiV1TenantsByTenantIDCostMonths" },
132
129
  { 'method' => "GET", 'path' => "/api/v1/tenants/{tenantID}/cost/summary", 'tag' => "Cost", 'operationId' => "costGetApiV1TenantsByTenantIDCostSummary" },
133
130
  { 'method' => "GET", 'path' => "/api/v1/tenants/{tenantID}/cost/timeseries", 'tag' => "Cost", 'operationId' => "costGetApiV1TenantsByTenantIDCostTimeseries" },
131
+ { 'method' => "GET", 'path' => "/api/v1/tenants/{tenantID}/deployments", 'tag' => "Deploy", 'operationId' => "deployGetApiV1TenantsByTenantIDDeployments" },
134
132
  { 'method' => "GET", 'path' => "/api/v1/tenants/{tenantID}/discover/apps", 'tag' => "Apps", 'operationId' => "appsGetApiV1TenantsByTenantIDDiscoverApps" },
135
133
  { 'method' => "GET", 'path' => "/api/v1/tenants/{tenantID}/email-domains", 'tag' => "Tenants", 'operationId' => "tenantsGetApiV1TenantsByTenantIDEmailDomains" },
136
134
  { 'method' => "POST", 'path' => "/api/v1/tenants/{tenantID}/email-domains", 'tag' => "Tenants", 'operationId' => "tenantsPostApiV1TenantsByTenantIDEmailDomains" },
137
135
  { 'method' => "DELETE", 'path' => "/api/v1/tenants/{tenantID}/email-domains/{domain}", 'tag' => "Tenants", 'operationId' => "tenantsDeleteApiV1TenantsByTenantIDEmailDomainsByDomain" },
136
+ { 'method' => "POST", 'path' => "/api/v1/tenants/{tenantID}/gateway/invoke", 'tag' => "Gateway", 'operationId' => "gatewayPostApiV1TenantsByTenantIDGatewayInvoke" },
138
137
  { 'method' => "POST", 'path' => "/api/v1/tenants/{tenantID}/gateway/query", 'tag' => "Gateway", 'operationId' => "gatewayPostApiV1TenantsByTenantIDGatewayQuery" },
138
+ { 'method' => "POST", 'path' => "/api/v1/tenants/{tenantID}/gateway/sessions", 'tag' => "Gateway", 'operationId' => "gatewayPostApiV1TenantsByTenantIDGatewaySessions" },
139
+ { 'method' => "DELETE", 'path' => "/api/v1/tenants/{tenantID}/gateway/sessions/{sessionID}", 'tag' => "Gateway", 'operationId' => "gatewayDeleteApiV1TenantsByTenantIDGatewaySessionsBySessionID" },
139
140
  { 'method' => "GET", 'path' => "/api/v1/tenants/{tenantID}/grants", 'tag' => "Authorization", 'operationId' => "authorizationGetApiV1TenantsByTenantIDGrants" },
140
- { 'method' => "POST", 'path' => "/api/v1/tenants/{tenantID}/grants/{grantID}/grant", 'tag' => "Authorization", 'operationId' => "authorizationPostApiV1TenantsByTenantIDGrantsByGrantIDGrant" },
141
- { 'method' => "POST", 'path' => "/api/v1/tenants/{tenantID}/grants/{grantID}/revoke", 'tag' => "Authorization", 'operationId' => "authorizationPostApiV1TenantsByTenantIDGrantsByGrantIDRevoke" },
141
+ { 'method' => "POST", 'path' => "/api/v1/tenants/{tenantID}/grants", 'tag' => "Authorization", 'operationId' => "authorizationPostApiV1TenantsByTenantIDGrants" },
142
+ { 'method' => "DELETE", 'path' => "/api/v1/tenants/{tenantID}/grants/{grantID}", 'tag' => "Authorization", 'operationId' => "authorizationDeleteApiV1TenantsByTenantIDGrantsByGrantID" },
143
+ { 'method' => "GET", 'path' => "/api/v1/tenants/{tenantID}/grants/{grantID}", 'tag' => "Authorization", 'operationId' => "authorizationGetApiV1TenantsByTenantIDGrantsByGrantID" },
142
144
  { 'method' => "DELETE", 'path' => "/api/v1/tenants/{tenantID}/icon", 'tag' => "Tenants", 'operationId' => "tenantsDeleteApiV1TenantsByTenantIDIcon" },
143
145
  { 'method' => "POST", 'path' => "/api/v1/tenants/{tenantID}/icon/upload-url", 'tag' => "Tenants", 'operationId' => "tenantsPostApiV1TenantsByTenantIDIconUploadUrl" },
144
146
  { 'method' => "GET", 'path' => "/api/v1/tenants/{tenantID}/identity-providers", 'tag' => "Auth", 'operationId' => "authGetApiV1TenantsByTenantIDIdentityProviders" },
145
147
  { 'method' => "POST", 'path' => "/api/v1/tenants/{tenantID}/identity-providers", 'tag' => "Auth", 'operationId' => "authPostApiV1TenantsByTenantIDIdentityProviders" },
146
148
  { 'method' => "POST", 'path' => "/api/v1/tenants/{tenantID}/identity-providers/{providerID}/disable", 'tag' => "Auth", 'operationId' => "authPostApiV1TenantsByTenantIDIdentityProvidersByProviderIDDisable" },
147
149
  { 'method' => "POST", 'path' => "/api/v1/tenants/{tenantID}/identity-providers/{providerID}/enable", 'tag' => "Auth", 'operationId' => "authPostApiV1TenantsByTenantIDIdentityProvidersByProviderIDEnable" },
150
+ { 'method' => "GET", 'path' => "/api/v1/tenants/{tenantID}/infra/apps/{appID}/usage-series", 'tag' => "Cost", 'operationId' => "costGetApiV1TenantsByTenantIDInfraAppsByAppIDUsageSeries" },
151
+ { 'method' => "GET", 'path' => "/api/v1/tenants/{tenantID}/infra/usage", 'tag' => "Cost", 'operationId' => "costGetApiV1TenantsByTenantIDInfraUsage" },
148
152
  { 'method' => "GET", 'path' => "/api/v1/tenants/{tenantID}/invitations", 'tag' => "Tenants", 'operationId' => "tenantsGetApiV1TenantsByTenantIDInvitations" },
149
153
  { 'method' => "POST", 'path' => "/api/v1/tenants/{tenantID}/invitations", 'tag' => "Tenants", 'operationId' => "tenantsPostApiV1TenantsByTenantIDInvitations" },
150
154
  { 'method' => "DELETE", 'path' => "/api/v1/tenants/{tenantID}/invitations/{invitationID}", 'tag' => "Tenants", 'operationId' => "tenantsDeleteApiV1TenantsByTenantIDInvitationsByInvitationID" },
@@ -152,29 +156,21 @@ module AxHub
152
156
  { 'method' => "GET", 'path' => "/api/v1/tenants/{tenantID}/invite-links", 'tag' => "Tenants", 'operationId' => "tenantsGetApiV1TenantsByTenantIDInviteLinks" },
153
157
  { 'method' => "POST", 'path' => "/api/v1/tenants/{tenantID}/invite-links", 'tag' => "Tenants", 'operationId' => "tenantsPostApiV1TenantsByTenantIDInviteLinks" },
154
158
  { 'method' => "DELETE", 'path' => "/api/v1/tenants/{tenantID}/invite-links/{linkID}", 'tag' => "Tenants", 'operationId' => "tenantsDeleteApiV1TenantsByTenantIDInviteLinksByLinkID" },
159
+ { 'method' => "GET", 'path' => "/api/v1/tenants/{tenantID}/me/connectors", 'tag' => "Gateway", 'operationId' => "gatewayGetApiV1TenantsByTenantIDMeConnectors" },
160
+ { 'method' => "GET", 'path' => "/api/v1/tenants/{tenantID}/me/connectors/{connectorID}/resources", 'tag' => "Gateway", 'operationId' => "gatewayGetApiV1TenantsByTenantIDMeConnectorsByConnectorIDResources" },
161
+ { 'method' => "GET", 'path' => "/api/v1/tenants/{tenantID}/me/grants", 'tag' => "Authorization", 'operationId' => "authorizationGetApiV1TenantsByTenantIDMeGrants" },
155
162
  { 'method' => "GET", 'path' => "/api/v1/tenants/{tenantID}/members", 'tag' => "Tenants", 'operationId' => "tenantsGetApiV1TenantsByTenantIDMembers" },
156
163
  { 'method' => "PATCH", 'path' => "/api/v1/tenants/{tenantID}/members/{membershipID}", 'tag' => "Tenants", 'operationId' => "tenantsPatchApiV1TenantsByTenantIDMembersByMembershipID" },
157
164
  { 'method' => "POST", 'path' => "/api/v1/tenants/{tenantID}/members/{membershipID}/deactivate", 'tag' => "Tenants", 'operationId' => "tenantsPostApiV1TenantsByTenantIDMembersByMembershipIDDeactivate" },
158
165
  { 'method' => "POST", 'path' => "/api/v1/tenants/{tenantID}/members/{membershipID}/reactivate", 'tag' => "Tenants", 'operationId' => "tenantsPostApiV1TenantsByTenantIDMembersByMembershipIDReactivate" },
159
- { 'method' => "GET", 'path' => "/api/v1/tenants/{tenantID}/resources", 'tag' => "Gateway", 'operationId' => "gatewayGetApiV1TenantsByTenantIDResources" },
160
- { 'method' => "DELETE", 'path' => "/api/v1/tenants/{tenantID}/resources/{resourceID}", 'tag' => "Gateway", 'operationId' => "gatewayDeleteApiV1TenantsByTenantIDResourcesByResourceID" },
161
- { 'method' => "PATCH", 'path' => "/api/v1/tenants/{tenantID}/resources/{resourceID}", 'tag' => "Gateway", 'operationId' => "gatewayPatchApiV1TenantsByTenantIDResourcesByResourceID" },
162
- { 'method' => "POST", 'path' => "/api/v1/tenants/{tenantID}/resources/{resourceID}/move", 'tag' => "Gateway", 'operationId' => "gatewayPostApiV1TenantsByTenantIDResourcesByResourceIDMove" },
163
- { 'method' => "POST", 'path' => "/api/v1/tenants/{tenantID}/resources/{resourceID}/tags", 'tag' => "Gateway", 'operationId' => "gatewayPostApiV1TenantsByTenantIDResourcesByResourceIDTags" },
164
- { 'method' => "DELETE", 'path' => "/api/v1/tenants/{tenantID}/resources/{resourceID}/tags/{tagID}", 'tag' => "Gateway", 'operationId' => "gatewayDeleteApiV1TenantsByTenantIDResourcesByResourceIDTagsByTagID" },
165
- { 'method' => "POST", 'path' => "/api/v1/tenants/{tenantID}/resources/bulk", 'tag' => "Gateway", 'operationId' => "gatewayPostApiV1TenantsByTenantIDResourcesBulk" },
166
- { 'method' => "POST", 'path' => "/api/v1/tenants/{tenantID}/resources/namespaces", 'tag' => "Gateway", 'operationId' => "gatewayPostApiV1TenantsByTenantIDResourcesNamespaces" },
166
+ { 'method' => "GET", 'path' => "/api/v1/tenants/{tenantID}/presets", 'tag' => "Authorization", 'operationId' => "authorizationGetApiV1TenantsByTenantIDPresets" },
167
+ { 'method' => "POST", 'path' => "/api/v1/tenants/{tenantID}/presets", 'tag' => "Authorization", 'operationId' => "authorizationPostApiV1TenantsByTenantIDPresets" },
168
+ { 'method' => "DELETE", 'path' => "/api/v1/tenants/{tenantID}/presets/{presetID}", 'tag' => "Authorization", 'operationId' => "authorizationDeleteApiV1TenantsByTenantIDPresetsByPresetID" },
169
+ { 'method' => "GET", 'path' => "/api/v1/tenants/{tenantID}/presets/{presetID}", 'tag' => "Authorization", 'operationId' => "authorizationGetApiV1TenantsByTenantIDPresetsByPresetID" },
170
+ { 'method' => "PATCH", 'path' => "/api/v1/tenants/{tenantID}/presets/{presetID}", 'tag' => "Authorization", 'operationId' => "authorizationPatchApiV1TenantsByTenantIDPresetsByPresetID" },
167
171
  { 'method' => "GET", 'path' => "/api/v1/tenants/{tenantID}/subjects", 'tag' => "Authorization", 'operationId' => "authorizationGetApiV1TenantsByTenantIDSubjects" },
168
172
  { 'method' => "POST", 'path' => "/api/v1/tenants/{tenantID}/subjects", 'tag' => "Authorization", 'operationId' => "authorizationPostApiV1TenantsByTenantIDSubjects" },
169
- { 'method' => "DELETE", 'path' => "/api/v1/tenants/{tenantID}/subjects/{subjectID}", 'tag' => "Authorization", 'operationId' => "authorizationDeleteApiV1TenantsByTenantIDSubjectsBySubjectID" },
170
- { 'method' => "PATCH", 'path' => "/api/v1/tenants/{tenantID}/subjects/{subjectID}", 'tag' => "Authorization", 'operationId' => "authorizationPatchApiV1TenantsByTenantIDSubjectsBySubjectID" },
171
- { 'method' => "POST", 'path' => "/api/v1/tenants/{tenantID}/subjects/{subjectID}/move", 'tag' => "Authorization", 'operationId' => "authorizationPostApiV1TenantsByTenantIDSubjectsBySubjectIDMove" },
172
- { 'method' => "POST", 'path' => "/api/v1/tenants/{tenantID}/subjects/{subjectID}/tags", 'tag' => "Authorization", 'operationId' => "authorizationPostApiV1TenantsByTenantIDSubjectsBySubjectIDTags" },
173
- { 'method' => "DELETE", 'path' => "/api/v1/tenants/{tenantID}/subjects/{subjectID}/tags/{tagID}", 'tag' => "Authorization", 'operationId' => "authorizationDeleteApiV1TenantsByTenantIDSubjectsBySubjectIDTagsByTagID" },
174
- { 'method' => "GET", 'path' => "/api/v1/tenants/{tenantID}/tags", 'tag' => "Authorization", 'operationId' => "authorizationGetApiV1TenantsByTenantIDTags" },
175
- { 'method' => "POST", 'path' => "/api/v1/tenants/{tenantID}/tags", 'tag' => "Authorization", 'operationId' => "authorizationPostApiV1TenantsByTenantIDTags" },
176
- { 'method' => "DELETE", 'path' => "/api/v1/tenants/{tenantID}/tags/{tagID}", 'tag' => "Authorization", 'operationId' => "authorizationDeleteApiV1TenantsByTenantIDTagsByTagID" },
177
- { 'method' => "PATCH", 'path' => "/api/v1/tenants/{tenantID}/tags/{tagID}", 'tag' => "Authorization", 'operationId' => "authorizationPatchApiV1TenantsByTenantIDTagsByTagID" },
173
+ { 'method' => "GET", 'path' => "/api/v1/tenants/{tenantID}/subjects/{subjectID}", 'tag' => "Authorization", 'operationId' => "authorizationGetApiV1TenantsByTenantIDSubjectsBySubjectID" },
178
174
  { 'method' => "GET", 'path' => "/api/v1/users/me/apps", 'tag' => "Apps", 'operationId' => "appsGetApiV1UsersMeApps" },
179
175
  { 'method' => "GET", 'path' => "/auth/{providerID}/start", 'tag' => "Auth", 'operationId' => "authGetAuthByProviderIDStart" },
180
176
  { 'method' => "GET", 'path' => "/auth/github", 'tag' => "identity", 'operationId' => "identityGetAuthGithub" },
@@ -208,6 +204,8 @@ module AxHub
208
204
  ].freeze
209
205
 
210
206
  ERROR_CODES = {
207
+ "action_denied" => ErrorInfo.new("permission_denied", 403, false),
208
+ "action_invalid" => ErrorInfo.new("validation", 400, false),
211
209
  "already_accessed" => ErrorInfo.new("conflict", 409, false),
212
210
  "already_active" => ErrorInfo.new("conflict", 409, false),
213
211
  "already_deleted" => ErrorInfo.new("conflict", 409, false),
@@ -217,23 +215,33 @@ module AxHub
217
215
  "already_revoked" => ErrorInfo.new("conflict", 409, false),
218
216
  "already_settled" => ErrorInfo.new("conflict", 409, false),
219
217
  "already_suspended" => ErrorInfo.new("conflict", 409, false),
218
+ "already_terminal" => ErrorInfo.new("conflict", 409, false),
220
219
  "app_unavailable" => ErrorInfo.new("conflict", 409, false),
221
220
  "bad_request" => ErrorInfo.new("validation", 400, false),
222
221
  "cannot_reactivate" => ErrorInfo.new("conflict", 409, false),
223
222
  "conflict" => ErrorInfo.new("conflict", 409, false),
223
+ "connector_inactive" => ErrorInfo.new("permission_denied", 403, false),
224
224
  "cross_tenant" => ErrorInfo.new("validation", 400, false),
225
225
  "domain_blocked" => ErrorInfo.new("precondition_failed", 422, false),
226
226
  "domain_taken" => ErrorInfo.new("conflict", 409, false),
227
227
  "duplicate" => ErrorInfo.new("validation", 400, false),
228
228
  "empty" => ErrorInfo.new("validation", 400, false),
229
+ "expiry_in_past" => ErrorInfo.new("validation", 400, false),
229
230
  "forbidden" => ErrorInfo.new("permission_denied", 403, false),
231
+ "grant_already_terminal" => ErrorInfo.new("conflict", 409, false),
232
+ "grant_conflict" => ErrorInfo.new("conflict", 409, false),
233
+ "grant_expired" => ErrorInfo.new("permission_denied", 403, false),
234
+ "grant_revoked" => ErrorInfo.new("permission_denied", 403, false),
230
235
  "internal_error" => ErrorInfo.new("internal", 500, false),
231
236
  "invalid_expiry" => ErrorInfo.new("validation", 400, false),
232
237
  "invalid_format" => ErrorInfo.new("validation", 400, false),
233
238
  "invalid_state_transition" => ErrorInfo.new("conflict", 409, false),
234
239
  "invalid_value" => ErrorInfo.new("validation", 400, false),
235
240
  "invitation_expired" => ErrorInfo.new("not_found", 410, false),
241
+ "kind_engine_mismatch" => ErrorInfo.new("validation", 400, false),
236
242
  "last_admin" => ErrorInfo.new("conflict", 409, false),
243
+ "link_invalid" => ErrorInfo.new("not_found", 404, false),
244
+ "no_active_grant" => ErrorInfo.new("not_found", 404, false),
237
245
  "not_admin" => ErrorInfo.new("permission_denied", 403, false),
238
246
  "not_allowed" => ErrorInfo.new("validation", 400, false),
239
247
  "not_deleted" => ErrorInfo.new("conflict", 409, false),
@@ -243,8 +251,11 @@ module AxHub
243
251
  "pending_exists" => ErrorInfo.new("conflict", 409, false),
244
252
  "permanently_deleted" => ErrorInfo.new("not_found", 410, false),
245
253
  "precondition_failed" => ErrorInfo.new("precondition_failed", 412, false),
254
+ "preset_mismatch" => ErrorInfo.new("validation", 400, false),
246
255
  "required" => ErrorInfo.new("validation", 400, false),
247
256
  "schema_name_taken" => ErrorInfo.new("conflict", 409, false),
257
+ "session_ended" => ErrorInfo.new("unauthenticated", 401, true),
258
+ "session_expired" => ErrorInfo.new("unauthenticated", 401, true),
248
259
  "slug_taken" => ErrorInfo.new("conflict", 409, false),
249
260
  "temporarily_unavailable" => ErrorInfo.new("unavailable", 429, true),
250
261
  "token_expired" => ErrorInfo.new("unauthenticated", 401, true),
@@ -271,7 +282,7 @@ module AxHub
271
282
  ].freeze
272
283
  class Client
273
284
  attr_reader :base_url, :apps
274
- def initialize(base_url: DEFAULT_BASE_URL, token: nil, token_type: nil, default_tenant_id: nil, default_tenant_slug: nil, timeout_seconds: 10)
285
+ def initialize(base_url: DEFAULT_BASE_URL, token: nil, token_type: nil, default_tenant_id: nil, default_tenant_slug: nil, timeout_seconds: 30)
275
286
  @base_url = base_url.sub(%r{/$}, ''); @token = token; @token_type = token_type&.to_sym; @default_tenant_id = default_tenant_id; @default_tenant_slug = default_tenant_slug; @timeout_seconds = timeout_seconds; @apps = AppsClient.new(self)
276
287
  end
277
288
  def redacted_token
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: axhub-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jocoding AX Partners
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-06-09 00:00:00.000000000 Z
11
+ date: 2026-06-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest