@proteos/sdk 0.90.0 → 0.92.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.
package/dist/index.js CHANGED
@@ -282,6 +282,13 @@ var SessionServiceImpl = class {
282
282
  request
283
283
  );
284
284
  }
285
+ async transferVoice(id, request) {
286
+ return this.client.request(
287
+ "POST",
288
+ `${SESSIONS_BASE_PATH}/${id}/voice/transfer`,
289
+ request
290
+ );
291
+ }
285
292
  async appendSpeech(id, request, requestOptions) {
286
293
  const response = await this.client.request(
287
294
  "POST",
@@ -299,6 +306,15 @@ var SessionServiceImpl = class {
299
306
  requestOptions
300
307
  );
301
308
  }
309
+ async getVoiceRecording(id, voiceSessionId, requestOptions) {
310
+ const { response } = await this.client.requestRaw(
311
+ "GET",
312
+ `${SESSIONS_BASE_PATH}/${id}/voice/${voiceSessionId}/recording`,
313
+ void 0,
314
+ requestOptions
315
+ );
316
+ return await response.blob();
317
+ }
302
318
  };
303
319
  function parseEvent(data) {
304
320
  if (!data) return null;
@@ -1060,6 +1076,8 @@ var PLATFORM_ENTITIES = [
1060
1076
  // their preset catalog.
1061
1077
  { slug: "sending-rules", name: "Sending Rules" },
1062
1078
  { slug: "email-signatures", name: "Email Signatures" },
1079
+ // Reusable messages and snippets, the organisation's and each person's own.
1080
+ { slug: "message-templates", name: "Message Templates" },
1063
1081
  // The channel_action ledger: acts through a connection that are neither a
1064
1082
  // message nor a reaction (LinkedIn invitations, profile visits, InMail).
1065
1083
  { slug: "channel-actions", name: "Channel Actions" },
@@ -1093,7 +1111,10 @@ var PLATFORM_ENTITIES = [
1093
1111
  { slug: "availability-constraints", name: "Availability Constraints" },
1094
1112
  // Discovery (discovery-service): what users send Proteos to show how they
1095
1113
  // work — screenshots, recordings, written feedback. Mass noun, no plural.
1096
- { slug: "discovery-evidence", name: "Discovery Evidence" }
1114
+ { slug: "discovery-evidence", name: "Discovery Evidence" },
1115
+ // Interview guides an admin writes; whoever reads a definition reads its
1116
+ // interviews, and whoever writes it invites people.
1117
+ { slug: "discovery-interview-definitions", name: "Discovery Interview Definitions" }
1097
1118
  ];
1098
1119
  var PLATFORM_ENTITY_SLUGS = PLATFORM_ENTITIES.map(
1099
1120
  (entity) => entity.slug
@@ -1119,7 +1140,10 @@ var SCOPED_PLATFORM_ENTITY_SLUGS = [
1119
1140
  // discovery-service: evidence is owned by its creator; a caller holding no
1120
1141
  // grant at all is treated as scoped (own rows), so every org member can
1121
1142
  // send feedback and see what they sent.
1122
- "discovery-evidence"
1143
+ "discovery-evidence",
1144
+ // discovery-service: an interview definition is owned by its creator; its
1145
+ // interviews follow it.
1146
+ "discovery-interview-definitions"
1123
1147
  ];
1124
1148
  function isPlatformEntity(slug) {
1125
1149
  return PLATFORM_ENTITY_SLUGS.includes(slug);
@@ -1314,6 +1338,8 @@ var DEFAULT_OPTIONS = {
1314
1338
  timeout: 3e4,
1315
1339
  headers: {}
1316
1340
  };
1341
+ var INVOKE_TIMEOUT_MS = 75e3;
1342
+ var BATCH_INVOKE_TIMEOUT_MS = 315e3;
1317
1343
  function resolveOptions(options) {
1318
1344
  return {
1319
1345
  baseUrl: options.baseUrl.replace(/\/$/, ""),
@@ -1753,7 +1779,8 @@ var ConnectorConnectionServiceImpl = class {
1753
1779
  const response = await this.client.request(
1754
1780
  "POST",
1755
1781
  `${CONNECTOR_BASE_PATH}/connections/${encodeURIComponent(id)}/methods/${encodeURIComponent(method)}/invoke`,
1756
- params
1782
+ params,
1783
+ { timeout: INVOKE_TIMEOUT_MS }
1757
1784
  );
1758
1785
  return response.result;
1759
1786
  }
@@ -1804,6 +1831,9 @@ function buildQuery(options) {
1804
1831
  return queryString ? `?${queryString}` : "";
1805
1832
  }
1806
1833
 
1834
+ // src/conversation/types.ts
1835
+ var UNSUBSCRIBE_URL_PLACEHOLDER = "https://unsubscribe.invalid/link";
1836
+
1807
1837
  // src/conversation/index.ts
1808
1838
  var CONVERSATION_BASE_PATH = "/conversations/v1";
1809
1839
  var ConversationClient = class {
@@ -1818,6 +1848,8 @@ var ConversationClient = class {
1818
1848
  /** Outbound send constraints: windows, connection limits, frequency caps + presets. */
1819
1849
  sendingRules;
1820
1850
  emailSignatures;
1851
+ /** Reusable messages and snippets, and rendering one for a recipient. */
1852
+ messageTemplates;
1821
1853
  /**
1822
1854
  * Channel actions: acts performed through a connection that are neither a
1823
1855
  * message nor a reaction — LinkedIn invitations, profile visits, InMail.
@@ -1865,6 +1897,7 @@ var ConversationClient = class {
1865
1897
  this.conversationFilters = new ConversationFilterServiceImpl(client);
1866
1898
  this.sendingRules = new SendingRuleServiceImpl(client);
1867
1899
  this.emailSignatures = new EmailSignatureServiceImpl(client);
1900
+ this.messageTemplates = new MessageTemplateServiceImpl(client);
1868
1901
  this.channelActions = new ChannelActionServiceImpl(client);
1869
1902
  this.channelEvents = new ChannelEventServiceImpl(client);
1870
1903
  this.glossaryTerms = new GlossaryTermServiceImpl(client);
@@ -3044,6 +3077,51 @@ var EmailSignatureServiceImpl = class {
3044
3077
  );
3045
3078
  }
3046
3079
  };
3080
+ var MessageTemplateServiceImpl = class {
3081
+ constructor(client) {
3082
+ this.client = client;
3083
+ }
3084
+ client;
3085
+ list(query = {}) {
3086
+ return this.client.requestWithQuery("GET", `${CONVERSATION_BASE_PATH}/message-templates`, query);
3087
+ }
3088
+ get(idOrKey) {
3089
+ return this.client.request(
3090
+ "GET",
3091
+ `${CONVERSATION_BASE_PATH}/message-templates/${encodeURIComponent(idOrKey)}`
3092
+ );
3093
+ }
3094
+ create(request) {
3095
+ return this.client.request("POST", `${CONVERSATION_BASE_PATH}/message-templates`, request);
3096
+ }
3097
+ update(id, request) {
3098
+ return this.client.request(
3099
+ "PATCH",
3100
+ `${CONVERSATION_BASE_PATH}/message-templates/${encodeURIComponent(id)}`,
3101
+ request
3102
+ );
3103
+ }
3104
+ upsertByKey(key, request) {
3105
+ return this.client.request(
3106
+ "PUT",
3107
+ `${CONVERSATION_BASE_PATH}/message-templates/${encodeURIComponent(key)}`,
3108
+ request
3109
+ );
3110
+ }
3111
+ async delete(id) {
3112
+ await this.client.request(
3113
+ "DELETE",
3114
+ `${CONVERSATION_BASE_PATH}/message-templates/${encodeURIComponent(id)}`
3115
+ );
3116
+ }
3117
+ render(request) {
3118
+ return this.client.request(
3119
+ "POST",
3120
+ `${CONVERSATION_BASE_PATH}/message-templates/render`,
3121
+ request
3122
+ );
3123
+ }
3124
+ };
3047
3125
  var ChannelActionServiceImpl = class {
3048
3126
  constructor(client) {
3049
3127
  this.client = client;
@@ -3402,10 +3480,14 @@ var DiscoveryClient = class {
3402
3480
  evidence;
3403
3481
  narrations;
3404
3482
  platform;
3483
+ interviewDefinitions;
3484
+ interviews;
3405
3485
  constructor(client) {
3406
3486
  this.evidence = new DiscoveryEvidenceServiceImpl(client);
3407
3487
  this.narrations = new DiscoveryEvidenceNarrationServiceImpl(client);
3408
3488
  this.platform = new PlatformDiscoveryEvidenceServiceImpl(client);
3489
+ this.interviewDefinitions = new DiscoveryInterviewDefinitionServiceImpl(client);
3490
+ this.interviews = new DiscoveryInterviewServiceImpl(client);
3409
3491
  }
3410
3492
  };
3411
3493
  var DiscoveryEvidenceServiceImpl = class {
@@ -3482,6 +3564,87 @@ var PlatformDiscoveryEvidenceServiceImpl = class {
3482
3564
  );
3483
3565
  }
3484
3566
  };
3567
+ var DiscoveryInterviewDefinitionServiceImpl = class {
3568
+ constructor(client) {
3569
+ this.client = client;
3570
+ }
3571
+ client;
3572
+ path(id, suffix = "") {
3573
+ const base = `${DISCOVERY_BASE_PATH}/interview-definitions`;
3574
+ return id === void 0 ? base : `${base}/${encode(id)}${suffix}`;
3575
+ }
3576
+ create(request) {
3577
+ return this.client.request("POST", this.path(), request);
3578
+ }
3579
+ list(query = {}) {
3580
+ return this.client.requestWithQuery("GET", this.path(), query);
3581
+ }
3582
+ get(id) {
3583
+ return this.client.request("GET", this.path(id));
3584
+ }
3585
+ update(id, request) {
3586
+ return this.client.request("PATCH", this.path(id), request);
3587
+ }
3588
+ async delete(id) {
3589
+ await this.client.request("DELETE", this.path(id));
3590
+ }
3591
+ publish(id) {
3592
+ return this.client.request("POST", this.path(id, "/publish"));
3593
+ }
3594
+ close(id) {
3595
+ return this.client.request("POST", this.path(id, "/close"));
3596
+ }
3597
+ reopen(id) {
3598
+ return this.client.request("POST", this.path(id, "/reopen"));
3599
+ }
3600
+ async invite(id, request) {
3601
+ const response = await this.client.request(
3602
+ "POST",
3603
+ this.path(id, "/interviews"),
3604
+ request
3605
+ );
3606
+ return response.data;
3607
+ }
3608
+ getParticipation(id) {
3609
+ return this.client.request("GET", this.path(id, "/participation"));
3610
+ }
3611
+ startParticipation(id, request) {
3612
+ return this.client.request("POST", this.path(id, "/participation/start"), request);
3613
+ }
3614
+ };
3615
+ var DiscoveryInterviewServiceImpl = class {
3616
+ constructor(client) {
3617
+ this.client = client;
3618
+ }
3619
+ client;
3620
+ path(id, suffix = "") {
3621
+ return `${DISCOVERY_BASE_PATH}/interviews/${encode(id)}${suffix}`;
3622
+ }
3623
+ list(query) {
3624
+ return this.client.requestWithQuery("GET", `${DISCOVERY_BASE_PATH}/interviews`, query);
3625
+ }
3626
+ get(id) {
3627
+ return this.client.request("GET", this.path(id));
3628
+ }
3629
+ async remind(id) {
3630
+ await this.client.request("POST", this.path(id, "/remind"));
3631
+ }
3632
+ synthesize(id) {
3633
+ return this.client.request("POST", this.path(id, "/synthesize"));
3634
+ }
3635
+ async delete(id) {
3636
+ await this.client.request("DELETE", this.path(id));
3637
+ }
3638
+ createDownloadUrl(id, fileId) {
3639
+ return this.client.request("POST", this.path(id, `/files/${encode(fileId)}/download-url`));
3640
+ }
3641
+ complete(id) {
3642
+ return this.client.request("POST", this.path(id, "/complete"), {});
3643
+ }
3644
+ getParticipation(id) {
3645
+ return this.client.request("GET", this.path(id, "/participation"));
3646
+ }
3647
+ };
3485
3648
 
3486
3649
  // src/events/index.ts
3487
3650
  var EVENTS_BASE_PATH = "/events/v1";
@@ -3602,7 +3765,8 @@ var ActionServiceImpl = class {
3602
3765
  const response = await this.client.request(
3603
3766
  "POST",
3604
3767
  `${ACTIONS_BASE_PATH}/${slug}/invoke`,
3605
- params
3768
+ params,
3769
+ { timeout: INVOKE_TIMEOUT_MS }
3606
3770
  );
3607
3771
  return response.result;
3608
3772
  }
@@ -3611,7 +3775,7 @@ var ActionServiceImpl = class {
3611
3775
  "POST",
3612
3776
  `/functions/v1/public/orgs/${encodeURIComponent(orgId)}/actions/${encodeURIComponent(slug)}/invoke`,
3613
3777
  params,
3614
- { skipAuth: true }
3778
+ { skipAuth: true, timeout: INVOKE_TIMEOUT_MS }
3615
3779
  );
3616
3780
  return response.result;
3617
3781
  }
@@ -3619,7 +3783,8 @@ var ActionServiceImpl = class {
3619
3783
  const response = await this.client.request(
3620
3784
  "POST",
3621
3785
  `/functions/v1/entities/${entitySlug}/records/${recordId}/actions/${slug}/invoke`,
3622
- params
3786
+ params,
3787
+ { timeout: INVOKE_TIMEOUT_MS }
3623
3788
  );
3624
3789
  return response.result;
3625
3790
  }
@@ -3627,7 +3792,8 @@ var ActionServiceImpl = class {
3627
3792
  const response = await this.client.request(
3628
3793
  "POST",
3629
3794
  `/functions/v1/entities/${entitySlug}/actions/${slug}/invoke`,
3630
- { record_ids: recordIds, params }
3795
+ { record_ids: recordIds, params },
3796
+ { timeout: BATCH_INVOKE_TIMEOUT_MS }
3631
3797
  );
3632
3798
  return response.result;
3633
3799
  }
@@ -3893,12 +4059,47 @@ var SpaceServiceImpl = class {
3893
4059
  await this.client.request("DELETE", `${SPACES_BASE_PATH}/${slug}`);
3894
4060
  }
3895
4061
  };
4062
+
4063
+ // src/knowledge/whiteboard-templates.ts
4064
+ var WHITEBOARD_TEMPLATES_BASE_PATH = "/knowledge/v1/whiteboard-templates";
4065
+ var WhiteboardTemplateServiceImpl = class {
4066
+ constructor(client) {
4067
+ this.client = client;
4068
+ }
4069
+ client;
4070
+ list(options = {}) {
4071
+ return new PageIterator((opts) => this.listPage(opts), options);
4072
+ }
4073
+ async listPage(options = {}) {
4074
+ return this.client.requestWithQuery(
4075
+ "GET",
4076
+ WHITEBOARD_TEMPLATES_BASE_PATH,
4077
+ options
4078
+ );
4079
+ }
4080
+ async get(id) {
4081
+ return this.client.request("GET", `${WHITEBOARD_TEMPLATES_BASE_PATH}/${id}`);
4082
+ }
4083
+ async create(request) {
4084
+ return this.client.request("POST", WHITEBOARD_TEMPLATES_BASE_PATH, request);
4085
+ }
4086
+ async update(id, request) {
4087
+ return this.client.request(
4088
+ "PATCH",
4089
+ `${WHITEBOARD_TEMPLATES_BASE_PATH}/${id}`,
4090
+ request
4091
+ );
4092
+ }
4093
+ async delete(id) {
4094
+ await this.client.request("DELETE", `${WHITEBOARD_TEMPLATES_BASE_PATH}/${id}`);
4095
+ }
4096
+ };
3896
4097
  var UNASSIGNED_SPACE_SLUG = "__unassigned__";
3897
4098
  var KnowledgeNodeMetadataSchema = z.object({
3898
4099
  id: z.string(),
3899
4100
  org_id: z.string(),
3900
4101
  title: z.string(),
3901
- type: z.enum(["markdown", "file", "url"]),
4102
+ type: z.enum(["markdown", "file", "url", "whiteboard"]),
3902
4103
  status: z.enum(["draft", "published", "archived"]),
3903
4104
  embedding_model: z.string().nullish(),
3904
4105
  embedded_at: z.string().nullish(),
@@ -3962,7 +4163,7 @@ var NodeNeighborhoodSchema = z.object({
3962
4163
  z.object({
3963
4164
  id: z.string(),
3964
4165
  title: z.string(),
3965
- type: z.enum(["markdown", "file", "url"]),
4166
+ type: z.enum(["markdown", "file", "url", "whiteboard"]),
3966
4167
  status: z.enum(["draft", "published", "archived"]),
3967
4168
  distance: z.number()
3968
4169
  })
@@ -3991,6 +4192,8 @@ var KnowledgeClient = class {
3991
4192
  spaces;
3992
4193
  /** Whole-org graph bulk read (radiant graph view): `knowledge.graph.get()`. */
3993
4194
  graph;
4195
+ /** Org-wide whiteboard templates: `knowledge.whiteboardTemplates`. */
4196
+ whiteboardTemplates;
3994
4197
  constructor(client) {
3995
4198
  this.nodes = new NodeServiceImpl(client);
3996
4199
  this.links = new LinkServiceImpl(client);
@@ -3998,6 +4201,7 @@ var KnowledgeClient = class {
3998
4201
  this.labels = new LabelServiceImpl(client);
3999
4202
  this.spaces = new SpaceServiceImpl(client);
4000
4203
  this.graph = new GraphServiceImpl(client);
4204
+ this.whiteboardTemplates = new WhiteboardTemplateServiceImpl(client);
4001
4205
  }
4002
4206
  };
4003
4207
 
@@ -4663,6 +4867,6 @@ var WorkflowClient = class {
4663
4867
  }
4664
4868
  };
4665
4869
 
4666
- export { AccountClient, ActionSchema, ActionScopeSchema, AgentClient, BatchTransactionErrorSchema, BatchUpsertRecordsResponseSchema, BatchUpsertTransactionResultSchema, BatchUpsertTransactionSchema, ConnectorClient, ConversationClient, DEFAULT_OPTIONS, DEFAULT_PORT, DataClient, DiscoveryClient, ERROR_PORT, ErrorCode, EventsClient, FunctionsClient, KnowledgeClient, KnowledgeLabelSchema, KnowledgeLinkSchema, KnowledgeNodeLabelSchema, KnowledgeNodeMetadataSchema, KnowledgeNodeSchema, KnowledgeNodeSearchResultSchema, KnowledgeRecordLinkSchema, NodeNeighborhoodSchema, OrganizationSchema, PLATFORM_ENTITIES, PLATFORM_ENTITY_SLUGS, ProfileSchema, ProteosClient, ProteosError, RecordDraftChangeSchema, RecordDraftItemResultSchema, RecordDraftItemSchema, RoleEntityPermissionSchema, RoleSchema, SCOPED_PLATFORM_ENTITY_SLUGS, SchedulingClient, StorageClient, UNASSIGNED_SPACE_SLUG, UserProfileAssignmentSchema, UserRoleAssignmentSchema, UserSchema, WorkflowClient, buildUrl, getDefaultErrorCode, isBadRequest, isConflict, isDeltaFrame, isForbidden, isNotFound, isPlatformEntity, isProteosError, isShareable, isUnauthorized, parseErrorResponse, resolveOptions, shareRouteFor, toQueryParams, toQueryString };
4870
+ export { AccountClient, ActionSchema, ActionScopeSchema, AgentClient, BatchTransactionErrorSchema, BatchUpsertRecordsResponseSchema, BatchUpsertTransactionResultSchema, BatchUpsertTransactionSchema, ConnectorClient, ConversationClient, DEFAULT_OPTIONS, DEFAULT_PORT, DataClient, DiscoveryClient, ERROR_PORT, ErrorCode, EventsClient, FunctionsClient, KnowledgeClient, KnowledgeLabelSchema, KnowledgeLinkSchema, KnowledgeNodeLabelSchema, KnowledgeNodeMetadataSchema, KnowledgeNodeSchema, KnowledgeNodeSearchResultSchema, KnowledgeRecordLinkSchema, NodeNeighborhoodSchema, OrganizationSchema, PLATFORM_ENTITIES, PLATFORM_ENTITY_SLUGS, ProfileSchema, ProteosClient, ProteosError, RecordDraftChangeSchema, RecordDraftItemResultSchema, RecordDraftItemSchema, RoleEntityPermissionSchema, RoleSchema, SCOPED_PLATFORM_ENTITY_SLUGS, SchedulingClient, StorageClient, UNASSIGNED_SPACE_SLUG, UNSUBSCRIBE_URL_PLACEHOLDER, UserProfileAssignmentSchema, UserRoleAssignmentSchema, UserSchema, WorkflowClient, buildUrl, getDefaultErrorCode, isBadRequest, isConflict, isDeltaFrame, isForbidden, isNotFound, isPlatformEntity, isProteosError, isShareable, isUnauthorized, parseErrorResponse, resolveOptions, shareRouteFor, toQueryParams, toQueryString };
4667
4871
  //# sourceMappingURL=index.js.map
4668
4872
  //# sourceMappingURL=index.js.map