@warmhub/sdk-ts 0.52.1 → 0.53.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.
@@ -2746,7 +2746,7 @@ async function submitOperationsViaStream(client, args) {
2746
2746
  orgName: args.orgName,
2747
2747
  repoName: args.repoName,
2748
2748
  streamId,
2749
- componentId: args.componentId,
2749
+ componentRef: args.componentRef,
2750
2750
  committer: args.committer,
2751
2751
  message: args.message,
2752
2752
  operations: chunk
@@ -3652,7 +3652,7 @@ function validateWarmHubClientOptions(options) {
3652
3652
  throw new TypeError(`Unknown WarmHubClient option "${key}"${hint}`);
3653
3653
  }
3654
3654
  }
3655
- var SDK_VERSION = "0.52.1" ;
3655
+ var SDK_VERSION = "0.53.0" ;
3656
3656
  var DEFAULT_API_URL = "https://api.warmhub.ai";
3657
3657
  var UNBATCHED_TRPC_PATHS = /* @__PURE__ */ new Set([
3658
3658
  "repo.shapeInstanceCounts",
@@ -4011,36 +4011,23 @@ var WarmHubClient = class _WarmHubClient {
4011
4011
  }
4012
4012
  };
4013
4013
  /**
4014
- * Lightweight permission checks for UI gating and service-side authorization probes.
4014
+ * Effective-access resolution for UI gating and service-side authorization.
4015
+ * First-party surface (web UI + whedge edge); the underlying `access.resolve`
4016
+ * procedure is `@internal`.
4017
+ * @internal
4015
4018
  */
4016
4019
  access = {
4017
4020
  /**
4018
- * Check whether the caller has a repo-scoped permission.
4019
- *
4020
- * @param permission Permission string such as `repo:read`, `repo:write`, `repo:configure`, or `repo:admin`.
4021
- */
4022
- checkRepoPermission: async (orgName, repoName, permission) => {
4023
- try {
4024
- return await this.trpc.access.checkRepoPermission.query({
4025
- orgName,
4026
- repoName,
4027
- permission
4028
- });
4029
- } catch (error) {
4030
- throw toWarmHubError(error);
4031
- }
4032
- },
4033
- /**
4034
- * Check whether the caller has an org-scoped permission.
4035
- *
4036
- * @param permission Permission string such as `org:read`, `org:configure`, or `org:admin`.
4021
+ * Resolve the caller's effective access for a batch of repos and/or orgs
4022
+ * (addressed by name). Returns the coarse scope SET per target so one call
4023
+ * answers any permission via `scopes.includes(...)` e.g.
4024
+ * `scopes.includes('repo:configure')`. Non-throwing: `visible: false` means
4025
+ * not-found/not-visible; `scopes: []` means authenticated-but-no-access.
4026
+ * Correlate results by the echoed `orgName`/`repoName`, not by position.
4037
4027
  */
4038
- checkOrgPermission: async (orgName, permission) => {
4028
+ resolve: async (input) => {
4039
4029
  try {
4040
- return await this.trpc.access.checkOrgPermission.query({
4041
- orgName,
4042
- permission
4043
- });
4030
+ return await this.trpc.access.resolve.query(input);
4044
4031
  } catch (error) {
4045
4032
  throw toWarmHubError(error);
4046
4033
  }
@@ -4138,14 +4125,14 @@ var WarmHubClient = class _WarmHubClient {
4138
4125
  }
4139
4126
  },
4140
4127
  /**
4141
- * Fetch one installed component by component ID.
4128
+ * Fetch one installed component by its `Org/Name` ref.
4142
4129
  */
4143
- get: async (orgName, repoName, componentId) => {
4130
+ get: async (orgName, repoName, componentRef) => {
4144
4131
  try {
4145
4132
  return await this.trpc.component.get.query({
4146
4133
  orgName,
4147
4134
  repoName,
4148
- componentId
4135
+ componentRef
4149
4136
  });
4150
4137
  } catch (error) {
4151
4138
  throw toWarmHubError(error);
@@ -4282,7 +4269,7 @@ var WarmHubClient = class _WarmHubClient {
4282
4269
  * @param message Optional commit message stored with the submitted operations.
4283
4270
  * @param operations Add, revise, or retract operations to submit in order.
4284
4271
  * @param opts.committer Optional wref identifying the actor on whose behalf the write is made. Must be a full wref string like `"Agent/bot-1"` (a thing that already exists), or a cross-repo wref like `"wh:other-org/other-repo/Agent/bot-1"`. Bare names such as `"eval-runner"` are rejected by the backend with a "Thing wref required" error — there is no implicit shape.
4285
- * @param opts.componentId Attribute writes to an installed component when the caller is allowed to claim it.
4272
+ * @param opts.componentRef Attribute writes to an installed component, identified by its `Org/Name` ref, when the caller is allowed to claim it.
4286
4273
  * @param opts.chunkSize Maximum operations per stream append. Values are clamped by the SDK.
4287
4274
  * @param opts.skipExisting Return `noop` for add operations whose target already exists.
4288
4275
  * @param opts.streamId Advanced continuation hook for caller-managed streams.
@@ -4295,7 +4282,7 @@ var WarmHubClient = class _WarmHubClient {
4295
4282
  repoName,
4296
4283
  committer: opts?.committer,
4297
4284
  message,
4298
- componentId: opts?.componentId,
4285
+ componentRef: opts?.componentRef,
4299
4286
  chunkSize: opts?.chunkSize,
4300
4287
  skipExisting: opts?.skipExisting,
4301
4288
  streamId: opts?.streamId,
@@ -4956,7 +4943,7 @@ var WarmHubClient = class _WarmHubClient {
4956
4943
  orgName,
4957
4944
  repoName,
4958
4945
  match: opts?.match,
4959
- componentId: opts?.componentId,
4946
+ componentRef: opts?.componentRef,
4960
4947
  excludeComponents: opts?.excludeComponents,
4961
4948
  includeRetracted: opts?.includeRetracted
4962
4949
  });
@@ -5463,7 +5450,7 @@ var WarmHubClient = class _WarmHubClient {
5463
5450
  includeRetracted: opts?.includeRetracted,
5464
5451
  limit: opts?.limit,
5465
5452
  cursor: opts?.cursor,
5466
- componentId: opts?.componentId,
5453
+ componentRef: opts?.componentRef,
5467
5454
  excludeComponents: opts?.excludeComponents,
5468
5455
  excludeInfraShapes: opts?.excludeInfraShapes,
5469
5456
  where: opts?.where
@@ -5835,7 +5822,7 @@ var WarmHubClient = class _WarmHubClient {
5835
5822
  resolveCollections: opts?.resolveCollections,
5836
5823
  limit: opts?.limit,
5837
5824
  cursor: opts?.cursor,
5838
- componentId: opts?.componentId,
5825
+ componentRef: opts?.componentRef,
5839
5826
  excludeComponents: opts?.excludeComponents,
5840
5827
  excludeInfraShapes: opts?.excludeInfraShapes,
5841
5828
  where: opts?.where
@@ -5890,7 +5877,7 @@ var WarmHubClient = class _WarmHubClient {
5890
5877
  resolveCollections: opts?.resolveCollections,
5891
5878
  limit: opts?.limit,
5892
5879
  cursor: opts?.cursor,
5893
- componentId: opts?.componentId,
5880
+ componentRef: opts?.componentRef,
5894
5881
  excludeComponents: opts?.excludeComponents,
5895
5882
  excludeInfraShapes: opts?.excludeInfraShapes,
5896
5883
  mode: opts?.mode
@@ -5914,7 +5901,7 @@ var WarmHubClient = class _WarmHubClient {
5914
5901
  match: opts?.match,
5915
5902
  includeRetracted: opts?.includeRetracted,
5916
5903
  resolveCollections: opts?.resolveCollections,
5917
- componentId: opts?.componentId,
5904
+ componentRef: opts?.componentRef,
5918
5905
  excludeComponents: opts?.excludeComponents,
5919
5906
  excludeInfraShapes: opts?.excludeInfraShapes,
5920
5907
  where: opts?.where
@@ -6605,5 +6592,5 @@ function isAbortError(error) {
6605
6592
  }
6606
6593
 
6607
6594
  export { AllStreamOperationsFailedError, CLI_INSTALL_REPO_HEADER, CLI_SIGNATURE_HEADER, CLI_TIMESTAMP_HEADER, CONTENT_FIELD_LIMIT_ERROR, CliCallVerificationError, DEFAULT_API_URL, DEFAULT_STREAM_CHUNK_SIZE, MAX_CONTENT_FIELD_BYTES, MAX_STREAM_APPEND_OPERATION_COUNT2 as MAX_STREAM_APPEND_OPERATION_COUNT, OperationBuilder, PartialStreamSubmissionError, SDK_VERSION, WarmHubClient, WarmHubError, connectionErrorMessage, contentFieldLimitError, countStreamAppendResultStatuses, isConnectionError, isRetryable, isWarmHubError, normalizeWref, resolveFunctionLogMode, sanitizeErrorMessage, sdkVersionIsBelowMinimum, streamAppendResultStatus, submitOperationsViaStream, toWarmHubError, validateAgainstShape, verifyCliCall };
6608
- //# sourceMappingURL=chunk-OPTB23HY.js.map
6609
- //# sourceMappingURL=chunk-OPTB23HY.js.map
6595
+ //# sourceMappingURL=chunk-L5PODJ66.js.map
6596
+ //# sourceMappingURL=chunk-L5PODJ66.js.map