@fabriktor/client 0.0.99 → 0.0.100
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/src/core/crud.d.ts
CHANGED
|
@@ -25,11 +25,11 @@ export type UpsertOneOptionsCRUD<In> = {
|
|
|
25
25
|
export type FindOneOptionsCRUD = Pick<RequestOptions, "signal"> & {
|
|
26
26
|
id: string;
|
|
27
27
|
};
|
|
28
|
-
export type ReplaceOneOptionsCRUD<In> =
|
|
28
|
+
export type ReplaceOneOptionsCRUD<In> = RequestOptions & {
|
|
29
29
|
id: string;
|
|
30
30
|
in: Partial<In>;
|
|
31
31
|
};
|
|
32
|
-
export type DeleteOneOptionsCRUD = {
|
|
32
|
+
export type DeleteOneOptionsCRUD = Pick<RequestOptions, "signal"> & {
|
|
33
33
|
id: string;
|
|
34
34
|
};
|
|
35
35
|
export type SearchManyOptionsCRUD = Pick<RequestOptions, "signal"> & {
|
package/dist/src/core/crud.js
CHANGED
|
@@ -91,6 +91,7 @@ export class CRUDClient {
|
|
|
91
91
|
method: HTTPMethodPatch,
|
|
92
92
|
token,
|
|
93
93
|
signal: opts.signal,
|
|
94
|
+
idempotency_key: opts.idempotency_key,
|
|
94
95
|
body: opts.in,
|
|
95
96
|
});
|
|
96
97
|
}
|
|
@@ -105,6 +106,7 @@ export class CRUDClient {
|
|
|
105
106
|
}),
|
|
106
107
|
method: HTTPMethodDelete,
|
|
107
108
|
token,
|
|
109
|
+
signal: opts.signal,
|
|
108
110
|
});
|
|
109
111
|
}
|
|
110
112
|
async searchMany(opts) {
|
package/dist/src/feed/feed.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { type FeedFavorite, type FeedPost, type FeedReaction, type InFeedFavorite, type InFeedPost, type InFeedReaction, type OperationResult, type PLFeedPull, type PLFeedRestrict, type RPFeedPull } from "@fabriktor/schema";
|
|
2
2
|
import type { TokenProvider } from "../core/auth.js";
|
|
3
3
|
import type { DeleteOneOptionsCRUD, FindOneOptionsCRUD, InsertOneOptionsCRUD, OperationResultOf, QueryOptionsCRUD, ReplaceOneOptionsCRUD, SearchManyOptionsCRUD, SearchResultOf } from "../core/crud.js";
|
|
4
|
-
import type { HTTPDoer } from "../core/http.js";
|
|
4
|
+
import type { HTTPDoer, RequestOptions } from "../core/http.js";
|
|
5
5
|
import type { CompletePayload } from "../core/type.js";
|
|
6
|
-
export type PullFeedOptions = CompletePayload<PLFeedPull
|
|
7
|
-
export type RestrictFeedOptions = CompletePayload<PLFeedRestrict
|
|
6
|
+
export type PullFeedOptions = CompletePayload<PLFeedPull> & RequestOptions;
|
|
7
|
+
export type RestrictFeedOptions = CompletePayload<PLFeedRestrict> & RequestOptions;
|
|
8
8
|
export type FeedClientOptions = {
|
|
9
9
|
http: HTTPDoer;
|
|
10
10
|
base_url: string;
|
package/dist/src/feed/feed.js
CHANGED
|
@@ -89,23 +89,31 @@ export class FeedClient {
|
|
|
89
89
|
return await this.feed_favorites.deleteOne(opts);
|
|
90
90
|
}
|
|
91
91
|
async pull(opts) {
|
|
92
|
+
const { signal, idempotency_key, ...body } = opts;
|
|
93
|
+
signal?.throwIfAborted();
|
|
92
94
|
const token = await requiredToken(this.get_token);
|
|
93
95
|
return await this.http.do({
|
|
94
96
|
base_url: this.base_url,
|
|
95
97
|
path: feedPostPath(PathPull),
|
|
96
98
|
method: HTTPMethodPost,
|
|
97
99
|
token,
|
|
98
|
-
body
|
|
100
|
+
body,
|
|
101
|
+
signal,
|
|
102
|
+
idempotency_key,
|
|
99
103
|
});
|
|
100
104
|
}
|
|
101
105
|
async restrict(opts) {
|
|
106
|
+
const { signal, idempotency_key, ...body } = opts;
|
|
107
|
+
signal?.throwIfAborted();
|
|
102
108
|
const token = await requiredToken(this.get_token);
|
|
103
109
|
return await this.http.do({
|
|
104
110
|
base_url: this.base_url,
|
|
105
111
|
path: feedPostPath(PathFeedRestrict),
|
|
106
112
|
method: HTTPMethodPost,
|
|
107
113
|
token,
|
|
108
|
-
body
|
|
114
|
+
body,
|
|
115
|
+
signal,
|
|
116
|
+
idempotency_key,
|
|
109
117
|
});
|
|
110
118
|
}
|
|
111
119
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { type InMarketplaceFavorite, type InMarketplacePost, type MarketplaceFavorite, type MarketplacePost, type OperationResult, type PLMarketplacePull, type RPMarketplacePull } from "@fabriktor/schema";
|
|
2
2
|
import type { TokenProvider } from "../core/auth.js";
|
|
3
3
|
import type { DeleteOneOptionsCRUD, FindOneOptionsCRUD, InsertOneOptionsCRUD, OperationResultOf, QueryOptionsCRUD, ReplaceOneOptionsCRUD, SearchManyOptionsCRUD, SearchResultOf } from "../core/crud.js";
|
|
4
|
-
import type { HTTPDoer } from "../core/http.js";
|
|
4
|
+
import type { HTTPDoer, RequestOptions } from "../core/http.js";
|
|
5
5
|
import type { CompletePayload } from "../core/type.js";
|
|
6
|
-
export type PullMarketplaceOptions = CompletePayload<PLMarketplacePull
|
|
6
|
+
export type PullMarketplaceOptions = CompletePayload<PLMarketplacePull> & RequestOptions;
|
|
7
7
|
export type MarketplaceClientOptions = {
|
|
8
8
|
http: HTTPDoer;
|
|
9
9
|
base_url: string;
|
|
@@ -66,13 +66,17 @@ export class MarketplaceClient {
|
|
|
66
66
|
return await this.marketplace_favorites.deleteOne(opts);
|
|
67
67
|
}
|
|
68
68
|
async pull(opts) {
|
|
69
|
+
const { signal, idempotency_key, ...body } = opts;
|
|
70
|
+
signal?.throwIfAborted();
|
|
69
71
|
const token = await requiredToken(this.get_token);
|
|
70
72
|
return await this.http.do({
|
|
71
73
|
base_url: this.base_url,
|
|
72
74
|
path: marketplacePostPath(PathPull),
|
|
73
75
|
method: HTTPMethodPost,
|
|
74
76
|
token,
|
|
75
|
-
body
|
|
77
|
+
body,
|
|
78
|
+
signal,
|
|
79
|
+
idempotency_key,
|
|
76
80
|
});
|
|
77
81
|
}
|
|
78
82
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fabriktor/client",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.100",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -17,6 +17,6 @@
|
|
|
17
17
|
"typescript": "^6.0.3"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@fabriktor/schema": "0.0.
|
|
20
|
+
"@fabriktor/schema": "0.0.70"
|
|
21
21
|
}
|
|
22
22
|
}
|