@clowdops/tsclient 0.6.9 → 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
@@ -5284,7 +5284,9 @@ var SUPPORTED_CONNECTOR_DOMAIN_SURFACE_VERSIONS = Object.freeze({
5284
5284
  WORK_TRACKING: "v1",
5285
5285
  CALENDAR: "v1",
5286
5286
  EMAIL: "v1",
5287
- CHANNEL_NOTIFICATION: "v1"
5287
+ CHANNEL_NOTIFICATION: "v1",
5288
+ SOCIAL: "v1",
5289
+ DOCUMENT_SOURCE: "v1"
5288
5290
  });
5289
5291
  var PROVIDER_LIFECYCLE_SURFACE = "PROVIDER_LIFECYCLE";
5290
5292
  var SUPPORTED_PROVIDER_LIFECYCLE_SURFACE_VERSION = "v1";
@@ -5434,6 +5436,15 @@ function parseConnectCatalog(raw) {
5434
5436
  return raw.map((r) => parseConnectCatalogRow(r));
5435
5437
  }
5436
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
+ }
5437
5448
  function parseConnectResultV1(raw) {
5438
5449
  if (!isRecord(raw)) fail("connect result must be an object");
5439
5450
  if (raw.contractVersion !== CONNECT_RESULT_V1) {
@@ -5445,6 +5456,7 @@ function parseConnectResultV1(raw) {
5445
5456
  }
5446
5457
  const resultId = requireString(raw, "resultId", "connect result");
5447
5458
  const provider = requireString(raw, "provider", "connect result");
5459
+ const scope = raw.returnScope === void 0 ? {} : { returnScope: parseReturnScope(raw.returnScope) };
5448
5460
  if (status === "connected") {
5449
5461
  const connectionId = requireString(raw, "connectionId", "connect result");
5450
5462
  const granted = raw.grantedCapabilities;
@@ -5457,7 +5469,8 @@ function parseConnectResultV1(raw) {
5457
5469
  resultId,
5458
5470
  provider,
5459
5471
  connectionId,
5460
- grantedCapabilities: granted
5472
+ grantedCapabilities: granted,
5473
+ ...scope
5461
5474
  };
5462
5475
  if (raw.accountLabel !== void 0) {
5463
5476
  if (typeof raw.accountLabel !== "string") fail("connect result: accountLabel must be a string");
@@ -5470,10 +5483,10 @@ function parseConnectResultV1(raw) {
5470
5483
  return out;
5471
5484
  }
5472
5485
  if (status === "orphan_grant") {
5473
- return { contractVersion: CONNECT_RESULT_V1, status: "orphan_grant", resultId, provider };
5486
+ return { contractVersion: CONNECT_RESULT_V1, status: "orphan_grant", resultId, provider, ...scope };
5474
5487
  }
5475
5488
  const failureClass = requireString(raw, "failureClass", "connect result");
5476
- return { contractVersion: CONNECT_RESULT_V1, status: "failed", resultId, provider, failureClass };
5489
+ return { contractVersion: CONNECT_RESULT_V1, status: "failed", resultId, provider, failureClass, ...scope };
5477
5490
  }
5478
5491
 
5479
5492
  // src/modules/connect/ConnectClient.ts
@@ -5583,7 +5596,8 @@ var ConnectClient = class {
5583
5596
  sandboxId: input.sandboxId,
5584
5597
  provider: input.provider,
5585
5598
  requestedCapabilities: input.requestedCapabilities,
5586
- ...input.ownership ? { ownership: input.ownership } : {}
5599
+ ...input.ownership ? { ownership: input.ownership } : {},
5600
+ ...input.consent ? { consent: input.consent } : {}
5587
5601
  }
5588
5602
  });
5589
5603
  if (!res.authorizationUrl || !res.expiresAt) {
@@ -6456,6 +6470,24 @@ var CrmHandoffsClient = class {
6456
6470
  );
6457
6471
  return unwrapData(res);
6458
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
+ }
6459
6491
  };
6460
6492
  function crmHandoffOutcomeLabel(outcome) {
6461
6493
  switch (outcome) {
@@ -6477,6 +6509,77 @@ function crmHandoffAwaitingDisposition(h) {
6477
6509
  return h.disposition == null;
6478
6510
  }
6479
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
+
6480
6583
  // src/modules/personExport/PersonExportClient.ts
6481
6584
  var PersonExportClient = class {
6482
6585
  constructor(http) {
@@ -7345,6 +7448,9 @@ var CloudAgentClient = class {
7345
7448
  this.meetingMinutes = new MeetingMinutesClient(this.http);
7346
7449
  this.followThrough = new FollowThroughClient(this.http);
7347
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);
7348
7454
  this.personExport = new PersonExportClient(this.http);
7349
7455
  this.artifacts = new ArtifactsClient(this.http);
7350
7456
  this.signals = new SignalsClient(this.http);
@@ -9663,6 +9769,7 @@ exports.FollowThroughClient = FollowThroughClient;
9663
9769
  exports.HttpError = HttpError;
9664
9770
  exports.INVOCATION_RESULT_KINDS = INVOCATION_RESULT_KINDS;
9665
9771
  exports.MFAType = MFAType;
9772
+ exports.MarketingConnectionsClient = MarketingConnectionsClient;
9666
9773
  exports.MarketingConsentClient = MarketingConsentClient;
9667
9774
  exports.MeetingMinutesClient = MeetingMinutesClient;
9668
9775
  exports.MeteringClient = MeteringClient;
@@ -9797,11 +9904,13 @@ exports.PmRiskApi = PmRiskApi;
9797
9904
  exports.PmViewsApi = PmViewsApi;
9798
9905
  exports.PmWriteApiBase = PmWriteApiBase;
9799
9906
  exports.ProviderType = ProviderType;
9907
+ exports.QualificationIngressKeysClient = QualificationIngressKeysClient;
9800
9908
  exports.REFUSAL_REASONS = REFUSAL_REASONS;
9801
9909
  exports.RealEstateAdminClient = RealEstateAdminClient;
9802
9910
  exports.ReferralsClient = ReferralsClient;
9803
9911
  exports.ResellerClient = ResellerClient;
9804
9912
  exports.ResourcesClient = ResourcesClient;
9913
+ exports.RetentionPoliciesClient = RetentionPoliciesClient;
9805
9914
  exports.SCHEMA_CAPABILITIES = SCHEMA_CAPABILITIES;
9806
9915
  exports.SCHEMA_WORK = SCHEMA_WORK;
9807
9916
  exports.SUPPORTED_CONNECTOR_DOMAIN_SURFACE_VERSIONS = SUPPORTED_CONNECTOR_DOMAIN_SURFACE_VERSIONS;