@papr/memory 1.16.0 → 1.18.0
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/CHANGELOG.md +53 -0
- package/README.md +29 -0
- package/client.d.mts +14 -4
- package/client.d.mts.map +1 -1
- package/client.d.ts +14 -4
- package/client.d.ts.map +1 -1
- package/client.js +9 -0
- package/client.js.map +1 -1
- package/client.mjs +9 -0
- package/client.mjs.map +1 -1
- package/internal/to-file.d.mts +1 -1
- package/internal/to-file.d.ts +1 -1
- package/internal/to-file.js +1 -1
- package/internal/to-file.mjs +1 -1
- package/internal/tslib.js +22 -22
- package/internal/utils/values.js +3 -3
- package/internal/utils/values.js.map +1 -1
- package/internal/utils/values.mjs +3 -3
- package/internal/utils/values.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/document.d.mts +119 -0
- package/resources/document.d.mts.map +1 -0
- package/resources/document.d.ts +119 -0
- package/resources/document.d.ts.map +1 -0
- package/resources/document.js +40 -0
- package/resources/document.js.map +1 -0
- package/resources/document.mjs +36 -0
- package/resources/document.mjs.map +1 -0
- package/resources/feedback.d.mts +20 -0
- package/resources/feedback.d.mts.map +1 -1
- package/resources/feedback.d.ts +20 -0
- package/resources/feedback.d.ts.map +1 -1
- package/resources/graphql.d.mts +52 -0
- package/resources/graphql.d.mts.map +1 -0
- package/resources/graphql.d.ts +52 -0
- package/resources/graphql.d.ts.map +1 -0
- package/resources/graphql.js +54 -0
- package/resources/graphql.js.map +1 -0
- package/resources/graphql.mjs +50 -0
- package/resources/graphql.mjs.map +1 -0
- package/resources/index.d.mts +6 -2
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +6 -2
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +9 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +4 -0
- package/resources/index.mjs.map +1 -1
- package/resources/memory.d.mts +373 -270
- package/resources/memory.d.mts.map +1 -1
- package/resources/memory.d.ts +373 -270
- package/resources/memory.d.ts.map +1 -1
- package/resources/memory.js +29 -4
- package/resources/memory.js.map +1 -1
- package/resources/memory.mjs +29 -4
- package/resources/memory.mjs.map +1 -1
- package/resources/schemas.d.mts +404 -0
- package/resources/schemas.d.mts.map +1 -0
- package/resources/schemas.d.ts +404 -0
- package/resources/schemas.d.ts.map +1 -0
- package/resources/schemas.js +127 -0
- package/resources/schemas.js.map +1 -0
- package/resources/schemas.mjs +123 -0
- package/resources/schemas.mjs.map +1 -0
- package/resources/shared.d.mts +10 -0
- package/resources/shared.d.mts.map +1 -0
- package/resources/shared.d.ts +10 -0
- package/resources/shared.d.ts.map +1 -0
- package/resources/shared.js +4 -0
- package/resources/shared.js.map +1 -0
- package/resources/shared.mjs +3 -0
- package/resources/shared.mjs.map +1 -0
- package/resources/user.d.mts +1 -18
- package/resources/user.d.mts.map +1 -1
- package/resources/user.d.ts +1 -18
- package/resources/user.d.ts.map +1 -1
- package/resources/user.js +0 -11
- package/resources/user.js.map +1 -1
- package/resources/user.mjs +0 -11
- package/resources/user.mjs.map +1 -1
- package/src/client.ts +61 -2
- package/src/internal/to-file.ts +1 -1
- package/src/internal/utils/values.ts +3 -3
- package/src/resources/document.ts +164 -0
- package/src/resources/feedback.ts +24 -0
- package/src/resources/graphql.ts +65 -0
- package/src/resources/index.ts +24 -1
- package/src/resources/memory.ts +418 -492
- package/src/resources/schemas.ts +541 -0
- package/src/resources/shared.ts +14 -0
- package/src/resources/user.ts +0 -23
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemas.d.mts","sourceRoot":"","sources":["../src/resources/schemas.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAGzB,qBAAa,OAAQ,SAAQ,WAAW;IACtC;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AO,EACL,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,gBAAgB,IAAI,gBAAgB,GAC1C,CAAC;CACH"}
|
|
@@ -0,0 +1,404 @@
|
|
|
1
|
+
import { APIResource } from "../core/resource.js";
|
|
2
|
+
import { APIPromise } from "../core/api-promise.js";
|
|
3
|
+
import { RequestOptions } from "../internal/request-options.js";
|
|
4
|
+
export declare class Schemas extends APIResource {
|
|
5
|
+
/**
|
|
6
|
+
* Create a new user-defined graph schema.
|
|
7
|
+
*
|
|
8
|
+
* This endpoint allows users to define custom node types and relationships for their knowledge graph.
|
|
9
|
+
* The schema will be validated and stored for use in future memory extractions.
|
|
10
|
+
*
|
|
11
|
+
* **Features:**
|
|
12
|
+
* - Define custom node types with properties and validation rules
|
|
13
|
+
* - Define custom relationship types with constraints
|
|
14
|
+
* - Automatic validation against system schemas
|
|
15
|
+
* - Support for different scopes (personal, workspace, organization)
|
|
16
|
+
* - **Enum support**: Use `enum_values` to restrict property values to a predefined list (max 10 values)
|
|
17
|
+
* - **Auto-indexing**: Required properties are automatically indexed in Neo4j for optimal query performance
|
|
18
|
+
*
|
|
19
|
+
* **Property Types & Validation:**
|
|
20
|
+
* - `string`: Text values with optional `enum_values`, `min_length`, `max_length`, `pattern`
|
|
21
|
+
* - `integer`: Whole numbers with optional `min_value`, `max_value`
|
|
22
|
+
* - `float`: Decimal numbers with optional `min_value`, `max_value`
|
|
23
|
+
* - `boolean`: True/false values
|
|
24
|
+
* - `datetime`: ISO 8601 timestamp strings
|
|
25
|
+
* - `array`: Lists of values
|
|
26
|
+
* - `object`: Complex nested objects
|
|
27
|
+
*
|
|
28
|
+
* **Enum Values:**
|
|
29
|
+
* - Add `enum_values` to any string property to restrict values to a predefined list
|
|
30
|
+
* - Maximum 10 enum values allowed per property
|
|
31
|
+
* - Use with `default` to set a default enum value
|
|
32
|
+
* - Example: `"enum_values": ["small", "medium", "large"]`
|
|
33
|
+
*
|
|
34
|
+
* **When to Use Enums:**
|
|
35
|
+
* - Limited, well-defined options (≤10 values): sizes, statuses, categories, priorities
|
|
36
|
+
* - Controlled vocabularies: "active/inactive", "high/medium/low", "bronze/silver/gold"
|
|
37
|
+
* - When you want exact matching and no variations
|
|
38
|
+
*
|
|
39
|
+
* **When to Avoid Enums:**
|
|
40
|
+
* - Open-ended text fields: names, titles, descriptions, addresses
|
|
41
|
+
* - Large sets of options (>10): countries, cities, product models
|
|
42
|
+
* - When you want semantic similarity matching for entity resolution
|
|
43
|
+
* - Dynamic or frequently changing value sets
|
|
44
|
+
*
|
|
45
|
+
* **Unique Identifiers & Entity Resolution:**
|
|
46
|
+
* - Properties marked as `unique_identifiers` are used for entity deduplication and merging
|
|
47
|
+
* - **With enum_values**: Exact matching is used - entities with the same enum value are considered identical
|
|
48
|
+
* - **Without enum_values**: Semantic similarity matching is used - entities with similar meanings are automatically merged
|
|
49
|
+
* - Example: A "name" unique_identifier without enums will merge "Apple Inc" and "Apple Inc." as the same entity
|
|
50
|
+
* - Example: A "sku" unique_identifier with enums will only merge entities with exactly matching SKU codes
|
|
51
|
+
* - Use enums for unique_identifiers when you have a limited, predefined set of values (≤10 options)
|
|
52
|
+
* - Avoid enums for unique_identifiers when you have broad, open-ended values or >10 possible options
|
|
53
|
+
* - **Best practices**: Use enums for controlled vocabularies (status codes, categories), avoid for open text (company names, product titles)
|
|
54
|
+
* - **In the example above**: "name" uses semantic similarity (open-ended), "sku" uses exact matching (controlled set)
|
|
55
|
+
*
|
|
56
|
+
* **LLM-Friendly Descriptions:**
|
|
57
|
+
* - Write detailed property descriptions that guide the LLM on expected formats and usage
|
|
58
|
+
* - Include examples of typical values (e.g., "Product name, typically 2-4 words like 'iPhone 15 Pro'")
|
|
59
|
+
* - Specify data formats and constraints clearly (e.g., "Price in USD as decimal number")
|
|
60
|
+
* - For enums, explain when to use each option (e.g., "use 'new' for brand new items")
|
|
61
|
+
*
|
|
62
|
+
* **Authentication Required**:
|
|
63
|
+
* One of the following authentication methods must be used:
|
|
64
|
+
* - Bearer token in `Authorization` header
|
|
65
|
+
* - API Key in `X-API-Key` header
|
|
66
|
+
* - Session token in `X-Session-Token` header
|
|
67
|
+
*
|
|
68
|
+
* **Required Headers**:
|
|
69
|
+
* - Content-Type: application/json
|
|
70
|
+
* - X-Client-Type: (e.g., 'papr_plugin', 'browser_extension')
|
|
71
|
+
*/
|
|
72
|
+
create(body: SchemaCreateParams, options?: RequestOptions): APIPromise<SchemaCreateResponse>;
|
|
73
|
+
/**
|
|
74
|
+
* Get a specific schema by ID.
|
|
75
|
+
*
|
|
76
|
+
* Returns the complete schema definition including node types, relationship types,
|
|
77
|
+
* and metadata. User must have read access to the schema.
|
|
78
|
+
*/
|
|
79
|
+
retrieve(schemaID: string, options?: RequestOptions): APIPromise<SchemaRetrieveResponse>;
|
|
80
|
+
/**
|
|
81
|
+
* Update an existing schema.
|
|
82
|
+
*
|
|
83
|
+
* Allows modification of schema properties, node types, and relationship types.
|
|
84
|
+
* User must have write access to the schema. Updates create a new version
|
|
85
|
+
* while preserving the existing data.
|
|
86
|
+
*/
|
|
87
|
+
update(schemaID: string, params: SchemaUpdateParams, options?: RequestOptions): APIPromise<SchemaUpdateResponse>;
|
|
88
|
+
/**
|
|
89
|
+
* List all schemas accessible to the authenticated user.
|
|
90
|
+
*
|
|
91
|
+
* Returns schemas that the user owns or has read access to, including:
|
|
92
|
+
* - Personal schemas created by the user
|
|
93
|
+
* - Workspace schemas shared within the user's workspace
|
|
94
|
+
* - Organization schemas available to the user's organization
|
|
95
|
+
*
|
|
96
|
+
* **Authentication Required**:
|
|
97
|
+
* One of the following authentication methods must be used:
|
|
98
|
+
* - Bearer token in `Authorization` header
|
|
99
|
+
* - API Key in `X-API-Key` header
|
|
100
|
+
* - Session token in `X-Session-Token` header
|
|
101
|
+
*/
|
|
102
|
+
list(query?: SchemaListParams | null | undefined, options?: RequestOptions): APIPromise<SchemaListResponse>;
|
|
103
|
+
/**
|
|
104
|
+
* Delete a schema.
|
|
105
|
+
*
|
|
106
|
+
* Soft deletes the schema by marking it as archived. The schema data and
|
|
107
|
+
* associated graph nodes/relationships are preserved for data integrity.
|
|
108
|
+
* User must have write access to the schema.
|
|
109
|
+
*/
|
|
110
|
+
delete(schemaID: string, options?: RequestOptions): APIPromise<unknown>;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Complete user-defined graph schema
|
|
114
|
+
*/
|
|
115
|
+
export interface UserGraphSchemaOutput {
|
|
116
|
+
name: string;
|
|
117
|
+
id?: string;
|
|
118
|
+
created_at?: string;
|
|
119
|
+
description?: string | null;
|
|
120
|
+
last_used_at?: string | null;
|
|
121
|
+
/**
|
|
122
|
+
* Custom node types (max 15 per schema)
|
|
123
|
+
*/
|
|
124
|
+
node_types?: {
|
|
125
|
+
[key: string]: UserGraphSchemaOutput.NodeTypes;
|
|
126
|
+
};
|
|
127
|
+
organization_id?: string | null;
|
|
128
|
+
read_access?: Array<string>;
|
|
129
|
+
/**
|
|
130
|
+
* Custom relationship types (max 20 per schema)
|
|
131
|
+
*/
|
|
132
|
+
relationship_types?: {
|
|
133
|
+
[key: string]: UserGraphSchemaOutput.RelationshipTypes;
|
|
134
|
+
};
|
|
135
|
+
scope?: 'personal' | 'workspace' | 'organization';
|
|
136
|
+
status?: 'draft' | 'active' | 'deprecated' | 'archived';
|
|
137
|
+
updated_at?: string | null;
|
|
138
|
+
usage_count?: number;
|
|
139
|
+
user_id?: string | {
|
|
140
|
+
[key: string]: unknown;
|
|
141
|
+
} | null;
|
|
142
|
+
version?: string;
|
|
143
|
+
workspace_id?: string | {
|
|
144
|
+
[key: string]: unknown;
|
|
145
|
+
} | null;
|
|
146
|
+
write_access?: Array<string>;
|
|
147
|
+
}
|
|
148
|
+
export declare namespace UserGraphSchemaOutput {
|
|
149
|
+
/**
|
|
150
|
+
* User-defined node type
|
|
151
|
+
*/
|
|
152
|
+
interface NodeTypes {
|
|
153
|
+
label: string;
|
|
154
|
+
name: string;
|
|
155
|
+
color?: string | null;
|
|
156
|
+
description?: string | null;
|
|
157
|
+
icon?: string | null;
|
|
158
|
+
/**
|
|
159
|
+
* Node properties (max 15 per node type)
|
|
160
|
+
*/
|
|
161
|
+
properties?: {
|
|
162
|
+
[key: string]: NodeTypes.Properties;
|
|
163
|
+
};
|
|
164
|
+
required_properties?: Array<string>;
|
|
165
|
+
/**
|
|
166
|
+
* Properties that uniquely identify this node type. Used for MERGE operations to
|
|
167
|
+
* avoid duplicates. Example: ['name', 'email'] for Customer nodes.
|
|
168
|
+
*/
|
|
169
|
+
unique_identifiers?: Array<string>;
|
|
170
|
+
}
|
|
171
|
+
namespace NodeTypes {
|
|
172
|
+
/**
|
|
173
|
+
* Property definition for nodes/relationships
|
|
174
|
+
*/
|
|
175
|
+
interface Properties {
|
|
176
|
+
type: 'string' | 'integer' | 'float' | 'boolean' | 'array' | 'datetime' | 'object';
|
|
177
|
+
default?: unknown;
|
|
178
|
+
description?: string | null;
|
|
179
|
+
/**
|
|
180
|
+
* List of allowed enum values (max 10)
|
|
181
|
+
*/
|
|
182
|
+
enum_values?: Array<string> | null;
|
|
183
|
+
max_length?: number | null;
|
|
184
|
+
max_value?: number | null;
|
|
185
|
+
min_length?: number | null;
|
|
186
|
+
min_value?: number | null;
|
|
187
|
+
pattern?: string | null;
|
|
188
|
+
required?: boolean;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* User-defined relationship type
|
|
193
|
+
*/
|
|
194
|
+
interface RelationshipTypes {
|
|
195
|
+
allowed_source_types: Array<string>;
|
|
196
|
+
allowed_target_types: Array<string>;
|
|
197
|
+
label: string;
|
|
198
|
+
name: string;
|
|
199
|
+
cardinality?: 'one-to-one' | 'one-to-many' | 'many-to-many';
|
|
200
|
+
color?: string | null;
|
|
201
|
+
description?: string | null;
|
|
202
|
+
properties?: {
|
|
203
|
+
[key: string]: RelationshipTypes.Properties;
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
namespace RelationshipTypes {
|
|
207
|
+
/**
|
|
208
|
+
* Property definition for nodes/relationships
|
|
209
|
+
*/
|
|
210
|
+
interface Properties {
|
|
211
|
+
type: 'string' | 'integer' | 'float' | 'boolean' | 'array' | 'datetime' | 'object';
|
|
212
|
+
default?: unknown;
|
|
213
|
+
description?: string | null;
|
|
214
|
+
/**
|
|
215
|
+
* List of allowed enum values (max 10)
|
|
216
|
+
*/
|
|
217
|
+
enum_values?: Array<string> | null;
|
|
218
|
+
max_length?: number | null;
|
|
219
|
+
max_value?: number | null;
|
|
220
|
+
min_length?: number | null;
|
|
221
|
+
min_value?: number | null;
|
|
222
|
+
pattern?: string | null;
|
|
223
|
+
required?: boolean;
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* Response model for schema operations
|
|
229
|
+
*/
|
|
230
|
+
export interface SchemaCreateResponse {
|
|
231
|
+
success: boolean;
|
|
232
|
+
code?: number;
|
|
233
|
+
/**
|
|
234
|
+
* Complete user-defined graph schema
|
|
235
|
+
*/
|
|
236
|
+
data?: UserGraphSchemaOutput | null;
|
|
237
|
+
error?: string | null;
|
|
238
|
+
}
|
|
239
|
+
/**
|
|
240
|
+
* Response model for schema operations
|
|
241
|
+
*/
|
|
242
|
+
export interface SchemaRetrieveResponse {
|
|
243
|
+
success: boolean;
|
|
244
|
+
code?: number;
|
|
245
|
+
/**
|
|
246
|
+
* Complete user-defined graph schema
|
|
247
|
+
*/
|
|
248
|
+
data?: UserGraphSchemaOutput | null;
|
|
249
|
+
error?: string | null;
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* Response model for schema operations
|
|
253
|
+
*/
|
|
254
|
+
export interface SchemaUpdateResponse {
|
|
255
|
+
success: boolean;
|
|
256
|
+
code?: number;
|
|
257
|
+
/**
|
|
258
|
+
* Complete user-defined graph schema
|
|
259
|
+
*/
|
|
260
|
+
data?: UserGraphSchemaOutput | null;
|
|
261
|
+
error?: string | null;
|
|
262
|
+
}
|
|
263
|
+
/**
|
|
264
|
+
* Response model for listing schemas
|
|
265
|
+
*/
|
|
266
|
+
export interface SchemaListResponse {
|
|
267
|
+
success: boolean;
|
|
268
|
+
code?: number;
|
|
269
|
+
data?: Array<UserGraphSchemaOutput> | null;
|
|
270
|
+
error?: string | null;
|
|
271
|
+
total?: number;
|
|
272
|
+
}
|
|
273
|
+
export type SchemaDeleteResponse = unknown;
|
|
274
|
+
export interface SchemaCreateParams {
|
|
275
|
+
name: string;
|
|
276
|
+
id?: string;
|
|
277
|
+
created_at?: string;
|
|
278
|
+
description?: string | null;
|
|
279
|
+
last_used_at?: string | null;
|
|
280
|
+
/**
|
|
281
|
+
* Custom node types (max 15 per schema)
|
|
282
|
+
*/
|
|
283
|
+
node_types?: {
|
|
284
|
+
[key: string]: SchemaCreateParams.NodeTypes;
|
|
285
|
+
};
|
|
286
|
+
organization_id?: string | null;
|
|
287
|
+
read_access?: Array<string>;
|
|
288
|
+
/**
|
|
289
|
+
* Custom relationship types (max 20 per schema)
|
|
290
|
+
*/
|
|
291
|
+
relationship_types?: {
|
|
292
|
+
[key: string]: SchemaCreateParams.RelationshipTypes;
|
|
293
|
+
};
|
|
294
|
+
scope?: 'personal' | 'workspace' | 'organization';
|
|
295
|
+
status?: 'draft' | 'active' | 'deprecated' | 'archived';
|
|
296
|
+
updated_at?: string | null;
|
|
297
|
+
usage_count?: number;
|
|
298
|
+
user_id?: string | {
|
|
299
|
+
[key: string]: unknown;
|
|
300
|
+
} | null;
|
|
301
|
+
version?: string;
|
|
302
|
+
workspace_id?: string | {
|
|
303
|
+
[key: string]: unknown;
|
|
304
|
+
} | null;
|
|
305
|
+
write_access?: Array<string>;
|
|
306
|
+
}
|
|
307
|
+
export declare namespace SchemaCreateParams {
|
|
308
|
+
/**
|
|
309
|
+
* User-defined node type
|
|
310
|
+
*/
|
|
311
|
+
interface NodeTypes {
|
|
312
|
+
label: string;
|
|
313
|
+
name: string;
|
|
314
|
+
color?: string | null;
|
|
315
|
+
description?: string | null;
|
|
316
|
+
icon?: string | null;
|
|
317
|
+
/**
|
|
318
|
+
* Node properties (max 15 per node type)
|
|
319
|
+
*/
|
|
320
|
+
properties?: {
|
|
321
|
+
[key: string]: NodeTypes.Properties;
|
|
322
|
+
};
|
|
323
|
+
required_properties?: Array<string>;
|
|
324
|
+
/**
|
|
325
|
+
* Properties that uniquely identify this node type. Used for MERGE operations to
|
|
326
|
+
* avoid duplicates. Example: ['name', 'email'] for Customer nodes.
|
|
327
|
+
*/
|
|
328
|
+
unique_identifiers?: Array<string>;
|
|
329
|
+
}
|
|
330
|
+
namespace NodeTypes {
|
|
331
|
+
/**
|
|
332
|
+
* Property definition for nodes/relationships
|
|
333
|
+
*/
|
|
334
|
+
interface Properties {
|
|
335
|
+
type: 'string' | 'integer' | 'float' | 'boolean' | 'array' | 'datetime' | 'object';
|
|
336
|
+
default?: unknown;
|
|
337
|
+
description?: string | null;
|
|
338
|
+
/**
|
|
339
|
+
* List of allowed enum values (max 10)
|
|
340
|
+
*/
|
|
341
|
+
enum_values?: Array<string> | null;
|
|
342
|
+
max_length?: number | null;
|
|
343
|
+
max_value?: number | null;
|
|
344
|
+
min_length?: number | null;
|
|
345
|
+
min_value?: number | null;
|
|
346
|
+
pattern?: string | null;
|
|
347
|
+
required?: boolean;
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
/**
|
|
351
|
+
* User-defined relationship type
|
|
352
|
+
*/
|
|
353
|
+
interface RelationshipTypes {
|
|
354
|
+
allowed_source_types: Array<string>;
|
|
355
|
+
allowed_target_types: Array<string>;
|
|
356
|
+
label: string;
|
|
357
|
+
name: string;
|
|
358
|
+
cardinality?: 'one-to-one' | 'one-to-many' | 'many-to-many';
|
|
359
|
+
color?: string | null;
|
|
360
|
+
description?: string | null;
|
|
361
|
+
properties?: {
|
|
362
|
+
[key: string]: RelationshipTypes.Properties;
|
|
363
|
+
};
|
|
364
|
+
}
|
|
365
|
+
namespace RelationshipTypes {
|
|
366
|
+
/**
|
|
367
|
+
* Property definition for nodes/relationships
|
|
368
|
+
*/
|
|
369
|
+
interface Properties {
|
|
370
|
+
type: 'string' | 'integer' | 'float' | 'boolean' | 'array' | 'datetime' | 'object';
|
|
371
|
+
default?: unknown;
|
|
372
|
+
description?: string | null;
|
|
373
|
+
/**
|
|
374
|
+
* List of allowed enum values (max 10)
|
|
375
|
+
*/
|
|
376
|
+
enum_values?: Array<string> | null;
|
|
377
|
+
max_length?: number | null;
|
|
378
|
+
max_value?: number | null;
|
|
379
|
+
min_length?: number | null;
|
|
380
|
+
min_value?: number | null;
|
|
381
|
+
pattern?: string | null;
|
|
382
|
+
required?: boolean;
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
export interface SchemaUpdateParams {
|
|
387
|
+
body: {
|
|
388
|
+
[key: string]: unknown;
|
|
389
|
+
};
|
|
390
|
+
}
|
|
391
|
+
export interface SchemaListParams {
|
|
392
|
+
/**
|
|
393
|
+
* Filter by status (draft, active, deprecated, archived)
|
|
394
|
+
*/
|
|
395
|
+
status_filter?: string | null;
|
|
396
|
+
/**
|
|
397
|
+
* Filter by workspace ID
|
|
398
|
+
*/
|
|
399
|
+
workspace_id?: string | null;
|
|
400
|
+
}
|
|
401
|
+
export declare namespace Schemas {
|
|
402
|
+
export { type UserGraphSchemaOutput as UserGraphSchemaOutput, type SchemaCreateResponse as SchemaCreateResponse, type SchemaRetrieveResponse as SchemaRetrieveResponse, type SchemaUpdateResponse as SchemaUpdateResponse, type SchemaListResponse as SchemaListResponse, type SchemaDeleteResponse as SchemaDeleteResponse, type SchemaCreateParams as SchemaCreateParams, type SchemaUpdateParams as SchemaUpdateParams, type SchemaListParams as SchemaListParams, };
|
|
403
|
+
}
|
|
404
|
+
//# sourceMappingURL=schemas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../src/resources/schemas.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAGzB,qBAAa,OAAQ,SAAQ,WAAW;IACtC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAkEG;IACH,MAAM,CAAC,IAAI,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,oBAAoB,CAAC;IAI5F;;;;;OAKG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,sBAAsB,CAAC;IAIxF;;;;;;OAMG;IACH,MAAM,CACJ,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,kBAAkB,EAC1B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,oBAAoB,CAAC;IAKnC;;;;;;;;;;;;;OAaG;IACH,IAAI,CACF,KAAK,GAAE,gBAAgB,GAAG,IAAI,GAAG,SAAc,EAC/C,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,kBAAkB,CAAC;IAIjC;;;;;;OAMG;IACH,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,OAAO,CAAC;CAGxE;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,MAAM,CAAC;IAEb,EAAE,CAAC,EAAE,MAAM,CAAC;IAEZ,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,WAAW,CAAC,EAAE,MAAM,GAAG,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,QAAQ,CAAC,EAAE,OAAO,CAAC;SACpB;KACF;CACF;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAC;CAClC;AAED,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE9B;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B;AAED,MAAM,CAAC,OAAO,WAAW,OAAO,CAAC;IAC/B,OAAO,EACL,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,gBAAgB,IAAI,gBAAgB,GAC1C,CAAC;CACH"}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.Schemas = void 0;
|
|
5
|
+
const resource_1 = require("../core/resource.js");
|
|
6
|
+
const path_1 = require("../internal/utils/path.js");
|
|
7
|
+
class Schemas extends resource_1.APIResource {
|
|
8
|
+
/**
|
|
9
|
+
* Create a new user-defined graph schema.
|
|
10
|
+
*
|
|
11
|
+
* This endpoint allows users to define custom node types and relationships for their knowledge graph.
|
|
12
|
+
* The schema will be validated and stored for use in future memory extractions.
|
|
13
|
+
*
|
|
14
|
+
* **Features:**
|
|
15
|
+
* - Define custom node types with properties and validation rules
|
|
16
|
+
* - Define custom relationship types with constraints
|
|
17
|
+
* - Automatic validation against system schemas
|
|
18
|
+
* - Support for different scopes (personal, workspace, organization)
|
|
19
|
+
* - **Enum support**: Use `enum_values` to restrict property values to a predefined list (max 10 values)
|
|
20
|
+
* - **Auto-indexing**: Required properties are automatically indexed in Neo4j for optimal query performance
|
|
21
|
+
*
|
|
22
|
+
* **Property Types & Validation:**
|
|
23
|
+
* - `string`: Text values with optional `enum_values`, `min_length`, `max_length`, `pattern`
|
|
24
|
+
* - `integer`: Whole numbers with optional `min_value`, `max_value`
|
|
25
|
+
* - `float`: Decimal numbers with optional `min_value`, `max_value`
|
|
26
|
+
* - `boolean`: True/false values
|
|
27
|
+
* - `datetime`: ISO 8601 timestamp strings
|
|
28
|
+
* - `array`: Lists of values
|
|
29
|
+
* - `object`: Complex nested objects
|
|
30
|
+
*
|
|
31
|
+
* **Enum Values:**
|
|
32
|
+
* - Add `enum_values` to any string property to restrict values to a predefined list
|
|
33
|
+
* - Maximum 10 enum values allowed per property
|
|
34
|
+
* - Use with `default` to set a default enum value
|
|
35
|
+
* - Example: `"enum_values": ["small", "medium", "large"]`
|
|
36
|
+
*
|
|
37
|
+
* **When to Use Enums:**
|
|
38
|
+
* - Limited, well-defined options (≤10 values): sizes, statuses, categories, priorities
|
|
39
|
+
* - Controlled vocabularies: "active/inactive", "high/medium/low", "bronze/silver/gold"
|
|
40
|
+
* - When you want exact matching and no variations
|
|
41
|
+
*
|
|
42
|
+
* **When to Avoid Enums:**
|
|
43
|
+
* - Open-ended text fields: names, titles, descriptions, addresses
|
|
44
|
+
* - Large sets of options (>10): countries, cities, product models
|
|
45
|
+
* - When you want semantic similarity matching for entity resolution
|
|
46
|
+
* - Dynamic or frequently changing value sets
|
|
47
|
+
*
|
|
48
|
+
* **Unique Identifiers & Entity Resolution:**
|
|
49
|
+
* - Properties marked as `unique_identifiers` are used for entity deduplication and merging
|
|
50
|
+
* - **With enum_values**: Exact matching is used - entities with the same enum value are considered identical
|
|
51
|
+
* - **Without enum_values**: Semantic similarity matching is used - entities with similar meanings are automatically merged
|
|
52
|
+
* - Example: A "name" unique_identifier without enums will merge "Apple Inc" and "Apple Inc." as the same entity
|
|
53
|
+
* - Example: A "sku" unique_identifier with enums will only merge entities with exactly matching SKU codes
|
|
54
|
+
* - Use enums for unique_identifiers when you have a limited, predefined set of values (≤10 options)
|
|
55
|
+
* - Avoid enums for unique_identifiers when you have broad, open-ended values or >10 possible options
|
|
56
|
+
* - **Best practices**: Use enums for controlled vocabularies (status codes, categories), avoid for open text (company names, product titles)
|
|
57
|
+
* - **In the example above**: "name" uses semantic similarity (open-ended), "sku" uses exact matching (controlled set)
|
|
58
|
+
*
|
|
59
|
+
* **LLM-Friendly Descriptions:**
|
|
60
|
+
* - Write detailed property descriptions that guide the LLM on expected formats and usage
|
|
61
|
+
* - Include examples of typical values (e.g., "Product name, typically 2-4 words like 'iPhone 15 Pro'")
|
|
62
|
+
* - Specify data formats and constraints clearly (e.g., "Price in USD as decimal number")
|
|
63
|
+
* - For enums, explain when to use each option (e.g., "use 'new' for brand new items")
|
|
64
|
+
*
|
|
65
|
+
* **Authentication Required**:
|
|
66
|
+
* One of the following authentication methods must be used:
|
|
67
|
+
* - Bearer token in `Authorization` header
|
|
68
|
+
* - API Key in `X-API-Key` header
|
|
69
|
+
* - Session token in `X-Session-Token` header
|
|
70
|
+
*
|
|
71
|
+
* **Required Headers**:
|
|
72
|
+
* - Content-Type: application/json
|
|
73
|
+
* - X-Client-Type: (e.g., 'papr_plugin', 'browser_extension')
|
|
74
|
+
*/
|
|
75
|
+
create(body, options) {
|
|
76
|
+
return this._client.post('/v1/schemas', { body, ...options });
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Get a specific schema by ID.
|
|
80
|
+
*
|
|
81
|
+
* Returns the complete schema definition including node types, relationship types,
|
|
82
|
+
* and metadata. User must have read access to the schema.
|
|
83
|
+
*/
|
|
84
|
+
retrieve(schemaID, options) {
|
|
85
|
+
return this._client.get((0, path_1.path) `/v1/schemas/${schemaID}`, options);
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Update an existing schema.
|
|
89
|
+
*
|
|
90
|
+
* Allows modification of schema properties, node types, and relationship types.
|
|
91
|
+
* User must have write access to the schema. Updates create a new version
|
|
92
|
+
* while preserving the existing data.
|
|
93
|
+
*/
|
|
94
|
+
update(schemaID, params, options) {
|
|
95
|
+
const { body } = params;
|
|
96
|
+
return this._client.put((0, path_1.path) `/v1/schemas/${schemaID}`, { body: body, ...options });
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* List all schemas accessible to the authenticated user.
|
|
100
|
+
*
|
|
101
|
+
* Returns schemas that the user owns or has read access to, including:
|
|
102
|
+
* - Personal schemas created by the user
|
|
103
|
+
* - Workspace schemas shared within the user's workspace
|
|
104
|
+
* - Organization schemas available to the user's organization
|
|
105
|
+
*
|
|
106
|
+
* **Authentication Required**:
|
|
107
|
+
* One of the following authentication methods must be used:
|
|
108
|
+
* - Bearer token in `Authorization` header
|
|
109
|
+
* - API Key in `X-API-Key` header
|
|
110
|
+
* - Session token in `X-Session-Token` header
|
|
111
|
+
*/
|
|
112
|
+
list(query = {}, options) {
|
|
113
|
+
return this._client.get('/v1/schemas', { query, ...options });
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Delete a schema.
|
|
117
|
+
*
|
|
118
|
+
* Soft deletes the schema by marking it as archived. The schema data and
|
|
119
|
+
* associated graph nodes/relationships are preserved for data integrity.
|
|
120
|
+
* User must have write access to the schema.
|
|
121
|
+
*/
|
|
122
|
+
delete(schemaID, options) {
|
|
123
|
+
return this._client.delete((0, path_1.path) `/v1/schemas/${schemaID}`, options);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
exports.Schemas = Schemas;
|
|
127
|
+
//# sourceMappingURL=schemas.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemas.js","sourceRoot":"","sources":["../src/resources/schemas.ts"],"names":[],"mappings":";AAAA,sFAAsF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