@undefineds.co/models 0.1.1 → 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/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 +5 -5
- package/dist/fixtures/contracts-chat-contact.js +1 -1
- 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 -40
- package/dist/index.js +20 -16
- 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/sidecar/persistence-mapping.d.ts +5 -5
- package/dist/sidecar/sidecar-events.d.ts +30 -30
- 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/types/message-block.d.ts +1 -1
- 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 -31
- 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-blocks.d.ts +0 -52
- package/dist/core/types/collaboration-blocks.js +0 -7
- package/dist/core/types/message-block.d.ts +0 -270
- package/dist/core/types/message-block.js +0 -125
- 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/sidecar.vocab.d.ts +0 -46
- package/dist/core/vocab/sidecar.vocab.js +0 -47
- 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/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/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/sidecar/index.d.ts +0 -2
- package/dist/sidecar/index.js +0 -2
- 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/chat.schema.d.ts
CHANGED
|
@@ -1 +1,37 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type ChatMemberRole = 'owner' | 'admin' | 'member';
|
|
2
|
+
export interface ChatMetadata {
|
|
3
|
+
memberRoles?: Record<string, ChatMemberRole>;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Chat schema (channel/place).
|
|
7
|
+
*
|
|
8
|
+
* CP0 baseline (alignment):
|
|
9
|
+
* - Chat is a container for messages/widgets regardless of counterpart type.
|
|
10
|
+
* - Do not encode counterpart-specific behavior in Chat (no chatType/subtype).
|
|
11
|
+
* - Participants use Solid chat-aligned flow vocabulary (wf/flow).
|
|
12
|
+
*
|
|
13
|
+
* Storage structure (aligned with xpod):
|
|
14
|
+
* - Chat metadata stored as #this in index.ttl
|
|
15
|
+
* - Location: /.data/chat/{id}/index.ttl#this
|
|
16
|
+
* - Threads stored as fragments in same file: /.data/chat/{id}/index.ttl#{threadId}
|
|
17
|
+
*/
|
|
18
|
+
export declare const chatTable: import("@undefineds.co/drizzle-solid/dist/core/schema").PodTableWithColumns<import("@undefineds.co/drizzle-solid/dist/core/schema").ResolvedColumns<{
|
|
19
|
+
id: import("@undefineds.co/drizzle-solid/dist/core/schema").PodStringColumn<false, false>;
|
|
20
|
+
title: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, true, false>;
|
|
21
|
+
description: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, false, false>;
|
|
22
|
+
avatarUrl: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"uri", null, false, false>;
|
|
23
|
+
starred: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"boolean", null, false, true>;
|
|
24
|
+
muted: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"boolean", null, false, true>;
|
|
25
|
+
unreadCount: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"integer", null, false, true>;
|
|
26
|
+
contact: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"uri", null, false, false>;
|
|
27
|
+
participants: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"array", "uri", false, false>;
|
|
28
|
+
metadata: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"object", null, false, false>;
|
|
29
|
+
lastActiveAt: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"datetime", null, false, false>;
|
|
30
|
+
lastMessageId: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"uri", null, false, false>;
|
|
31
|
+
lastMessagePreview: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, false, false>;
|
|
32
|
+
createdAt: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"datetime", null, true, true>;
|
|
33
|
+
updatedAt: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"datetime", null, true, true>;
|
|
34
|
+
}>>;
|
|
35
|
+
export type ChatRow = typeof chatTable.$inferSelect;
|
|
36
|
+
export type ChatInsert = typeof chatTable.$inferInsert;
|
|
37
|
+
export type ChatUpdate = typeof chatTable.$inferUpdate;
|
package/dist/chat.schema.js
CHANGED
|
@@ -1 +1,47 @@
|
|
|
1
|
-
|
|
1
|
+
import { boolean, object, podTable, string, text, timestamp, uri, id, integer } from '@undefineds.co/drizzle-solid';
|
|
2
|
+
import { UDFS, DCTerms, SCHEMA, MEETING, WF } from './namespaces.js';
|
|
3
|
+
/**
|
|
4
|
+
* Chat schema (channel/place).
|
|
5
|
+
*
|
|
6
|
+
* CP0 baseline (alignment):
|
|
7
|
+
* - Chat is a container for messages/widgets regardless of counterpart type.
|
|
8
|
+
* - Do not encode counterpart-specific behavior in Chat (no chatType/subtype).
|
|
9
|
+
* - Participants use Solid chat-aligned flow vocabulary (wf/flow).
|
|
10
|
+
*
|
|
11
|
+
* Storage structure (aligned with xpod):
|
|
12
|
+
* - Chat metadata stored as #this in index.ttl
|
|
13
|
+
* - Location: /.data/chat/{id}/index.ttl#this
|
|
14
|
+
* - Threads stored as fragments in same file: /.data/chat/{id}/index.ttl#{threadId}
|
|
15
|
+
*/
|
|
16
|
+
export const chatTable = podTable('chats', {
|
|
17
|
+
id: id('id'),
|
|
18
|
+
// Display
|
|
19
|
+
title: string('title').predicate(DCTerms.title).notNull(),
|
|
20
|
+
description: string('description').predicate(DCTerms.description),
|
|
21
|
+
avatarUrl: uri('avatarUrl').predicate(SCHEMA.image),
|
|
22
|
+
// Chat state
|
|
23
|
+
starred: boolean('starred').predicate(UDFS.favorite).default(false),
|
|
24
|
+
muted: boolean('muted').predicate(UDFS.muted).default(false),
|
|
25
|
+
unreadCount: integer('unreadCount').predicate(UDFS.unreadCount).default(0),
|
|
26
|
+
// Optional counterpart/contact represented by this channel. Stored as RDF URI; callers may pass a short contact id.
|
|
27
|
+
contact: uri('contact').predicate(UDFS.term('contact')).link('contact'),
|
|
28
|
+
// Explicit membership for group chats.
|
|
29
|
+
participants: uri('participants')
|
|
30
|
+
.array()
|
|
31
|
+
.predicate(WF.participant),
|
|
32
|
+
// Structured chat metadata.
|
|
33
|
+
metadata: object('metadata').predicate(UDFS.metadata),
|
|
34
|
+
// Last activity
|
|
35
|
+
lastActiveAt: timestamp('lastActiveAt').predicate(UDFS.lastActiveAt),
|
|
36
|
+
lastMessageId: uri('lastMessageId').predicate(WF.message),
|
|
37
|
+
lastMessagePreview: text('lastMessagePreview').predicate(SCHEMA.text),
|
|
38
|
+
// Timestamps
|
|
39
|
+
createdAt: timestamp('createdAt').predicate(DCTerms.created).notNull().defaultNow(),
|
|
40
|
+
updatedAt: timestamp('updatedAt').predicate(DCTerms.modified).notNull().defaultNow(),
|
|
41
|
+
}, {
|
|
42
|
+
base: '/.data/chat/',
|
|
43
|
+
sparqlEndpoint: '/.data/chat/-/sparql',
|
|
44
|
+
type: MEETING.LongChat,
|
|
45
|
+
namespace: UDFS,
|
|
46
|
+
subjectTemplate: '{id}/index.ttl#this',
|
|
47
|
+
});
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
export type LinxAuthType = 'client_credentials' | 'oidc_oauth';
|
|
2
|
+
export interface LinxClientConfig {
|
|
3
|
+
url: string;
|
|
4
|
+
webId: string;
|
|
5
|
+
authType: LinxAuthType;
|
|
6
|
+
}
|
|
7
|
+
export interface LinxClientCredentialsSecrets {
|
|
8
|
+
clientId: string;
|
|
9
|
+
clientSecret: string;
|
|
10
|
+
}
|
|
11
|
+
export interface LinxOidcOAuthSecrets {
|
|
12
|
+
oidcRefreshToken: string;
|
|
13
|
+
oidcAccessToken: string;
|
|
14
|
+
oidcExpiresAt: string;
|
|
15
|
+
oidcClientId?: string;
|
|
16
|
+
}
|
|
17
|
+
export type LinxClientSecrets = LinxClientCredentialsSecrets | LinxOidcOAuthSecrets;
|
|
18
|
+
export interface AccountSession {
|
|
19
|
+
url: string;
|
|
20
|
+
email: string;
|
|
21
|
+
token: string;
|
|
22
|
+
webId?: string;
|
|
23
|
+
podUrl?: string;
|
|
24
|
+
createdAt: string;
|
|
25
|
+
}
|
|
26
|
+
export interface LinxAccountControls {
|
|
27
|
+
pod?: string;
|
|
28
|
+
clientCredentials?: string;
|
|
29
|
+
}
|
|
30
|
+
export interface LinxAccountData {
|
|
31
|
+
controls: LinxAccountControls;
|
|
32
|
+
pods: Record<string, string>;
|
|
33
|
+
webIds: Record<string, string>;
|
|
34
|
+
clientCredentials: Record<string, string>;
|
|
35
|
+
}
|
|
36
|
+
export interface LinxClientCredential {
|
|
37
|
+
id: string;
|
|
38
|
+
secret?: string;
|
|
39
|
+
label?: string;
|
|
40
|
+
webId?: string;
|
|
41
|
+
}
|
|
42
|
+
export interface LinxStoredCredentials {
|
|
43
|
+
url: string;
|
|
44
|
+
webId: string;
|
|
45
|
+
authType: LinxAuthType;
|
|
46
|
+
secrets: LinxClientSecrets;
|
|
47
|
+
}
|
|
48
|
+
export type LinxCredentialBootstrapStatus = 'reused' | 'created' | 'recreated';
|
|
49
|
+
export interface LinxWhoAmIField {
|
|
50
|
+
key: 'email' | 'server' | 'webId' | 'pod' | 'session-created-at';
|
|
51
|
+
value: string;
|
|
52
|
+
}
|
|
53
|
+
export interface PerformLinxPasswordLoginInput {
|
|
54
|
+
baseUrl?: string | null;
|
|
55
|
+
fallbackBaseUrl?: string;
|
|
56
|
+
email: string;
|
|
57
|
+
password: string;
|
|
58
|
+
requestedWebId?: string | null;
|
|
59
|
+
credentialName?: string | null;
|
|
60
|
+
existingCredentials?: LinxStoredCredentials | null;
|
|
61
|
+
now?: Date;
|
|
62
|
+
}
|
|
63
|
+
export interface PerformLinxPasswordLoginResult {
|
|
64
|
+
baseUrl: string;
|
|
65
|
+
webId: string;
|
|
66
|
+
account: LinxAccountData;
|
|
67
|
+
session: AccountSession;
|
|
68
|
+
credentialStatus: LinxCredentialBootstrapStatus;
|
|
69
|
+
credentialsToSave?: {
|
|
70
|
+
url: string;
|
|
71
|
+
webId: string;
|
|
72
|
+
authType: 'client_credentials';
|
|
73
|
+
secrets: LinxClientCredentialsSecrets;
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
export interface PerformLinxPasswordLoginDependencies {
|
|
77
|
+
checkServer(baseUrl: string): Promise<boolean>;
|
|
78
|
+
login(email: string, password: string, baseUrl: string): Promise<string | null>;
|
|
79
|
+
getAccountData(token: string, baseUrl: string): Promise<LinxAccountData | null>;
|
|
80
|
+
validateClientCredentials?(credentials: LinxStoredCredentials): Promise<boolean>;
|
|
81
|
+
createClientCredentials(token: string, credentialsUrl: string, webId: string, name?: string): Promise<LinxClientCredential | null>;
|
|
82
|
+
}
|
|
83
|
+
export declare const LINX_HOME_DIRNAME = ".linx";
|
|
84
|
+
export declare const LINX_CONFIG_FILE_NAME = "config.json";
|
|
85
|
+
export declare const LINX_SECRETS_FILE_NAME = "secrets.json";
|
|
86
|
+
export declare const LINX_ACCOUNT_SESSION_FILE_NAME = "account.json";
|
|
87
|
+
export declare const LINX_CLOUD_IDENTITY_ORIGIN = "https://id.undefineds.co";
|
|
88
|
+
export declare const LINX_CLOUD_API_ORIGIN = "https://api.undefineds.co";
|
|
89
|
+
export declare const LINX_CLOUD_ACCOUNT_API_BASE_URL = "https://id.undefineds.co/";
|
|
90
|
+
export declare const LINX_CLOUD_RUNTIME_API_BASE_URL = "https://api.undefineds.co/v1";
|
|
91
|
+
export declare const LINX_CLOUD_API_BASE_URL = "https://id.undefineds.co/";
|
|
92
|
+
export declare const LINX_CLOUD_IDENTITY_HOSTS: readonly ["id.undefineds.co"];
|
|
93
|
+
export declare function resolveLinxBaseUrl(url?: string | null, fallbackBaseUrl?: string): string;
|
|
94
|
+
export declare function resolveLinxRuntimeApiBaseUrl(url?: string | null, fallbackBaseUrl?: string): string;
|
|
95
|
+
export declare function resolveLinxCloudAccountBaseUrl(url?: string | null): string;
|
|
96
|
+
export declare function resolveLinxCloudRuntimeApiBaseUrl(url?: string | null): string;
|
|
97
|
+
export declare function resolveLinxCloudApiBaseUrl(url?: string | null): string;
|
|
98
|
+
export declare function isLinxCloudIdentityBaseUrl(url?: string | null): boolean;
|
|
99
|
+
export declare function resolveLinxRuntimeOriginForIssuerUrl(url?: string | null): string;
|
|
100
|
+
export declare function resolveLinxRuntimeApiBaseUrlForIssuerUrl(url?: string | null): string;
|
|
101
|
+
export declare function resolveLinxPodUrl(webId: string): string;
|
|
102
|
+
export declare function resolveLinxPodBaseUrl(webId: string): string;
|
|
103
|
+
export declare function extractProfileUsernameFromWebId(webId: string): string;
|
|
104
|
+
export declare function parseLinxClientConfig(raw: unknown): LinxClientConfig | null;
|
|
105
|
+
export declare function isLinxClientCredentialsSecrets(secrets: LinxClientSecrets): secrets is LinxClientCredentialsSecrets;
|
|
106
|
+
export declare function isLinxOidcOAuthSecrets(secrets: LinxClientSecrets): secrets is LinxOidcOAuthSecrets;
|
|
107
|
+
export declare function parseLinxClientSecrets(raw: unknown): LinxClientSecrets | null;
|
|
108
|
+
export declare function parseLinxAccountData(raw: unknown): LinxAccountData | null;
|
|
109
|
+
export declare function parseLinxClientCredential(raw: unknown): LinxClientCredential | null;
|
|
110
|
+
export declare function parseAccountSession(raw: unknown): AccountSession | null;
|
|
111
|
+
export declare function selectLinxAccountWebId(account: LinxAccountData | null, preferredWebId?: string | null): string | null;
|
|
112
|
+
export declare function resolveLinxAccountPodUrl(account: LinxAccountData | null, webId?: string | null): string | null;
|
|
113
|
+
export declare function hasMatchingLinxStoredCredentials(credentials: Pick<LinxStoredCredentials, 'url' | 'webId'> | null | undefined, baseUrl: string, webId: string): boolean;
|
|
114
|
+
export declare function resolveLinxCredentialBootstrapStatus(input: {
|
|
115
|
+
reusedExistingCredentials: boolean;
|
|
116
|
+
hadMatchingStoredCredentials: boolean;
|
|
117
|
+
}): LinxCredentialBootstrapStatus;
|
|
118
|
+
export declare function listLinxWhoAmIFields(session: AccountSession, options?: {
|
|
119
|
+
verbose?: boolean;
|
|
120
|
+
}): LinxWhoAmIField[];
|
|
121
|
+
export declare function performLinxPasswordLogin(input: PerformLinxPasswordLoginInput, deps: PerformLinxPasswordLoginDependencies): Promise<PerformLinxPasswordLoginResult>;
|
|
@@ -0,0 +1,299 @@
|
|
|
1
|
+
export const LINX_HOME_DIRNAME = '.linx';
|
|
2
|
+
export const LINX_CONFIG_FILE_NAME = 'config.json';
|
|
3
|
+
export const LINX_SECRETS_FILE_NAME = 'secrets.json';
|
|
4
|
+
export const LINX_ACCOUNT_SESSION_FILE_NAME = 'account.json';
|
|
5
|
+
export const LINX_CLOUD_IDENTITY_ORIGIN = 'https://id.undefineds.co';
|
|
6
|
+
export const LINX_CLOUD_API_ORIGIN = 'https://api.undefineds.co';
|
|
7
|
+
export const LINX_CLOUD_ACCOUNT_API_BASE_URL = `${LINX_CLOUD_IDENTITY_ORIGIN}/`;
|
|
8
|
+
export const LINX_CLOUD_RUNTIME_API_BASE_URL = `${LINX_CLOUD_API_ORIGIN}/v1`;
|
|
9
|
+
export const LINX_CLOUD_API_BASE_URL = LINX_CLOUD_ACCOUNT_API_BASE_URL;
|
|
10
|
+
export const LINX_CLOUD_IDENTITY_HOSTS = ['id.undefineds.co'];
|
|
11
|
+
function isRecord(value) {
|
|
12
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
13
|
+
}
|
|
14
|
+
function optionalString(value) {
|
|
15
|
+
return typeof value === 'string' ? value : undefined;
|
|
16
|
+
}
|
|
17
|
+
function parseStringRecord(value) {
|
|
18
|
+
if (!isRecord(value)) {
|
|
19
|
+
return {};
|
|
20
|
+
}
|
|
21
|
+
const entries = Object.entries(value)
|
|
22
|
+
.filter((entry) => typeof entry[1] === 'string');
|
|
23
|
+
return Object.fromEntries(entries);
|
|
24
|
+
}
|
|
25
|
+
function normalizeAuthType(value) {
|
|
26
|
+
return value === 'oidc_oauth' ? 'oidc_oauth' : 'client_credentials';
|
|
27
|
+
}
|
|
28
|
+
function trimTrailingSlash(url) {
|
|
29
|
+
return url.replace(/\/+$/, '');
|
|
30
|
+
}
|
|
31
|
+
function resolveHostname(url) {
|
|
32
|
+
try {
|
|
33
|
+
return new URL(url).hostname;
|
|
34
|
+
}
|
|
35
|
+
catch {
|
|
36
|
+
return '';
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
export function resolveLinxBaseUrl(url, fallbackBaseUrl = 'http://localhost:3000') {
|
|
40
|
+
const raw = typeof url === 'string' && url.trim() ? url.trim() : fallbackBaseUrl;
|
|
41
|
+
return raw.endsWith('/') ? raw : `${raw}/`;
|
|
42
|
+
}
|
|
43
|
+
export function resolveLinxRuntimeApiBaseUrl(url, fallbackBaseUrl = LINX_CLOUD_ACCOUNT_API_BASE_URL) {
|
|
44
|
+
const normalized = trimTrailingSlash(resolveLinxBaseUrl(url, fallbackBaseUrl));
|
|
45
|
+
return normalized.endsWith('/v1') ? normalized : `${normalized}/v1`;
|
|
46
|
+
}
|
|
47
|
+
export function resolveLinxCloudAccountBaseUrl(url) {
|
|
48
|
+
return resolveLinxBaseUrl(url, LINX_CLOUD_ACCOUNT_API_BASE_URL);
|
|
49
|
+
}
|
|
50
|
+
export function resolveLinxCloudRuntimeApiBaseUrl(url) {
|
|
51
|
+
return resolveLinxRuntimeApiBaseUrl(url, LINX_CLOUD_RUNTIME_API_BASE_URL);
|
|
52
|
+
}
|
|
53
|
+
export function resolveLinxCloudApiBaseUrl(url) {
|
|
54
|
+
return resolveLinxCloudAccountBaseUrl(url);
|
|
55
|
+
}
|
|
56
|
+
export function isLinxCloudIdentityBaseUrl(url) {
|
|
57
|
+
const normalized = resolveLinxBaseUrl(url, LINX_CLOUD_ACCOUNT_API_BASE_URL);
|
|
58
|
+
const hostname = resolveHostname(normalized);
|
|
59
|
+
return LINX_CLOUD_IDENTITY_HOSTS.includes(hostname);
|
|
60
|
+
}
|
|
61
|
+
export function resolveLinxRuntimeOriginForIssuerUrl(url) {
|
|
62
|
+
const normalized = trimTrailingSlash(resolveLinxBaseUrl(url, LINX_CLOUD_ACCOUNT_API_BASE_URL));
|
|
63
|
+
if (isLinxCloudIdentityBaseUrl(normalized)) {
|
|
64
|
+
return LINX_CLOUD_API_ORIGIN;
|
|
65
|
+
}
|
|
66
|
+
return normalized;
|
|
67
|
+
}
|
|
68
|
+
export function resolveLinxRuntimeApiBaseUrlForIssuerUrl(url) {
|
|
69
|
+
const runtimeOrigin = resolveLinxRuntimeOriginForIssuerUrl(url);
|
|
70
|
+
return resolveLinxRuntimeApiBaseUrl(runtimeOrigin, LINX_CLOUD_RUNTIME_API_BASE_URL);
|
|
71
|
+
}
|
|
72
|
+
export function resolveLinxPodUrl(webId) {
|
|
73
|
+
try {
|
|
74
|
+
const target = new URL(webId);
|
|
75
|
+
const pathParts = target.pathname.split('/').filter(Boolean);
|
|
76
|
+
return `${target.origin}/${pathParts[0] ?? ''}/`.replace(/\/+$/, '/');
|
|
77
|
+
}
|
|
78
|
+
catch {
|
|
79
|
+
return '';
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
export function resolveLinxPodBaseUrl(webId) {
|
|
83
|
+
return trimTrailingSlash(resolveLinxPodUrl(webId));
|
|
84
|
+
}
|
|
85
|
+
export function extractProfileUsernameFromWebId(webId) {
|
|
86
|
+
try {
|
|
87
|
+
const target = new URL(webId);
|
|
88
|
+
const pathParts = target.pathname.split('/').filter(Boolean).map((part) => decodeURIComponent(part));
|
|
89
|
+
const profileIndex = pathParts.indexOf('profile');
|
|
90
|
+
if (profileIndex > 0) {
|
|
91
|
+
return pathParts[profileIndex - 1];
|
|
92
|
+
}
|
|
93
|
+
const firstUserSegment = pathParts.find((part) => part !== 'profile' && part !== 'card');
|
|
94
|
+
if (firstUserSegment) {
|
|
95
|
+
return firstUserSegment;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
catch {
|
|
99
|
+
// Fall through to the unsigned-in fallback.
|
|
100
|
+
}
|
|
101
|
+
return 'there';
|
|
102
|
+
}
|
|
103
|
+
export function parseLinxClientConfig(raw) {
|
|
104
|
+
if (!isRecord(raw) || typeof raw.url !== 'string' || typeof raw.webId !== 'string') {
|
|
105
|
+
return null;
|
|
106
|
+
}
|
|
107
|
+
return {
|
|
108
|
+
url: raw.url,
|
|
109
|
+
webId: raw.webId,
|
|
110
|
+
authType: normalizeAuthType(raw.authType),
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
export function isLinxClientCredentialsSecrets(secrets) {
|
|
114
|
+
return 'clientId' in secrets && 'clientSecret' in secrets;
|
|
115
|
+
}
|
|
116
|
+
export function isLinxOidcOAuthSecrets(secrets) {
|
|
117
|
+
return 'oidcRefreshToken' in secrets && 'oidcAccessToken' in secrets && 'oidcExpiresAt' in secrets;
|
|
118
|
+
}
|
|
119
|
+
export function parseLinxClientSecrets(raw) {
|
|
120
|
+
if (!isRecord(raw)) {
|
|
121
|
+
return null;
|
|
122
|
+
}
|
|
123
|
+
if (typeof raw.clientId === 'string' && typeof raw.clientSecret === 'string') {
|
|
124
|
+
return {
|
|
125
|
+
clientId: raw.clientId,
|
|
126
|
+
clientSecret: raw.clientSecret,
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
if (typeof raw.oidcRefreshToken === 'string'
|
|
130
|
+
&& typeof raw.oidcAccessToken === 'string'
|
|
131
|
+
&& typeof raw.oidcExpiresAt === 'string') {
|
|
132
|
+
return {
|
|
133
|
+
oidcRefreshToken: raw.oidcRefreshToken,
|
|
134
|
+
oidcAccessToken: raw.oidcAccessToken,
|
|
135
|
+
oidcExpiresAt: raw.oidcExpiresAt,
|
|
136
|
+
oidcClientId: optionalString(raw.oidcClientId),
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
return null;
|
|
140
|
+
}
|
|
141
|
+
export function parseLinxAccountData(raw) {
|
|
142
|
+
if (!isRecord(raw)) {
|
|
143
|
+
return null;
|
|
144
|
+
}
|
|
145
|
+
const controls = isRecord(raw.controls) ? raw.controls : {};
|
|
146
|
+
const accountControls = isRecord(controls.account) ? controls.account : controls;
|
|
147
|
+
return {
|
|
148
|
+
controls: {
|
|
149
|
+
pod: optionalString(accountControls.pod),
|
|
150
|
+
clientCredentials: optionalString(accountControls.clientCredentials),
|
|
151
|
+
},
|
|
152
|
+
pods: parseStringRecord(raw.pods),
|
|
153
|
+
webIds: parseStringRecord(raw.webIds),
|
|
154
|
+
clientCredentials: parseStringRecord(raw.clientCredentials),
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
export function parseLinxClientCredential(raw) {
|
|
158
|
+
if (!isRecord(raw) || typeof raw.id !== 'string') {
|
|
159
|
+
return null;
|
|
160
|
+
}
|
|
161
|
+
return {
|
|
162
|
+
id: raw.id,
|
|
163
|
+
label: optionalString(raw.label),
|
|
164
|
+
secret: optionalString(raw.secret),
|
|
165
|
+
webId: optionalString(raw.webId),
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
export function parseAccountSession(raw) {
|
|
169
|
+
if (!isRecord(raw)
|
|
170
|
+
|| typeof raw.url !== 'string'
|
|
171
|
+
|| typeof raw.email !== 'string'
|
|
172
|
+
|| typeof raw.token !== 'string'
|
|
173
|
+
|| typeof raw.createdAt !== 'string') {
|
|
174
|
+
return null;
|
|
175
|
+
}
|
|
176
|
+
return {
|
|
177
|
+
url: raw.url,
|
|
178
|
+
email: raw.email,
|
|
179
|
+
token: raw.token,
|
|
180
|
+
webId: optionalString(raw.webId),
|
|
181
|
+
podUrl: optionalString(raw.podUrl),
|
|
182
|
+
createdAt: raw.createdAt,
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
export function selectLinxAccountWebId(account, preferredWebId) {
|
|
186
|
+
if (typeof preferredWebId === 'string' && preferredWebId.trim()) {
|
|
187
|
+
return preferredWebId.trim();
|
|
188
|
+
}
|
|
189
|
+
if (!account) {
|
|
190
|
+
return null;
|
|
191
|
+
}
|
|
192
|
+
return Object.keys(account.webIds)[0] ?? null;
|
|
193
|
+
}
|
|
194
|
+
export function resolveLinxAccountPodUrl(account, webId) {
|
|
195
|
+
if (!account) {
|
|
196
|
+
return null;
|
|
197
|
+
}
|
|
198
|
+
if (webId && account.webIds[webId]) {
|
|
199
|
+
return resolveLinxBaseUrl(account.webIds[webId], account.webIds[webId]);
|
|
200
|
+
}
|
|
201
|
+
const firstMappedPodUrl = Object.values(account.webIds)[0];
|
|
202
|
+
if (typeof firstMappedPodUrl === 'string' && firstMappedPodUrl.trim()) {
|
|
203
|
+
return resolveLinxBaseUrl(firstMappedPodUrl, firstMappedPodUrl);
|
|
204
|
+
}
|
|
205
|
+
if (account.controls.pod?.trim()) {
|
|
206
|
+
return resolveLinxBaseUrl(account.controls.pod, account.controls.pod);
|
|
207
|
+
}
|
|
208
|
+
const firstPodKey = Object.keys(account.pods)[0];
|
|
209
|
+
if (typeof firstPodKey === 'string' && firstPodKey.trim()) {
|
|
210
|
+
return resolveLinxBaseUrl(firstPodKey, firstPodKey);
|
|
211
|
+
}
|
|
212
|
+
return null;
|
|
213
|
+
}
|
|
214
|
+
export function hasMatchingLinxStoredCredentials(credentials, baseUrl, webId) {
|
|
215
|
+
return credentials?.url === baseUrl && credentials?.webId === webId;
|
|
216
|
+
}
|
|
217
|
+
export function resolveLinxCredentialBootstrapStatus(input) {
|
|
218
|
+
if (input.reusedExistingCredentials) {
|
|
219
|
+
return 'reused';
|
|
220
|
+
}
|
|
221
|
+
return input.hadMatchingStoredCredentials ? 'recreated' : 'created';
|
|
222
|
+
}
|
|
223
|
+
export function listLinxWhoAmIFields(session, options = {}) {
|
|
224
|
+
const fields = [
|
|
225
|
+
{ key: 'email', value: session.email },
|
|
226
|
+
{ key: 'server', value: session.url },
|
|
227
|
+
];
|
|
228
|
+
if (session.webId) {
|
|
229
|
+
fields.push({ key: 'webId', value: session.webId });
|
|
230
|
+
}
|
|
231
|
+
if (options.verbose && session.podUrl) {
|
|
232
|
+
fields.push({ key: 'pod', value: session.podUrl });
|
|
233
|
+
}
|
|
234
|
+
fields.push({ key: 'session-created-at', value: session.createdAt });
|
|
235
|
+
return fields;
|
|
236
|
+
}
|
|
237
|
+
export async function performLinxPasswordLogin(input, deps) {
|
|
238
|
+
const baseUrl = resolveLinxBaseUrl(input.baseUrl, input.fallbackBaseUrl);
|
|
239
|
+
if (!(await deps.checkServer(baseUrl))) {
|
|
240
|
+
throw new Error(`Cannot reach server at ${baseUrl}`);
|
|
241
|
+
}
|
|
242
|
+
const token = await deps.login(input.email, input.password, baseUrl);
|
|
243
|
+
if (!token) {
|
|
244
|
+
throw new Error('Login failed.');
|
|
245
|
+
}
|
|
246
|
+
const account = await deps.getAccountData(token, baseUrl);
|
|
247
|
+
if (!account) {
|
|
248
|
+
throw new Error('Failed to load account data after login.');
|
|
249
|
+
}
|
|
250
|
+
const webId = selectLinxAccountWebId(account, input.requestedWebId);
|
|
251
|
+
if (!webId) {
|
|
252
|
+
throw new Error('No WebID found. Pass --web-id explicitly.');
|
|
253
|
+
}
|
|
254
|
+
const hadMatchingStoredCredentials = hasMatchingLinxStoredCredentials(input.existingCredentials, baseUrl, webId);
|
|
255
|
+
const existingCredentialsValid = hadMatchingStoredCredentials && input.existingCredentials?.authType === 'client_credentials'
|
|
256
|
+
? await deps.validateClientCredentials?.(input.existingCredentials)
|
|
257
|
+
: false;
|
|
258
|
+
const reusedExistingCredentials = hadMatchingStoredCredentials
|
|
259
|
+
&& input.existingCredentials?.authType === 'client_credentials'
|
|
260
|
+
&& existingCredentialsValid === true;
|
|
261
|
+
const credentialStatus = resolveLinxCredentialBootstrapStatus({
|
|
262
|
+
reusedExistingCredentials,
|
|
263
|
+
hadMatchingStoredCredentials,
|
|
264
|
+
});
|
|
265
|
+
let credentialsToSave;
|
|
266
|
+
if (!reusedExistingCredentials) {
|
|
267
|
+
if (!account.controls.clientCredentials) {
|
|
268
|
+
throw new Error('Cannot find client credentials endpoint.');
|
|
269
|
+
}
|
|
270
|
+
const credential = await deps.createClientCredentials(token, account.controls.clientCredentials, webId, input.credentialName ?? undefined);
|
|
271
|
+
if (!credential?.id || !credential.secret) {
|
|
272
|
+
throw new Error('Failed to create local client credentials.');
|
|
273
|
+
}
|
|
274
|
+
credentialsToSave = {
|
|
275
|
+
url: baseUrl,
|
|
276
|
+
webId,
|
|
277
|
+
authType: 'client_credentials',
|
|
278
|
+
secrets: {
|
|
279
|
+
clientId: credential.id,
|
|
280
|
+
clientSecret: credential.secret,
|
|
281
|
+
},
|
|
282
|
+
};
|
|
283
|
+
}
|
|
284
|
+
return {
|
|
285
|
+
baseUrl,
|
|
286
|
+
webId,
|
|
287
|
+
account,
|
|
288
|
+
credentialStatus,
|
|
289
|
+
...(credentialsToSave ? { credentialsToSave } : {}),
|
|
290
|
+
session: {
|
|
291
|
+
url: baseUrl,
|
|
292
|
+
email: input.email,
|
|
293
|
+
token,
|
|
294
|
+
webId,
|
|
295
|
+
podUrl: resolveLinxAccountPodUrl(account, webId) ?? resolveLinxPodUrl(webId),
|
|
296
|
+
createdAt: (input.now ?? new Date()).toISOString(),
|
|
297
|
+
},
|
|
298
|
+
};
|
|
299
|
+
}
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
export declare const contactRepository: import("./repository
|
|
2
|
-
id: import("@undefineds.co/
|
|
3
|
-
name: import("@undefineds.co/
|
|
4
|
-
avatarUrl: import("@undefineds.co/
|
|
5
|
-
entityUri: import("@undefineds.co/
|
|
6
|
-
rdfType: import("@undefineds.co/
|
|
7
|
-
contactType: import("@undefineds.co/
|
|
8
|
-
isPublic: import("@undefineds.co/
|
|
9
|
-
externalPlatform: import("@undefineds.co/
|
|
10
|
-
externalId: import("@undefineds.co/
|
|
11
|
-
alias: import("@undefineds.co/
|
|
12
|
-
starred: import("@undefineds.co/
|
|
13
|
-
note: import("@undefineds.co/
|
|
14
|
-
sortKey: import("@undefineds.co/
|
|
15
|
-
gender: import("@undefineds.co/
|
|
16
|
-
province: import("@undefineds.co/
|
|
17
|
-
city: import("@undefineds.co/
|
|
18
|
-
createdAt: import("@undefineds.co/
|
|
19
|
-
updatedAt: import("@undefineds.co/
|
|
20
|
-
deletedAt: import("@undefineds.co/
|
|
21
|
-
lastSyncedAt: import("@undefineds.co/
|
|
1
|
+
export declare const contactRepository: import("./repository").PodRepositoryDescriptor<import("@undefineds.co/drizzle-solid/dist/core/schema").PodTableWithColumns<import("@undefineds.co/drizzle-solid/dist/core/schema").ResolvedColumns<{
|
|
2
|
+
id: import("@undefineds.co/drizzle-solid/dist/core/schema").PodStringColumn<false, false>;
|
|
3
|
+
name: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, true, false>;
|
|
4
|
+
avatarUrl: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"uri", null, false, false>;
|
|
5
|
+
entityUri: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"uri", null, true, false>;
|
|
6
|
+
rdfType: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"uri", null, true, true>;
|
|
7
|
+
contactType: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, true, false>;
|
|
8
|
+
isPublic: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"boolean", null, false, true>;
|
|
9
|
+
externalPlatform: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, false, false>;
|
|
10
|
+
externalId: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, false, false>;
|
|
11
|
+
alias: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, false, false>;
|
|
12
|
+
starred: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"boolean", null, false, true>;
|
|
13
|
+
note: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, false, false>;
|
|
14
|
+
sortKey: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, false, false>;
|
|
15
|
+
gender: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, false, false>;
|
|
16
|
+
province: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, false, false>;
|
|
17
|
+
city: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, false, false>;
|
|
18
|
+
createdAt: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"datetime", null, true, true>;
|
|
19
|
+
updatedAt: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"datetime", null, true, true>;
|
|
20
|
+
deletedAt: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"datetime", null, false, false>;
|
|
21
|
+
lastSyncedAt: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"datetime", null, false, false>;
|
|
22
22
|
}>>, {
|
|
23
23
|
id: string;
|
|
24
24
|
name: string;
|
package/dist/contact.schema.d.ts
CHANGED
|
@@ -1 +1,48 @@
|
|
|
1
|
-
export
|
|
1
|
+
export declare const ContactType: {
|
|
2
|
+
readonly SOLID: "solid";
|
|
3
|
+
readonly EXTERNAL: "external";
|
|
4
|
+
readonly AGENT: "agent";
|
|
5
|
+
readonly GROUP: "group";
|
|
6
|
+
};
|
|
7
|
+
export type ContactTypeValue = typeof ContactType[keyof typeof ContactType];
|
|
8
|
+
export declare const ContactClass: {
|
|
9
|
+
readonly PERSON: string;
|
|
10
|
+
readonly AGENT: string;
|
|
11
|
+
readonly GROUP: string;
|
|
12
|
+
};
|
|
13
|
+
export type ContactClassValue = typeof ContactClass[keyof typeof ContactClass];
|
|
14
|
+
type ContactClassifier = {
|
|
15
|
+
rdfType?: string | null;
|
|
16
|
+
contactType?: string | null;
|
|
17
|
+
};
|
|
18
|
+
export declare function isGroupContact(contact: ContactClassifier | null | undefined): boolean;
|
|
19
|
+
export declare function isAgentContact(contact: ContactClassifier | null | undefined): boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Contact Table - Unified contact index for all contact types.
|
|
22
|
+
*/
|
|
23
|
+
export declare const contactTable: import("@undefineds.co/drizzle-solid/dist/core/schema").PodTableWithColumns<import("@undefineds.co/drizzle-solid/dist/core/schema").ResolvedColumns<{
|
|
24
|
+
id: import("@undefineds.co/drizzle-solid/dist/core/schema").PodStringColumn<false, false>;
|
|
25
|
+
name: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, true, false>;
|
|
26
|
+
avatarUrl: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"uri", null, false, false>;
|
|
27
|
+
entityUri: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"uri", null, true, false>;
|
|
28
|
+
rdfType: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"uri", null, true, true>;
|
|
29
|
+
contactType: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, true, false>;
|
|
30
|
+
isPublic: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"boolean", null, false, true>;
|
|
31
|
+
externalPlatform: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, false, false>;
|
|
32
|
+
externalId: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, false, false>;
|
|
33
|
+
alias: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, false, false>;
|
|
34
|
+
starred: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"boolean", null, false, true>;
|
|
35
|
+
note: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, false, false>;
|
|
36
|
+
sortKey: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, false, false>;
|
|
37
|
+
gender: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, false, false>;
|
|
38
|
+
province: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, false, false>;
|
|
39
|
+
city: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, false, false>;
|
|
40
|
+
createdAt: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"datetime", null, true, true>;
|
|
41
|
+
updatedAt: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"datetime", null, true, true>;
|
|
42
|
+
deletedAt: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"datetime", null, false, false>;
|
|
43
|
+
lastSyncedAt: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"datetime", null, false, false>;
|
|
44
|
+
}>>;
|
|
45
|
+
export type ContactRow = typeof contactTable.$inferSelect;
|
|
46
|
+
export type ContactInsert = typeof contactTable.$inferInsert;
|
|
47
|
+
export type ContactUpdate = typeof contactTable.$inferUpdate;
|
|
48
|
+
export {};
|