@warmhub/sdk-ts 0.52.0 → 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.0" ;
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
+ * 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.
4021
4027
  */
4022
- checkRepoPermission: async (orgName, repoName, permission) => {
4028
+ resolve: async (input) => {
4023
4029
  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`.
4037
- */
4038
- checkOrgPermission: async (orgName, permission) => {
4039
- 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
  });
@@ -5144,6 +5131,27 @@ var WarmHubClient = class _WarmHubClient {
5144
5131
  throw toWarmHubError(error);
5145
5132
  }
5146
5133
  },
5134
+ /**
5135
+ * Reveal the raw webhook URL(s) for a subscription.
5136
+ *
5137
+ * Reads return only `webhookOrigin`/`fallbackWebhookOrigin` (scheme://host);
5138
+ * the raw URL path is a bearer secret. This break-glass call returns the
5139
+ * raw URL(s) and is audit-logged server-side. Requires `repo:configure`.
5140
+ * Because it returns the secret, a name-scoped principal (e.g. a component
5141
+ * setup token) may reveal only the subscriptions it is scoped to — a
5142
+ * stricter contract than the redacted `get`/`list`, which are unscoped.
5143
+ */
5144
+ reveal: async (orgName, repoName, name) => {
5145
+ try {
5146
+ return await this.trpc.subscription.reveal.query({
5147
+ orgName,
5148
+ repoName,
5149
+ name
5150
+ });
5151
+ } catch (error) {
5152
+ throw toWarmHubError(error);
5153
+ }
5154
+ },
5147
5155
  /**
5148
5156
  * List subscriptions attached to a repository.
5149
5157
  */
@@ -5442,7 +5450,7 @@ var WarmHubClient = class _WarmHubClient {
5442
5450
  includeRetracted: opts?.includeRetracted,
5443
5451
  limit: opts?.limit,
5444
5452
  cursor: opts?.cursor,
5445
- componentId: opts?.componentId,
5453
+ componentRef: opts?.componentRef,
5446
5454
  excludeComponents: opts?.excludeComponents,
5447
5455
  excludeInfraShapes: opts?.excludeInfraShapes,
5448
5456
  where: opts?.where
@@ -5814,7 +5822,7 @@ var WarmHubClient = class _WarmHubClient {
5814
5822
  resolveCollections: opts?.resolveCollections,
5815
5823
  limit: opts?.limit,
5816
5824
  cursor: opts?.cursor,
5817
- componentId: opts?.componentId,
5825
+ componentRef: opts?.componentRef,
5818
5826
  excludeComponents: opts?.excludeComponents,
5819
5827
  excludeInfraShapes: opts?.excludeInfraShapes,
5820
5828
  where: opts?.where
@@ -5869,7 +5877,7 @@ var WarmHubClient = class _WarmHubClient {
5869
5877
  resolveCollections: opts?.resolveCollections,
5870
5878
  limit: opts?.limit,
5871
5879
  cursor: opts?.cursor,
5872
- componentId: opts?.componentId,
5880
+ componentRef: opts?.componentRef,
5873
5881
  excludeComponents: opts?.excludeComponents,
5874
5882
  excludeInfraShapes: opts?.excludeInfraShapes,
5875
5883
  mode: opts?.mode
@@ -5893,7 +5901,7 @@ var WarmHubClient = class _WarmHubClient {
5893
5901
  match: opts?.match,
5894
5902
  includeRetracted: opts?.includeRetracted,
5895
5903
  resolveCollections: opts?.resolveCollections,
5896
- componentId: opts?.componentId,
5904
+ componentRef: opts?.componentRef,
5897
5905
  excludeComponents: opts?.excludeComponents,
5898
5906
  excludeInfraShapes: opts?.excludeInfraShapes,
5899
5907
  where: opts?.where
@@ -6584,5 +6592,5 @@ function isAbortError(error) {
6584
6592
  }
6585
6593
 
6586
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 };
6587
- //# sourceMappingURL=chunk-74GPEEAF.js.map
6588
- //# sourceMappingURL=chunk-74GPEEAF.js.map
6595
+ //# sourceMappingURL=chunk-L5PODJ66.js.map
6596
+ //# sourceMappingURL=chunk-L5PODJ66.js.map