@proteos/sdk 0.18.1
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/LICENSE +40 -0
- package/dist/chunk-7RGN4E22.cjs +1185 -0
- package/dist/chunk-7RGN4E22.cjs.map +1 -0
- package/dist/chunk-XJP5WCRZ.js +1125 -0
- package/dist/chunk-XJP5WCRZ.js.map +1 -0
- package/dist/index.cjs +2384 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +5225 -0
- package/dist/index.d.ts +5225 -0
- package/dist/index.js +2146 -0
- package/dist/index.js.map +1 -0
- package/dist/meta/index.cjs +204 -0
- package/dist/meta/index.cjs.map +1 -0
- package/dist/meta/index.d.cts +2 -0
- package/dist/meta/index.d.ts +2 -0
- package/dist/meta/index.js +3 -0
- package/dist/meta/index.js.map +1 -0
- package/dist/types-BNsjfU8N.d.cts +3299 -0
- package/dist/types-BNsjfU8N.d.ts +3299 -0
- package/package.json +86 -0
- package/src/agent/agents.ts +53 -0
- package/src/agent/index.ts +134 -0
- package/src/agent/mcp-servers.ts +102 -0
- package/src/agent/prompts.ts +80 -0
- package/src/agent/session-types.ts +397 -0
- package/src/agent/sessions.ts +197 -0
- package/src/agent/skills.ts +89 -0
- package/src/agent/tools.ts +53 -0
- package/src/agent/types.ts +362 -0
- package/src/auth/index.ts +111 -0
- package/src/auth/me.ts +46 -0
- package/src/auth/organizations.ts +128 -0
- package/src/auth/platform-entities.ts +78 -0
- package/src/auth/roles.ts +213 -0
- package/src/auth/types.ts +294 -0
- package/src/auth/users.ts +226 -0
- package/src/client.ts +441 -0
- package/src/connector/index.ts +120 -0
- package/src/connector/types.ts +150 -0
- package/src/conversation/index.ts +297 -0
- package/src/conversation/types.ts +590 -0
- package/src/conversation/voice.ts +123 -0
- package/src/data/index.ts +53 -0
- package/src/data/queries.ts +66 -0
- package/src/data/records.ts +122 -0
- package/src/data/types.ts +89 -0
- package/src/errors.ts +148 -0
- package/src/events/index.ts +172 -0
- package/src/events/types.ts +77 -0
- package/src/functions/actions.ts +95 -0
- package/src/functions/index.ts +32 -0
- package/src/functions/types.ts +71 -0
- package/src/http/index.ts +2 -0
- package/src/http/query-params.ts +106 -0
- package/src/index.ts +598 -0
- package/src/iterator.ts +183 -0
- package/src/knowledge/graph.ts +35 -0
- package/src/knowledge/index.ts +104 -0
- package/src/knowledge/labels.ts +70 -0
- package/src/knowledge/links.ts +65 -0
- package/src/knowledge/nodes.ts +198 -0
- package/src/knowledge/record-links.ts +66 -0
- package/src/knowledge/types.ts +569 -0
- package/src/meta/apps.ts +107 -0
- package/src/meta/components.ts +124 -0
- package/src/meta/currency/index.ts +202 -0
- package/src/meta/entities.ts +193 -0
- package/src/meta/filters.ts +76 -0
- package/src/meta/index.ts +227 -0
- package/src/meta/layout/common-props.ts +93 -0
- package/src/meta/layout/control-registry.json +70 -0
- package/src/meta/layout/control-registry.ts +92 -0
- package/src/meta/layout/elements.ts +203 -0
- package/src/meta/layout/index.ts +41 -0
- package/src/meta/layout/page-layout.ts +35 -0
- package/src/meta/layout/size-value.ts +27 -0
- package/src/meta/list-views.ts +109 -0
- package/src/meta/lists.ts +104 -0
- package/src/meta/menu-configurations.ts +128 -0
- package/src/meta/modules.ts +159 -0
- package/src/meta/pages.ts +106 -0
- package/src/meta/types.ts +1115 -0
- package/src/meta/variables.ts +98 -0
- package/src/storage/files.ts +183 -0
- package/src/storage/index.ts +33 -0
- package/src/storage/types.ts +70 -0
- package/src/types/common.ts +143 -0
- package/src/types/index.ts +28 -0
- package/src/types/options.ts +95 -0
- package/src/workflow/executions.ts +99 -0
- package/src/workflow/index.ts +109 -0
- package/src/workflow/node-types.ts +50 -0
- package/src/workflow/types.ts +658 -0
- package/src/workflow/workflows.ts +152 -0
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import type { ProteosClient } from '../client.js'
|
|
2
|
+
import { PageIterator } from '../iterator.js'
|
|
3
|
+
import type { ListResult } from '../types/common.js'
|
|
4
|
+
import type { CreatePageRequest, ListPagesOptions, Page, UpdatePageRequest } from './types.js'
|
|
5
|
+
|
|
6
|
+
const PAGES_BASE_PATH = '/meta/v1/pages'
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Service for managing page configurations.
|
|
10
|
+
* Pages define the layout and content of entity detail views.
|
|
11
|
+
*/
|
|
12
|
+
export interface PageService {
|
|
13
|
+
/**
|
|
14
|
+
* Lists pages with optional filtering.
|
|
15
|
+
*
|
|
16
|
+
* @param options - Filter and pagination options
|
|
17
|
+
* @returns Async iterator over pages
|
|
18
|
+
*/
|
|
19
|
+
list(options?: ListPagesOptions): PageIterator<Page, ListPagesOptions>
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Fetches a single page of page configurations.
|
|
23
|
+
*/
|
|
24
|
+
listPage(options?: ListPagesOptions): Promise<ListResult<Page>>
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Gets a single page by slug.
|
|
28
|
+
*
|
|
29
|
+
* @param slug - Page slug (author-controlled, kebab-case, unique per org)
|
|
30
|
+
* @returns The page
|
|
31
|
+
* @throws {ProteosError} If page not found (404)
|
|
32
|
+
*/
|
|
33
|
+
get(slug: string): Promise<Page>
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Creates a new page.
|
|
37
|
+
*
|
|
38
|
+
* @param request - Page creation request
|
|
39
|
+
* @returns The created page
|
|
40
|
+
* @throws {ProteosError} If validation fails (400) or conflict (409)
|
|
41
|
+
*/
|
|
42
|
+
create(request: CreatePageRequest): Promise<Page>
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Creates or updates a page idempotently by slug. The URL slug wins on
|
|
46
|
+
* mismatch with the body's slug field.
|
|
47
|
+
*
|
|
48
|
+
* @param slug - Page slug
|
|
49
|
+
* @param request - Page body
|
|
50
|
+
* @returns The created or updated page
|
|
51
|
+
*/
|
|
52
|
+
upsert(slug: string, request: CreatePageRequest): Promise<Page>
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Updates an existing page.
|
|
56
|
+
*
|
|
57
|
+
* @param slug - Page slug
|
|
58
|
+
* @param request - Fields to update
|
|
59
|
+
* @returns The updated page
|
|
60
|
+
* @throws {ProteosError} If page not found (404) or validation fails (400)
|
|
61
|
+
*/
|
|
62
|
+
update(slug: string, request: UpdatePageRequest): Promise<Page>
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Deletes a page.
|
|
66
|
+
*
|
|
67
|
+
* @param slug - Page slug
|
|
68
|
+
* @throws {ProteosError} If page not found (404)
|
|
69
|
+
*/
|
|
70
|
+
delete(slug: string): Promise<void>
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Implementation of PageService.
|
|
75
|
+
*/
|
|
76
|
+
export class PageServiceImpl implements PageService {
|
|
77
|
+
constructor(private readonly client: ProteosClient) {}
|
|
78
|
+
|
|
79
|
+
list(options: ListPagesOptions = {}): PageIterator<Page, ListPagesOptions> {
|
|
80
|
+
return new PageIterator((opts) => this.listPage(opts), options)
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
async listPage(options: ListPagesOptions = {}): Promise<ListResult<Page>> {
|
|
84
|
+
return this.client.requestWithQuery<ListResult<Page>>('GET', PAGES_BASE_PATH, options)
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
async get(slug: string): Promise<Page> {
|
|
88
|
+
return this.client.request<Page>('GET', `${PAGES_BASE_PATH}/${slug}`)
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
async create(request: CreatePageRequest): Promise<Page> {
|
|
92
|
+
return this.client.request<Page>('POST', PAGES_BASE_PATH, request)
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
async upsert(slug: string, request: CreatePageRequest): Promise<Page> {
|
|
96
|
+
return this.client.request<Page>('PUT', `${PAGES_BASE_PATH}/${slug}`, { ...request, slug })
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
async update(slug: string, request: UpdatePageRequest): Promise<Page> {
|
|
100
|
+
return this.client.request<Page>('PATCH', `${PAGES_BASE_PATH}/${slug}`, request)
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
async delete(slug: string): Promise<void> {
|
|
104
|
+
await this.client.request<void>('DELETE', `${PAGES_BASE_PATH}/${slug}`)
|
|
105
|
+
}
|
|
106
|
+
}
|