@undefineds.co/models 0.2.19 → 0.2.21
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 +17 -16
- package/dist/agent.repository.js +2 -2
- package/dist/agent.schema.d.ts +20 -3
- package/dist/agent.schema.js +3 -1
- package/dist/ai-model.schema.d.ts +13 -3
- package/dist/ai-model.schema.js +5 -3
- package/dist/ai-provider.schema.d.ts +13 -3
- package/dist/ai-provider.schema.js +5 -1
- package/dist/ai-runtime.schema.d.ts +84 -0
- package/dist/ai-runtime.schema.js +64 -0
- package/dist/chat.repository.js +2 -2
- package/dist/contact.repository.js +2 -2
- package/dist/contact.schema.d.ts +26 -4
- package/dist/contact.schema.js +4 -2
- package/dist/credential.schema.d.ts +105 -3
- package/dist/credential.schema.js +13 -1
- package/dist/favorite/favorite.schema.d.ts +18 -4
- package/dist/favorite/favorite.schema.js +4 -2
- package/dist/favorite/index.d.ts +1 -1
- package/dist/favorite/index.js +1 -1
- package/dist/favorite/starred-sync.d.ts +2 -2
- package/dist/favorite/starred-sync.js +4 -4
- package/dist/file/file.schema.d.ts +26 -5
- package/dist/file/file.schema.js +5 -3
- package/dist/file/index.d.ts +1 -1
- package/dist/file/index.js +1 -1
- package/dist/inbox-notification.schema.d.ts +10 -3
- package/dist/inbox-notification.schema.js +3 -1
- package/dist/index.d.ts +11 -10
- package/dist/index.js +11 -10
- package/dist/message.repository.js +2 -2
- package/dist/namespaces.js +31 -0
- package/dist/profile.d.ts +2 -1
- package/dist/profile.js +6 -3
- package/dist/profile.repository.js +3 -3
- package/dist/profile.schema.d.ts +16 -3
- package/dist/profile.schema.js +3 -1
- package/dist/repository.d.ts +6 -1
- package/dist/repository.js +6 -1
- package/dist/schema.d.ts +98 -10
- package/dist/schema.js +31 -21
- package/dist/session/session.schema.d.ts +1 -1
- package/dist/session/session.schema.js +1 -1
- package/dist/session.repository.js +2 -2
- package/dist/settings/index.d.ts +1 -1
- package/dist/settings/index.js +1 -1
- package/dist/settings/settings.schema.d.ts +17 -5
- package/dist/settings/settings.schema.js +4 -2
- package/dist/thread.repository.js +2 -2
- package/package.json +14 -3
|
@@ -1,19 +1,31 @@
|
|
|
1
1
|
import { id, integer, podTable, string, timestamp, uri } from "@undefineds.co/drizzle-solid";
|
|
2
2
|
import { XPOD_CREDENTIAL } from "./namespaces.js";
|
|
3
|
-
export const
|
|
3
|
+
export const credentialResource = podTable("credential", {
|
|
4
4
|
id: id("id"),
|
|
5
5
|
provider: uri("provider").predicate(XPOD_CREDENTIAL.provider).link("aiProvider"),
|
|
6
6
|
service: string("service").predicate(XPOD_CREDENTIAL.service).notNull().default("ai"),
|
|
7
7
|
status: string("status").predicate(XPOD_CREDENTIAL.status).notNull().default("active"),
|
|
8
8
|
apiKey: string("apiKey").predicate(XPOD_CREDENTIAL.apiKey),
|
|
9
9
|
baseUrl: string("baseUrl").predicate(XPOD_CREDENTIAL.baseUrl),
|
|
10
|
+
proxyUrl: string("proxyUrl").predicate(XPOD_CREDENTIAL.proxyUrl),
|
|
10
11
|
label: string("label").predicate(XPOD_CREDENTIAL.label),
|
|
11
12
|
lastUsedAt: timestamp("lastUsedAt").predicate(XPOD_CREDENTIAL.lastUsedAt),
|
|
12
13
|
failCount: integer("failCount").predicate(XPOD_CREDENTIAL.failCount).default(0),
|
|
13
14
|
rateLimitResetAt: timestamp("rateLimitResetAt").predicate(XPOD_CREDENTIAL.rateLimitResetAt),
|
|
15
|
+
oauthRefreshToken: string("oauthRefreshToken").predicate(XPOD_CREDENTIAL.oauthRefreshToken),
|
|
16
|
+
oauthAccessToken: string("oauthAccessToken").predicate(XPOD_CREDENTIAL.oauthAccessToken),
|
|
17
|
+
oauthExpiresAt: timestamp("oauthExpiresAt").predicate(XPOD_CREDENTIAL.oauthExpiresAt),
|
|
18
|
+
projectId: string("projectId").predicate(XPOD_CREDENTIAL.projectId),
|
|
19
|
+
organizationId: string("organizationId").predicate(XPOD_CREDENTIAL.organizationId),
|
|
14
20
|
}, {
|
|
15
21
|
base: "/settings/credentials.ttl",
|
|
16
22
|
type: XPOD_CREDENTIAL.Credential,
|
|
17
23
|
namespace: XPOD_CREDENTIAL,
|
|
18
24
|
subjectTemplate: "#{id}",
|
|
19
25
|
});
|
|
26
|
+
// Compatibility aliases. New model code should prefer `credentialResource`.
|
|
27
|
+
export const credentialTable = credentialResource;
|
|
28
|
+
export const apiKeyCredentialResource = credentialResource;
|
|
29
|
+
export const apiKeyCredentialTable = credentialResource;
|
|
30
|
+
export const oauthCredentialResource = credentialResource;
|
|
31
|
+
export const oauthCredentialTable = credentialResource;
|
|
@@ -1,10 +1,24 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Favorite
|
|
2
|
+
* Favorite resource
|
|
3
3
|
* 收藏项 - 基于 Solid Pod 存储
|
|
4
4
|
*
|
|
5
5
|
* 支持收藏:Chat, Thread, Contact, Message 等
|
|
6
6
|
* favoriteType 使用 RDF type URI 标识实体类型
|
|
7
7
|
*/
|
|
8
|
+
export declare const favoriteResource: import("@undefineds.co/drizzle-solid/dist/core/schema").PodTableWithColumns<import("@undefineds.co/drizzle-solid/dist/core/schema").ResolvedColumns<{
|
|
9
|
+
id: import("@undefineds.co/drizzle-solid/dist/core/schema").PodStringColumn<false, false>;
|
|
10
|
+
targetType: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"uri", null, true, false>;
|
|
11
|
+
targetUri: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"uri", null, true, false>;
|
|
12
|
+
title: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, true, false>;
|
|
13
|
+
snapshotContent: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, false, false>;
|
|
14
|
+
snapshotAuthor: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, false, false>;
|
|
15
|
+
sourceModule: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, false, false>;
|
|
16
|
+
sourceId: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, false, false>;
|
|
17
|
+
searchText: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, false, false>;
|
|
18
|
+
snapshotMeta: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, false, false>;
|
|
19
|
+
favoredAt: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"datetime", null, true, true>;
|
|
20
|
+
updatedAt: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"datetime", null, false, false>;
|
|
21
|
+
}>>;
|
|
8
22
|
export declare const favoriteTable: import("@undefineds.co/drizzle-solid/dist/core/schema").PodTableWithColumns<import("@undefineds.co/drizzle-solid/dist/core/schema").ResolvedColumns<{
|
|
9
23
|
id: import("@undefineds.co/drizzle-solid/dist/core/schema").PodStringColumn<false, false>;
|
|
10
24
|
targetType: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"uri", null, true, false>;
|
|
@@ -19,6 +33,6 @@ export declare const favoriteTable: import("@undefineds.co/drizzle-solid/dist/co
|
|
|
19
33
|
favoredAt: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"datetime", null, true, true>;
|
|
20
34
|
updatedAt: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"datetime", null, false, false>;
|
|
21
35
|
}>>;
|
|
22
|
-
export type FavoriteRow = typeof
|
|
23
|
-
export type FavoriteInsert = typeof
|
|
24
|
-
export type FavoriteUpdate = typeof
|
|
36
|
+
export type FavoriteRow = typeof favoriteResource.$inferSelect;
|
|
37
|
+
export type FavoriteInsert = typeof favoriteResource.$inferInsert;
|
|
38
|
+
export type FavoriteUpdate = typeof favoriteResource.$inferUpdate;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { podTable, string, timestamp, text, id, uri } from "@undefineds.co/drizzle-solid";
|
|
2
2
|
import { UDFS, DCTerms, SCHEMA, RDF } from "../namespaces.js";
|
|
3
3
|
/**
|
|
4
|
-
* Favorite
|
|
4
|
+
* Favorite resource
|
|
5
5
|
* 收藏项 - 基于 Solid Pod 存储
|
|
6
6
|
*
|
|
7
7
|
* 支持收藏:Chat, Thread, Contact, Message 等
|
|
8
8
|
* favoriteType 使用 RDF type URI 标识实体类型
|
|
9
9
|
*/
|
|
10
|
-
export const
|
|
10
|
+
export const favoriteResource = podTable("favorite", {
|
|
11
11
|
id: id("id"),
|
|
12
12
|
// 收藏目标
|
|
13
13
|
targetType: uri("targetType").predicate(RDF.type).notNull(), // RDF type URI (e.g., MEETING.LongChat)
|
|
@@ -32,3 +32,5 @@ export const favoriteTable = podTable("favorite", {
|
|
|
32
32
|
type: SCHEMA.CreativeWork,
|
|
33
33
|
namespace: UDFS,
|
|
34
34
|
});
|
|
35
|
+
// Compatibility alias. New model code should prefer `favoriteResource`.
|
|
36
|
+
export const favoriteTable = favoriteResource;
|
package/dist/favorite/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { favoriteTable, type FavoriteRow, type FavoriteInsert, type FavoriteUpdate } from "./favorite.schema";
|
|
1
|
+
export { favoriteResource, favoriteTable, type FavoriteRow, type FavoriteInsert, type FavoriteUpdate } from "./favorite.schema";
|
|
2
2
|
export { createStarredSyncHook, registerDbForStarredSync, chatStarredSyncHook, threadStarredSyncHook, contactStarredSyncHook, chatSnapshotExtractor, threadSnapshotExtractor, contactSnapshotExtractor, type SnapshotExtractor, type StarredSyncConfig, type SourceModule, } from "./starred-sync";
|
package/dist/favorite/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Starred Sync Hook
|
|
3
3
|
*
|
|
4
|
-
* 当实体的 starred 字段变更时,自动同步到
|
|
4
|
+
* 当实体的 starred 字段变更时,自动同步到 favoriteResource:
|
|
5
5
|
* - starred: true → 创建 Favorite 记录
|
|
6
6
|
* - starred: false → 删除 Favorite 记录
|
|
7
7
|
*
|
|
@@ -37,7 +37,7 @@ export interface StarredSyncConfig<T = Record<string, unknown>> {
|
|
|
37
37
|
* 创建 starred 同步 hook
|
|
38
38
|
*
|
|
39
39
|
* @example
|
|
40
|
-
* const
|
|
40
|
+
* const chatResource = podTable('chats', columns, {
|
|
41
41
|
* hooks: createStarredSyncHook({
|
|
42
42
|
* rdfType: MEETING.LongChat,
|
|
43
43
|
* extractor: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { favoriteResource } from './favorite.schema.js';
|
|
2
2
|
import { MEETING, SIOC } from '../namespaces.js';
|
|
3
3
|
import { VCARD } from '@inrupt/vocab-common-rdf';
|
|
4
4
|
// ============================================================================
|
|
@@ -34,7 +34,7 @@ async function createFavorite(_ctx, config, record) {
|
|
|
34
34
|
try {
|
|
35
35
|
const db = getDbInstance();
|
|
36
36
|
if (db) {
|
|
37
|
-
await db.insert(
|
|
37
|
+
await db.insert(favoriteResource).values(favoriteData).execute();
|
|
38
38
|
console.log(`[StarredSync] Created favorite: ${rdfType} → ${targetUri}`);
|
|
39
39
|
}
|
|
40
40
|
else {
|
|
@@ -54,7 +54,7 @@ async function deleteFavorite(_ctx, targetUri) {
|
|
|
54
54
|
try {
|
|
55
55
|
const db = getDbInstance();
|
|
56
56
|
if (db) {
|
|
57
|
-
await db.delete(
|
|
57
|
+
await db.delete(favoriteResource)
|
|
58
58
|
.where({ targetUri })
|
|
59
59
|
.execute();
|
|
60
60
|
console.log(`[StarredSync] Deleted favorite: ${targetUri}`);
|
|
@@ -71,7 +71,7 @@ async function deleteFavorite(_ctx, targetUri) {
|
|
|
71
71
|
* 创建 starred 同步 hook
|
|
72
72
|
*
|
|
73
73
|
* @example
|
|
74
|
-
* const
|
|
74
|
+
* const chatResource = podTable('chats', columns, {
|
|
75
75
|
* hooks: createStarredSyncHook({
|
|
76
76
|
* rdfType: MEETING.LongChat,
|
|
77
77
|
* extractor: {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* 标签、索引等元数据功能由 xpod sidecar 提供。
|
|
4
4
|
* 此 schema 将在未来版本中移除。
|
|
5
5
|
*
|
|
6
|
-
* File
|
|
6
|
+
* File resource
|
|
7
7
|
* 文件管理模型 - 基于 Solid Pod 存储
|
|
8
8
|
*
|
|
9
9
|
* 参考标准:
|
|
@@ -11,8 +11,29 @@
|
|
|
11
11
|
* - Schema.org CreativeWork
|
|
12
12
|
* - LDP NonRDFSource (实际文件)
|
|
13
13
|
*
|
|
14
|
-
*
|
|
14
|
+
* 注意:此 resource 存储文件元数据,实际文件内容存储在 Pod 的文件系统中
|
|
15
15
|
*/
|
|
16
|
+
export declare const fileResource: import("@undefineds.co/drizzle-solid/dist/core/schema").PodTableWithColumns<import("@undefineds.co/drizzle-solid/dist/core/schema").ResolvedColumns<{
|
|
17
|
+
id: import("@undefineds.co/drizzle-solid/dist/core/schema").PodStringColumn<false, false>;
|
|
18
|
+
name: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, true, false>;
|
|
19
|
+
description: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, false, false>;
|
|
20
|
+
mimeType: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, true, false>;
|
|
21
|
+
size: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"integer", null, true, false>;
|
|
22
|
+
hash: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, false, false>;
|
|
23
|
+
podUri: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, true, false>;
|
|
24
|
+
localPath: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, false, false>;
|
|
25
|
+
syncStatus: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, true, true>;
|
|
26
|
+
lastSyncedAt: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"datetime", null, false, false>;
|
|
27
|
+
owner: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, true, false>;
|
|
28
|
+
sharedWith: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, false, false>;
|
|
29
|
+
folder: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, false, false>;
|
|
30
|
+
tags: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, false, false>;
|
|
31
|
+
createdAt: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"datetime", null, true, true>;
|
|
32
|
+
modifiedAt: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"datetime", null, true, true>;
|
|
33
|
+
deletedAt: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"datetime", null, false, false>;
|
|
34
|
+
starred: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"boolean", null, false, true>;
|
|
35
|
+
pinnedAt: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"datetime", null, false, false>;
|
|
36
|
+
}>>;
|
|
16
37
|
export declare const fileTable: import("@undefineds.co/drizzle-solid/dist/core/schema").PodTableWithColumns<import("@undefineds.co/drizzle-solid/dist/core/schema").ResolvedColumns<{
|
|
17
38
|
id: import("@undefineds.co/drizzle-solid/dist/core/schema").PodStringColumn<false, false>;
|
|
18
39
|
name: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, true, false>;
|
|
@@ -34,6 +55,6 @@ export declare const fileTable: import("@undefineds.co/drizzle-solid/dist/core/s
|
|
|
34
55
|
starred: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"boolean", null, false, true>;
|
|
35
56
|
pinnedAt: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"datetime", null, false, false>;
|
|
36
57
|
}>>;
|
|
37
|
-
export type FileRow = typeof
|
|
38
|
-
export type FileInsert = typeof
|
|
39
|
-
export type FileUpdate = typeof
|
|
58
|
+
export type FileRow = typeof fileResource.$inferSelect;
|
|
59
|
+
export type FileInsert = typeof fileResource.$inferInsert;
|
|
60
|
+
export type FileUpdate = typeof fileResource.$inferUpdate;
|
package/dist/file/file.schema.js
CHANGED
|
@@ -5,7 +5,7 @@ import { UDFS, DCTerms, SCHEMA } from "../namespaces.js";
|
|
|
5
5
|
* 标签、索引等元数据功能由 xpod sidecar 提供。
|
|
6
6
|
* 此 schema 将在未来版本中移除。
|
|
7
7
|
*
|
|
8
|
-
* File
|
|
8
|
+
* File resource
|
|
9
9
|
* 文件管理模型 - 基于 Solid Pod 存储
|
|
10
10
|
*
|
|
11
11
|
* 参考标准:
|
|
@@ -13,9 +13,9 @@ import { UDFS, DCTerms, SCHEMA } from "../namespaces.js";
|
|
|
13
13
|
* - Schema.org CreativeWork
|
|
14
14
|
* - LDP NonRDFSource (实际文件)
|
|
15
15
|
*
|
|
16
|
-
*
|
|
16
|
+
* 注意:此 resource 存储文件元数据,实际文件内容存储在 Pod 的文件系统中
|
|
17
17
|
*/
|
|
18
|
-
export const
|
|
18
|
+
export const fileResource = podTable("file", {
|
|
19
19
|
// 基础信息
|
|
20
20
|
id: id("id"),
|
|
21
21
|
name: string("name").predicate(SCHEMA.name).notNull(), // 文件名
|
|
@@ -49,3 +49,5 @@ export const fileTable = podTable("file", {
|
|
|
49
49
|
type: SCHEMA.MediaObject,
|
|
50
50
|
namespace: UDFS,
|
|
51
51
|
});
|
|
52
|
+
// Compatibility alias. New model code should prefer `fileResource`.
|
|
53
|
+
export const fileTable = fileResource;
|
package/dist/file/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { fileTable, type FileRow, type FileInsert, type FileUpdate } from "./file.schema";
|
|
1
|
+
export { fileResource, fileTable, type FileRow, type FileInsert, type FileUpdate } from "./file.schema";
|
package/dist/file/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { fileTable } from "./file.schema.js";
|
|
1
|
+
export { fileResource, fileTable } from "./file.schema.js";
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
export declare const inboxNotificationResource: 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
|
+
rdfType: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"array", "uri", true, true>;
|
|
4
|
+
actor: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"uri", null, false, false>;
|
|
5
|
+
object: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"uri", null, true, false>;
|
|
6
|
+
createdAt: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"datetime", null, true, true>;
|
|
7
|
+
}>>;
|
|
1
8
|
export declare const inboxNotificationTable: import("@undefineds.co/drizzle-solid/dist/core/schema").PodTableWithColumns<import("@undefineds.co/drizzle-solid/dist/core/schema").ResolvedColumns<{
|
|
2
9
|
id: import("@undefineds.co/drizzle-solid/dist/core/schema").PodStringColumn<false, false>;
|
|
3
10
|
rdfType: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"array", "uri", true, true>;
|
|
@@ -5,6 +12,6 @@ export declare const inboxNotificationTable: import("@undefineds.co/drizzle-soli
|
|
|
5
12
|
object: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"uri", null, true, false>;
|
|
6
13
|
createdAt: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"datetime", null, true, true>;
|
|
7
14
|
}>>;
|
|
8
|
-
export type InboxNotificationRow = typeof
|
|
9
|
-
export type InboxNotificationInsert = typeof
|
|
10
|
-
export type InboxNotificationUpdate = typeof
|
|
15
|
+
export type InboxNotificationRow = typeof inboxNotificationResource.$inferSelect;
|
|
16
|
+
export type InboxNotificationInsert = typeof inboxNotificationResource.$inferInsert;
|
|
17
|
+
export type InboxNotificationUpdate = typeof inboxNotificationResource.$inferUpdate;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { podTable, uri, timestamp, id } from '@undefineds.co/drizzle-solid';
|
|
2
2
|
import { AS, DCTerms, RDF } from './namespaces.js';
|
|
3
3
|
// Solid inbox notifications (protocol channel)
|
|
4
|
-
export const
|
|
4
|
+
export const inboxNotificationResource = podTable('inbox_notification', {
|
|
5
5
|
id: id('id'),
|
|
6
6
|
// Protocol inbox messages are not always Announce. Keep rdf:type writable so
|
|
7
7
|
// app notifications can use as:Announce while other Solid inbox payloads keep their own type.
|
|
@@ -17,3 +17,5 @@ export const inboxNotificationTable = podTable('inbox_notification', {
|
|
|
17
17
|
namespace: AS,
|
|
18
18
|
subjectTemplate: '{id}.ttl',
|
|
19
19
|
});
|
|
20
|
+
// Compatibility alias. New model code should prefer `inboxNotificationResource`.
|
|
21
|
+
export const inboxNotificationTable = inboxNotificationResource;
|
package/dist/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export * from "./vocab";
|
|
|
3
3
|
export * from './profile';
|
|
4
4
|
export * from './profile.repository';
|
|
5
5
|
export * from './profile.schema';
|
|
6
|
-
export { ContactGender, contactTable, ContactClass, ContactType, isAgentContact, isGroupContact, normalizeContactGender, type ContactRow, type ContactInsert, type ContactUpdate, type ContactClassValue, type ContactGenderValue, type ContactTypeValue, } from './contact.schema';
|
|
6
|
+
export { ContactGender, contactResource, contactTable, ContactClass, ContactType, isAgentContact, isGroupContact, normalizeContactGender, type ContactRow, type ContactInsert, type ContactUpdate, type ContactClassValue, type ContactGenderValue, type ContactTypeValue, } from './contact.schema';
|
|
7
7
|
export { contactRepository } from './contact.repository';
|
|
8
8
|
export { chatResource, chatTable, type ChatMetadata, type ChatMemberRole, type ChatRow, type ChatInsert, type ChatUpdate, } from './chat.schema';
|
|
9
9
|
export { chatRepository } from './chat.repository';
|
|
@@ -15,10 +15,10 @@ export { messageRepository } from './message.repository';
|
|
|
15
15
|
export { MessageBlockType, MessageBlockStatus, type BaseMessageBlock, type PlaceholderMessageBlock, type MainTextMessageBlock, type ThinkingMessageBlock, type ImageMessageBlock, type CodeMessageBlock, type ToolMessageBlock, type FileMessageBlock, type ErrorMessageBlock, type CitationMessageBlock, type MessageBlock, type MessageRichContent, createMessageBlock, isBlockType, parseMessageBlocks, serializeMessageBlocks, } from './types/message-block';
|
|
16
16
|
export { type ToolApprovalBlock, type ToolCallBlock, type TaskProgressBlock, type CollaborationRichBlock, type ToolRisk, type ToolApprovalStatus, type ToolCallStatus, type TaskProgressStepStatus, } from "./types/collaboration-blocks";
|
|
17
17
|
export * from "./fixtures/contracts-chat-contact";
|
|
18
|
-
export { fileTable, type FileRow, type FileInsert, type FileUpdate, } from './file';
|
|
19
|
-
export { favoriteTable, type FavoriteRow, type FavoriteInsert, type FavoriteUpdate, createStarredSyncHook, registerDbForStarredSync, chatStarredSyncHook, threadStarredSyncHook, contactStarredSyncHook, chatSnapshotExtractor, threadSnapshotExtractor, contactSnapshotExtractor, type SnapshotExtractor, type StarredSyncConfig, type SourceModule, } from './favorite';
|
|
20
|
-
export { settingsTable, SETTING_KEYS, type SettingKey, type SettingsRow, type SettingsInsert, type SettingsUpdate, } from './settings';
|
|
21
|
-
export { agentTable, type AgentRow, type AgentInsert, type AgentUpdate, } from './agent.schema';
|
|
18
|
+
export { fileResource, fileTable, type FileRow, type FileInsert, type FileUpdate, } from './file';
|
|
19
|
+
export { favoriteResource, favoriteTable, type FavoriteRow, type FavoriteInsert, type FavoriteUpdate, createStarredSyncHook, registerDbForStarredSync, chatStarredSyncHook, threadStarredSyncHook, contactStarredSyncHook, chatSnapshotExtractor, threadSnapshotExtractor, contactSnapshotExtractor, type SnapshotExtractor, type StarredSyncConfig, type SourceModule, } from './favorite';
|
|
20
|
+
export { settingsResource, settingsTable, SETTING_KEYS, type SettingKey, type SettingsRow, type SettingsInsert, type SettingsUpdate, } from './settings';
|
|
21
|
+
export { agentResource, agentTable, type AgentRow, type AgentInsert, type AgentUpdate, } from './agent.schema';
|
|
22
22
|
export { agentRepository } from './agent.repository';
|
|
23
23
|
export { DEFAULT_AGENT_PROVIDERS, type AgentProviderMetadata, type AgentModelOption, } from './agent.providers';
|
|
24
24
|
export { sessionResource, sessionTable, buildRuntimeSessionIri, extractRuntimeSessionId, type SessionType, type SessionStatus, type SessionRow, type SessionInsert, type SessionUpdate, } from './session';
|
|
@@ -27,19 +27,20 @@ export { approvalResource, approvalTable, extractApprovalIdFromApprovalRef, type
|
|
|
27
27
|
export { auditResource, auditTable, extractAuditIdFromAuditRef, type AuditRow, type AuditInsert, type AuditUpdate, } from './audit.schema';
|
|
28
28
|
export { buildAuditDetailRecord, buildAuditPresentation, createResolvedAuthTimestampsIndex, formatAuditActorRole, formatInboxStatusLabel, type AuditPresentation, } from './audit.presentation';
|
|
29
29
|
export { grantResource, grantTable, type GrantRow, type GrantInsert, type GrantUpdate, } from './grant.schema';
|
|
30
|
-
export { inboxNotificationTable, type InboxNotificationRow, type InboxNotificationInsert, type InboxNotificationUpdate, } from './inbox-notification.schema';
|
|
30
|
+
export { inboxNotificationResource, inboxNotificationTable, type InboxNotificationRow, type InboxNotificationInsert, type InboxNotificationUpdate, } from './inbox-notification.schema';
|
|
31
31
|
export { ApprovalVocab, AuditVocab, GrantVocab, InboxNotificationVocab } from './vocab/sidecar.vocab';
|
|
32
32
|
export * from './sidecar/sidecar-events';
|
|
33
33
|
export * from './sidecar/persistence-mapping';
|
|
34
34
|
export { knowledgeFolderSchema, type KnowledgeFolderScope } from './knowledge';
|
|
35
35
|
export { extensionSchema } from './extension';
|
|
36
|
-
export { credentialTable, type CredentialRow, type CredentialInsert, type CredentialUpdate, } from "./credential.schema";
|
|
37
|
-
export { aiProviderTable, type AIProviderRow, type AIProviderInsert, type AIProviderUpdate, } from "./ai-provider.schema";
|
|
38
|
-
export { aiModelTable, type AIModelRow, type AIModelInsert, type AIModelUpdate, } from "./ai-model.schema";
|
|
36
|
+
export { apiKeyCredentialResource, apiKeyCredentialTable, credentialResource, credentialTable, oauthCredentialResource, oauthCredentialTable, type ApiKeyCredentialRow, type ApiKeyCredentialInsert, type ApiKeyCredentialUpdate, type CredentialRow, type CredentialInsert, type CredentialUpdate, type OAuthCredentialRow, type OAuthCredentialInsert, type OAuthCredentialUpdate, } from "./credential.schema";
|
|
37
|
+
export { aiProviderResource, aiProviderTable, type AIProviderRow, type AIProviderInsert, type AIProviderUpdate, } from "./ai-provider.schema";
|
|
38
|
+
export { aiModelResource, aiModelTable, type AIModelRow, type AIModelInsert, type AIModelUpdate, } from "./ai-model.schema";
|
|
39
|
+
export { agentStatusResource, agentStatusTable, aiConfigResource, aiConfigTable, indexedFileResource, indexedFileTable, vectorStoreResource, vectorStoreTable, type AgentStatusRow, type AgentStatusInsert, type AgentStatusUpdate, type AIConfigRow, type AIConfigInsert, type AIConfigUpdate as AIConfigResourceUpdate, type IndexedFileRow, type IndexedFileInsert, type IndexedFileUpdate, type VectorStoreRow, type VectorStoreInsert, type VectorStoreUpdate, } from './ai-runtime.schema';
|
|
39
40
|
export { aiConfigModelRef, aiConfigProviderRef, buildAIConfigMutationPlan, buildAIConfigProviderStateMap, getAIConfigDefaultBaseUrl, getAIConfigProviderCatalog, getAIConfigProviderFamilyIds, getAIConfigProviderMetadata, getDefaultAIConfigCredentialId, normalizeAIConfigProviderId, normalizeAIConfigModelId, normalizeAIConfigResourceId, sameAIConfigProviderFamily, type AIConfigModel, type AIConfigMutationPlan, type AIConfigProviderCatalogEntry, type AIConfigProviderState, type AIConfigUpdate, type BuildAIConfigProviderStateMapOptions, } from './ai-config';
|
|
40
41
|
export { buildAcpPermissionResponse, buildWatchThreadMetadata, buildWatchTranscriptMessages, buildWatchUserInputResponse, createWatchSessionId, detectWatchAuthFailure, formatWatchAutoFallbackMessage, formatWatchBackendAuthMessage, extractWatchSessionIdFromJsonLine, getWatchArchiveRelativePaths, getWatchAuthLoginCommand, looksLikeWatchAuthFailureText, normalizeAcpInteractionRequest, normalizeAcpRequest, normalizeAcpSessionNotification, normalizeCodexAppServerNotification, normalizeCodexAppServerRequest, normalizeWatchCredentialSource, parseWatchClaudeAuthStatus, parseWatchJsonLine, parseWatchJsonProtocolLine, resolveWatchAutoApprovalDecision, resolveWatchCredentialSourceResolution, resolveWatchInteractionAutoResponse, resolveWatchQuestionAnswer, shouldAttemptCloudCredentialProbe, WATCH_EVENTS_FILE_NAME, WATCH_HOME_DIRNAME, WATCH_SESSIONS_DIRNAME, WATCH_SESSION_FILE_NAME, type WatchApprovalDecision, type WatchApprovalRequest, type CreateWatchSessionIdOptions, type WatchAuthFailure, type WatchAuthState, type WatchAuthStatus, type WatchArchiveRelativePaths, type WatchBackend, type WatchCloudCredentialProbe, type WatchCloudCredentialProbeStatus, type WatchCredentialSource, type WatchCredentialSourceResolution, type WatchEventLogEntry, type WatchMode, type WatchNormalizedEvent, type WatchOutputStream, type WatchResolvedCredentialSource, type WatchRuntime, type WatchSessionRecord, type WatchSessionStatus, type WatchThreadMetadata, type WatchTranscriptMessage, type WatchTranscriptMessageRole, type WatchTranscriptMessageSource, } from './watch';
|
|
41
42
|
export { applySolidComunicaPatches, } from './comunica-patches';
|
|
42
|
-
export { createRepositoryDescriptor, definePodRepository, initSolidTables, type AnyPodTable, type PodRepositoryDescriptor, type RepositoryCacheOptions, type RepositoryInvalidations, type RepositoryScope, type SolidDatabase, } from './repository';
|
|
43
|
+
export { createRepositoryDescriptor, definePodRepository, initSolidResources, initSolidTables, type AnyPodResource, type AnyPodTable, type PodRepositoryDescriptor, type RepositoryCacheOptions, type RepositoryInvalidations, type RepositoryScope, type SolidDatabase, } from './repository';
|
|
43
44
|
export { importJobSchema } from './import';
|
|
44
45
|
export { eq, ne, and, or, drizzle } from '@undefineds.co/drizzle-solid';
|
|
45
46
|
export { solidResources, solidSchema } from './schema';
|
package/dist/index.js
CHANGED
|
@@ -20,7 +20,7 @@ export * from './profile.js';
|
|
|
20
20
|
export * from './profile.repository.js';
|
|
21
21
|
export * from './profile.schema.js';
|
|
22
22
|
// Contact - 联系人 (unified index for Solid users, external users, and AI agents)
|
|
23
|
-
export { ContactGender, contactTable, ContactClass, ContactType, isAgentContact, isGroupContact, normalizeContactGender, } from './contact.schema.js';
|
|
23
|
+
export { ContactGender, contactResource, contactTable, ContactClass, ContactType, isAgentContact, isGroupContact, normalizeContactGender, } from './contact.schema.js';
|
|
24
24
|
export { contactRepository } from './contact.repository.js';
|
|
25
25
|
// Chat & Message - 聊天和消息
|
|
26
26
|
export { chatResource, chatTable, } from './chat.schema.js';
|
|
@@ -35,15 +35,15 @@ export { MessageBlockType, MessageBlockStatus, createMessageBlock, isBlockType,
|
|
|
35
35
|
// Wave A CP0: fixtures for downstream parallel development
|
|
36
36
|
export * from "./fixtures/contracts-chat-contact.js";
|
|
37
37
|
// File - 文件管理
|
|
38
|
-
export { fileTable, } from './file/index.js';
|
|
38
|
+
export { fileResource, fileTable, } from './file/index.js';
|
|
39
39
|
// Favorite - 收藏
|
|
40
|
-
export { favoriteTable,
|
|
40
|
+
export { favoriteResource, favoriteTable,
|
|
41
41
|
// Starred Sync Hook
|
|
42
42
|
createStarredSyncHook, registerDbForStarredSync, chatStarredSyncHook, threadStarredSyncHook, contactStarredSyncHook, chatSnapshotExtractor, threadSnapshotExtractor, contactSnapshotExtractor, } from './favorite/index.js';
|
|
43
43
|
// Settings - 用户设置
|
|
44
|
-
export { settingsTable, SETTING_KEYS, } from './settings/index.js';
|
|
44
|
+
export { settingsResource, settingsTable, SETTING_KEYS, } from './settings/index.js';
|
|
45
45
|
// Agent - AI 助手配置
|
|
46
|
-
export { agentTable, } from './agent.schema.js';
|
|
46
|
+
export { agentResource, agentTable, } from './agent.schema.js';
|
|
47
47
|
export { agentRepository } from './agent.repository.js';
|
|
48
48
|
export { DEFAULT_AGENT_PROVIDERS, } from './agent.providers.js';
|
|
49
49
|
// ============================================
|
|
@@ -57,7 +57,7 @@ export { approvalResource, approvalTable, extractApprovalIdFromApprovalRef, } fr
|
|
|
57
57
|
export { auditResource, auditTable, extractAuditIdFromAuditRef, } from './audit.schema.js';
|
|
58
58
|
export { buildAuditDetailRecord, buildAuditPresentation, createResolvedAuthTimestampsIndex, formatAuditActorRole, formatInboxStatusLabel, } from './audit.presentation.js';
|
|
59
59
|
export { grantResource, grantTable, } from './grant.schema.js';
|
|
60
|
-
export { inboxNotificationTable, } from './inbox-notification.schema.js';
|
|
60
|
+
export { inboxNotificationResource, inboxNotificationTable, } from './inbox-notification.schema.js';
|
|
61
61
|
// Sidecar vocab + runtime contracts
|
|
62
62
|
export { ApprovalVocab, AuditVocab, GrantVocab, InboxNotificationVocab } from './vocab/sidecar.vocab.js';
|
|
63
63
|
export * from './sidecar/sidecar-events.js';
|
|
@@ -67,13 +67,14 @@ export { knowledgeFolderSchema } from './knowledge/index.js';
|
|
|
67
67
|
// Extension - 扩展
|
|
68
68
|
export { extensionSchema } from './extension/index.js';
|
|
69
69
|
// xpod AI schema
|
|
70
|
-
export { credentialTable, } from "./credential.schema.js";
|
|
71
|
-
export { aiProviderTable, } from "./ai-provider.schema.js";
|
|
72
|
-
export { aiModelTable, } from "./ai-model.schema.js";
|
|
70
|
+
export { apiKeyCredentialResource, apiKeyCredentialTable, credentialResource, credentialTable, oauthCredentialResource, oauthCredentialTable, } from "./credential.schema.js";
|
|
71
|
+
export { aiProviderResource, aiProviderTable, } from "./ai-provider.schema.js";
|
|
72
|
+
export { aiModelResource, aiModelTable, } from "./ai-model.schema.js";
|
|
73
|
+
export { agentStatusResource, agentStatusTable, aiConfigResource, aiConfigTable, indexedFileResource, indexedFileTable, vectorStoreResource, vectorStoreTable, } from './ai-runtime.schema.js';
|
|
73
74
|
export { aiConfigModelRef, aiConfigProviderRef, buildAIConfigMutationPlan, buildAIConfigProviderStateMap, getAIConfigDefaultBaseUrl, getAIConfigProviderCatalog, getAIConfigProviderFamilyIds, getAIConfigProviderMetadata, getDefaultAIConfigCredentialId, normalizeAIConfigProviderId, normalizeAIConfigModelId, normalizeAIConfigResourceId, sameAIConfigProviderFamily, } from './ai-config/index.js';
|
|
74
75
|
export { buildAcpPermissionResponse, buildWatchThreadMetadata, buildWatchTranscriptMessages, buildWatchUserInputResponse, createWatchSessionId, detectWatchAuthFailure, formatWatchAutoFallbackMessage, formatWatchBackendAuthMessage, extractWatchSessionIdFromJsonLine, getWatchArchiveRelativePaths, getWatchAuthLoginCommand, looksLikeWatchAuthFailureText, normalizeAcpInteractionRequest, normalizeAcpRequest, normalizeAcpSessionNotification, normalizeCodexAppServerNotification, normalizeCodexAppServerRequest, normalizeWatchCredentialSource, parseWatchClaudeAuthStatus, parseWatchJsonLine, parseWatchJsonProtocolLine, resolveWatchAutoApprovalDecision, resolveWatchCredentialSourceResolution, resolveWatchInteractionAutoResponse, resolveWatchQuestionAnswer, shouldAttemptCloudCredentialProbe, WATCH_EVENTS_FILE_NAME, WATCH_HOME_DIRNAME, WATCH_SESSIONS_DIRNAME, WATCH_SESSION_FILE_NAME, } from './watch/index.js';
|
|
75
76
|
export { applySolidComunicaPatches, } from './comunica-patches.js';
|
|
76
|
-
export { createRepositoryDescriptor, definePodRepository, initSolidTables, } from './repository.js';
|
|
77
|
+
export { createRepositoryDescriptor, definePodRepository, initSolidResources, initSolidTables, } from './repository.js';
|
|
77
78
|
// Import Job - 导入任务
|
|
78
79
|
export { importJobSchema } from './import/index.js';
|
|
79
80
|
// ============================================
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { definePodRepository } from './repository.js';
|
|
2
|
-
import {
|
|
2
|
+
import { messageResource } from './message.schema.js';
|
|
3
3
|
export const messageRepository = definePodRepository({
|
|
4
4
|
namespace: 'message',
|
|
5
|
-
table:
|
|
5
|
+
table: messageResource,
|
|
6
6
|
searchableFields: ['content'],
|
|
7
7
|
defaultSort: { field: 'createdAt', direction: 'asc' },
|
|
8
8
|
});
|
package/dist/namespaces.js
CHANGED
|
@@ -240,22 +240,35 @@ export const LINX_CHAT = UDFS;
|
|
|
240
240
|
export const LINX_MSG = UDFS;
|
|
241
241
|
export const XPOD_CREDENTIAL = createNamespace('cred', 'https://vocab.xpod.dev/credential#', {
|
|
242
242
|
Credential: 'Credential',
|
|
243
|
+
ApiKeyCredential: 'ApiKeyCredential',
|
|
244
|
+
OAuthCredential: 'OAuthCredential',
|
|
243
245
|
provider: 'provider',
|
|
244
246
|
service: 'service',
|
|
245
247
|
status: 'status',
|
|
246
248
|
apiKey: 'apiKey',
|
|
247
249
|
baseUrl: 'baseUrl',
|
|
250
|
+
proxyUrl: 'proxyUrl',
|
|
248
251
|
label: 'label',
|
|
249
252
|
lastUsedAt: 'lastUsedAt',
|
|
250
253
|
failCount: 'failCount',
|
|
251
254
|
rateLimitResetAt: 'rateLimitResetAt',
|
|
255
|
+
oauthRefreshToken: 'oauthRefreshToken',
|
|
256
|
+
oauthAccessToken: 'oauthAccessToken',
|
|
257
|
+
oauthExpiresAt: 'oauthExpiresAt',
|
|
258
|
+
projectId: 'projectId',
|
|
259
|
+
organizationId: 'organizationId',
|
|
252
260
|
});
|
|
253
261
|
export const XPOD_AI = createNamespace('ai', 'https://vocab.xpod.dev/ai#', {
|
|
254
262
|
Provider: 'Provider',
|
|
255
263
|
Model: 'Model',
|
|
264
|
+
AIConfig: 'AIConfig',
|
|
265
|
+
VectorStore: 'VectorStore',
|
|
266
|
+
IndexedFile: 'IndexedFile',
|
|
267
|
+
AgentStatus: 'AgentStatus',
|
|
256
268
|
baseUrl: 'baseUrl',
|
|
257
269
|
proxyUrl: 'proxyUrl',
|
|
258
270
|
hasModel: 'hasModel',
|
|
271
|
+
defaultModel: 'defaultModel',
|
|
259
272
|
displayName: 'displayName',
|
|
260
273
|
modelType: 'modelType',
|
|
261
274
|
isProvidedBy: 'isProvidedBy',
|
|
@@ -263,4 +276,22 @@ export const XPOD_AI = createNamespace('ai', 'https://vocab.xpod.dev/ai#', {
|
|
|
263
276
|
status: 'status',
|
|
264
277
|
createdAt: 'createdAt',
|
|
265
278
|
updatedAt: 'updatedAt',
|
|
279
|
+
embeddingModel: 'embeddingModel',
|
|
280
|
+
previousModel: 'previousModel',
|
|
281
|
+
migrationStatus: 'migrationStatus',
|
|
282
|
+
migrationProgress: 'migrationProgress',
|
|
283
|
+
name: 'name',
|
|
284
|
+
container: 'container',
|
|
285
|
+
chunkingStrategy: 'chunkingStrategy',
|
|
286
|
+
lastActiveAt: 'lastActiveAt',
|
|
287
|
+
lastActivityAt: 'lastActivityAt',
|
|
288
|
+
fileUrl: 'fileUrl',
|
|
289
|
+
vectorId: 'vectorId',
|
|
290
|
+
usageBytes: 'usageBytes',
|
|
291
|
+
lastError: 'lastError',
|
|
292
|
+
indexedAt: 'indexedAt',
|
|
293
|
+
agentId: 'agentId',
|
|
294
|
+
startedAt: 'startedAt',
|
|
295
|
+
currentTaskId: 'currentTaskId',
|
|
296
|
+
errorMessage: 'errorMessage',
|
|
266
297
|
});
|
package/dist/profile.d.ts
CHANGED
|
@@ -8,12 +8,13 @@ export interface SolidProfileSessionLike {
|
|
|
8
8
|
fetch?: typeof fetch;
|
|
9
9
|
}
|
|
10
10
|
export interface SolidProfileReader<TTable = unknown> {
|
|
11
|
-
findByIri(
|
|
11
|
+
findByIri(resource: TTable, iri: string): Promise<unknown | null>;
|
|
12
12
|
}
|
|
13
13
|
export declare function createSolidProfileDatabase(session: unknown): Promise<SolidProfileReader>;
|
|
14
14
|
export declare function applySolidProfileComunicaPatches(): boolean;
|
|
15
15
|
export declare function resolveSolidProfile(db: SolidProfileReader, webId: string): Promise<SolidProfileRow | null>;
|
|
16
16
|
export declare function resolveSolidProfileWithTable<TTable>(db: SolidProfileReader<TTable>, webId: string, table: TTable): Promise<SolidProfileRow | null>;
|
|
17
|
+
export declare function resolveSolidProfileWithResource<TResource>(db: SolidProfileReader<TResource>, webId: string, resource: TResource): Promise<SolidProfileRow | null>;
|
|
17
18
|
export declare function resolveSolidProfileDisplayName(db: SolidProfileReader, webId: string): Promise<string | null>;
|
|
18
19
|
export declare function resolveSolidProfileIdentityWithReader(db: SolidProfileReader, webId: string): Promise<SolidProfileIdentity | null>;
|
|
19
20
|
export declare function resolveSolidProfileIdentityFromWebIdDocument(session: SolidProfileSessionLike, options?: {
|
package/dist/profile.js
CHANGED
|
@@ -6,14 +6,14 @@ import { applySolidComunicaPatches } from "./comunica-patches.js";
|
|
|
6
6
|
export { pickSolidProfileDisplayName, profileRepository, } from "./profile.repository.js";
|
|
7
7
|
export async function createSolidProfileDatabase(session) {
|
|
8
8
|
applySolidProfileComunicaPatches();
|
|
9
|
-
const [{ drizzle }, {
|
|
9
|
+
const [{ drizzle }, { solidProfileResource }] = await Promise.all([
|
|
10
10
|
import("@undefineds.co/drizzle-solid"),
|
|
11
11
|
import("./profile.schema.js"),
|
|
12
12
|
]);
|
|
13
13
|
return drizzle(session, {
|
|
14
14
|
logger: false,
|
|
15
15
|
disableInteropDiscovery: true,
|
|
16
|
-
schema: {
|
|
16
|
+
schema: { solidProfileResource },
|
|
17
17
|
});
|
|
18
18
|
}
|
|
19
19
|
export function applySolidProfileComunicaPatches() {
|
|
@@ -23,10 +23,13 @@ export async function resolveSolidProfile(db, webId) {
|
|
|
23
23
|
return await profileRepository.findByWebId(db, webId);
|
|
24
24
|
}
|
|
25
25
|
export async function resolveSolidProfileWithTable(db, webId, table) {
|
|
26
|
+
return resolveSolidProfileWithResource(db, webId, table);
|
|
27
|
+
}
|
|
28
|
+
export async function resolveSolidProfileWithResource(db, webId, resource) {
|
|
26
29
|
if (!webId.trim()) {
|
|
27
30
|
return null;
|
|
28
31
|
}
|
|
29
|
-
return await db.findByIri(
|
|
32
|
+
return await db.findByIri(resource, webId);
|
|
30
33
|
}
|
|
31
34
|
export async function resolveSolidProfileDisplayName(db, webId) {
|
|
32
35
|
return await profileRepository.resolveDisplayName(db, webId);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { extractProfileUsernameFromWebId } from './client/index.js';
|
|
2
2
|
import { definePodRepository } from './repository.js';
|
|
3
|
-
import {
|
|
3
|
+
import { solidProfileResource, } from './profile.schema.js';
|
|
4
4
|
const baseProfileRepository = definePodRepository({
|
|
5
5
|
namespace: 'profile',
|
|
6
|
-
table:
|
|
6
|
+
table: solidProfileResource,
|
|
7
7
|
searchableFields: ['name', 'nick'],
|
|
8
8
|
disableMutations: {
|
|
9
9
|
create: true,
|
|
@@ -17,7 +17,7 @@ export const profileRepository = {
|
|
|
17
17
|
if (!webId.trim()) {
|
|
18
18
|
return null;
|
|
19
19
|
}
|
|
20
|
-
return await db.findByIri?.(
|
|
20
|
+
return await db.findByIri?.(solidProfileResource, webId) ?? null;
|
|
21
21
|
},
|
|
22
22
|
async resolveDisplayName(db, webId) {
|
|
23
23
|
return pickSolidProfileDisplayName(await profileRepository.findByWebId(db, webId));
|
package/dist/profile.schema.d.ts
CHANGED
|
@@ -1,3 +1,16 @@
|
|
|
1
|
+
export declare const solidProfileResource: 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
|
+
}>>;
|
|
1
14
|
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
15
|
id: import("@undefineds.co/drizzle-solid/dist/core/schema/columns.js").PodStringColumn<false, false>;
|
|
3
16
|
name: import("@undefineds.co/drizzle-solid/dist/core/schema/columns.js").ColumnBuilder<"string", null, false, false>;
|
|
@@ -11,6 +24,6 @@ export declare const solidProfileTable: import("@undefineds.co/drizzle-solid/dis
|
|
|
11
24
|
favorite: import("@undefineds.co/drizzle-solid/dist/core/schema/columns.js").ColumnBuilder<"string", null, false, false>;
|
|
12
25
|
inbox: import("@undefineds.co/drizzle-solid/dist/core/schema/columns.js").ColumnBuilder<"string", null, false, false>;
|
|
13
26
|
}>>;
|
|
14
|
-
export type SolidProfileRow = typeof
|
|
15
|
-
export type SolidProfileInsert = typeof
|
|
16
|
-
export type SolidProfileUpdate = typeof
|
|
27
|
+
export type SolidProfileRow = typeof solidProfileResource.$inferSelect;
|
|
28
|
+
export type SolidProfileInsert = typeof solidProfileResource.$inferInsert;
|
|
29
|
+
export type SolidProfileUpdate = typeof solidProfileResource.$inferUpdate;
|
package/dist/profile.schema.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { id, podTable, string } from "@undefineds.co/drizzle-solid";
|
|
2
2
|
import { FOAF, LDP, UDFS, VCARD } from "./namespaces.js";
|
|
3
|
-
export const
|
|
3
|
+
export const solidProfileResource = podTable("profile", {
|
|
4
4
|
id: id("id"),
|
|
5
5
|
name: string("name").predicate(VCARD.fn),
|
|
6
6
|
nick: string("nick").predicate(FOAF.nick),
|
|
@@ -17,3 +17,5 @@ export const solidProfileTable = podTable("profile", {
|
|
|
17
17
|
type: FOAF.Person,
|
|
18
18
|
namespace: UDFS,
|
|
19
19
|
});
|
|
20
|
+
// Compatibility alias. New model code should prefer `solidProfileResource`.
|
|
21
|
+
export const solidProfileTable = solidProfileResource;
|
package/dist/repository.d.ts
CHANGED
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import { initSolidTables, type AnyPodTable } from '@undefineds.co/drizzle-solid';
|
|
2
|
+
export { createRepositoryDescriptor, definePodRepository, type PodRepositoryDescriptor, type RepositoryCacheOptions, type RepositoryInvalidations, type RepositoryScope, type SolidDatabase, } from '@undefineds.co/drizzle-solid';
|
|
3
|
+
export { initSolidTables };
|
|
4
|
+
export type { AnyPodTable };
|
|
5
|
+
export declare const initSolidResources: typeof initSolidTables;
|
|
6
|
+
export type AnyPodResource = AnyPodTable;
|
package/dist/repository.js
CHANGED
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import { initSolidTables, } from '@undefineds.co/drizzle-solid';
|
|
2
|
+
export { createRepositoryDescriptor, definePodRepository, } from '@undefineds.co/drizzle-solid';
|
|
3
|
+
export { initSolidTables };
|
|
4
|
+
// Resource-first aliases for shared Solid model call sites. The underlying
|
|
5
|
+
// drizzle-solid API still uses table-shaped arguments for compatibility.
|
|
6
|
+
export const initSolidResources = initSolidTables;
|