@clowdops/tsclient 0.6.8 → 0.6.10

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.
package/dist/index.cjs CHANGED
@@ -4989,9 +4989,8 @@ var CapacityClient = class {
4989
4989
 
4990
4990
  // src/modules/bi/BIClient.ts
4991
4991
  var BIClient = class {
4992
- constructor(http, baseUrl) {
4992
+ constructor(http) {
4993
4993
  this.http = http;
4994
- this.baseUrl = baseUrl;
4995
4994
  }
4996
4995
  /**
4997
4996
  * Compact grounding catalog for a workspace's model: entities + measures +
@@ -5034,15 +5033,6 @@ var BIClient = class {
5034
5033
  triggerDiscovery(workspaceId) {
5035
5034
  return this.http.post(`/workspaces/${workspaceId}/bi/discover`, {});
5036
5035
  }
5037
- /**
5038
- * The browser URL that starts the delegated Power BI OAuth flow for a data
5039
- * project. Navigate the window here; the backend redirects to Microsoft and,
5040
- * on the callback, creates the POWERBI credential and returns to the frontend.
5041
- * `workspaceId` tells the backend which project to attach the credential to.
5042
- */
5043
- powerBIConnectUrl(workspaceId) {
5044
- return `${this.baseUrl}/connect/powerbi?workspaceId=${encodeURIComponent(workspaceId)}`;
5045
- }
5046
5036
  // ── Cross-dataset links (governance panel) ─────────────────────────────────
5047
5037
  /** Lists the workspace's cross-dataset links (with model names + probe stats). */
5048
5038
  listLinks(workspaceId) {
@@ -5294,7 +5284,9 @@ var SUPPORTED_CONNECTOR_DOMAIN_SURFACE_VERSIONS = Object.freeze({
5294
5284
  WORK_TRACKING: "v1",
5295
5285
  CALENDAR: "v1",
5296
5286
  EMAIL: "v1",
5297
- CHANNEL_NOTIFICATION: "v1"
5287
+ CHANNEL_NOTIFICATION: "v1",
5288
+ SOCIAL: "v1",
5289
+ DOCUMENT_SOURCE: "v1"
5298
5290
  });
5299
5291
  var PROVIDER_LIFECYCLE_SURFACE = "PROVIDER_LIFECYCLE";
5300
5292
  var SUPPORTED_PROVIDER_LIFECYCLE_SURFACE_VERSION = "v1";
@@ -5444,6 +5436,15 @@ function parseConnectCatalog(raw) {
5444
5436
  return raw.map((r) => parseConnectCatalogRow(r));
5445
5437
  }
5446
5438
  var RESULT_STATUSES = /* @__PURE__ */ new Set(["connected", "orphan_grant", "failed"]);
5439
+ function parseReturnScope(raw) {
5440
+ const ctx = "connect result returnScope";
5441
+ if (!isRecord(raw)) fail(`${ctx} must be an object`);
5442
+ return {
5443
+ product: requireString(raw, "product", ctx),
5444
+ projectId: requireString(raw, "projectId", ctx),
5445
+ sandboxId: requireString(raw, "sandboxId", ctx)
5446
+ };
5447
+ }
5447
5448
  function parseConnectResultV1(raw) {
5448
5449
  if (!isRecord(raw)) fail("connect result must be an object");
5449
5450
  if (raw.contractVersion !== CONNECT_RESULT_V1) {
@@ -5455,6 +5456,7 @@ function parseConnectResultV1(raw) {
5455
5456
  }
5456
5457
  const resultId = requireString(raw, "resultId", "connect result");
5457
5458
  const provider = requireString(raw, "provider", "connect result");
5459
+ const scope = raw.returnScope === void 0 ? {} : { returnScope: parseReturnScope(raw.returnScope) };
5458
5460
  if (status === "connected") {
5459
5461
  const connectionId = requireString(raw, "connectionId", "connect result");
5460
5462
  const granted = raw.grantedCapabilities;
@@ -5467,7 +5469,8 @@ function parseConnectResultV1(raw) {
5467
5469
  resultId,
5468
5470
  provider,
5469
5471
  connectionId,
5470
- grantedCapabilities: granted
5472
+ grantedCapabilities: granted,
5473
+ ...scope
5471
5474
  };
5472
5475
  if (raw.accountLabel !== void 0) {
5473
5476
  if (typeof raw.accountLabel !== "string") fail("connect result: accountLabel must be a string");
@@ -5480,10 +5483,10 @@ function parseConnectResultV1(raw) {
5480
5483
  return out;
5481
5484
  }
5482
5485
  if (status === "orphan_grant") {
5483
- return { contractVersion: CONNECT_RESULT_V1, status: "orphan_grant", resultId, provider };
5486
+ return { contractVersion: CONNECT_RESULT_V1, status: "orphan_grant", resultId, provider, ...scope };
5484
5487
  }
5485
5488
  const failureClass = requireString(raw, "failureClass", "connect result");
5486
- return { contractVersion: CONNECT_RESULT_V1, status: "failed", resultId, provider, failureClass };
5489
+ return { contractVersion: CONNECT_RESULT_V1, status: "failed", resultId, provider, failureClass, ...scope };
5487
5490
  }
5488
5491
 
5489
5492
  // src/modules/connect/ConnectClient.ts
@@ -5592,7 +5595,9 @@ var ConnectClient = class {
5592
5595
  projectId: input.projectId,
5593
5596
  sandboxId: input.sandboxId,
5594
5597
  provider: input.provider,
5595
- requestedCapabilities: input.requestedCapabilities
5598
+ requestedCapabilities: input.requestedCapabilities,
5599
+ ...input.ownership ? { ownership: input.ownership } : {},
5600
+ ...input.consent ? { consent: input.consent } : {}
5596
5601
  }
5597
5602
  });
5598
5603
  if (!res.authorizationUrl || !res.expiresAt) {
@@ -6465,6 +6470,24 @@ var CrmHandoffsClient = class {
6465
6470
  );
6466
6471
  return unwrapData(res);
6467
6472
  }
6473
+ /** The Brand's current Marketing qualification rule and Sales readiness criteria
6474
+ * declarations, each null until declared. */
6475
+ async declarations(sandboxId) {
6476
+ const res = await this.http.get(
6477
+ `/marketing-crm-handoff/declarations${this.query({ sandboxId })}`
6478
+ );
6479
+ return unwrapData(res);
6480
+ }
6481
+ /** Declare or revise the rule or the readiness criteria (org administrator, never
6482
+ * impersonated). Only the stream's recorded owner may revise it, and the two
6483
+ * streams need distinct owners. */
6484
+ async declare(input) {
6485
+ const res = await this.http.post(
6486
+ "/marketing-crm-handoff/declarations",
6487
+ { body: { project_id: input.projectId, sandbox_id: input.sandboxId, kind: input.kind, body: input.body } }
6488
+ );
6489
+ return unwrapData(res);
6490
+ }
6468
6491
  };
6469
6492
  function crmHandoffOutcomeLabel(outcome) {
6470
6493
  switch (outcome) {
@@ -6486,6 +6509,77 @@ function crmHandoffAwaitingDisposition(h) {
6486
6509
  return h.disposition == null;
6487
6510
  }
6488
6511
 
6512
+ // src/modules/marketingConnections/MarketingConnectionsClient.ts
6513
+ var BASE5 = "/marketing-connections";
6514
+ var READINESS_PATH = "/api/agentengine/v1/agent/marketing-connections/readiness";
6515
+ var MarketingConnectionsClient = class {
6516
+ constructor(http) {
6517
+ this.http = http;
6518
+ }
6519
+ /** Choose the connection's target from its stored options (Project Write and
6520
+ * Brand Write; refused while impersonating). Returns the credential view with
6521
+ * its updated metadata; the server republishes the topology. */
6522
+ async selectTarget(body) {
6523
+ const res = await this.http.put(`${BASE5}/target`, { body });
6524
+ return res.credential;
6525
+ }
6526
+ /** The Google Drive documents picked for the Brand (Brand Read). */
6527
+ async gdriveFiles(sandboxId) {
6528
+ const res = await this.http.get(`${BASE5}/gdrive/files`, {
6529
+ query: { sandboxId }
6530
+ });
6531
+ return res.items ?? [];
6532
+ }
6533
+ /** One item per Marketing capability, from a dry run of the real resolver. */
6534
+ async readiness(query) {
6535
+ const res = await this.http.get(READINESS_PATH, {
6536
+ query: { projectId: query.projectId, sandboxId: query.sandboxId },
6537
+ headers: { "X-Sandbox-Id": query.sandboxId, "X-Project-Id": query.projectId }
6538
+ });
6539
+ return res.items ?? [];
6540
+ }
6541
+ };
6542
+
6543
+ // src/modules/retentionPolicies/RetentionPoliciesClient.ts
6544
+ var BASE6 = "/retention-policies";
6545
+ var RetentionPoliciesClient = class {
6546
+ constructor(http) {
6547
+ this.http = http;
6548
+ }
6549
+ /** The effective policy of a kind for the Brand (Brand Read). */
6550
+ get(query) {
6551
+ return this.http.get(BASE6, { query: { sandboxId: query.sandboxId, kind: query.kind } });
6552
+ }
6553
+ /** Set the Brand's days for a kind, 1 to 365 (Brand Write). */
6554
+ put(body) {
6555
+ return this.http.put(BASE6, { body });
6556
+ }
6557
+ };
6558
+
6559
+ // src/modules/qualificationIngressKeys/QualificationIngressKeysClient.ts
6560
+ var BASE7 = "/marketing-qualification/ingress-keys";
6561
+ var QualificationIngressKeysClient = class {
6562
+ constructor(http) {
6563
+ this.http = http;
6564
+ }
6565
+ /** The Brand's keys, active and revoked, without plaintext. */
6566
+ async list(sandboxId) {
6567
+ const res = await this.http.get(BASE7, { query: { sandboxId } });
6568
+ return res.items ?? [];
6569
+ }
6570
+ /** Create the Brand's key, revoking the previous one. The plaintext `key` is
6571
+ * returned only here; it is never readable again. */
6572
+ async create(body) {
6573
+ const res = await this.http.post(BASE7, { body, sensitive: true });
6574
+ if (!res.key) throw new Error("createQualificationIngressKey response missing key.");
6575
+ return res;
6576
+ }
6577
+ /** Revoke a key (the server answers 204). */
6578
+ async revoke(id) {
6579
+ await this.http.delete(`${BASE7}/${encodeURIComponent(id)}`);
6580
+ }
6581
+ };
6582
+
6489
6583
  // src/modules/personExport/PersonExportClient.ts
6490
6584
  var PersonExportClient = class {
6491
6585
  constructor(http) {
@@ -7341,7 +7435,7 @@ var CloudAgentClient = class {
7341
7435
  this.platformAdmin = new PlatformAdminClient(this.http);
7342
7436
  this.deployments = new DeploymentsClient(this.http);
7343
7437
  this.capacity = new CapacityClient(this.http);
7344
- this.bi = new BIClient(this.http, this.http.baseUrl);
7438
+ this.bi = new BIClient(this.http);
7345
7439
  this.dashboards = new DashboardsClient(this.http, this.http.baseUrl);
7346
7440
  this.capabilities = new CapabilitiesClient(this.http);
7347
7441
  this.contacts = new ContactsClient(this.http);
@@ -7354,6 +7448,9 @@ var CloudAgentClient = class {
7354
7448
  this.meetingMinutes = new MeetingMinutesClient(this.http);
7355
7449
  this.followThrough = new FollowThroughClient(this.http);
7356
7450
  this.crmHandoffs = new CrmHandoffsClient(this.http);
7451
+ this.marketingConnections = new MarketingConnectionsClient(this.http);
7452
+ this.retentionPolicies = new RetentionPoliciesClient(this.http);
7453
+ this.qualificationIngressKeys = new QualificationIngressKeysClient(this.http);
7357
7454
  this.personExport = new PersonExportClient(this.http);
7358
7455
  this.artifacts = new ArtifactsClient(this.http);
7359
7456
  this.signals = new SignalsClient(this.http);
@@ -9672,6 +9769,7 @@ exports.FollowThroughClient = FollowThroughClient;
9672
9769
  exports.HttpError = HttpError;
9673
9770
  exports.INVOCATION_RESULT_KINDS = INVOCATION_RESULT_KINDS;
9674
9771
  exports.MFAType = MFAType;
9772
+ exports.MarketingConnectionsClient = MarketingConnectionsClient;
9675
9773
  exports.MarketingConsentClient = MarketingConsentClient;
9676
9774
  exports.MeetingMinutesClient = MeetingMinutesClient;
9677
9775
  exports.MeteringClient = MeteringClient;
@@ -9806,11 +9904,13 @@ exports.PmRiskApi = PmRiskApi;
9806
9904
  exports.PmViewsApi = PmViewsApi;
9807
9905
  exports.PmWriteApiBase = PmWriteApiBase;
9808
9906
  exports.ProviderType = ProviderType;
9907
+ exports.QualificationIngressKeysClient = QualificationIngressKeysClient;
9809
9908
  exports.REFUSAL_REASONS = REFUSAL_REASONS;
9810
9909
  exports.RealEstateAdminClient = RealEstateAdminClient;
9811
9910
  exports.ReferralsClient = ReferralsClient;
9812
9911
  exports.ResellerClient = ResellerClient;
9813
9912
  exports.ResourcesClient = ResourcesClient;
9913
+ exports.RetentionPoliciesClient = RetentionPoliciesClient;
9814
9914
  exports.SCHEMA_CAPABILITIES = SCHEMA_CAPABILITIES;
9815
9915
  exports.SCHEMA_WORK = SCHEMA_WORK;
9816
9916
  exports.SUPPORTED_CONNECTOR_DOMAIN_SURFACE_VERSIONS = SUPPORTED_CONNECTOR_DOMAIN_SURFACE_VERSIONS;