@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.
Files changed (94) hide show
  1. package/LICENSE +40 -0
  2. package/dist/chunk-7RGN4E22.cjs +1185 -0
  3. package/dist/chunk-7RGN4E22.cjs.map +1 -0
  4. package/dist/chunk-XJP5WCRZ.js +1125 -0
  5. package/dist/chunk-XJP5WCRZ.js.map +1 -0
  6. package/dist/index.cjs +2384 -0
  7. package/dist/index.cjs.map +1 -0
  8. package/dist/index.d.cts +5225 -0
  9. package/dist/index.d.ts +5225 -0
  10. package/dist/index.js +2146 -0
  11. package/dist/index.js.map +1 -0
  12. package/dist/meta/index.cjs +204 -0
  13. package/dist/meta/index.cjs.map +1 -0
  14. package/dist/meta/index.d.cts +2 -0
  15. package/dist/meta/index.d.ts +2 -0
  16. package/dist/meta/index.js +3 -0
  17. package/dist/meta/index.js.map +1 -0
  18. package/dist/types-BNsjfU8N.d.cts +3299 -0
  19. package/dist/types-BNsjfU8N.d.ts +3299 -0
  20. package/package.json +86 -0
  21. package/src/agent/agents.ts +53 -0
  22. package/src/agent/index.ts +134 -0
  23. package/src/agent/mcp-servers.ts +102 -0
  24. package/src/agent/prompts.ts +80 -0
  25. package/src/agent/session-types.ts +397 -0
  26. package/src/agent/sessions.ts +197 -0
  27. package/src/agent/skills.ts +89 -0
  28. package/src/agent/tools.ts +53 -0
  29. package/src/agent/types.ts +362 -0
  30. package/src/auth/index.ts +111 -0
  31. package/src/auth/me.ts +46 -0
  32. package/src/auth/organizations.ts +128 -0
  33. package/src/auth/platform-entities.ts +78 -0
  34. package/src/auth/roles.ts +213 -0
  35. package/src/auth/types.ts +294 -0
  36. package/src/auth/users.ts +226 -0
  37. package/src/client.ts +441 -0
  38. package/src/connector/index.ts +120 -0
  39. package/src/connector/types.ts +150 -0
  40. package/src/conversation/index.ts +297 -0
  41. package/src/conversation/types.ts +590 -0
  42. package/src/conversation/voice.ts +123 -0
  43. package/src/data/index.ts +53 -0
  44. package/src/data/queries.ts +66 -0
  45. package/src/data/records.ts +122 -0
  46. package/src/data/types.ts +89 -0
  47. package/src/errors.ts +148 -0
  48. package/src/events/index.ts +172 -0
  49. package/src/events/types.ts +77 -0
  50. package/src/functions/actions.ts +95 -0
  51. package/src/functions/index.ts +32 -0
  52. package/src/functions/types.ts +71 -0
  53. package/src/http/index.ts +2 -0
  54. package/src/http/query-params.ts +106 -0
  55. package/src/index.ts +598 -0
  56. package/src/iterator.ts +183 -0
  57. package/src/knowledge/graph.ts +35 -0
  58. package/src/knowledge/index.ts +104 -0
  59. package/src/knowledge/labels.ts +70 -0
  60. package/src/knowledge/links.ts +65 -0
  61. package/src/knowledge/nodes.ts +198 -0
  62. package/src/knowledge/record-links.ts +66 -0
  63. package/src/knowledge/types.ts +569 -0
  64. package/src/meta/apps.ts +107 -0
  65. package/src/meta/components.ts +124 -0
  66. package/src/meta/currency/index.ts +202 -0
  67. package/src/meta/entities.ts +193 -0
  68. package/src/meta/filters.ts +76 -0
  69. package/src/meta/index.ts +227 -0
  70. package/src/meta/layout/common-props.ts +93 -0
  71. package/src/meta/layout/control-registry.json +70 -0
  72. package/src/meta/layout/control-registry.ts +92 -0
  73. package/src/meta/layout/elements.ts +203 -0
  74. package/src/meta/layout/index.ts +41 -0
  75. package/src/meta/layout/page-layout.ts +35 -0
  76. package/src/meta/layout/size-value.ts +27 -0
  77. package/src/meta/list-views.ts +109 -0
  78. package/src/meta/lists.ts +104 -0
  79. package/src/meta/menu-configurations.ts +128 -0
  80. package/src/meta/modules.ts +159 -0
  81. package/src/meta/pages.ts +106 -0
  82. package/src/meta/types.ts +1115 -0
  83. package/src/meta/variables.ts +98 -0
  84. package/src/storage/files.ts +183 -0
  85. package/src/storage/index.ts +33 -0
  86. package/src/storage/types.ts +70 -0
  87. package/src/types/common.ts +143 -0
  88. package/src/types/index.ts +28 -0
  89. package/src/types/options.ts +95 -0
  90. package/src/workflow/executions.ts +99 -0
  91. package/src/workflow/index.ts +109 -0
  92. package/src/workflow/node-types.ts +50 -0
  93. package/src/workflow/types.ts +658 -0
  94. 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
+ }