@colisweb/rescript-toolkit 2.51.2 → 2.53.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/package.json +14 -15
- package/src/vendors/Axios.res +114 -6
- package/src/vendors/BsSentry.res +0 -64
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@colisweb/rescript-toolkit",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.53.0",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"clean": "rescript clean",
|
|
6
6
|
"build": "rescript build -with-deps",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"@colisweb/bs-react-intl-extractor-bin": "0.12.2",
|
|
28
28
|
"@colisweb/react-day-picker": "7.4.16",
|
|
29
29
|
"@colisweb/restorative": "0.5.1",
|
|
30
|
-
"@datadog/browser-rum": "4.
|
|
30
|
+
"@datadog/browser-rum": "4.21.1",
|
|
31
31
|
"@reach/accordion": "0.17.0",
|
|
32
32
|
"@reach/alert-dialog": "0.17.0",
|
|
33
33
|
"@reach/auto-id": "0.17.0",
|
|
@@ -42,48 +42,47 @@
|
|
|
42
42
|
"@reach/tooltip": "0.17.0",
|
|
43
43
|
"@reach/visually-hidden": "0.17.0",
|
|
44
44
|
"@rescript/react": "0.10.3",
|
|
45
|
-
"@tailwindcss/line-clamp": "0.4.
|
|
46
|
-
"autoprefixer": "10.4.
|
|
45
|
+
"@tailwindcss/line-clamp": "0.4.2",
|
|
46
|
+
"autoprefixer": "10.4.12",
|
|
47
47
|
"axios": "0.24.0",
|
|
48
48
|
"bs-axios": "0.0.43",
|
|
49
49
|
"case": "1.6.3",
|
|
50
50
|
"click-outside-hook": "1.1.0",
|
|
51
|
-
"copy-to-clipboard": "3.3.
|
|
52
|
-
"date-fns": "2.29.
|
|
53
|
-
"decco": "1.
|
|
51
|
+
"copy-to-clipboard": "3.3.2",
|
|
52
|
+
"date-fns": "2.29.3",
|
|
53
|
+
"decco": "1.6.0",
|
|
54
54
|
"dedent": "0.7.0",
|
|
55
55
|
"downshift": "5.2.5",
|
|
56
56
|
"lenses-ppx": "6.1.10",
|
|
57
57
|
"list-selectors": "2.0.1",
|
|
58
58
|
"lodash": "4.17.21",
|
|
59
|
-
"postcss": "8.4.
|
|
59
|
+
"postcss": "8.4.17",
|
|
60
60
|
"postcss-loader": "4.2.0",
|
|
61
61
|
"postcss-preset-env": "6.7.0",
|
|
62
|
-
"prismjs": "1.
|
|
62
|
+
"prismjs": "1.29.0",
|
|
63
63
|
"react": "18.2.0",
|
|
64
|
-
"react-big-calendar": "1.0
|
|
64
|
+
"react-big-calendar": "1.5.0",
|
|
65
65
|
"react-datepicker": "3.8.0",
|
|
66
66
|
"react-dom": "18.2.0",
|
|
67
67
|
"react-error-boundary": "3.1.4",
|
|
68
68
|
"react-helmet": "6.1.0",
|
|
69
69
|
"react-icons": "4.4.0",
|
|
70
|
-
"react-intl": "6.
|
|
70
|
+
"react-intl": "6.1.2",
|
|
71
71
|
"react-select": "5.4.0",
|
|
72
72
|
"react-table": "7.8.0",
|
|
73
73
|
"react-use": "17.4.0",
|
|
74
74
|
"reason-promise": "1.1.5",
|
|
75
75
|
"res-react-intl": "3.1.2",
|
|
76
76
|
"reschema": "1.3.1",
|
|
77
|
-
"rescript": "10.0.
|
|
77
|
+
"rescript": "10.0.1",
|
|
78
78
|
"rescript-classnames": "6.0.0",
|
|
79
79
|
"rescript-react-update": "5.0.0",
|
|
80
80
|
"sanitize-html": "1.27.4",
|
|
81
81
|
"swr": "1.3.0",
|
|
82
|
-
"tailwindcss": "3.1.
|
|
82
|
+
"tailwindcss": "3.1.8"
|
|
83
83
|
},
|
|
84
84
|
"devDependencies": {
|
|
85
85
|
"@babel/core": "7.18.6",
|
|
86
|
-
"@sentry/browser": "6.17.6",
|
|
87
86
|
"@storybook/addon-actions": "6.1.21",
|
|
88
87
|
"@storybook/addon-essentials": "6.1.21",
|
|
89
88
|
"@storybook/addon-knobs": "6.1.21",
|
|
@@ -93,7 +92,7 @@
|
|
|
93
92
|
"@storybook/theming": "6.1.21",
|
|
94
93
|
"babel-loader": "8.2.5",
|
|
95
94
|
"highlight.js": "11.3.1",
|
|
96
|
-
"husky": "8.0.
|
|
95
|
+
"husky": "8.0.1",
|
|
97
96
|
"is-ci": "3.0.1",
|
|
98
97
|
"raw-loader": "4.0.2",
|
|
99
98
|
"react-is": "17.0.2",
|
package/src/vendors/Axios.res
CHANGED
|
@@ -97,6 +97,70 @@ external delete: (string, ~config: config=?, unit) => Promise.Js.t<response<'dat
|
|
|
97
97
|
external options: (string, ~config: config=?, unit) => Promise.Js.t<response<'data>, 'err> =
|
|
98
98
|
"options"
|
|
99
99
|
|
|
100
|
+
module Instance = {
|
|
101
|
+
type t
|
|
102
|
+
|
|
103
|
+
@module("axios")
|
|
104
|
+
external create: config => t = "create"
|
|
105
|
+
|
|
106
|
+
@send
|
|
107
|
+
external get: (t, string, ~config: config=?, unit) => Promise.Js.t<response<'data>, 'err> = "get"
|
|
108
|
+
|
|
109
|
+
@send
|
|
110
|
+
external post: (
|
|
111
|
+
t,
|
|
112
|
+
string,
|
|
113
|
+
~data: 'a,
|
|
114
|
+
~config: config=?,
|
|
115
|
+
unit,
|
|
116
|
+
) => Promise.Js.t<response<'data>, 'err> = "post"
|
|
117
|
+
|
|
118
|
+
@send
|
|
119
|
+
external put: (
|
|
120
|
+
t,
|
|
121
|
+
string,
|
|
122
|
+
~data: 'a,
|
|
123
|
+
~config: config=?,
|
|
124
|
+
unit,
|
|
125
|
+
) => Promise.Js.t<response<'data>, 'err> = "put"
|
|
126
|
+
|
|
127
|
+
@send
|
|
128
|
+
external patch: (
|
|
129
|
+
t,
|
|
130
|
+
string,
|
|
131
|
+
~data: 'a,
|
|
132
|
+
~config: config=?,
|
|
133
|
+
unit,
|
|
134
|
+
) => Promise.Js.t<response<'data>, 'err> = "patch"
|
|
135
|
+
|
|
136
|
+
@send
|
|
137
|
+
external delete: (t, string, ~config: config=?, unit) => Promise.Js.t<response<'data>, 'err> =
|
|
138
|
+
"delete"
|
|
139
|
+
|
|
140
|
+
@send
|
|
141
|
+
external options: (t, string, ~config: config=?, unit) => Promise.Js.t<response<'data>, 'err> =
|
|
142
|
+
"options"
|
|
143
|
+
|
|
144
|
+
module Interceptors = {
|
|
145
|
+
type interceptor
|
|
146
|
+
module Request = {
|
|
147
|
+
@send @scope(("interceptors", "request"))
|
|
148
|
+
external use: (t, 'config => Promise.Js.t<'updatedConfig, 'error>) => interceptor = "use"
|
|
149
|
+
|
|
150
|
+
@send @scope(("interceptors", "request"))
|
|
151
|
+
external eject: (t, interceptor) => unit = "eject"
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
module Response = {
|
|
155
|
+
@send @scope(("interceptors", "response"))
|
|
156
|
+
external use: (t, 'res => 'res, error<'z> => 'a) => unit = "use"
|
|
157
|
+
|
|
158
|
+
@send @scope(("interceptors", "response"))
|
|
159
|
+
external eject: (t, interceptor) => unit = "eject"
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
100
164
|
module Interceptors = {
|
|
101
165
|
type t
|
|
102
166
|
module Request = {
|
|
@@ -106,6 +170,14 @@ module Interceptors = {
|
|
|
106
170
|
@module("axios") @scope(("default", "interceptors", "request"))
|
|
107
171
|
external eject: t => unit = "eject"
|
|
108
172
|
}
|
|
173
|
+
|
|
174
|
+
module Response = {
|
|
175
|
+
@module("axios") @scope(("default", "interceptors", "response"))
|
|
176
|
+
external use: ('res => 'res, error<'z> => 'a) => unit = "use"
|
|
177
|
+
|
|
178
|
+
@module("axios") @scope(("default", "interceptors", "response"))
|
|
179
|
+
external eject: t => unit = "eject"
|
|
180
|
+
}
|
|
109
181
|
}
|
|
110
182
|
|
|
111
183
|
module WithResult = {
|
|
@@ -133,47 +205,83 @@ module WithResult = {
|
|
|
133
205
|
})
|
|
134
206
|
|
|
135
207
|
let get = (
|
|
208
|
+
~instance=?,
|
|
136
209
|
~config=?,
|
|
137
210
|
~decodeData: decodeData<'newData>,
|
|
138
211
|
~mapError: option<mapError<'a, 'response, 'headers, 'request>>=?,
|
|
139
212
|
string,
|
|
140
|
-
) =>
|
|
213
|
+
) =>
|
|
214
|
+
switch instance {
|
|
215
|
+
| None => get(string, ~config?, ())->toResult(~decodeData, ~mapError)
|
|
216
|
+
| Some(instance) =>
|
|
217
|
+
instance->Instance.get(string, ~config?, ())->toResult(~decodeData, ~mapError)
|
|
218
|
+
}
|
|
141
219
|
|
|
142
220
|
let post = (
|
|
221
|
+
~instance=?,
|
|
143
222
|
~data,
|
|
144
223
|
~config=?,
|
|
145
224
|
~decodeData: decodeData<'newData>,
|
|
146
225
|
~mapError: option<mapError<'a, 'response, 'headers, 'request>>=?,
|
|
147
226
|
string,
|
|
148
|
-
) =>
|
|
227
|
+
) =>
|
|
228
|
+
switch instance {
|
|
229
|
+
| None => post(string, ~data, ~config?, ())->toResult(~decodeData, ~mapError)
|
|
230
|
+
| Some(instance) =>
|
|
231
|
+
instance->Instance.post(string, ~data, ~config?, ())->toResult(~decodeData, ~mapError)
|
|
232
|
+
}
|
|
149
233
|
|
|
150
234
|
let put = (
|
|
235
|
+
~instance=?,
|
|
151
236
|
~data,
|
|
152
237
|
~config=?,
|
|
153
238
|
~decodeData: decodeData<'newData>,
|
|
154
239
|
~mapError: option<mapError<'a, 'response, 'headers, 'request>>=?,
|
|
155
240
|
string,
|
|
156
|
-
) =>
|
|
241
|
+
) =>
|
|
242
|
+
switch instance {
|
|
243
|
+
| None => put(string, ~data, ~config?, ())->toResult(~decodeData, ~mapError)
|
|
244
|
+
| Some(instance) =>
|
|
245
|
+
instance->Instance.put(string, ~data, ~config?, ())->toResult(~decodeData, ~mapError)
|
|
246
|
+
}
|
|
157
247
|
|
|
158
248
|
let patch = (
|
|
249
|
+
~instance=?,
|
|
159
250
|
~data,
|
|
160
251
|
~config=?,
|
|
161
252
|
~decodeData: decodeData<'newData>,
|
|
162
253
|
~mapError: option<mapError<'a, 'response, 'headers, 'request>>=?,
|
|
163
254
|
string,
|
|
164
|
-
) =>
|
|
255
|
+
) =>
|
|
256
|
+
switch instance {
|
|
257
|
+
| None => patch(string, ~data, ~config?, ())->toResult(~decodeData, ~mapError)
|
|
258
|
+
| Some(instance) =>
|
|
259
|
+
instance->Instance.patch(string, ~data, ~config?, ())->toResult(~decodeData, ~mapError)
|
|
260
|
+
}
|
|
165
261
|
|
|
166
262
|
let delete = (
|
|
263
|
+
~instance=?,
|
|
167
264
|
~config=?,
|
|
168
265
|
~decodeData: decodeData<'newData>,
|
|
169
266
|
~mapError: option<mapError<'a, 'response, 'headers, 'request>>=?,
|
|
170
267
|
string,
|
|
171
|
-
) =>
|
|
268
|
+
) =>
|
|
269
|
+
switch instance {
|
|
270
|
+
| None => delete(string, ~config?, ())->toResult(~decodeData, ~mapError)
|
|
271
|
+
| Some(instance) =>
|
|
272
|
+
instance->Instance.delete(string, ~config?, ())->toResult(~decodeData, ~mapError)
|
|
273
|
+
}
|
|
172
274
|
|
|
173
275
|
let options = (
|
|
276
|
+
~instance=?,
|
|
174
277
|
~config=?,
|
|
175
278
|
~decodeData: decodeData<'newData>,
|
|
176
279
|
~mapError: option<mapError<'a, 'response, 'headers, 'request>>=?,
|
|
177
280
|
string,
|
|
178
|
-
) =>
|
|
281
|
+
) =>
|
|
282
|
+
switch instance {
|
|
283
|
+
| None => options(string, ~config?, ())->toResult(~decodeData, ~mapError)
|
|
284
|
+
| Some(instance) =>
|
|
285
|
+
instance->Instance.options(string, ~config?, ())->toResult(~decodeData, ~mapError)
|
|
286
|
+
}
|
|
179
287
|
}
|
package/src/vendors/BsSentry.res
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
module Sentry = {
|
|
2
|
-
// init
|
|
3
|
-
type initOptions
|
|
4
|
-
type integration
|
|
5
|
-
|
|
6
|
-
@module("@sentry/tracing") @as("Integrations") @new
|
|
7
|
-
external browserTracing: unit => integration = "BrowserTracing"
|
|
8
|
-
|
|
9
|
-
@obj
|
|
10
|
-
external initOptions: (
|
|
11
|
-
~dsn: string,
|
|
12
|
-
~environment: string,
|
|
13
|
-
~beforeSend: ('a, 'b) => 'c=?,
|
|
14
|
-
~ignoreErrors: array<string>=?,
|
|
15
|
-
~integrations: array<integration>=?,
|
|
16
|
-
unit,
|
|
17
|
-
) => initOptions = ""
|
|
18
|
-
|
|
19
|
-
@module("@sentry/browser") external init: initOptions => unit = "init"
|
|
20
|
-
|
|
21
|
-
// setTag
|
|
22
|
-
@module("@sentry/browser")
|
|
23
|
-
external setTag: (string, string) => unit = "setTag"
|
|
24
|
-
|
|
25
|
-
// addBreadcrumb
|
|
26
|
-
type breadcrumbOptions
|
|
27
|
-
|
|
28
|
-
@obj
|
|
29
|
-
external breadcrumbOptions: (
|
|
30
|
-
~data: option<Js.t<'a>>,
|
|
31
|
-
~category: string,
|
|
32
|
-
~message: string,
|
|
33
|
-
~level: [#fatal | #error | #warning | #info | #debug],
|
|
34
|
-
) => breadcrumbOptions = ""
|
|
35
|
-
|
|
36
|
-
@module("@sentry/browser")
|
|
37
|
-
external addBreadcrumb: breadcrumbOptions => unit = "addBreadcrumb"
|
|
38
|
-
|
|
39
|
-
// setUser
|
|
40
|
-
@module("@sentry/browser") external setUser: 'user => unit = "setUser"
|
|
41
|
-
|
|
42
|
-
module Scope = {
|
|
43
|
-
type t
|
|
44
|
-
|
|
45
|
-
@send external setExtra: (t, string, 'a) => unit = "setExtra"
|
|
46
|
-
@send external setTag: (t, string, 'a) => unit = "setTag"
|
|
47
|
-
@send external setUser: (t, 'a) => unit = "setUser"
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
// withScope
|
|
51
|
-
@module("@sentry/browser")
|
|
52
|
-
external withScope: (Scope.t => unit) => unit = "withScope"
|
|
53
|
-
|
|
54
|
-
@module("@sentry/browser")
|
|
55
|
-
external configureScope: (Scope.t => unit) => unit = "configureScope"
|
|
56
|
-
|
|
57
|
-
// captureException
|
|
58
|
-
@module("@sentry/browser")
|
|
59
|
-
external captureException: Js.Promise.error => unit = "captureException"
|
|
60
|
-
|
|
61
|
-
// captureMessage
|
|
62
|
-
@module("@sentry/browser")
|
|
63
|
-
external captureMessage: string => unit = "captureMessage"
|
|
64
|
-
}
|