@undefineds.co/models 0.2.0 → 0.2.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/README.md +515 -125
- package/dist/agent.repository.d.ts +20 -40
- package/dist/agent.schema.d.ts +20 -1
- package/dist/agent.schema.js +25 -1
- package/dist/ai-config/index.d.ts +8 -6
- package/dist/ai-config/index.js +41 -23
- package/dist/ai-model.schema.d.ts +13 -1
- package/dist/ai-model.schema.js +17 -1
- package/dist/ai-provider.schema.d.ts +9 -1
- package/dist/ai-provider.schema.js +13 -1
- package/dist/approval.schema.d.ts +21 -1
- package/dist/approval.schema.js +33 -1
- package/dist/audit.schema.d.ts +17 -1
- package/dist/audit.schema.js +29 -1
- package/dist/chat.repository.d.ts +19 -15
- package/dist/chat.schema.d.ts +37 -1
- package/dist/chat.schema.js +47 -1
- package/dist/client/index.d.ts +121 -0
- package/dist/client/index.js +299 -0
- package/dist/contact.repository.d.ts +21 -21
- package/dist/contact.schema.d.ts +48 -1
- package/dist/contact.schema.js +60 -1
- package/dist/credential.schema.d.ts +15 -1
- package/dist/credential.schema.js +19 -1
- package/dist/discovery/index.d.ts +2 -2
- package/dist/discovery/index.js +2 -2
- package/dist/extension/extension.schema.d.ts +4 -1
- package/dist/extension/extension.schema.js +11 -1
- package/dist/extension/index.d.ts +1 -1
- package/dist/favorite/favorite.schema.d.ts +24 -1
- package/dist/favorite/favorite.schema.js +34 -1
- package/dist/favorite/index.d.ts +2 -2
- package/dist/file/file.schema.d.ts +39 -1
- package/dist/file/file.schema.js +51 -1
- package/dist/file/index.d.ts +1 -1
- package/dist/fixtures/contracts-chat-contact.d.ts +8 -8
- package/dist/fixtures/contracts-chat-contact.js +5 -9
- package/dist/grant.schema.d.ts +16 -1
- package/dist/grant.schema.js +29 -1
- package/dist/import/index.d.ts +1 -1
- package/dist/inbox-notification.schema.d.ts +9 -1
- package/dist/inbox-notification.schema.js +16 -1
- package/dist/index.d.ts +42 -43
- package/dist/index.js +27 -26
- package/dist/knowledge/index.d.ts +1 -1
- package/dist/knowledge/knowledge-folder.schema.d.ts +7 -1
- package/dist/knowledge/knowledge-folder.schema.js +6 -1
- package/dist/message.repository.d.ts +20 -20
- package/dist/message.schema.d.ts +32 -1
- package/dist/message.schema.js +47 -1
- package/dist/namespaces.d.ts +178 -1
- package/dist/namespaces.js +253 -1
- package/dist/profile.d.ts +22 -1
- package/dist/profile.js +88 -1
- package/dist/profile.repository.d.ts +105 -0
- package/dist/profile.repository.js +47 -0
- package/dist/profile.schema.d.ts +16 -0
- package/dist/{core/profile.js → profile.schema.js} +4 -4
- package/dist/repository.d.ts +49 -9
- package/dist/repository.js +49 -46
- package/dist/schema.d.ts +244 -1
- package/dist/schema.js +37 -1
- package/dist/session/index.d.ts +1 -1
- package/dist/session/index.js +1 -1
- package/dist/session/session.schema.d.ts +43 -1
- package/dist/session/session.schema.js +46 -1
- package/dist/session.repository.d.ts +61 -0
- package/dist/session.repository.js +8 -0
- package/dist/settings/index.d.ts +1 -1
- package/dist/settings/settings.schema.d.ts +49 -1
- package/dist/settings/settings.schema.js +63 -1
- package/dist/{governance/runtime-projections.d.ts → sidecar/persistence-mapping.d.ts} +7 -7
- package/dist/{governance/runtime-projections.js → sidecar/persistence-mapping.js} +7 -1
- package/dist/{protocols/runtime-events.d.ts → sidecar/sidecar-events.d.ts} +35 -35
- package/dist/{protocols/runtime-events.js → sidecar/sidecar-events.js} +21 -4
- package/dist/thread.repository.d.ts +15 -19
- package/dist/thread.schema.d.ts +30 -1
- package/dist/thread.schema.js +39 -1
- package/dist/{core/types/collaboration-rich-content.d.ts → types/collaboration-blocks.d.ts} +7 -7
- package/dist/types/collaboration-blocks.js +7 -0
- package/dist/types/message-block.d.ts +270 -0
- package/dist/types/message-block.js +125 -0
- package/dist/vocab/_namespaces.d.ts +1 -1
- package/dist/vocab/index.d.ts +5 -6
- package/dist/vocab/index.js +0 -1
- package/dist/vocab/message.vocab.js +1 -1
- package/dist/vocab/thread.vocab.d.ts +1 -2
- package/dist/vocab/thread.vocab.js +2 -3
- package/dist/watch/index.d.ts +226 -0
- package/dist/watch/index.js +1156 -0
- package/package.json +41 -39
- package/dist/_drizzle-solid/columns.d.ts +0 -37
- package/dist/_drizzle-solid/columns.js +0 -1
- package/dist/_drizzle-solid/pod-table.d.ts +0 -3
- package/dist/_drizzle-solid/pod-table.js +0 -1
- package/dist/_drizzle-solid/types.d.ts +0 -40
- package/dist/_drizzle-solid/types.js +0 -1
- package/dist/ai-config.d.ts +0 -1
- package/dist/ai-config.js +0 -1
- package/dist/chat.utils.d.ts +0 -3
- package/dist/chat.utils.js +0 -30
- package/dist/core/agent-provider.schema.d.ts +0 -1
- package/dist/core/agent-provider.schema.js +0 -1
- package/dist/core/agent-status.schema.d.ts +0 -12
- package/dist/core/agent-status.schema.js +0 -18
- package/dist/core/agent.schema.d.ts +0 -72
- package/dist/core/agent.schema.js +0 -38
- package/dist/core/ai-config.schema.d.ts +0 -11
- package/dist/core/ai-config.schema.js +0 -18
- package/dist/core/ai-model.schema.d.ts +0 -15
- package/dist/core/ai-model.schema.js +0 -21
- package/dist/core/ai-provider.schema.d.ts +0 -16
- package/dist/core/ai-provider.schema.js +0 -28
- package/dist/core/approval.schema.d.ts +0 -21
- package/dist/core/approval.schema.js +0 -33
- package/dist/core/audit.schema.d.ts +0 -17
- package/dist/core/audit.schema.js +0 -29
- package/dist/core/chat.schema.d.ts +0 -36
- package/dist/core/chat.schema.js +0 -45
- package/dist/core/contact.schema.d.ts +0 -47
- package/dist/core/contact.schema.js +0 -59
- package/dist/core/credential.schema.d.ts +0 -56
- package/dist/core/credential.schema.js +0 -40
- package/dist/core/extension/extension.schema.d.ts +0 -4
- package/dist/core/extension/extension.schema.js +0 -11
- package/dist/core/extension/index.d.ts +0 -1
- package/dist/core/extension/index.js +0 -1
- package/dist/core/extension.d.ts +0 -1
- package/dist/core/extension.js +0 -1
- package/dist/core/favorite/favorite.schema.d.ts +0 -24
- package/dist/core/favorite/favorite.schema.js +0 -34
- package/dist/core/favorite/index.d.ts +0 -1
- package/dist/core/favorite/index.js +0 -1
- package/dist/core/file/file.schema.d.ts +0 -39
- package/dist/core/file/file.schema.js +0 -51
- package/dist/core/file/index.d.ts +0 -1
- package/dist/core/file/index.js +0 -1
- package/dist/core/file.d.ts +0 -1
- package/dist/core/file.js +0 -1
- package/dist/core/grant.schema.d.ts +0 -16
- package/dist/core/grant.schema.js +0 -29
- package/dist/core/import/import-job.schema.d.ts +0 -5
- package/dist/core/import/import-job.schema.js +0 -5
- package/dist/core/import/index.d.ts +0 -1
- package/dist/core/import/index.js +0 -1
- package/dist/core/import.d.ts +0 -1
- package/dist/core/import.js +0 -1
- package/dist/core/inbox-notification.schema.d.ts +0 -9
- package/dist/core/inbox-notification.schema.js +0 -16
- package/dist/core/index.d.ts +0 -31
- package/dist/core/index.js +0 -32
- package/dist/core/knowledge/index.d.ts +0 -1
- package/dist/core/knowledge/index.js +0 -1
- package/dist/core/knowledge/knowledge-folder.schema.d.ts +0 -7
- package/dist/core/knowledge/knowledge-folder.schema.js +0 -6
- package/dist/core/knowledge.d.ts +0 -1
- package/dist/core/knowledge.js +0 -1
- package/dist/core/message.schema.d.ts +0 -33
- package/dist/core/message.schema.js +0 -49
- package/dist/core/namespaces.d.ts +0 -176
- package/dist/core/namespaces.js +0 -289
- package/dist/core/profile.d.ts +0 -16
- package/dist/core/schema.d.ts +0 -304
- package/dist/core/schema.js +0 -46
- package/dist/core/session/index.d.ts +0 -1
- package/dist/core/session/index.js +0 -1
- package/dist/core/session/session.schema.d.ts +0 -6
- package/dist/core/session/session.schema.js +0 -6
- package/dist/core/session.d.ts +0 -1
- package/dist/core/session.js +0 -1
- package/dist/core/settings/index.d.ts +0 -1
- package/dist/core/settings/index.js +0 -1
- package/dist/core/settings/settings.schema.d.ts +0 -49
- package/dist/core/settings/settings.schema.js +0 -63
- package/dist/core/settings.d.ts +0 -1
- package/dist/core/settings.js +0 -1
- package/dist/core/thread.schema.d.ts +0 -28
- package/dist/core/thread.schema.js +0 -36
- package/dist/core/types/collaboration-rich-content.js +0 -7
- package/dist/core/types/message-rich-content.d.ts +0 -121
- package/dist/core/types/message-rich-content.js +0 -85
- package/dist/core/vector-store.schema.d.ts +0 -25
- package/dist/core/vector-store.schema.js +0 -35
- package/dist/core/vocab/_namespaces.d.ts +0 -1
- package/dist/core/vocab/_namespaces.js +0 -3
- package/dist/core/vocab/chat.vocab.d.ts +0 -16
- package/dist/core/vocab/chat.vocab.js +0 -22
- package/dist/core/vocab/contact.vocab.d.ts +0 -21
- package/dist/core/vocab/contact.vocab.js +0 -22
- package/dist/core/vocab/index.d.ts +0 -6
- package/dist/core/vocab/index.js +0 -6
- package/dist/core/vocab/message.vocab.d.ts +0 -20
- package/dist/core/vocab/message.vocab.js +0 -24
- package/dist/core/vocab/thread.vocab.d.ts +0 -11
- package/dist/core/vocab/thread.vocab.js +0 -14
- package/dist/core/vocab/workspace.vocab.d.ts +0 -12
- package/dist/core/vocab/workspace.vocab.js +0 -13
- package/dist/core/vocab.d.ts +0 -1
- package/dist/core/vocab.js +0 -1
- package/dist/core/workspace.schema.d.ts +0 -35
- package/dist/core/workspace.schema.js +0 -106
- package/dist/core.d.ts +0 -1
- package/dist/core.js +0 -1
- package/dist/discovery/vercel.d.ts +0 -25
- package/dist/discovery/vercel.js +0 -95
- package/dist/discovery.d.ts +0 -1
- package/dist/discovery.js +0 -1
- package/dist/extension.d.ts +0 -1
- package/dist/extension.js +0 -1
- package/dist/favorite.d.ts +0 -1
- package/dist/favorite.js +0 -1
- package/dist/file.d.ts +0 -1
- package/dist/file.js +0 -1
- package/dist/governance/index.d.ts +0 -1
- package/dist/governance/index.js +0 -1
- package/dist/import.d.ts +0 -1
- package/dist/import.js +0 -1
- package/dist/knowledge.d.ts +0 -1
- package/dist/knowledge.js +0 -1
- package/dist/protocols/index.d.ts +0 -1
- package/dist/protocols/index.js +0 -1
- package/dist/session.d.ts +0 -1
- package/dist/session.js +0 -1
- package/dist/settings.d.ts +0 -1
- package/dist/settings.js +0 -1
- package/dist/types/collaboration-rich-content.d.ts +0 -52
- package/dist/types/collaboration-rich-content.js +0 -7
- package/dist/types/message-rich-content.d.ts +0 -121
- package/dist/types/message-rich-content.js +0 -85
- package/dist/vocab/governance.vocab.d.ts +0 -46
- package/dist/vocab/governance.vocab.js +0 -47
- package/dist/vocab/workspace.vocab.d.ts +0 -12
- package/dist/vocab/workspace.vocab.js +0 -13
- package/dist/vocab.d.ts +0 -1
- package/dist/vocab.js +0 -1
- package/dist/workspace.repository.d.ts +0 -45
- package/dist/workspace.repository.js +0 -8
- package/dist/workspace.schema.d.ts +0 -1
- package/dist/workspace.schema.js +0 -1
- /package/dist/{core/vocab/governance.vocab.d.ts → vocab/sidecar.vocab.d.ts} +0 -0
- /package/dist/{core/vocab/governance.vocab.js → vocab/sidecar.vocab.js} +0 -0
package/dist/namespaces.js
CHANGED
|
@@ -1 +1,253 @@
|
|
|
1
|
-
|
|
1
|
+
import { FOAF, VCARD, LDP, DCTERMS, RDF as RDF_VOCAB, ACL as ACL_VOCAB } from '@inrupt/vocab-common-rdf';
|
|
2
|
+
const ABSOLUTE_IRI = /^[a-zA-Z][a-zA-Z\d+.-]*:/;
|
|
3
|
+
const createNamespace = (prefix, baseUri, terms) => {
|
|
4
|
+
const builder = ((term) => ABSOLUTE_IRI.test(term) ? term : `${baseUri}${term}`);
|
|
5
|
+
builder.prefix = prefix;
|
|
6
|
+
builder.uri = baseUri;
|
|
7
|
+
builder.NAMESPACE = baseUri;
|
|
8
|
+
builder.term = (name) => builder(name);
|
|
9
|
+
Object.entries(terms).forEach(([key, local]) => {
|
|
10
|
+
Object.defineProperty(builder, key, {
|
|
11
|
+
value: builder(local),
|
|
12
|
+
enumerable: true,
|
|
13
|
+
});
|
|
14
|
+
});
|
|
15
|
+
return builder;
|
|
16
|
+
};
|
|
17
|
+
export { FOAF, VCARD, LDP };
|
|
18
|
+
export const DCTerms = DCTERMS;
|
|
19
|
+
export const RDF = RDF_VOCAB;
|
|
20
|
+
export const ACL = ACL_VOCAB;
|
|
21
|
+
// ODRL isn't provided as a NamespaceConfig-compatible builder in vocab-common-rdf.
|
|
22
|
+
// We define a small namespace builder to keep drizzle-solid happy.
|
|
23
|
+
export const ODRL = createNamespace('odrl', 'http://www.w3.org/ns/odrl/2/', {
|
|
24
|
+
Policy: 'Policy',
|
|
25
|
+
target: 'target',
|
|
26
|
+
action: 'action',
|
|
27
|
+
});
|
|
28
|
+
export const RDFS = createNamespace('rdfs', 'http://www.w3.org/2000/01/rdf-schema#', {
|
|
29
|
+
Class: 'Class',
|
|
30
|
+
label: 'label',
|
|
31
|
+
comment: 'comment',
|
|
32
|
+
subClassOf: 'subClassOf',
|
|
33
|
+
domain: 'domain',
|
|
34
|
+
range: 'range',
|
|
35
|
+
});
|
|
36
|
+
export const OWL = createNamespace('owl', 'http://www.w3.org/2002/07/owl#', {
|
|
37
|
+
Ontology: 'Ontology',
|
|
38
|
+
Class: 'Class',
|
|
39
|
+
ObjectProperty: 'ObjectProperty',
|
|
40
|
+
DatatypeProperty: 'DatatypeProperty',
|
|
41
|
+
});
|
|
42
|
+
export const SCHEMA = createNamespace('schema', 'http://schema.org/', {
|
|
43
|
+
CreativeWork: 'CreativeWork',
|
|
44
|
+
MediaObject: 'MediaObject',
|
|
45
|
+
PropertyValue: 'PropertyValue',
|
|
46
|
+
author: 'author',
|
|
47
|
+
dateCreated: 'dateCreated',
|
|
48
|
+
dateDeleted: 'dateDeleted',
|
|
49
|
+
description: 'description',
|
|
50
|
+
encodingFormat: 'encodingFormat',
|
|
51
|
+
fileSize: 'fileSize',
|
|
52
|
+
image: 'image',
|
|
53
|
+
name: 'name',
|
|
54
|
+
participant: 'participant',
|
|
55
|
+
text: 'text',
|
|
56
|
+
url: 'url',
|
|
57
|
+
});
|
|
58
|
+
export const SIOC = createNamespace('sioc', 'http://rdfs.org/sioc/ns#', {
|
|
59
|
+
Post: 'Post',
|
|
60
|
+
Thread: 'Thread',
|
|
61
|
+
Forum: 'Forum',
|
|
62
|
+
content: 'content',
|
|
63
|
+
richContent: 'richContent',
|
|
64
|
+
hasReply: 'has_reply',
|
|
65
|
+
replyOf: 'reply_of',
|
|
66
|
+
hasCreator: 'has_creator',
|
|
67
|
+
createdAt: 'created_at',
|
|
68
|
+
hasContainer: 'has_container',
|
|
69
|
+
has_parent: 'has_parent',
|
|
70
|
+
numReplies: 'num_replies',
|
|
71
|
+
has_member: 'has_member',
|
|
72
|
+
});
|
|
73
|
+
export const MEETING = createNamespace('mee', 'http://www.w3.org/ns/pim/meeting#', {
|
|
74
|
+
LongChat: 'LongChat',
|
|
75
|
+
Message: 'Message',
|
|
76
|
+
});
|
|
77
|
+
export const WF = createNamespace('wf', 'http://www.w3.org/2005/01/wf/flow-1.0#', {
|
|
78
|
+
message: 'message',
|
|
79
|
+
participation: 'participation',
|
|
80
|
+
participant: 'participant',
|
|
81
|
+
});
|
|
82
|
+
// Activity Streams 2.0 - W3C standard for social web
|
|
83
|
+
export const AS = createNamespace('as', 'https://www.w3.org/ns/activitystreams#', {
|
|
84
|
+
Announce: 'Announce',
|
|
85
|
+
Public: 'Public',
|
|
86
|
+
audience: 'audience',
|
|
87
|
+
actor: 'actor',
|
|
88
|
+
object: 'object',
|
|
89
|
+
});
|
|
90
|
+
// Company-level namespace (community-first guidance): all custom terms live under udfs:.
|
|
91
|
+
// NOTE: This base URI is part of the contract.
|
|
92
|
+
export const UDFS = createNamespace('udfs', 'https://undefineds.co/ns#', {
|
|
93
|
+
// Types
|
|
94
|
+
ApprovalRequest: 'ApprovalRequest',
|
|
95
|
+
AuditEntry: 'AuditEntry',
|
|
96
|
+
AutonomyGrant: 'AutonomyGrant',
|
|
97
|
+
favorite: 'favorite',
|
|
98
|
+
favoriteType: 'favoriteType',
|
|
99
|
+
favoriteTarget: 'favoriteTarget',
|
|
100
|
+
favoredAt: 'favoredAt',
|
|
101
|
+
conversation: 'conversation',
|
|
102
|
+
conversationType: 'conversationType',
|
|
103
|
+
conversationTitle: 'conversationTitle',
|
|
104
|
+
lastMessage: 'lastMessage',
|
|
105
|
+
lastActiveAt: 'lastActiveAt',
|
|
106
|
+
lastSyncedAt: 'lastSyncedAt',
|
|
107
|
+
sortKey: 'sortKey',
|
|
108
|
+
hasThread: 'hasThread',
|
|
109
|
+
inThread: 'inThread',
|
|
110
|
+
participants: 'participants',
|
|
111
|
+
messageContent: 'messageContent',
|
|
112
|
+
messageType: 'messageType',
|
|
113
|
+
messageStatus: 'messageStatus',
|
|
114
|
+
readBy: 'readBy',
|
|
115
|
+
Contact: 'Contact',
|
|
116
|
+
PersonContact: 'PersonContact',
|
|
117
|
+
AgentContact: 'AgentContact',
|
|
118
|
+
GroupContact: 'GroupContact',
|
|
119
|
+
hasContact: 'hasContact',
|
|
120
|
+
contactType: 'contactType',
|
|
121
|
+
entityUri: 'entityUri',
|
|
122
|
+
externalPlatform: 'externalPlatform',
|
|
123
|
+
externalId: 'externalId',
|
|
124
|
+
alias: 'alias',
|
|
125
|
+
aiAssistant: 'aiAssistant',
|
|
126
|
+
aiModel: 'aiModel',
|
|
127
|
+
aiModels: 'aiModels',
|
|
128
|
+
aiProvider: 'aiProvider',
|
|
129
|
+
credential: 'credential',
|
|
130
|
+
systemPrompt: 'systemPrompt',
|
|
131
|
+
temperature: 'temperature',
|
|
132
|
+
maxTokens: 'maxTokens',
|
|
133
|
+
systemMessage: 'systemMessage',
|
|
134
|
+
provider: 'provider',
|
|
135
|
+
model: 'model',
|
|
136
|
+
metadata: 'metadata',
|
|
137
|
+
tools: 'tools',
|
|
138
|
+
contextWindow: 'contextWindow',
|
|
139
|
+
contextRound: 'contextRound',
|
|
140
|
+
Agent: 'Agent',
|
|
141
|
+
agentCapability: 'agentCapability',
|
|
142
|
+
agentTool: 'agentTool',
|
|
143
|
+
agentConfig: 'agentConfig',
|
|
144
|
+
fileHash: 'fileHash',
|
|
145
|
+
syncStatus: 'syncStatus',
|
|
146
|
+
localPath: 'localPath',
|
|
147
|
+
isDefault: 'isDefault',
|
|
148
|
+
settingKey: 'settingKey',
|
|
149
|
+
settingValue: 'settingValue',
|
|
150
|
+
settingType: 'settingType',
|
|
151
|
+
apiKey: 'apiKey',
|
|
152
|
+
baseUrl: 'baseUrl',
|
|
153
|
+
inbox: 'inbox',
|
|
154
|
+
session: 'session',
|
|
155
|
+
status: 'status',
|
|
156
|
+
risk: 'risk',
|
|
157
|
+
assignedTo: 'assignedTo',
|
|
158
|
+
reason: 'reason',
|
|
159
|
+
resolvedAt: 'resolvedAt',
|
|
160
|
+
action: 'action',
|
|
161
|
+
actor: 'actor',
|
|
162
|
+
actorRole: 'actorRole',
|
|
163
|
+
context: 'context',
|
|
164
|
+
policy: 'policy',
|
|
165
|
+
approval: 'approval',
|
|
166
|
+
effect: 'effect',
|
|
167
|
+
riskCeiling: 'riskCeiling',
|
|
168
|
+
revokedAt: 'revokedAt',
|
|
169
|
+
archivedAt: 'archivedAt',
|
|
170
|
+
deletedAt: 'deletedAt',
|
|
171
|
+
pinnedAt: 'pinnedAt',
|
|
172
|
+
pinned: 'pinned',
|
|
173
|
+
muted: 'muted',
|
|
174
|
+
mutedAt: 'mutedAt',
|
|
175
|
+
unreadCount: 'unreadCount',
|
|
176
|
+
ttsModel: 'ttsModel',
|
|
177
|
+
videoModel: 'videoModel',
|
|
178
|
+
chatType: 'chatType',
|
|
179
|
+
workspace: 'workspace',
|
|
180
|
+
container: 'workspace',
|
|
181
|
+
policyRef: 'policyRef',
|
|
182
|
+
policyVersion: 'policyVersion',
|
|
183
|
+
parentThreadId: 'parentThreadId',
|
|
184
|
+
sessionStatus: 'sessionStatus',
|
|
185
|
+
sessionTool: 'sessionTool',
|
|
186
|
+
tokenUsage: 'tokenUsage',
|
|
187
|
+
groupOwner: 'groupOwner',
|
|
188
|
+
groupAdmin: 'groupAdmin',
|
|
189
|
+
senderName: 'senderName',
|
|
190
|
+
senderAvatarUrl: 'senderAvatarUrl',
|
|
191
|
+
mentions: 'mentions',
|
|
192
|
+
replyTo: 'replyTo',
|
|
193
|
+
routedBy: 'routedBy',
|
|
194
|
+
routeTargetAgentId: 'routeTargetAgentId',
|
|
195
|
+
coordinationId: 'coordinationId',
|
|
196
|
+
toolCallId: 'toolCallId',
|
|
197
|
+
toolName: 'toolName',
|
|
198
|
+
toolArguments: 'toolArguments',
|
|
199
|
+
toolStatus: 'toolStatus',
|
|
200
|
+
toolResult: 'toolResult',
|
|
201
|
+
toolError: 'toolError',
|
|
202
|
+
toolDuration: 'toolDuration',
|
|
203
|
+
toolRisk: 'toolRisk',
|
|
204
|
+
approvalStatus: 'approvalStatus',
|
|
205
|
+
decisionBy: 'decisionBy',
|
|
206
|
+
decisionRole: 'decisionRole',
|
|
207
|
+
onBehalfOf: 'onBehalfOf',
|
|
208
|
+
approvalReason: 'approvalReason',
|
|
209
|
+
inboxItemId: 'inboxItemId',
|
|
210
|
+
taskProgressId: 'taskProgressId',
|
|
211
|
+
taskSteps: 'taskSteps',
|
|
212
|
+
currentStep: 'currentStep',
|
|
213
|
+
totalSteps: 'totalSteps',
|
|
214
|
+
// Favorites V2
|
|
215
|
+
sourceModule: 'sourceModule',
|
|
216
|
+
sourceId: 'sourceId',
|
|
217
|
+
searchText: 'searchText',
|
|
218
|
+
snapshotMeta: 'snapshotMeta',
|
|
219
|
+
});
|
|
220
|
+
export const UDFS_NAMESPACE = UDFS.NAMESPACE;
|
|
221
|
+
// Legacy alias: existing code may still import LINQ.
|
|
222
|
+
// Keep as alias to avoid churn.
|
|
223
|
+
export const LINQ = UDFS;
|
|
224
|
+
// Wave A contracts: unified under company namespace (UDFS).
|
|
225
|
+
// Keep legacy names as aliases to avoid downstream churn.
|
|
226
|
+
export const LINX_CHAT = UDFS;
|
|
227
|
+
export const LINX_MSG = UDFS;
|
|
228
|
+
export const XPOD_CREDENTIAL = createNamespace('cred', 'https://vocab.xpod.dev/credential#', {
|
|
229
|
+
Credential: 'Credential',
|
|
230
|
+
provider: 'provider',
|
|
231
|
+
service: 'service',
|
|
232
|
+
status: 'status',
|
|
233
|
+
apiKey: 'apiKey',
|
|
234
|
+
baseUrl: 'baseUrl',
|
|
235
|
+
label: 'label',
|
|
236
|
+
lastUsedAt: 'lastUsedAt',
|
|
237
|
+
failCount: 'failCount',
|
|
238
|
+
rateLimitResetAt: 'rateLimitResetAt',
|
|
239
|
+
});
|
|
240
|
+
export const XPOD_AI = createNamespace('ai', 'https://vocab.xpod.dev/ai#', {
|
|
241
|
+
Provider: 'Provider',
|
|
242
|
+
Model: 'Model',
|
|
243
|
+
baseUrl: 'baseUrl',
|
|
244
|
+
proxyUrl: 'proxyUrl',
|
|
245
|
+
hasModel: 'hasModel',
|
|
246
|
+
displayName: 'displayName',
|
|
247
|
+
modelType: 'modelType',
|
|
248
|
+
isProvidedBy: 'isProvidedBy',
|
|
249
|
+
dimension: 'dimension',
|
|
250
|
+
status: 'status',
|
|
251
|
+
createdAt: 'createdAt',
|
|
252
|
+
updatedAt: 'updatedAt',
|
|
253
|
+
});
|
package/dist/profile.d.ts
CHANGED
|
@@ -1 +1,22 @@
|
|
|
1
|
-
|
|
1
|
+
import type { SolidProfileRow } from "./profile.schema.js";
|
|
2
|
+
import { type SolidProfileIdentity } from "./profile.repository.js";
|
|
3
|
+
export { pickSolidProfileDisplayName, profileRepository, type SolidProfileIdentity, } from "./profile.repository.js";
|
|
4
|
+
type NodeRequire = (id: string) => unknown;
|
|
5
|
+
export interface SolidProfileSessionLike {
|
|
6
|
+
info?: {
|
|
7
|
+
webId?: string;
|
|
8
|
+
};
|
|
9
|
+
fetch?: typeof fetch;
|
|
10
|
+
}
|
|
11
|
+
export interface SolidProfileReader<TTable = unknown> {
|
|
12
|
+
findByIri(table: TTable, iri: string): Promise<unknown | null>;
|
|
13
|
+
}
|
|
14
|
+
export declare function createSolidProfileDatabase(session: unknown): Promise<SolidProfileReader>;
|
|
15
|
+
export declare function applySolidProfileComunicaPatches(requireModule?: NodeRequire): Promise<boolean>;
|
|
16
|
+
export declare function resolveSolidProfile(db: SolidProfileReader, webId: string): Promise<SolidProfileRow | null>;
|
|
17
|
+
export declare function resolveSolidProfileWithTable<TTable>(db: SolidProfileReader<TTable>, webId: string, table: TTable): Promise<SolidProfileRow | null>;
|
|
18
|
+
export declare function resolveSolidProfileDisplayName(db: SolidProfileReader, webId: string): Promise<string | null>;
|
|
19
|
+
export declare function resolveSolidProfileIdentityWithReader(db: SolidProfileReader, webId: string): Promise<SolidProfileIdentity | null>;
|
|
20
|
+
export declare function resolveSolidProfileIdentity(session: SolidProfileSessionLike, options?: {
|
|
21
|
+
webId?: string;
|
|
22
|
+
}): Promise<SolidProfileIdentity | null>;
|
package/dist/profile.js
CHANGED
|
@@ -1 +1,88 @@
|
|
|
1
|
-
|
|
1
|
+
import { profileRepository } from "./profile.repository.js";
|
|
2
|
+
export { pickSolidProfileDisplayName, profileRepository, } from "./profile.repository.js";
|
|
3
|
+
export async function createSolidProfileDatabase(session) {
|
|
4
|
+
await applySolidProfileComunicaPatches();
|
|
5
|
+
const [{ drizzle }, { solidProfileTable }] = await Promise.all([
|
|
6
|
+
import("@undefineds.co/drizzle-solid"),
|
|
7
|
+
import("./profile.schema.js"),
|
|
8
|
+
]);
|
|
9
|
+
return drizzle(session, {
|
|
10
|
+
logger: false,
|
|
11
|
+
disableInteropDiscovery: true,
|
|
12
|
+
schema: { solidProfileTable },
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
export async function applySolidProfileComunicaPatches(requireModule) {
|
|
16
|
+
const resolvedRequire = requireModule ?? await createNodeRequire();
|
|
17
|
+
if (!resolvedRequire) {
|
|
18
|
+
return false;
|
|
19
|
+
}
|
|
20
|
+
return [
|
|
21
|
+
"@comunica/actor-query-result-serialize-sparql-json",
|
|
22
|
+
"@comunica/actor-query-result-serialize-stats",
|
|
23
|
+
"@comunica/query-sparql-solid/node_modules/@comunica/actor-query-result-serialize-sparql-json",
|
|
24
|
+
"@comunica/query-sparql-solid/node_modules/@comunica/actor-query-result-serialize-stats",
|
|
25
|
+
].map((moduleName) => patchActionObserverHttp(resolvedRequire, moduleName)).some(Boolean);
|
|
26
|
+
}
|
|
27
|
+
export async function resolveSolidProfile(db, webId) {
|
|
28
|
+
return await profileRepository.findByWebId(db, webId);
|
|
29
|
+
}
|
|
30
|
+
export async function resolveSolidProfileWithTable(db, webId, table) {
|
|
31
|
+
if (!webId.trim()) {
|
|
32
|
+
return null;
|
|
33
|
+
}
|
|
34
|
+
return await db.findByIri(table, webId);
|
|
35
|
+
}
|
|
36
|
+
export async function resolveSolidProfileDisplayName(db, webId) {
|
|
37
|
+
return await profileRepository.resolveDisplayName(db, webId);
|
|
38
|
+
}
|
|
39
|
+
export async function resolveSolidProfileIdentityWithReader(db, webId) {
|
|
40
|
+
return await profileRepository.resolveIdentity(db, webId);
|
|
41
|
+
}
|
|
42
|
+
export async function resolveSolidProfileIdentity(session, options = {}) {
|
|
43
|
+
const webId = options.webId ?? session.info?.webId;
|
|
44
|
+
if (!webId?.trim()) {
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
const db = await createSolidProfileDatabase(session);
|
|
48
|
+
return resolveSolidProfileIdentityWithReader(db, webId);
|
|
49
|
+
}
|
|
50
|
+
async function createNodeRequire() {
|
|
51
|
+
if (typeof process === 'undefined') {
|
|
52
|
+
return null;
|
|
53
|
+
}
|
|
54
|
+
try {
|
|
55
|
+
const moduleLib = await import("node:module");
|
|
56
|
+
if (typeof moduleLib.createRequire !== 'function') {
|
|
57
|
+
return null;
|
|
58
|
+
}
|
|
59
|
+
return moduleLib.createRequire(import.meta.url);
|
|
60
|
+
}
|
|
61
|
+
catch {
|
|
62
|
+
return null;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
function patchActionObserverHttp(requireModule, moduleName) {
|
|
66
|
+
try {
|
|
67
|
+
const module = requireModule(moduleName);
|
|
68
|
+
const prototype = module.ActionObserverHttp?.prototype;
|
|
69
|
+
const originalOnRun = prototype?.onRun;
|
|
70
|
+
if (!prototype || typeof originalOnRun !== 'function') {
|
|
71
|
+
return false;
|
|
72
|
+
}
|
|
73
|
+
if (prototype.__linxObservedActorsPatchApplied) {
|
|
74
|
+
return true;
|
|
75
|
+
}
|
|
76
|
+
prototype.onRun = function patchedActionObserverOnRun(actor, action, output) {
|
|
77
|
+
if (!Array.isArray(this.observedActors)) {
|
|
78
|
+
this.observedActors = [];
|
|
79
|
+
}
|
|
80
|
+
return originalOnRun.call(this, actor, action, output);
|
|
81
|
+
};
|
|
82
|
+
prototype.__linxObservedActorsPatchApplied = true;
|
|
83
|
+
return true;
|
|
84
|
+
}
|
|
85
|
+
catch {
|
|
86
|
+
return false;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { type AnyPodTable } from './repository.js';
|
|
2
|
+
import { type SolidProfileRow } from './profile.schema.js';
|
|
3
|
+
export interface SolidProfileIdentity {
|
|
4
|
+
webId: string;
|
|
5
|
+
profile: SolidProfileRow | null;
|
|
6
|
+
displayName: string | null;
|
|
7
|
+
username: string;
|
|
8
|
+
}
|
|
9
|
+
export interface SolidProfileRepositoryReader {
|
|
10
|
+
findByIri?(table: AnyPodTable, iri: string): Promise<unknown | null>;
|
|
11
|
+
}
|
|
12
|
+
export declare const profileRepository: {
|
|
13
|
+
findByWebId(db: SolidProfileRepositoryReader, webId: string): Promise<SolidProfileRow | null>;
|
|
14
|
+
resolveDisplayName(db: SolidProfileRepositoryReader, webId: string): Promise<string | null>;
|
|
15
|
+
resolveIdentity(db: SolidProfileRepositoryReader, webId: string): Promise<SolidProfileIdentity | null>;
|
|
16
|
+
namespace: string;
|
|
17
|
+
resourcePath: string;
|
|
18
|
+
searchableFields?: ("name" | "favorite" | "inbox" | "id" | "nick" | "avatar" | "note" | "email" | "phone" | "region" | "gender")[] | undefined;
|
|
19
|
+
defaultSort?: {
|
|
20
|
+
field: "name" | "favorite" | "inbox" | "id" | "nick" | "avatar" | "note" | "email" | "phone" | "region" | "gender";
|
|
21
|
+
direction: "asc" | "desc";
|
|
22
|
+
} | undefined;
|
|
23
|
+
cache?: import("./repository.js").RepositoryCacheOptions;
|
|
24
|
+
invalidations: import("./repository.js").RepositoryInvalidations;
|
|
25
|
+
list: (db: import("./repository.js").SolidDatabase, filters?: Record<string, unknown> | undefined) => Promise<{
|
|
26
|
+
id: string;
|
|
27
|
+
name: string;
|
|
28
|
+
nick: string;
|
|
29
|
+
avatar: string;
|
|
30
|
+
note: string;
|
|
31
|
+
email: string;
|
|
32
|
+
phone: string;
|
|
33
|
+
region: string;
|
|
34
|
+
gender: string;
|
|
35
|
+
favorite: string;
|
|
36
|
+
inbox: string;
|
|
37
|
+
}[]>;
|
|
38
|
+
detail: (db: import("./repository.js").SolidDatabase, id: string) => Promise<{
|
|
39
|
+
id: string;
|
|
40
|
+
name: string;
|
|
41
|
+
nick: string;
|
|
42
|
+
avatar: string;
|
|
43
|
+
note: string;
|
|
44
|
+
email: string;
|
|
45
|
+
phone: string;
|
|
46
|
+
region: string;
|
|
47
|
+
gender: string;
|
|
48
|
+
favorite: string;
|
|
49
|
+
inbox: string;
|
|
50
|
+
} | null>;
|
|
51
|
+
create?: ((db: import("./repository.js").SolidDatabase, input: {
|
|
52
|
+
id?: string | undefined;
|
|
53
|
+
name?: string | undefined;
|
|
54
|
+
nick?: string | undefined;
|
|
55
|
+
avatar?: string | undefined;
|
|
56
|
+
note?: string | undefined;
|
|
57
|
+
email?: string | undefined;
|
|
58
|
+
phone?: string | undefined;
|
|
59
|
+
region?: string | undefined;
|
|
60
|
+
gender?: string | undefined;
|
|
61
|
+
favorite?: string | undefined;
|
|
62
|
+
inbox?: string | undefined;
|
|
63
|
+
}) => Promise<{
|
|
64
|
+
id: string;
|
|
65
|
+
name: string;
|
|
66
|
+
nick: string;
|
|
67
|
+
avatar: string;
|
|
68
|
+
note: string;
|
|
69
|
+
email: string;
|
|
70
|
+
phone: string;
|
|
71
|
+
region: string;
|
|
72
|
+
gender: string;
|
|
73
|
+
favorite: string;
|
|
74
|
+
inbox: string;
|
|
75
|
+
}>) | undefined;
|
|
76
|
+
update?: ((db: import("./repository.js").SolidDatabase, id: string, input: {
|
|
77
|
+
id?: string | null | undefined;
|
|
78
|
+
name?: string | null | undefined;
|
|
79
|
+
nick?: string | null | undefined;
|
|
80
|
+
avatar?: string | null | undefined;
|
|
81
|
+
note?: string | null | undefined;
|
|
82
|
+
email?: string | null | undefined;
|
|
83
|
+
phone?: string | null | undefined;
|
|
84
|
+
region?: string | null | undefined;
|
|
85
|
+
gender?: string | null | undefined;
|
|
86
|
+
favorite?: string | null | undefined;
|
|
87
|
+
inbox?: string | null | undefined;
|
|
88
|
+
}) => Promise<{
|
|
89
|
+
id: string;
|
|
90
|
+
name: string;
|
|
91
|
+
nick: string;
|
|
92
|
+
avatar: string;
|
|
93
|
+
note: string;
|
|
94
|
+
email: string;
|
|
95
|
+
phone: string;
|
|
96
|
+
region: string;
|
|
97
|
+
gender: string;
|
|
98
|
+
favorite: string;
|
|
99
|
+
inbox: string;
|
|
100
|
+
}>) | undefined;
|
|
101
|
+
remove?: (db: import("./repository.js").SolidDatabase, id: string) => Promise<{
|
|
102
|
+
id: string;
|
|
103
|
+
}>;
|
|
104
|
+
};
|
|
105
|
+
export declare function pickSolidProfileDisplayName(profile: Pick<SolidProfileRow, 'name' | 'nick'> | null | undefined): string | null;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { extractProfileUsernameFromWebId } from './client/index.js';
|
|
2
|
+
import { definePodRepository } from './repository.js';
|
|
3
|
+
import { solidProfileTable, } from './profile.schema.js';
|
|
4
|
+
const baseProfileRepository = definePodRepository({
|
|
5
|
+
namespace: 'profile',
|
|
6
|
+
table: solidProfileTable,
|
|
7
|
+
searchableFields: ['name', 'nick'],
|
|
8
|
+
disableMutations: {
|
|
9
|
+
create: true,
|
|
10
|
+
update: true,
|
|
11
|
+
remove: true,
|
|
12
|
+
},
|
|
13
|
+
});
|
|
14
|
+
export const profileRepository = {
|
|
15
|
+
...baseProfileRepository,
|
|
16
|
+
async findByWebId(db, webId) {
|
|
17
|
+
if (!webId.trim()) {
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
return await db.findByIri?.(solidProfileTable, webId) ?? null;
|
|
21
|
+
},
|
|
22
|
+
async resolveDisplayName(db, webId) {
|
|
23
|
+
return pickSolidProfileDisplayName(await profileRepository.findByWebId(db, webId));
|
|
24
|
+
},
|
|
25
|
+
async resolveIdentity(db, webId) {
|
|
26
|
+
if (!webId.trim()) {
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
const profile = await profileRepository.findByWebId(db, webId);
|
|
30
|
+
return {
|
|
31
|
+
webId,
|
|
32
|
+
profile,
|
|
33
|
+
displayName: pickSolidProfileDisplayName(profile),
|
|
34
|
+
username: extractProfileUsernameFromWebId(webId),
|
|
35
|
+
};
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
export function pickSolidProfileDisplayName(profile) {
|
|
39
|
+
return normalizeDisplayName(profile?.name) ?? normalizeDisplayName(profile?.nick) ?? null;
|
|
40
|
+
}
|
|
41
|
+
function normalizeDisplayName(value) {
|
|
42
|
+
if (typeof value !== 'string') {
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
const trimmed = value.trim();
|
|
46
|
+
return trimmed ? trimmed : null;
|
|
47
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare const solidProfileTable: import("@undefineds.co/drizzle-solid/dist/core/schema/pod-table.js").PodTableWithColumns<import("@undefineds.co/drizzle-solid/dist/core/schema/types.js").ResolvedColumns<{
|
|
2
|
+
id: import("@undefineds.co/drizzle-solid/dist/core/schema/columns.js").PodStringColumn<false, false>;
|
|
3
|
+
name: import("@undefineds.co/drizzle-solid/dist/core/schema/columns.js").ColumnBuilder<"string", null, false, false>;
|
|
4
|
+
nick: import("@undefineds.co/drizzle-solid/dist/core/schema/columns.js").ColumnBuilder<"string", null, false, false>;
|
|
5
|
+
avatar: import("@undefineds.co/drizzle-solid/dist/core/schema/columns.js").ColumnBuilder<"string", null, false, false>;
|
|
6
|
+
note: import("@undefineds.co/drizzle-solid/dist/core/schema/columns.js").ColumnBuilder<"string", null, false, false>;
|
|
7
|
+
email: import("@undefineds.co/drizzle-solid/dist/core/schema/columns.js").ColumnBuilder<"string", null, false, false>;
|
|
8
|
+
phone: import("@undefineds.co/drizzle-solid/dist/core/schema/columns.js").ColumnBuilder<"string", null, false, false>;
|
|
9
|
+
region: import("@undefineds.co/drizzle-solid/dist/core/schema/columns.js").ColumnBuilder<"string", null, false, false>;
|
|
10
|
+
gender: import("@undefineds.co/drizzle-solid/dist/core/schema/columns.js").ColumnBuilder<"string", null, false, false>;
|
|
11
|
+
favorite: import("@undefineds.co/drizzle-solid/dist/core/schema/columns.js").ColumnBuilder<"string", null, false, false>;
|
|
12
|
+
inbox: import("@undefineds.co/drizzle-solid/dist/core/schema/columns.js").ColumnBuilder<"string", null, false, false>;
|
|
13
|
+
}>>;
|
|
14
|
+
export type SolidProfileRow = typeof solidProfileTable.$inferSelect;
|
|
15
|
+
export type SolidProfileInsert = typeof solidProfileTable.$inferInsert;
|
|
16
|
+
export type SolidProfileUpdate = typeof solidProfileTable.$inferUpdate;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { podTable, string
|
|
2
|
-
import {
|
|
1
|
+
import { id, podTable, string } from "@undefineds.co/drizzle-solid";
|
|
2
|
+
import { FOAF, LDP, UDFS, VCARD } from "./namespaces.js";
|
|
3
3
|
export const solidProfileTable = podTable("profile", {
|
|
4
|
-
id: id(
|
|
4
|
+
id: id("id"),
|
|
5
5
|
name: string("name").predicate(VCARD.fn),
|
|
6
6
|
nick: string("nick").predicate(FOAF.nick),
|
|
7
7
|
avatar: string("avatar").predicate(VCARD.hasPhoto),
|
|
@@ -11,7 +11,7 @@ export const solidProfileTable = podTable("profile", {
|
|
|
11
11
|
region: string("region").predicate(VCARD.region),
|
|
12
12
|
gender: string("gender").predicate(VCARD.hasGender),
|
|
13
13
|
favorite: string("favorite").predicate(UDFS.favorite),
|
|
14
|
-
inbox: string("inbox").predicate(LDP.inbox)
|
|
14
|
+
inbox: string("inbox").predicate(LDP.inbox),
|
|
15
15
|
}, {
|
|
16
16
|
base: "idp:///profile/card",
|
|
17
17
|
type: FOAF.Person,
|
package/dist/repository.d.ts
CHANGED
|
@@ -1,5 +1,52 @@
|
|
|
1
|
-
import type { PodTable, InferTableData, InferInsertData, InferUpdateData,
|
|
2
|
-
export
|
|
1
|
+
import type { PodTable, InferTableData, InferInsertData, InferUpdateData, QueryCondition } from '@undefineds.co/drizzle-solid';
|
|
2
|
+
export interface AnyPodTable {
|
|
3
|
+
resolveUri?: (id: string) => string;
|
|
4
|
+
config?: {
|
|
5
|
+
name?: string;
|
|
6
|
+
base?: string;
|
|
7
|
+
};
|
|
8
|
+
getResourcePath?: () => string;
|
|
9
|
+
}
|
|
10
|
+
export interface PodExecutableQuery<TRow = unknown> {
|
|
11
|
+
where(condition: unknown): PodExecutableQuery<TRow>;
|
|
12
|
+
whereByIri?(iri: string | string[]): PodExecutableQuery<TRow>;
|
|
13
|
+
orderBy(...args: unknown[]): PodExecutableQuery<TRow>;
|
|
14
|
+
execute(): Promise<TRow[]>;
|
|
15
|
+
}
|
|
16
|
+
export interface PodInsertQuery {
|
|
17
|
+
values(values: unknown): {
|
|
18
|
+
execute(): Promise<unknown[]>;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
export interface PodUpdateQuery {
|
|
22
|
+
set(values: unknown): PodMutationQuery;
|
|
23
|
+
}
|
|
24
|
+
export interface PodMutationQuery {
|
|
25
|
+
where(condition: unknown): PodMutationQuery;
|
|
26
|
+
whereByIri?(iri: string): PodMutationQuery;
|
|
27
|
+
execute(): Promise<unknown[]>;
|
|
28
|
+
}
|
|
29
|
+
export interface SolidDatabase<TSchema extends Record<string, unknown> = Record<string, unknown>> {
|
|
30
|
+
init?(tables: AnyPodTable[] | AnyPodTable, ...rest: unknown[]): Promise<void>;
|
|
31
|
+
select(fields?: unknown): {
|
|
32
|
+
from(table: AnyPodTable): PodExecutableQuery;
|
|
33
|
+
};
|
|
34
|
+
insert(table: AnyPodTable): PodInsertQuery;
|
|
35
|
+
update(table: AnyPodTable): PodUpdateQuery;
|
|
36
|
+
delete(table: AnyPodTable): PodMutationQuery;
|
|
37
|
+
findByIri?<T = unknown>(table: AnyPodTable, iri: string): Promise<T | null>;
|
|
38
|
+
updateByIri?<T = unknown>(table: AnyPodTable, iri: string, data: Record<string, unknown>): Promise<T | null>;
|
|
39
|
+
deleteByIri?(table: AnyPodTable, iri: string): Promise<unknown>;
|
|
40
|
+
subscribe?(table: AnyPodTable, options: unknown): Promise<{
|
|
41
|
+
unsubscribe?: () => void;
|
|
42
|
+
} | (() => void)>;
|
|
43
|
+
}
|
|
44
|
+
export declare function initSolidTables(db: SolidDatabase, tables: AnyPodTable[]): Promise<void>;
|
|
45
|
+
export declare function resolvePodUri(webId: string, table: {
|
|
46
|
+
resolveUri?: (id: string) => string;
|
|
47
|
+
}, id: string): string;
|
|
48
|
+
export declare function findPodRowByStorageId<T>(db: SolidDatabase, webId: string, table: AnyPodTable, id: string): Promise<T | null>;
|
|
49
|
+
export declare function whereByPodStorageId<TTable extends AnyPodTable>(webId: string, table: TTable, query: PodMutationQuery, id: string): PodMutationQuery;
|
|
3
50
|
export interface RepositoryCacheOptions {
|
|
4
51
|
staleTime?: number;
|
|
5
52
|
gcTime?: number;
|
|
@@ -48,12 +95,5 @@ export interface PodRepositoryOptions<TTable extends PodTable<any>, Row extends
|
|
|
48
95
|
disableMutations?: Partial<Record<'create' | 'update' | 'remove', boolean>>;
|
|
49
96
|
}
|
|
50
97
|
export declare function resolveRowId(row: Partial<Record<string, unknown>> | null): string | null;
|
|
51
|
-
export declare function isIriLikeIdentifier(value: string): boolean;
|
|
52
|
-
export declare function stripEntityIdentifiers<T extends Record<string, unknown>>(data: T | null | undefined): Partial<T>;
|
|
53
|
-
type ExactTargetInput = string | Partial<Record<string, unknown>>;
|
|
54
|
-
export declare function findExactRecord<TTable extends PodTable<any>>(db: SolidDatabase<any>, table: TTable, target: ExactTargetInput): Promise<InferTableData<TTable> | null>;
|
|
55
|
-
export declare function updateExactRecord<TTable extends PodTable<any>>(db: SolidDatabase<any>, table: TTable, target: ExactTargetInput, data: Partial<Record<string, unknown>>): Promise<InferTableData<TTable> | null>;
|
|
56
|
-
export declare function deleteExactRecord<TTable extends PodTable<any>>(db: SolidDatabase<any>, table: TTable, target: ExactTargetInput): Promise<boolean>;
|
|
57
98
|
export declare function createRepositoryDescriptor<TTable extends PodTable<any>, Row extends Record<string, unknown> = InferTableData<TTable>, Insert = InferInsertData<TTable>, Update = InferUpdateData<TTable>, Filters extends Record<string, unknown> = Record<string, unknown>>(options: PodRepositoryOptions<TTable, Row, Filters>): PodRepositoryDescriptor<TTable, Row, Insert, Update, Filters>;
|
|
58
99
|
export declare const definePodRepository: typeof createRepositoryDescriptor;
|
|
59
|
-
export {};
|