@mymehq/sdk 2.0.0 → 2.1.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/LICENSE +21 -0
- package/dist/index.d.ts +5 -23
- package/dist/index.js +0 -38
- package/package.json +11 -11
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Myme
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ConflictSnapshot, ItemState, CreateItemInput, Item, PaginatedResult, ItemWithMetadata, Version, Edge, Metadata, SearchResult,
|
|
2
|
-
export { ApiKey, ConflictSnapshot, CreateItemInput, CreateKeyInput, Item, ItemState, Metadata, PaginatedResult, SearchResult,
|
|
1
|
+
import { ConflictSnapshot, ItemState, CreateItemInput, Item, PaginatedResult, ItemWithMetadata, Version, Edge, Metadata, SearchResult, CreateEdgeInput, EdgeTypeSchema, TypeSchema, CreateKeyInput, ApiKey, CreateWebhookInput, Webhook, UpdateWebhookInput, WebhookDelivery, TenantConfig } from '@mymehq/shared';
|
|
2
|
+
export { ApiKey, ConflictSnapshot, CreateItemInput, CreateKeyInput, Item, ItemState, Metadata, PaginatedResult, SearchResult, TypeSchema, Version } from '@mymehq/shared';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Conflict resolution strategy for item updates.
|
|
@@ -51,13 +51,9 @@ interface ListFilters {
|
|
|
51
51
|
state?: ItemState;
|
|
52
52
|
source?: string;
|
|
53
53
|
/** Filter to items whose parent-of source is this id. Kept as a
|
|
54
|
-
* server-side convenience alias
|
|
55
|
-
*
|
|
56
|
-
* `edge[parent-of]` existence check. */
|
|
54
|
+
* server-side convenience alias for an `edge[parent-of]` existence
|
|
55
|
+
* check. */
|
|
57
56
|
parent_id?: string;
|
|
58
|
-
/** Filter to items in this thread. Server translates to
|
|
59
|
-
* `edge[in-thread]` check after the thread_id column was dropped. */
|
|
60
|
-
thread_id?: string;
|
|
61
57
|
root_only?: boolean;
|
|
62
58
|
/** When set, restricts the result to library items (true) or ambient
|
|
63
59
|
* items (false). Per V0 spec, the default unrestricted view returns
|
|
@@ -92,8 +88,7 @@ declare class MymeClient {
|
|
|
92
88
|
readonly items: {
|
|
93
89
|
create: (input: CreateItemInput & {
|
|
94
90
|
/** Atomic edges payload: for each edge type, listed ids become
|
|
95
|
-
* targets with the new item as source.
|
|
96
|
-
* / thread_id / about which were dropped in Wave 2 PR 4. */
|
|
91
|
+
* targets with the new item as source. */
|
|
97
92
|
edges?: Record<string, string[]>;
|
|
98
93
|
}) => Promise<Item>;
|
|
99
94
|
get: (id: string) => Promise<Item>;
|
|
@@ -132,19 +127,6 @@ declare class MymeClient {
|
|
|
132
127
|
deleteExtension: (itemId: string, namespace: string) => Promise<void>;
|
|
133
128
|
};
|
|
134
129
|
search(query: string, filters?: SearchFilters): Promise<SearchResult[]>;
|
|
135
|
-
readonly threads: {
|
|
136
|
-
create: () => Promise<Thread>;
|
|
137
|
-
list: (filters?: {
|
|
138
|
-
limit?: number;
|
|
139
|
-
cursor?: string;
|
|
140
|
-
}) => Promise<PaginatedResult<Thread>>;
|
|
141
|
-
get: (id: string) => Promise<{
|
|
142
|
-
thread: Thread;
|
|
143
|
-
items: Item[];
|
|
144
|
-
}>;
|
|
145
|
-
addItem: (threadId: string, itemId: string) => Promise<Item>;
|
|
146
|
-
removeItem: (threadId: string, itemId: string) => Promise<Item>;
|
|
147
|
-
};
|
|
148
130
|
readonly edges: {
|
|
149
131
|
/** Create a single edge. Server enforces cardinality / type
|
|
150
132
|
* constraints / cycle prevention; throws on violation. */
|
package/dist/index.js
CHANGED
|
@@ -401,44 +401,6 @@ var MymeClient = class {
|
|
|
401
401
|
);
|
|
402
402
|
return res.results;
|
|
403
403
|
}
|
|
404
|
-
// ---- Threads ----
|
|
405
|
-
threads = {
|
|
406
|
-
create: async () => {
|
|
407
|
-
const res = await this.transport.request(
|
|
408
|
-
"POST",
|
|
409
|
-
"/threads"
|
|
410
|
-
);
|
|
411
|
-
return res.thread;
|
|
412
|
-
},
|
|
413
|
-
list: async (filters) => {
|
|
414
|
-
return this.transport.request(
|
|
415
|
-
"GET",
|
|
416
|
-
"/threads",
|
|
417
|
-
{ query: filters }
|
|
418
|
-
);
|
|
419
|
-
},
|
|
420
|
-
get: async (id) => {
|
|
421
|
-
return this.transport.request(
|
|
422
|
-
"GET",
|
|
423
|
-
`/threads/${id}`
|
|
424
|
-
);
|
|
425
|
-
},
|
|
426
|
-
addItem: async (threadId, itemId) => {
|
|
427
|
-
const res = await this.transport.request(
|
|
428
|
-
"POST",
|
|
429
|
-
`/threads/${threadId}/items`,
|
|
430
|
-
{ body: { item_id: itemId } }
|
|
431
|
-
);
|
|
432
|
-
return res.item;
|
|
433
|
-
},
|
|
434
|
-
removeItem: async (threadId, itemId) => {
|
|
435
|
-
const res = await this.transport.request(
|
|
436
|
-
"DELETE",
|
|
437
|
-
`/threads/${threadId}/items/${itemId}`
|
|
438
|
-
);
|
|
439
|
-
return res.item;
|
|
440
|
-
}
|
|
441
|
-
};
|
|
442
404
|
// ---- Edges ----
|
|
443
405
|
edges = {
|
|
444
406
|
/** Create a single edge. Server enforces cardinality / type
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mymehq/sdk",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org",
|
|
@@ -15,19 +15,19 @@
|
|
|
15
15
|
"files": [
|
|
16
16
|
"dist"
|
|
17
17
|
],
|
|
18
|
-
"scripts": {
|
|
19
|
-
"build": "tsup",
|
|
20
|
-
"typecheck": "tsc --noEmit",
|
|
21
|
-
"test": "vitest run",
|
|
22
|
-
"test:watch": "vitest"
|
|
23
|
-
},
|
|
24
18
|
"dependencies": {
|
|
25
|
-
"@mymehq/shared": "
|
|
19
|
+
"@mymehq/shared": "2.1.0"
|
|
26
20
|
},
|
|
27
21
|
"devDependencies": {
|
|
28
|
-
"@mymehq/server": "workspace:*",
|
|
29
22
|
"@types/node": "^22.0.0",
|
|
30
23
|
"tsup": "^8.5.1",
|
|
31
|
-
"typescript": "^6.0.2"
|
|
24
|
+
"typescript": "^6.0.2",
|
|
25
|
+
"@mymehq/server": "0.0.1"
|
|
26
|
+
},
|
|
27
|
+
"scripts": {
|
|
28
|
+
"build": "tsup",
|
|
29
|
+
"typecheck": "tsc --noEmit",
|
|
30
|
+
"test": "vitest run",
|
|
31
|
+
"test:watch": "vitest"
|
|
32
32
|
}
|
|
33
|
-
}
|
|
33
|
+
}
|