@proteos/sdk 0.49.0 → 0.51.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/{chunk-TDG5QFZ5.js → chunk-IRFFXJMB.js} +66 -4
- package/dist/chunk-IRFFXJMB.js.map +1 -0
- package/dist/{chunk-OD7GPJAW.cjs → chunk-RKFXHDVU.cjs} +67 -3
- package/dist/chunk-RKFXHDVU.cjs.map +1 -0
- package/dist/index.cjs +456 -98
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1036 -9
- package/dist/index.d.ts +1036 -9
- package/dist/index.js +353 -5
- package/dist/index.js.map +1 -1
- package/dist/meta/index.cjs +65 -57
- package/dist/meta/index.d.cts +1 -1
- package/dist/meta/index.d.ts +1 -1
- package/dist/meta/index.js +1 -1
- package/dist/{types-COxVBT4w.d.cts → types-C9flkAj-.d.cts} +208 -7
- package/dist/{types-COxVBT4w.d.ts → types-C9flkAj-.d.ts} +208 -7
- package/package.json +1 -1
- package/src/auth/index.ts +40 -11
- package/src/auth/me.ts +13 -1
- package/src/auth/platform-entities.ts +17 -0
- package/src/auth/profiles.ts +82 -0
- package/src/auth/types.ts +87 -0
- package/src/auth/user-profile-assignments.ts +41 -0
- package/src/auth/users.ts +37 -0
- package/src/conversation/index.ts +417 -10
- package/src/conversation/types.ts +731 -3
- package/src/errors.ts +20 -3
- package/src/index.ts +104 -17
- package/src/meta/app-configurations.ts +100 -0
- package/src/meta/index.ts +28 -10
- package/src/meta/types.ts +94 -4
- package/src/workflow/types.ts +13 -0
- package/dist/chunk-OD7GPJAW.cjs.map +0 -1
- package/dist/chunk-TDG5QFZ5.js.map +0 -1
package/src/errors.ts
CHANGED
|
@@ -23,12 +23,24 @@ export class ProteosError extends Error {
|
|
|
23
23
|
readonly httpStatus: number
|
|
24
24
|
/** API error code (e.g., 'not_found', 'unauthorized') */
|
|
25
25
|
readonly code: ErrorCodeType | string
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
/**
|
|
27
|
+
* Optional machine-readable payload beside the message — e.g. a denied send's
|
|
28
|
+
* `earliest_allowed_at` / `rule_id`, the offending `contact_id`. Absent on
|
|
29
|
+
* most errors.
|
|
30
|
+
*/
|
|
31
|
+
readonly details: Record<string, unknown> | undefined
|
|
32
|
+
|
|
33
|
+
constructor(
|
|
34
|
+
message: string,
|
|
35
|
+
httpStatus: number,
|
|
36
|
+
code: ErrorCodeType | string,
|
|
37
|
+
details?: Record<string, unknown>,
|
|
38
|
+
) {
|
|
28
39
|
super(message)
|
|
29
40
|
this.name = 'ProteosError'
|
|
30
41
|
this.httpStatus = httpStatus
|
|
31
42
|
this.code = code
|
|
43
|
+
this.details = details
|
|
32
44
|
|
|
33
45
|
// V8-specific API for cleaner stack traces; not present in all runtimes
|
|
34
46
|
const v8Capture = (Error as unknown as { captureStackTrace?: (t: object, c: unknown) => void })
|
|
@@ -112,6 +124,7 @@ export function getDefaultErrorCode(httpStatus: number): ErrorCodeType | string
|
|
|
112
124
|
export interface ApiErrorResponse {
|
|
113
125
|
code?: string
|
|
114
126
|
message?: string
|
|
127
|
+
details?: Record<string, unknown>
|
|
115
128
|
}
|
|
116
129
|
|
|
117
130
|
/**
|
|
@@ -121,6 +134,7 @@ export async function parseErrorResponse(response: Response): Promise<ProteosErr
|
|
|
121
134
|
const httpStatus = response.status
|
|
122
135
|
let code: string = getDefaultErrorCode(httpStatus)
|
|
123
136
|
let message = 'Unknown error'
|
|
137
|
+
let details: Record<string, unknown> | undefined
|
|
124
138
|
|
|
125
139
|
try {
|
|
126
140
|
const body = await response.text()
|
|
@@ -136,6 +150,9 @@ export async function parseErrorResponse(response: Response): Promise<ProteosErr
|
|
|
136
150
|
} else {
|
|
137
151
|
message = body || `HTTP ${httpStatus}`
|
|
138
152
|
}
|
|
153
|
+
if (json.details && typeof json.details === 'object') {
|
|
154
|
+
details = json.details
|
|
155
|
+
}
|
|
139
156
|
} catch {
|
|
140
157
|
// Not JSON, use body as message
|
|
141
158
|
message = body.trim() || `HTTP ${httpStatus}`
|
|
@@ -144,5 +161,5 @@ export async function parseErrorResponse(response: Response): Promise<ProteosErr
|
|
|
144
161
|
message = `HTTP ${httpStatus}`
|
|
145
162
|
}
|
|
146
163
|
|
|
147
|
-
return new ProteosError(message, httpStatus, code)
|
|
164
|
+
return new ProteosError(message, httpStatus, code, details)
|
|
148
165
|
}
|
package/src/index.ts
CHANGED
|
@@ -64,8 +64,8 @@ export type {
|
|
|
64
64
|
ListPromptsOptions,
|
|
65
65
|
ListSessionsOptions,
|
|
66
66
|
ListSkillsOptions,
|
|
67
|
-
ListToolsOptions,
|
|
68
67
|
ListToolsetsOptions,
|
|
68
|
+
ListToolsOptions,
|
|
69
69
|
McpBinding,
|
|
70
70
|
McpConnectionState,
|
|
71
71
|
McpConnectionStatus,
|
|
@@ -78,9 +78,11 @@ export type {
|
|
|
78
78
|
ModelRequestEndPayload,
|
|
79
79
|
ModelRequestStartPayload,
|
|
80
80
|
ModelUsage,
|
|
81
|
+
PlatformBinding,
|
|
81
82
|
Prompt,
|
|
82
83
|
PromptService,
|
|
83
84
|
PromptVersion,
|
|
85
|
+
QueryBinding,
|
|
84
86
|
ReasoningPayload,
|
|
85
87
|
ResultBlock,
|
|
86
88
|
Session,
|
|
@@ -99,18 +101,16 @@ export type {
|
|
|
99
101
|
StartMcpOAuthResponse,
|
|
100
102
|
StopReason,
|
|
101
103
|
TextBlock,
|
|
102
|
-
PlatformBinding,
|
|
103
|
-
QueryBinding,
|
|
104
104
|
Tool,
|
|
105
105
|
ToolBinding,
|
|
106
106
|
ToolConfirmationPayload,
|
|
107
107
|
ToolKind,
|
|
108
108
|
ToolResultPayload,
|
|
109
|
+
ToolService,
|
|
109
110
|
Toolset,
|
|
110
111
|
ToolsetKind,
|
|
111
112
|
ToolsetService,
|
|
112
113
|
ToolsetToolSummary,
|
|
113
|
-
ToolService,
|
|
114
114
|
ToolUsePayload,
|
|
115
115
|
Turn,
|
|
116
116
|
UpdateAgentRequest,
|
|
@@ -133,15 +133,18 @@ export type {
|
|
|
133
133
|
CreateApiKeyRequest,
|
|
134
134
|
CreatedApiKey,
|
|
135
135
|
CreateOrganizationRequest,
|
|
136
|
+
CreateProfileRequest,
|
|
136
137
|
CreateRoleRequest,
|
|
137
138
|
CreateTeamRequest,
|
|
138
139
|
CreateUserRequest,
|
|
139
140
|
ListOrganizationsOptions,
|
|
140
141
|
ListOrgUserRoleAssignmentsOptions,
|
|
142
|
+
ListProfilesOptions,
|
|
141
143
|
ListRolePermissionsOptions,
|
|
142
144
|
ListRolesOptions,
|
|
143
145
|
ListTeamMembersOptions,
|
|
144
146
|
ListTeamsOptions,
|
|
147
|
+
ListUserProfileAssignmentsOptions,
|
|
145
148
|
ListUserRoleAssignmentsOptions,
|
|
146
149
|
ListUsersOptions,
|
|
147
150
|
// Me (caller-scoped) service
|
|
@@ -153,24 +156,31 @@ export type {
|
|
|
153
156
|
Permission,
|
|
154
157
|
// Platform entities
|
|
155
158
|
PlatformEntity,
|
|
159
|
+
// Profile types (the org's user-types, one per user)
|
|
160
|
+
Profile,
|
|
161
|
+
ProfileService,
|
|
156
162
|
// Role types
|
|
157
163
|
Role,
|
|
158
164
|
RoleEntityPermission,
|
|
159
165
|
RoleService,
|
|
166
|
+
SetProfileRequest,
|
|
167
|
+
// Share types (instance-level access)
|
|
168
|
+
SharePermission,
|
|
169
|
+
ShareRow,
|
|
170
|
+
ShareService,
|
|
160
171
|
Team,
|
|
161
172
|
TeamMember,
|
|
162
173
|
TeamService,
|
|
163
174
|
UpdateMeRequest,
|
|
164
175
|
UpdateOrganizationRequest,
|
|
176
|
+
UpdateProfileRequest,
|
|
165
177
|
UpdateRoleRequest,
|
|
166
178
|
UpdateTeamRequest,
|
|
167
179
|
UpdateUserRequest,
|
|
168
|
-
// Share types (instance-level access)
|
|
169
|
-
SharePermission,
|
|
170
|
-
ShareRow,
|
|
171
|
-
ShareService,
|
|
172
180
|
// User types
|
|
173
181
|
User,
|
|
182
|
+
UserProfileAssignment,
|
|
183
|
+
UserProfileAssignmentService,
|
|
174
184
|
// User role assignment types
|
|
175
185
|
UserRoleAssignment,
|
|
176
186
|
UserRoleAssignmentService,
|
|
@@ -185,10 +195,12 @@ export {
|
|
|
185
195
|
OrganizationSchema,
|
|
186
196
|
PLATFORM_ENTITIES,
|
|
187
197
|
PLATFORM_ENTITY_SLUGS,
|
|
188
|
-
|
|
198
|
+
ProfileSchema,
|
|
189
199
|
RoleEntityPermissionSchema,
|
|
190
200
|
RoleSchema,
|
|
201
|
+
SCOPED_PLATFORM_ENTITY_SLUGS,
|
|
191
202
|
shareRouteFor,
|
|
203
|
+
UserProfileAssignmentSchema,
|
|
192
204
|
UserRoleAssignmentSchema,
|
|
193
205
|
UserSchema,
|
|
194
206
|
} from './auth/index.js'
|
|
@@ -222,14 +234,29 @@ export type {
|
|
|
222
234
|
AgentListenerService,
|
|
223
235
|
AgentListenerTriggerType,
|
|
224
236
|
AllFilterConfig,
|
|
237
|
+
ApplySendingLimitPresetRequest,
|
|
225
238
|
AttachContactAddressRequest,
|
|
239
|
+
AttachConversationBriefRequest,
|
|
226
240
|
Attachment,
|
|
227
241
|
AutomatedFilterConfig,
|
|
228
242
|
AutomatedSignal,
|
|
229
243
|
BlockContactRequest,
|
|
244
|
+
BounceClassification,
|
|
245
|
+
BounceKind,
|
|
230
246
|
CallStatus,
|
|
231
247
|
CallTokenResponse,
|
|
232
248
|
Channel,
|
|
249
|
+
ChannelAction,
|
|
250
|
+
ChannelActionCapability,
|
|
251
|
+
ChannelActionParams,
|
|
252
|
+
ChannelActionResponse,
|
|
253
|
+
ChannelActionService,
|
|
254
|
+
ChannelActionStatus,
|
|
255
|
+
ChannelActionTargetKind,
|
|
256
|
+
ChannelActionType,
|
|
257
|
+
ChannelEvent,
|
|
258
|
+
ChannelEventService,
|
|
259
|
+
ChannelEventType,
|
|
233
260
|
Connection,
|
|
234
261
|
ConnectionCredentials,
|
|
235
262
|
ConnectionScope,
|
|
@@ -237,6 +264,7 @@ export type {
|
|
|
237
264
|
ConnectionStatus,
|
|
238
265
|
ConnectionSyncRange,
|
|
239
266
|
ConnectionSyncStatus,
|
|
267
|
+
ConnectorCatalogEntry,
|
|
240
268
|
ConnectorKey,
|
|
241
269
|
ConnectorProvider,
|
|
242
270
|
ConsentStatus,
|
|
@@ -256,6 +284,9 @@ export type {
|
|
|
256
284
|
// Aliased: the agent module already exports its own ContentBlock.
|
|
257
285
|
ContentBlock as MessageContentBlock,
|
|
258
286
|
Conversation,
|
|
287
|
+
ConversationBrief,
|
|
288
|
+
ConversationBriefService,
|
|
289
|
+
ConversationBriefStatus,
|
|
259
290
|
ConversationFilter,
|
|
260
291
|
ConversationFilterAction,
|
|
261
292
|
ConversationFilterConfig,
|
|
@@ -272,24 +303,48 @@ export type {
|
|
|
272
303
|
CreateAgentListenerRequest,
|
|
273
304
|
CreateConnectionRequest,
|
|
274
305
|
CreateContactGroupRequest,
|
|
306
|
+
CreateContactRequest,
|
|
307
|
+
CreateConversationBriefRequest,
|
|
275
308
|
CreateConversationFilterRequest,
|
|
276
309
|
CreateConversationTypeRequest,
|
|
277
310
|
CreateGlossaryTermRequest,
|
|
311
|
+
CreateSendingRuleRequest,
|
|
278
312
|
CreateToneProfileSetupRequest,
|
|
279
313
|
DispatchMeetingBotRequest,
|
|
280
314
|
DomainFilterConfig,
|
|
315
|
+
EmailDnsRecord,
|
|
316
|
+
EmailDomainStatus,
|
|
317
|
+
EmailEngagementQuality,
|
|
318
|
+
EmailHealth,
|
|
319
|
+
EmailHealthWindow,
|
|
320
|
+
EmailIp,
|
|
321
|
+
EmailProviderHealth,
|
|
322
|
+
EmailProviderStats,
|
|
323
|
+
EmailSender,
|
|
324
|
+
EmailSenderStatus,
|
|
325
|
+
EmailSuppression,
|
|
326
|
+
EmailSuppressionCounts,
|
|
327
|
+
EmailSuppressionKind,
|
|
281
328
|
ErasureRequestStatus,
|
|
282
329
|
FilterMatchOn,
|
|
330
|
+
FrequencyCapRuleConfig,
|
|
331
|
+
GetConnectionHealthQuery,
|
|
283
332
|
GlossaryTerm,
|
|
284
333
|
GlossaryTermService,
|
|
334
|
+
InmailParams,
|
|
285
335
|
InstallConnectionResponse,
|
|
286
336
|
InternalConversationsFilterConfig,
|
|
337
|
+
InvitationParams,
|
|
338
|
+
LimitRuleConfig,
|
|
287
339
|
ListAgentListenersQuery,
|
|
340
|
+
ListChannelActionsQuery,
|
|
341
|
+
ListChannelEventsQuery,
|
|
288
342
|
ListConnectionsQuery,
|
|
289
343
|
ListContactAddressesQuery,
|
|
290
344
|
ListContactGroupsQuery,
|
|
291
345
|
ListContactMergeProposalsQuery,
|
|
292
346
|
ListContactsQuery,
|
|
347
|
+
ListConversationBriefsQuery,
|
|
293
348
|
ListConversationFilterEventsQuery,
|
|
294
349
|
ListConversationFiltersQuery,
|
|
295
350
|
ListConversationsQuery,
|
|
@@ -301,12 +356,16 @@ export type {
|
|
|
301
356
|
// PageIterator-based ListResult used by the other modules.
|
|
302
357
|
ListResponse,
|
|
303
358
|
ListRoomsQuery,
|
|
359
|
+
ListSendingLimitPresetsQuery,
|
|
360
|
+
ListSendingRulesQuery,
|
|
304
361
|
ListToneProfileSetupsQuery,
|
|
305
362
|
ListToneProfilesQuery,
|
|
306
363
|
MeetingService,
|
|
307
364
|
MergeContactsRequest,
|
|
308
365
|
MergeProposalStatus,
|
|
309
366
|
Message,
|
|
367
|
+
MessageDelivery,
|
|
368
|
+
MessageDeliveryStatus,
|
|
310
369
|
MessageDirection,
|
|
311
370
|
MessagePreview,
|
|
312
371
|
MessageRecipient,
|
|
@@ -314,15 +373,16 @@ export type {
|
|
|
314
373
|
MessageStatus,
|
|
315
374
|
MintCallTokenRequest,
|
|
316
375
|
MistranscribedTerm,
|
|
317
|
-
PhoneNumber,
|
|
318
|
-
PhoneNumberRouting,
|
|
319
|
-
PhoneNumberStatus,
|
|
320
|
-
RoutingTarget,
|
|
321
376
|
MistranscribedTermService,
|
|
322
377
|
MistranscribedTermStatus,
|
|
323
378
|
MistranscriptionSuggestionSource,
|
|
379
|
+
PerformChannelActionRequest,
|
|
324
380
|
PermissionEventSource,
|
|
325
381
|
PermissionEventType,
|
|
382
|
+
PhoneNumber,
|
|
383
|
+
PhoneNumberRouting,
|
|
384
|
+
PhoneNumberStatus,
|
|
385
|
+
ProfileVisitParams,
|
|
326
386
|
Reaction,
|
|
327
387
|
ReactionCapability,
|
|
328
388
|
ReactionOption,
|
|
@@ -331,10 +391,21 @@ export type {
|
|
|
331
391
|
RecipientRole,
|
|
332
392
|
RecordPermissionEventRequest,
|
|
333
393
|
ResolveToneProfileQuery,
|
|
394
|
+
RespondChannelActionRequest,
|
|
334
395
|
RoleBasedFilterConfig,
|
|
335
396
|
Room,
|
|
397
|
+
RoutingTarget,
|
|
398
|
+
SendEligibility,
|
|
399
|
+
SendEligibilityRequest,
|
|
400
|
+
SendingLimitPreset,
|
|
401
|
+
SendingPeriod,
|
|
402
|
+
SendingRule,
|
|
403
|
+
SendingRuleConfig,
|
|
404
|
+
SendingRuleService,
|
|
405
|
+
SendingRuleType,
|
|
336
406
|
SendMessageRequest,
|
|
337
407
|
SendRecipient,
|
|
408
|
+
SetDefaultSenderRequest,
|
|
338
409
|
SyncConnectionRequest,
|
|
339
410
|
ToneProfile,
|
|
340
411
|
ToneProfileScope,
|
|
@@ -352,13 +423,19 @@ export type {
|
|
|
352
423
|
UpdateConnectionRequest,
|
|
353
424
|
UpdateContactGroupRequest,
|
|
354
425
|
UpdateContactRequest,
|
|
426
|
+
UpdateConversationBriefRequest,
|
|
355
427
|
UpdateConversationFilterRequest,
|
|
356
428
|
UpdateConversationTypeRequest,
|
|
357
429
|
UpdateDraftRequest,
|
|
358
430
|
UpdateGlossaryTermRequest,
|
|
359
431
|
UpdatePhoneNumberRequest,
|
|
432
|
+
UpdateSendingRuleRequest,
|
|
360
433
|
VoiceService,
|
|
361
434
|
VoiceTranscriptionStream,
|
|
435
|
+
WarmupRuleConfig,
|
|
436
|
+
Weekday,
|
|
437
|
+
WindowDay,
|
|
438
|
+
WindowRuleConfig,
|
|
362
439
|
} from './conversation/index.js'
|
|
363
440
|
// Conversation client (conversation-service)
|
|
364
441
|
export { ConversationClient } from './conversation/index.js'
|
|
@@ -503,11 +580,15 @@ export {
|
|
|
503
580
|
export type {
|
|
504
581
|
// App types
|
|
505
582
|
App,
|
|
583
|
+
// AppConfiguration types
|
|
584
|
+
AppConfiguration,
|
|
585
|
+
AppConfigurationService,
|
|
586
|
+
AppHome,
|
|
587
|
+
AppHomeType,
|
|
506
588
|
AppService,
|
|
507
589
|
// Array/enum attribute metas (config_schema renderers narrow on these)
|
|
508
590
|
ArrayAttributeMeta,
|
|
509
591
|
Attribute,
|
|
510
|
-
CurrentUserDefault,
|
|
511
592
|
// Attribute-level access restrictions (read/write allow-lists of role + team slugs)
|
|
512
593
|
AttributeAccessRule,
|
|
513
594
|
AttributeRestrictions,
|
|
@@ -517,6 +598,7 @@ export type {
|
|
|
517
598
|
// Component types
|
|
518
599
|
Component,
|
|
519
600
|
ComponentService,
|
|
601
|
+
CreateAppConfigurationRequest,
|
|
520
602
|
CreateAppRequest,
|
|
521
603
|
CreateComponentRequest,
|
|
522
604
|
CreateDesignReferenceRequest,
|
|
@@ -530,6 +612,7 @@ export type {
|
|
|
530
612
|
CurrencyAttributeMeta,
|
|
531
613
|
CurrencySymbolSide,
|
|
532
614
|
CurrencyValue,
|
|
615
|
+
CurrentUserDefault,
|
|
533
616
|
DeployModuleRequest,
|
|
534
617
|
// DesignReference types
|
|
535
618
|
DesignReference,
|
|
@@ -547,6 +630,7 @@ export type {
|
|
|
547
630
|
FilterGroup,
|
|
548
631
|
// List types
|
|
549
632
|
List,
|
|
633
|
+
ListAppConfigurationsOptions,
|
|
550
634
|
ListAppsOptions,
|
|
551
635
|
ListComponentsOptions,
|
|
552
636
|
ListDesignReferencesOptions,
|
|
@@ -587,6 +671,7 @@ export type {
|
|
|
587
671
|
RelationAttributeMeta,
|
|
588
672
|
SortConfig,
|
|
589
673
|
SortDirection,
|
|
674
|
+
UpdateAppConfigurationRequest,
|
|
590
675
|
UpdateAppRequest,
|
|
591
676
|
UpdateComponentRequest,
|
|
592
677
|
UpdateDesignReferenceRequest,
|
|
@@ -604,11 +689,15 @@ export type {
|
|
|
604
689
|
// Value-level constants from meta
|
|
605
690
|
// Meta Zod schemas
|
|
606
691
|
export {
|
|
692
|
+
AppConfigurationSchema,
|
|
693
|
+
AppHomeSchema,
|
|
607
694
|
AppSchema,
|
|
608
695
|
AttributeSchema,
|
|
696
|
+
acceptsCurrentUserDefault,
|
|
609
697
|
allCurrencyCodes,
|
|
610
698
|
ColumnSchema,
|
|
611
699
|
ComponentSchema,
|
|
700
|
+
CURRENT_USER_DEFAULT,
|
|
612
701
|
CurrencyAttributeMetaSchema,
|
|
613
702
|
currencyLabel,
|
|
614
703
|
currencySymbol,
|
|
@@ -620,10 +709,8 @@ export {
|
|
|
620
709
|
FilterGroupSchema,
|
|
621
710
|
formatAmount,
|
|
622
711
|
formatMoney,
|
|
623
|
-
isPlatformAttributeName,
|
|
624
|
-
CURRENT_USER_DEFAULT,
|
|
625
|
-
acceptsCurrentUserDefault,
|
|
626
712
|
isCurrentUserDefault,
|
|
713
|
+
isPlatformAttributeName,
|
|
627
714
|
ListSchema,
|
|
628
715
|
ListViewSchema,
|
|
629
716
|
localeNumberSeparators,
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import type { ProteosClient } from '../client.js'
|
|
2
|
+
import { PageIterator } from '../iterator.js'
|
|
3
|
+
import type { ListResult } from '../types/common.js'
|
|
4
|
+
import type {
|
|
5
|
+
AppConfiguration,
|
|
6
|
+
CreateAppConfigurationRequest,
|
|
7
|
+
ListAppConfigurationsOptions,
|
|
8
|
+
UpdateAppConfigurationRequest,
|
|
9
|
+
} from './types.js'
|
|
10
|
+
|
|
11
|
+
const APP_CONFIGURATIONS_BASE_PATH = '/meta/v1/app-configurations'
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Service for app configurations — the typed (app × profile) binding rows
|
|
15
|
+
* that say how an app presents itself: home, menu, agents, record pages.
|
|
16
|
+
* `profile_slug: ''` is the app's base configuration for everyone; a row with
|
|
17
|
+
* a profile is that profile's override (merged field-wise over the base).
|
|
18
|
+
*/
|
|
19
|
+
export interface AppConfigurationService {
|
|
20
|
+
/** Lists app configurations (auto-paginating iterator). */
|
|
21
|
+
list(
|
|
22
|
+
options?: ListAppConfigurationsOptions,
|
|
23
|
+
): PageIterator<AppConfiguration, ListAppConfigurationsOptions>
|
|
24
|
+
|
|
25
|
+
/** Fetches a single page of app configurations. */
|
|
26
|
+
listPage(options?: ListAppConfigurationsOptions): Promise<ListResult<AppConfiguration>>
|
|
27
|
+
|
|
28
|
+
/** Gets an app configuration by slug (404 when unknown). */
|
|
29
|
+
get(slug: string): Promise<AppConfiguration>
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Creates an app configuration. Every reference (app, home list/page, menu,
|
|
33
|
+
* record pages) must exist; `profile_slug` and agent keys are other
|
|
34
|
+
* services' and are not validated.
|
|
35
|
+
* @throws {ProteosError} 409 `app_configuration_already_exists` when the
|
|
36
|
+
* (app_slug, profile_slug) pair is already bound.
|
|
37
|
+
*/
|
|
38
|
+
create(request: CreateAppConfigurationRequest): Promise<AppConfiguration>
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Creates or replaces an app configuration idempotently by slug
|
|
42
|
+
* (`PUT /meta/v1/app-configurations/:slug`). Replaces the whole
|
|
43
|
+
* configuration; the (app_slug, profile_slug) binding of an existing slug
|
|
44
|
+
* is immutable.
|
|
45
|
+
*/
|
|
46
|
+
upsert(slug: string, request: CreateAppConfigurationRequest): Promise<AppConfiguration>
|
|
47
|
+
|
|
48
|
+
/** Partially updates an app configuration (`home: null` clears the home). */
|
|
49
|
+
update(slug: string, request: UpdateAppConfigurationRequest): Promise<AppConfiguration>
|
|
50
|
+
|
|
51
|
+
/** Deletes an app configuration. */
|
|
52
|
+
delete(slug: string): Promise<void>
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export class AppConfigurationServiceImpl implements AppConfigurationService {
|
|
56
|
+
constructor(private readonly client: ProteosClient) {}
|
|
57
|
+
|
|
58
|
+
list(
|
|
59
|
+
options: ListAppConfigurationsOptions = {},
|
|
60
|
+
): PageIterator<AppConfiguration, ListAppConfigurationsOptions> {
|
|
61
|
+
return new PageIterator((opts) => this.listPage(opts), options)
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
async listPage(
|
|
65
|
+
options: ListAppConfigurationsOptions = {},
|
|
66
|
+
): Promise<ListResult<AppConfiguration>> {
|
|
67
|
+
return this.client.requestWithQuery<ListResult<AppConfiguration>>(
|
|
68
|
+
'GET',
|
|
69
|
+
APP_CONFIGURATIONS_BASE_PATH,
|
|
70
|
+
options,
|
|
71
|
+
)
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
async get(slug: string): Promise<AppConfiguration> {
|
|
75
|
+
return this.client.request<AppConfiguration>('GET', `${APP_CONFIGURATIONS_BASE_PATH}/${slug}`)
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
async create(request: CreateAppConfigurationRequest): Promise<AppConfiguration> {
|
|
79
|
+
return this.client.request<AppConfiguration>('POST', APP_CONFIGURATIONS_BASE_PATH, request)
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
async upsert(slug: string, request: CreateAppConfigurationRequest): Promise<AppConfiguration> {
|
|
83
|
+
return this.client.request<AppConfiguration>('PUT', `${APP_CONFIGURATIONS_BASE_PATH}/${slug}`, {
|
|
84
|
+
...request,
|
|
85
|
+
slug,
|
|
86
|
+
})
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
async update(slug: string, request: UpdateAppConfigurationRequest): Promise<AppConfiguration> {
|
|
90
|
+
return this.client.request<AppConfiguration>(
|
|
91
|
+
'PATCH',
|
|
92
|
+
`${APP_CONFIGURATIONS_BASE_PATH}/${slug}`,
|
|
93
|
+
request,
|
|
94
|
+
)
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
async delete(slug: string): Promise<void> {
|
|
98
|
+
await this.client.request<void>('DELETE', `${APP_CONFIGURATIONS_BASE_PATH}/${slug}`)
|
|
99
|
+
}
|
|
100
|
+
}
|
package/src/meta/index.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ProteosClient } from '../client.js'
|
|
2
|
+
import { type AppConfigurationService, AppConfigurationServiceImpl } from './app-configurations.js'
|
|
2
3
|
import { type AppService, AppServiceImpl } from './apps.js'
|
|
3
4
|
import { type ComponentService, ComponentServiceImpl } from './components.js'
|
|
4
5
|
import { type DesignReferenceService, DesignReferenceServiceImpl } from './design-references.js'
|
|
@@ -79,6 +80,12 @@ export class MetaClient {
|
|
|
79
80
|
*/
|
|
80
81
|
readonly apps: AppService
|
|
81
82
|
|
|
83
|
+
/**
|
|
84
|
+
* Service for managing app configurations — the typed (app × profile)
|
|
85
|
+
* bindings: home, menu, agents, record pages.
|
|
86
|
+
*/
|
|
87
|
+
readonly appConfigurations: AppConfigurationService
|
|
88
|
+
|
|
82
89
|
/**
|
|
83
90
|
* Service for managing design references (stored DESIGN.md documents).
|
|
84
91
|
*/
|
|
@@ -99,10 +106,12 @@ export class MetaClient {
|
|
|
99
106
|
this.pages = new PageServiceImpl(client)
|
|
100
107
|
this.menuConfigurations = new MenuConfigurationServiceImpl(client)
|
|
101
108
|
this.apps = new AppServiceImpl(client)
|
|
109
|
+
this.appConfigurations = new AppConfigurationServiceImpl(client)
|
|
102
110
|
this.designReferences = new DesignReferenceServiceImpl(client)
|
|
103
111
|
}
|
|
104
112
|
}
|
|
105
113
|
|
|
114
|
+
export type { AppConfigurationService } from './app-configurations.js'
|
|
106
115
|
export type { AppService } from './apps.js'
|
|
107
116
|
export type { ComponentService } from './components.js'
|
|
108
117
|
export * from './currency/index.js'
|
|
@@ -120,16 +129,21 @@ export type { PageService } from './pages.js'
|
|
|
120
129
|
export type {
|
|
121
130
|
// App types
|
|
122
131
|
App,
|
|
132
|
+
// AppConfiguration types
|
|
133
|
+
AppConfiguration,
|
|
134
|
+
AppHome,
|
|
135
|
+
AppHomeType,
|
|
123
136
|
ArrayAttributeMeta,
|
|
124
137
|
Attribute,
|
|
125
|
-
AttributeMeta,
|
|
126
138
|
AttributeAccessRule,
|
|
139
|
+
AttributeMeta,
|
|
127
140
|
AttributeRestrictions,
|
|
128
141
|
AttributeType,
|
|
129
142
|
Column,
|
|
130
143
|
ComparisonOperator,
|
|
131
144
|
// Component types
|
|
132
145
|
Component,
|
|
146
|
+
CreateAppConfigurationRequest,
|
|
133
147
|
CreateAppRequest,
|
|
134
148
|
CreateComponentRequest,
|
|
135
149
|
CreateDesignReferenceRequest,
|
|
@@ -142,6 +156,7 @@ export type {
|
|
|
142
156
|
// Currency attribute meta + value
|
|
143
157
|
CurrencyAttributeMeta,
|
|
144
158
|
CurrencyValue,
|
|
159
|
+
CurrentUserDefault,
|
|
145
160
|
DatetimeAttributeMeta,
|
|
146
161
|
DatetimeFormat,
|
|
147
162
|
DeployModuleRequest,
|
|
@@ -159,6 +174,7 @@ export type {
|
|
|
159
174
|
FilterGroup,
|
|
160
175
|
// List types
|
|
161
176
|
List,
|
|
177
|
+
ListAppConfigurationsOptions,
|
|
162
178
|
ListAppsOptions,
|
|
163
179
|
ListComponentsOptions,
|
|
164
180
|
ListDesignReferencesOptions,
|
|
@@ -188,6 +204,10 @@ export type {
|
|
|
188
204
|
PageAction,
|
|
189
205
|
PageActionKind,
|
|
190
206
|
PageType,
|
|
207
|
+
// User attribute meta
|
|
208
|
+
PrincipalAttributeMeta,
|
|
209
|
+
PrincipalRef,
|
|
210
|
+
PrincipalType,
|
|
191
211
|
PublicAccessOperation,
|
|
192
212
|
PublicPageComponent,
|
|
193
213
|
PublicPageResponse,
|
|
@@ -197,6 +217,7 @@ export type {
|
|
|
197
217
|
SortDirection,
|
|
198
218
|
StringAttributeMeta,
|
|
199
219
|
StringFormat,
|
|
220
|
+
UpdateAppConfigurationRequest,
|
|
200
221
|
UpdateAppRequest,
|
|
201
222
|
UpdateComponentRequest,
|
|
202
223
|
UpdateDesignReferenceRequest,
|
|
@@ -206,11 +227,6 @@ export type {
|
|
|
206
227
|
UpdateMenuConfigurationRequest,
|
|
207
228
|
UpdatePageRequest,
|
|
208
229
|
UpdateVariableRequest,
|
|
209
|
-
// User attribute meta
|
|
210
|
-
PrincipalAttributeMeta,
|
|
211
|
-
CurrentUserDefault,
|
|
212
|
-
PrincipalRef,
|
|
213
|
-
PrincipalType,
|
|
214
230
|
UserAttributeMeta,
|
|
215
231
|
// Variable types
|
|
216
232
|
Variable,
|
|
@@ -218,10 +234,14 @@ export type {
|
|
|
218
234
|
// Re-export value-level constants
|
|
219
235
|
// Re-export Zod schemas
|
|
220
236
|
export {
|
|
237
|
+
AppConfigurationSchema,
|
|
238
|
+
AppHomeSchema,
|
|
221
239
|
AppSchema,
|
|
222
240
|
AttributeSchema,
|
|
241
|
+
acceptsCurrentUserDefault,
|
|
223
242
|
ColumnSchema,
|
|
224
243
|
ComponentSchema,
|
|
244
|
+
CURRENT_USER_DEFAULT,
|
|
225
245
|
CurrencyAttributeMetaSchema,
|
|
226
246
|
DesignReferenceSchema,
|
|
227
247
|
EntitySchema,
|
|
@@ -229,6 +249,7 @@ export {
|
|
|
229
249
|
FileAttributeMetaSchema,
|
|
230
250
|
FilterElementSchema,
|
|
231
251
|
FilterGroupSchema,
|
|
252
|
+
isCurrentUserDefault,
|
|
232
253
|
isPlatformAttributeName,
|
|
233
254
|
ListSchema,
|
|
234
255
|
ListViewSchema,
|
|
@@ -240,12 +261,9 @@ export {
|
|
|
240
261
|
PageActionSchema,
|
|
241
262
|
PageSchema,
|
|
242
263
|
PLATFORM_ATTRIBUTE_NAMES,
|
|
243
|
-
CURRENT_USER_DEFAULT,
|
|
244
|
-
acceptsCurrentUserDefault,
|
|
245
|
-
isCurrentUserDefault,
|
|
246
264
|
parseCurrencyMeta,
|
|
247
|
-
parsePrincipalMeta,
|
|
248
265
|
parseFileMeta,
|
|
266
|
+
parsePrincipalMeta,
|
|
249
267
|
parseRelationMeta,
|
|
250
268
|
parseUserMeta,
|
|
251
269
|
platformAttributes,
|