@fabriktor/client 0.0.86 → 0.0.88
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
|
@@ -12,7 +12,7 @@ export type CRUDClientOptions = {
|
|
|
12
12
|
col: string;
|
|
13
13
|
get_token?: TokenProvider;
|
|
14
14
|
};
|
|
15
|
-
export type QueryOptionsCRUD = {
|
|
15
|
+
export type QueryOptionsCRUD = Pick<RequestOptions, "signal"> & {
|
|
16
16
|
query?: QueryOptions;
|
|
17
17
|
};
|
|
18
18
|
export type InsertOneOptionsCRUD<In> = RequestOptions & {
|
package/dist/src/core/crud.js
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
import { ColTimesheetsSummaries, ColTimesheetsWeekSheets, HTTPMethodPost, PathTimesheetsApprove, PathTimesheetsPunch, PathTimesheetsSync, SvcTimesheets, } from "@fabriktor/schema";
|
|
7
7
|
import { requiredToken } from "../core/auth.js";
|
|
8
8
|
import { newCRUDClient } from "../core/crud.js";
|
|
9
|
+
import { newIdempotencyKey } from "../core/idempotency.js";
|
|
9
10
|
import { buildPath } from "../core/path.js";
|
|
10
11
|
export class TimesheetsClient {
|
|
11
12
|
weeksheets;
|
|
@@ -64,6 +65,8 @@ export class TimesheetsClient {
|
|
|
64
65
|
method: HTTPMethodPost,
|
|
65
66
|
token,
|
|
66
67
|
body: opts,
|
|
68
|
+
// Each intentional action is distinct. Never replay a timed-out punch.
|
|
69
|
+
idempotency_key: newIdempotencyKey(),
|
|
67
70
|
});
|
|
68
71
|
}
|
|
69
72
|
async sync(opts) {
|
|
@@ -74,6 +77,8 @@ export class TimesheetsClient {
|
|
|
74
77
|
method: HTTPMethodPost,
|
|
75
78
|
token,
|
|
76
79
|
body: opts,
|
|
80
|
+
// Each intentional action is distinct. Never replay a timed-out punch.
|
|
81
|
+
idempotency_key: newIdempotencyKey(),
|
|
77
82
|
});
|
|
78
83
|
}
|
|
79
84
|
async punch(opts) {
|
|
@@ -84,6 +89,8 @@ export class TimesheetsClient {
|
|
|
84
89
|
method: HTTPMethodPost,
|
|
85
90
|
token,
|
|
86
91
|
body: opts,
|
|
92
|
+
// Each intentional action is distinct. Never replay a timed-out punch.
|
|
93
|
+
idempotency_key: newIdempotencyKey(),
|
|
87
94
|
});
|
|
88
95
|
}
|
|
89
96
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fabriktor/client",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.88",
|
|
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.64"
|
|
21
21
|
}
|
|
22
22
|
}
|