@warmhub/sdk-ts 0.57.0 → 0.59.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.
@@ -178,7 +178,16 @@ var REPO_AUTH_SCOPES = [
178
178
  "repo:read",
179
179
  "repo:write",
180
180
  "repo:configure",
181
- "repo:admin"
181
+ "repo:admin",
182
+ // GH-4679: the repo-scoped twin of `org:action-callback`. A narrow capability
183
+ // for acknowledging a repo-scoped action run's delivery (the async webhook
184
+ // callback). Deliberately NOT implied by `repo:write` — a webhook handler
185
+ // (e.g. a component) can be granted exactly this without standing authority to
186
+ // write things/shapes. The callback gate currently ALSO accepts `repo:write`
187
+ // so existing consumers (the Veritas worker) keep acking; that broad
188
+ // acceptance is dropped once consumers move to this scope. Held by
189
+ // owner/admin roles; grantable to a token (or component manifest) on its own.
190
+ "repo:action-callback"
182
191
  ];
183
192
 
184
193
  // ../rules/src/component-manifest-contract.ts
@@ -3652,7 +3661,7 @@ function validateWarmHubClientOptions(options) {
3652
3661
  throw new TypeError(`Unknown WarmHubClient option "${key}"${hint}`);
3653
3662
  }
3654
3663
  }
3655
- var SDK_VERSION = "0.57.0" ;
3664
+ var SDK_VERSION = "0.59.0" ;
3656
3665
  var DEFAULT_API_URL = "https://api.warmhub.ai";
3657
3666
  var UNBATCHED_TRPC_PATHS = /* @__PURE__ */ new Set([
3658
3667
  "repo.shapeInstanceCounts",
@@ -3720,6 +3729,27 @@ function chunkArray(items, chunkSize) {
3720
3729
  }
3721
3730
  return chunks;
3722
3731
  }
3732
+ function toSubscriptionRef(args) {
3733
+ const [first, repoName, name] = args;
3734
+ return typeof first === "string" ? { orgName: first, repoName, name } : first;
3735
+ }
3736
+ function toSubscriptionListRef(args) {
3737
+ const [first, repoName] = args;
3738
+ return typeof first === "string" ? { orgName: first, repoName } : first;
3739
+ }
3740
+ function toSubscriptionBindRef(args) {
3741
+ const [first, repoName, subscriptionName, credentialSetName] = args;
3742
+ return typeof first === "string" ? {
3743
+ orgName: first,
3744
+ repoName,
3745
+ subscriptionName,
3746
+ credentialSetName
3747
+ } : first;
3748
+ }
3749
+ function toSubscriptionUnbindRef(args) {
3750
+ const [first, repoName, subscriptionName] = args;
3751
+ return typeof first === "string" ? { orgName: first, repoName, subscriptionName } : first;
3752
+ }
3723
3753
  function sanitizeSubscriptionCreateInput(input) {
3724
3754
  const {
3725
3755
  actionContainer: _actionContainer,
@@ -5224,14 +5254,16 @@ var WarmHubClient = class _WarmHubClient {
5224
5254
  },
5225
5255
  /**
5226
5256
  * Get one subscription by name.
5257
+ *
5258
+ * Repo-scoped subscriptions are addressed by `(orgName, repoName, name)`;
5259
+ * org-scoped subscriptions (`org.renamed`) omit `repoName` via the object
5260
+ * form: `get({ orgName, name })`.
5227
5261
  */
5228
- get: async (orgName, repoName, name) => {
5262
+ get: async (...args) => {
5229
5263
  try {
5230
- const result = await this.trpc.subscription.get.query({
5231
- orgName,
5232
- repoName,
5233
- name
5234
- });
5264
+ const result = await this.trpc.subscription.get.query(
5265
+ toSubscriptionRef(args)
5266
+ );
5235
5267
  return normalizeSubscriptionInfo(result);
5236
5268
  } catch (error) {
5237
5269
  throw toWarmHubError(error);
@@ -5247,26 +5279,27 @@ var WarmHubClient = class _WarmHubClient {
5247
5279
  * setup token) may reveal only the subscriptions it is scoped to — a
5248
5280
  * stricter contract than the redacted `get`/`list`, which are unscoped.
5249
5281
  */
5250
- reveal: async (orgName, repoName, name) => {
5282
+ reveal: async (...args) => {
5251
5283
  try {
5252
- return await this.trpc.subscription.reveal.query({
5253
- orgName,
5254
- repoName,
5255
- name
5256
- });
5284
+ return await this.trpc.subscription.reveal.query(
5285
+ toSubscriptionRef(args)
5286
+ );
5257
5287
  } catch (error) {
5258
5288
  throw toWarmHubError(error);
5259
5289
  }
5260
5290
  },
5261
5291
  /**
5262
- * List subscriptions attached to a repository.
5292
+ * List subscriptions in a scope.
5293
+ *
5294
+ * Pass `(orgName, repoName)` to list a repository's subscriptions, or omit
5295
+ * `repoName` — `list(orgName)` or `list({ orgName })` — to list the
5296
+ * org-scoped (`org.renamed`) subscriptions.
5263
5297
  */
5264
- list: async (orgName, repoName) => {
5298
+ list: async (...args) => {
5265
5299
  try {
5266
- const result = await this.trpc.subscription.list.query({
5267
- orgName,
5268
- repoName
5269
- });
5300
+ const result = await this.trpc.subscription.list.query(
5301
+ toSubscriptionListRef(args)
5302
+ );
5270
5303
  return normalizeSubscriptionList(result);
5271
5304
  } catch (error) {
5272
5305
  throw toWarmHubError(error);
@@ -5289,71 +5322,71 @@ var WarmHubClient = class _WarmHubClient {
5289
5322
  },
5290
5323
  /**
5291
5324
  * Pause a subscription.
5325
+ *
5326
+ * Omit `repoName` (object form) to pause an org-scoped subscription.
5292
5327
  */
5293
- pause: async (orgName, repoName, name) => {
5328
+ pause: async (...args) => {
5294
5329
  try {
5295
- return await this.trpc.subscription.pause.mutate({
5296
- orgName,
5297
- repoName,
5298
- name
5299
- });
5330
+ return await this.trpc.subscription.pause.mutate(
5331
+ toSubscriptionRef(args)
5332
+ );
5300
5333
  } catch (error) {
5301
5334
  throw toWarmHubError(error);
5302
5335
  }
5303
5336
  },
5304
5337
  /**
5305
5338
  * Resume a paused subscription.
5339
+ *
5340
+ * Omit `repoName` (object form) to resume an org-scoped subscription.
5306
5341
  */
5307
- resume: async (orgName, repoName, name) => {
5342
+ resume: async (...args) => {
5308
5343
  try {
5309
- return await this.trpc.subscription.resume.mutate({
5310
- orgName,
5311
- repoName,
5312
- name
5313
- });
5344
+ return await this.trpc.subscription.resume.mutate(
5345
+ toSubscriptionRef(args)
5346
+ );
5314
5347
  } catch (error) {
5315
5348
  throw toWarmHubError(error);
5316
5349
  }
5317
5350
  },
5318
5351
  /**
5319
5352
  * Delete a subscription.
5353
+ *
5354
+ * Omit `repoName` (object form) to delete an org-scoped subscription.
5320
5355
  */
5321
- remove: async (orgName, repoName, name) => {
5356
+ remove: async (...args) => {
5322
5357
  try {
5323
- return await this.trpc.subscription.remove.mutate({
5324
- orgName,
5325
- repoName,
5326
- name
5327
- });
5358
+ return await this.trpc.subscription.remove.mutate(
5359
+ toSubscriptionRef(args)
5360
+ );
5328
5361
  } catch (error) {
5329
5362
  throw toWarmHubError(error);
5330
5363
  }
5331
5364
  },
5332
5365
  /**
5333
5366
  * Bind a credential set to a subscription for outbound webhook authentication.
5367
+ *
5368
+ * Omit `repoName` (object form) to bind an org-scoped subscription to one of
5369
+ * the org's org-scoped credential sets.
5334
5370
  */
5335
- bindCredentials: async (orgName, repoName, subscriptionName, credentialSetName) => {
5371
+ bindCredentials: async (...args) => {
5336
5372
  try {
5337
- return await this.trpc.subscription.bindCredentials.mutate({
5338
- orgName,
5339
- repoName,
5340
- subscriptionName,
5341
- credentialSetName
5342
- });
5373
+ return await this.trpc.subscription.bindCredentials.mutate(
5374
+ toSubscriptionBindRef(args)
5375
+ );
5343
5376
  } catch (error) {
5344
5377
  throw toWarmHubError(error);
5345
5378
  }
5346
5379
  },
5347
5380
  /**
5348
5381
  * Remove the credential set currently bound to a subscription.
5382
+ *
5383
+ * Omit `repoName` (object form) for an org-scoped subscription.
5349
5384
  */
5350
- unbindCredentials: async (orgName, repoName, subscriptionName) => {
5385
+ unbindCredentials: async (...args) => {
5351
5386
  try {
5352
- return await this.trpc.subscription.unbindCredentials.mutate({
5353
- orgName,
5354
- repoName,
5355
- subscriptionName
5356
- });
5387
+ return await this.trpc.subscription.unbindCredentials.mutate(
5388
+ toSubscriptionUnbindRef(args)
5389
+ );
5357
5390
  } catch (error) {
5358
5391
  throw toWarmHubError(error);
5359
5392
  }
@@ -6806,5 +6839,5 @@ function isAbortError(error) {
6806
6839
  }
6807
6840
 
6808
6841
  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 };
6809
- //# sourceMappingURL=chunk-BTB4654X.js.map
6810
- //# sourceMappingURL=chunk-BTB4654X.js.map
6842
+ //# sourceMappingURL=chunk-ZXAWTFKV.js.map
6843
+ //# sourceMappingURL=chunk-ZXAWTFKV.js.map