@proteos/sdk 0.85.0 → 0.86.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.
@@ -1,9 +1,9 @@
1
1
  import type { ProteosClient } from '../client.js'
2
2
  import type {
3
+ ConnectionTokenResponse,
3
4
  Connector,
4
5
  ConnectorConnection,
5
6
  ConnectorMethod,
6
- ConnectionTokenResponse,
7
7
  CreateConnectorConnectionRequest,
8
8
  InstallConnectorConnectionResponse,
9
9
  InvokeMethodResponse,
@@ -54,7 +54,10 @@ class ConnectorCatalogServiceImpl implements ConnectorCatalogService {
54
54
  }
55
55
 
56
56
  get(key: string): Promise<Connector> {
57
- return this.client.request('GET', `${CONNECTOR_BASE_PATH}/connectors/${encodeURIComponent(key)}`)
57
+ return this.client.request(
58
+ 'GET',
59
+ `${CONNECTOR_BASE_PATH}/connectors/${encodeURIComponent(key)}`,
60
+ )
58
61
  }
59
62
 
60
63
  async listMethods(key: string): Promise<ConnectorMethod[]> {
@@ -86,7 +89,10 @@ class ConnectorConnectionServiceImpl implements ConnectorConnectionService {
86
89
  }
87
90
 
88
91
  get(id: string): Promise<ConnectorConnection> {
89
- return this.client.request('GET', `${CONNECTOR_BASE_PATH}/connections/${encodeURIComponent(id)}`)
92
+ return this.client.request(
93
+ 'GET',
94
+ `${CONNECTOR_BASE_PATH}/connections/${encodeURIComponent(id)}`,
95
+ )
90
96
  }
91
97
 
92
98
  create(request: CreateConnectorConnectionRequest): Promise<ConnectorConnection> {
@@ -94,19 +100,32 @@ class ConnectorConnectionServiceImpl implements ConnectorConnectionService {
94
100
  }
95
101
 
96
102
  update(id: string, request: UpdateConnectorConnectionRequest): Promise<ConnectorConnection> {
97
- return this.client.request('PATCH', `${CONNECTOR_BASE_PATH}/connections/${encodeURIComponent(id)}`, request)
103
+ return this.client.request(
104
+ 'PATCH',
105
+ `${CONNECTOR_BASE_PATH}/connections/${encodeURIComponent(id)}`,
106
+ request,
107
+ )
98
108
  }
99
109
 
100
110
  async delete(id: string): Promise<void> {
101
- await this.client.request('DELETE', `${CONNECTOR_BASE_PATH}/connections/${encodeURIComponent(id)}`)
111
+ await this.client.request(
112
+ 'DELETE',
113
+ `${CONNECTOR_BASE_PATH}/connections/${encodeURIComponent(id)}`,
114
+ )
102
115
  }
103
116
 
104
117
  install(id: string): Promise<InstallConnectorConnectionResponse> {
105
- return this.client.request('POST', `${CONNECTOR_BASE_PATH}/connections/${encodeURIComponent(id)}/install`)
118
+ return this.client.request(
119
+ 'POST',
120
+ `${CONNECTOR_BASE_PATH}/connections/${encodeURIComponent(id)}/install`,
121
+ )
106
122
  }
107
123
 
108
124
  token(id: string): Promise<ConnectionTokenResponse> {
109
- return this.client.request('POST', `${CONNECTOR_BASE_PATH}/connections/${encodeURIComponent(id)}/token`)
125
+ return this.client.request(
126
+ 'POST',
127
+ `${CONNECTOR_BASE_PATH}/connections/${encodeURIComponent(id)}/token`,
128
+ )
110
129
  }
111
130
 
112
131
  async invokeMethod<T = unknown>(id: string, method: string, params: unknown = {}): Promise<T> {
@@ -124,6 +124,7 @@ import type {
124
124
  ToneProfileSetup,
125
125
  Transcription,
126
126
  UnreadCounts,
127
+ UnreadCountsQuery,
127
128
  UpdateAgentListenerRequest,
128
129
  UpdateConnectionRequest,
129
130
  UpdateContactGroupRequest,
@@ -785,7 +786,7 @@ export interface ConversationService {
785
786
  /** Remove the marker — the conversation reads as unread again. */
786
787
  markUnread(id: string): Promise<void>
787
788
  /** Unread-conversation counts for the requesting user (envelope + badges). */
788
- unreadCounts(): Promise<UnreadCounts>
789
+ unreadCounts(query?: UnreadCountsQuery): Promise<UnreadCounts>
789
790
  }
790
791
 
791
792
  class ConversationServiceImpl implements ConversationService {
@@ -853,8 +854,12 @@ class ConversationServiceImpl implements ConversationService {
853
854
  )
854
855
  }
855
856
 
856
- unreadCounts(): Promise<UnreadCounts> {
857
- return this.client.request('GET', `${CONVERSATION_BASE_PATH}/conversations/unread-counts`)
857
+ unreadCounts(query?: UnreadCountsQuery): Promise<UnreadCounts> {
858
+ return this.client.requestWithQuery(
859
+ 'GET',
860
+ `${CONVERSATION_BASE_PATH}/conversations/unread-counts`,
861
+ query,
862
+ )
858
863
  }
859
864
  }
860
865
 
@@ -2217,6 +2217,21 @@ export interface ListConversationsQuery extends PaginationQuery {
2217
2217
  tag_key?: string
2218
2218
  /** With `tag_key`: only conversations whose tag has this value. */
2219
2219
  tag_value?: string
2220
+ /**
2221
+ * The hub's Mine / All axis. `own`: threads on the caller's own
2222
+ * connections and the org-wide ones (on a shared sending connection only
2223
+ * threads the caller is in), plus connection-less threads they created.
2224
+ * `all` (the default when omitted): everything the caller may read.
2225
+ */
2226
+ conversation_scope?: ConversationScope
2227
+ }
2228
+
2229
+ /** `?conversation_scope=` values — see ListConversationsQuery. */
2230
+ export type ConversationScope = 'own' | 'all'
2231
+
2232
+ /** Unread counts follow the same Mine / All axis as the list. */
2233
+ export interface UnreadCountsQuery {
2234
+ conversation_scope?: ConversationScope
2220
2235
  }
2221
2236
 
2222
2237
  /**
@@ -68,15 +68,17 @@ class TopicServiceImpl implements TopicService {
68
68
  }
69
69
 
70
70
  async events(topic: string, options: ListEventsOptions = {}): Promise<PlatformEvent[]> {
71
- const response = await this.client.requestWithQuery<{ data: PlatformEvent[] }, ListEventsOptions>(
72
- 'GET',
73
- `${EVENTS_BASE_PATH}/topics/${encodeURIComponent(topic)}/events`,
74
- options,
75
- )
71
+ const response = await this.client.requestWithQuery<
72
+ { data: PlatformEvent[] },
73
+ ListEventsOptions
74
+ >('GET', `${EVENTS_BASE_PATH}/topics/${encodeURIComponent(topic)}/events`, options)
76
75
  return response.data ?? []
77
76
  }
78
77
 
79
- async *tail(topic: string, options: TailOptions = {}): AsyncGenerator<PlatformEvent, void, unknown> {
78
+ async *tail(
79
+ topic: string,
80
+ options: TailOptions = {},
81
+ ): AsyncGenerator<PlatformEvent, void, unknown> {
80
82
  const path = `${EVENTS_BASE_PATH}/topics/${encodeURIComponent(topic)}/events?follow=true`
81
83
  let body: ReadableStream<Uint8Array> | null
82
84
  try {
package/src/index.ts CHANGED
@@ -339,6 +339,7 @@ export type {
339
339
  ConversationPhase,
340
340
  ConversationPhaseProgress,
341
341
  ConversationPhaseStatus,
342
+ ConversationScope,
342
343
  ConversationService,
343
344
  ConversationStatus,
344
345
  ConversationSummaryStatus,
@@ -521,6 +522,7 @@ export type {
521
522
  TwilioPhoneSettings,
522
523
  TwilioPhoneVoicemailSettings,
523
524
  UnreadCounts,
525
+ UnreadCountsQuery,
524
526
  UpdateAgentListenerRequest,
525
527
  UpdateConnectionRequest,
526
528
  UpdateContactGroupRequest,
@@ -3,8 +3,8 @@ import { type GraphService, GraphServiceImpl } from './graph.js'
3
3
  import { type LabelService, LabelServiceImpl } from './labels.js'
4
4
  import { type LinkService, LinkServiceImpl } from './links.js'
5
5
  import { type NodeService, NodeServiceImpl } from './nodes.js'
6
- import { type SpaceService, SpaceServiceImpl } from './spaces.js'
7
6
  import { type RecordLinkService, RecordLinkServiceImpl } from './record-links.js'
7
+ import { type SpaceService, SpaceServiceImpl } from './spaces.js'
8
8
 
9
9
  /**
10
10
  * Facade for the knowledge-service (graph-native knowledge base: nodes, typed
@@ -47,8 +47,8 @@ export type { GraphService } from './graph.js'
47
47
  export type { LabelService } from './labels.js'
48
48
  export type { LinkService } from './links.js'
49
49
  export type { NodeService } from './nodes.js'
50
- export type { SpaceService } from './spaces.js'
51
50
  export type { RecordLinkService } from './record-links.js'
51
+ export type { SpaceService } from './spaces.js'
52
52
 
53
53
  // Re-export types
54
54
  export type {
@@ -102,10 +102,7 @@ export type {
102
102
  UpdateSpaceRequest,
103
103
  WriteContentResponse,
104
104
  } from './types.js'
105
-
106
105
  // Re-export the reserved space-filter sentinel (a value, not a type).
107
- export { UNASSIGNED_SPACE_SLUG } from './types.js'
108
-
109
106
  // Re-export Zod schemas
110
107
  export {
111
108
  KnowledgeLabelSchema,
@@ -116,4 +113,5 @@ export {
116
113
  KnowledgeNodeSearchResultSchema,
117
114
  KnowledgeRecordLinkSchema,
118
115
  NodeNeighborhoodSchema,
116
+ UNASSIGNED_SPACE_SLUG,
119
117
  } from './types.js'
package/src/meta/index.ts CHANGED
@@ -276,11 +276,8 @@ export type {
276
276
  // PageExtension types
277
277
  PageExtension,
278
278
  PageExtensionPlacement,
279
- PageType,
280
- RecordPageBinding,
281
279
  PageMode,
282
- TriggerPageBinding,
283
- TriggerPhase,
280
+ PageType,
284
281
  // User attribute meta
285
282
  PrincipalAttributeMeta,
286
283
  PrincipalRef,
@@ -288,12 +285,15 @@ export type {
288
285
  PublicAccessOperation,
289
286
  PublicPageComponent,
290
287
  PublicPageResponse,
288
+ RecordPageBinding,
291
289
  // Relation attribute meta
292
290
  RelationAttributeMeta,
293
291
  SortConfig,
294
292
  SortDirection,
295
293
  StringAttributeMeta,
296
294
  StringFormat,
295
+ TriggerPageBinding,
296
+ TriggerPhase,
297
297
  UpdateAppConfigurationRequest,
298
298
  UpdateAppRequest,
299
299
  UpdateComponentRequest,
@@ -317,8 +317,6 @@ export type {
317
317
  export {
318
318
  AppConfigurationSchema,
319
319
  AppHomeSchema,
320
- RecordPageBindingSchema,
321
- TriggerPageBindingSchema,
322
320
  AppSchema,
323
321
  AttributeSchema,
324
322
  acceptsCurrentUserDefault,
@@ -353,9 +351,9 @@ export {
353
351
  MenuItemType,
354
352
  ModuleSchema,
355
353
  OnDeleteActionSchema,
354
+ PAGE_ACTION_MATCH_MAX_LIMIT,
356
355
  PAGE_EXTENSION_ANCHOR_MAIN,
357
356
  PAGE_EXTENSION_ANCHOR_SIDE_PANEL,
358
- PAGE_ACTION_MATCH_MAX_LIMIT,
359
357
  PageActionMatchSchema,
360
358
  PageActionSchema,
361
359
  PageExtensionPlacementSchema,
@@ -369,8 +367,10 @@ export {
369
367
  parseRelationMeta,
370
368
  parseUserMeta,
371
369
  platformAttributes,
370
+ RecordPageBindingSchema,
372
371
  RelationAttributeMetaSchema,
373
372
  SortConfigSchema,
373
+ TriggerPageBindingSchema,
374
374
  UserAttributeMetaSchema,
375
375
  VariableSchema,
376
376
  } from './types.js'
@@ -32,97 +32,61 @@
32
32
  "controls": {
33
33
  "string": {
34
34
  "primary": "text",
35
- "compatible": [
36
- "text",
37
- "textarea",
38
- "password",
39
- "record-filter"
40
- ],
35
+ "compatible": ["text", "textarea", "password", "record-filter"],
41
36
  "byFormat": {
42
37
  "email": {
43
38
  "primary": "email",
44
- "compatible": [
45
- "email",
46
- "text"
47
- ]
39
+ "compatible": ["email", "text"]
48
40
  },
49
41
  "uri": {
50
42
  "primary": "url",
51
- "compatible": [
52
- "url",
53
- "text"
54
- ]
43
+ "compatible": ["url", "text"]
55
44
  },
56
45
  "uuid": {
57
46
  "primary": "text",
58
- "compatible": [
59
- "text"
60
- ]
47
+ "compatible": ["text"]
61
48
  },
62
49
  "hostname": {
63
50
  "primary": "text",
64
- "compatible": [
65
- "text"
66
- ]
51
+ "compatible": ["text"]
67
52
  },
68
53
  "ipv4": {
69
54
  "primary": "text",
70
- "compatible": [
71
- "text"
72
- ]
55
+ "compatible": ["text"]
73
56
  },
74
57
  "ipv6": {
75
58
  "primary": "text",
76
- "compatible": [
77
- "text"
78
- ]
59
+ "compatible": ["text"]
79
60
  }
80
61
  }
81
62
  },
82
63
  "number": {
83
64
  "primary": "number",
84
- "compatible": [
85
- "number"
86
- ]
65
+ "compatible": ["number"]
87
66
  },
88
67
  "integer": {
89
68
  "primary": "number",
90
- "compatible": [
91
- "number"
92
- ]
69
+ "compatible": ["number"]
93
70
  },
94
71
  "boolean": {
95
72
  "primary": "switch",
96
- "compatible": [
97
- "switch",
98
- "checkbox"
99
- ]
73
+ "compatible": ["switch", "checkbox"]
100
74
  },
101
75
  "enum": {
102
76
  "primary": "select",
103
- "compatible": [
104
- "select",
105
- "radio-group",
106
- "chip-group"
107
- ]
77
+ "compatible": ["select", "radio-group", "chip-group"]
108
78
  },
109
79
  "array": {
110
80
  "primary": "tag-input",
111
- "compatible": [
112
- "tag-input"
113
- ],
81
+ "compatible": ["tag-input"],
114
82
  "byItemsType": {
115
83
  "string": {
116
84
  "primary": "tag-input",
117
- "compatible": [
118
- "tag-input"
119
- ]
85
+ "compatible": ["tag-input"]
120
86
  },
121
87
  "enum": {
122
88
  "primary": "multi-select",
123
- "compatible": [
124
- "multi-select"
125
- ]
89
+ "compatible": ["multi-select"]
126
90
  }
127
91
  }
128
92
  },
@@ -132,21 +96,15 @@
132
96
  "byFormat": {
133
97
  "date": {
134
98
  "primary": "date-picker",
135
- "compatible": [
136
- "date-picker"
137
- ]
99
+ "compatible": ["date-picker"]
138
100
  },
139
101
  "date-time": {
140
102
  "primary": "datetime-picker",
141
- "compatible": [
142
- "datetime-picker"
143
- ]
103
+ "compatible": ["datetime-picker"]
144
104
  },
145
105
  "time": {
146
106
  "primary": "time-picker",
147
- "compatible": [
148
- "time-picker"
149
- ]
107
+ "compatible": ["time-picker"]
150
108
  },
151
109
  "duration": {
152
110
  "primary": null,
@@ -160,47 +118,31 @@
160
118
  },
161
119
  "relation": {
162
120
  "primary": "entity-picker",
163
- "compatible": [
164
- "entity-picker"
165
- ]
121
+ "compatible": ["entity-picker"]
166
122
  },
167
123
  "user": {
168
124
  "primary": "user-picker",
169
- "compatible": [
170
- "user-picker"
171
- ]
125
+ "compatible": ["user-picker"]
172
126
  },
173
127
  "currency": {
174
128
  "primary": "currency",
175
- "compatible": [
176
- "currency"
177
- ]
129
+ "compatible": ["currency"]
178
130
  },
179
131
  "contact-address": {
180
132
  "primary": "contact-address",
181
- "compatible": [
182
- "contact-address",
183
- "text"
184
- ]
133
+ "compatible": ["contact-address", "text"]
185
134
  },
186
135
  "knowledge-text": {
187
136
  "primary": "knowledge-text",
188
- "compatible": [
189
- "knowledge-text"
190
- ]
137
+ "compatible": ["knowledge-text"]
191
138
  },
192
139
  "file": {
193
140
  "primary": "file",
194
- "compatible": [
195
- "file",
196
- "file-viewer"
197
- ]
141
+ "compatible": ["file", "file-viewer"]
198
142
  },
199
143
  "principal": {
200
144
  "primary": "principal-picker",
201
- "compatible": [
202
- "principal-picker"
203
- ]
145
+ "compatible": ["principal-picker"]
204
146
  }
205
147
  }
206
148
  }
@@ -20,9 +20,7 @@ const LIST_EXTENSIONS_BASE_PATH = '/meta/v1/list-extensions'
20
20
  */
21
21
  export interface ListExtensionService {
22
22
  /** Lists entity extensions (auto-paginating iterator). */
23
- list(
24
- options?: ListListExtensionsOptions,
25
- ): PageIterator<ListExtension, ListListExtensionsOptions>
23
+ list(options?: ListListExtensionsOptions): PageIterator<ListExtension, ListListExtensionsOptions>
26
24
 
27
25
  /** Fetches a single page of entity extensions. */
28
26
  listPage(options?: ListListExtensionsOptions): Promise<ListResult<ListExtension>>
@@ -3,8 +3,8 @@ import { PageIterator } from '../iterator.js'
3
3
  import type { ListResult } from '../types/common.js'
4
4
  import type {
5
5
  CreatePageExtensionRequest,
6
- PageExtension,
7
6
  ListPageExtensionsOptions,
7
+ PageExtension,
8
8
  UpdatePageExtensionRequest,
9
9
  } from './types.js'
10
10
 
@@ -20,9 +20,7 @@ const PAGE_EXTENSIONS_BASE_PATH = '/meta/v1/page-extensions'
20
20
  */
21
21
  export interface PageExtensionService {
22
22
  /** Lists entity extensions (auto-paginating iterator). */
23
- list(
24
- options?: ListPageExtensionsOptions,
25
- ): PageIterator<PageExtension, ListPageExtensionsOptions>
23
+ list(options?: ListPageExtensionsOptions): PageIterator<PageExtension, ListPageExtensionsOptions>
26
24
 
27
25
  /** Fetches a single page of entity extensions. */
28
26
  listPage(options?: ListPageExtensionsOptions): Promise<ListResult<PageExtension>>
package/src/meta/types.ts CHANGED
@@ -2035,7 +2035,11 @@ export interface RecordPageBinding {
2035
2035
  }
2036
2036
 
2037
2037
  export const RecordPageBindingSchema = z
2038
- .object({ view: z.string().optional(), create: z.string().optional(), edit: z.string().optional() })
2038
+ .object({
2039
+ view: z.string().optional(),
2040
+ create: z.string().optional(),
2041
+ edit: z.string().optional(),
2042
+ })
2039
2043
  .strict()
2040
2044
 
2041
2045
  /**
@@ -2051,7 +2055,11 @@ export interface TriggerPageBinding {
2051
2055
  }
2052
2056
 
2053
2057
  export const TriggerPageBindingSchema = z
2054
- .object({ input: z.string().optional(), running: z.string().optional(), result: z.string().optional() })
2058
+ .object({
2059
+ input: z.string().optional(),
2060
+ running: z.string().optional(),
2061
+ result: z.string().optional(),
2062
+ })
2055
2063
  .strict()
2056
2064
 
2057
2065
  /**