@commercelayer/app-elements 2.3.4 → 2.3.6
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/{InputDateComponent-DVeJh7Yg.js → InputDateComponent-DB9A3Wki.js} +1 -1
- package/dist/{main-oyG8loOE.js → main-QhVMvWFU.js} +7306 -7047
- package/dist/main.d.ts +3 -2
- package/dist/main.js +166 -162
- package/dist/mocks/data/markets.d.ts +2 -0
- package/dist/providers/TokenProvider/TokenProvider.d.ts +2 -8
- package/dist/providers/TokenProvider/extras.d.ts +22 -0
- package/dist/providers/TokenProvider/index.d.ts +2 -1
- package/dist/providers/TokenProvider/storage.d.ts +11 -4
- package/dist/providers/TokenProvider/types.d.ts +15 -6
- package/dist/style.css +1 -1
- package/dist/tailwind.config.js +11 -11
- package/dist/ui/atoms/Icon/icons.d.ts +1 -0
- package/dist/ui/composite/Dropdown/DropdownItem.d.ts +2 -0
- package/dist/ui/composite/Routes/Routes.d.ts +68 -0
- package/dist/ui/composite/Routes/index.d.ts +2 -0
- package/dist/ui/composite/Routes/utils.test.d.ts +1 -0
- package/dist/ui/composite/Toolbar.d.ts +1 -0
- package/dist/ui/forms/MarketWithCurrencySelector/HookedMarketWithCurrencySelector.d.ts +20 -0
- package/dist/ui/forms/MarketWithCurrencySelector/HookedMarketWithCurrencySelector.test.d.ts +1 -0
- package/dist/ui/forms/MarketWithCurrencySelector/index.d.ts +1 -0
- package/dist/vendor.css +1 -1
- package/package.json +1 -1
- /package/dist/{helpers/route.test.d.ts → providers/TokenProvider/extras.test.d.ts} +0 -0
- /package/dist/{helpers/route.d.ts → ui/composite/Routes/utils.d.ts} +0 -0
package/dist/main.d.ts
CHANGED
|
@@ -6,7 +6,6 @@ export { formatDate, formatDateRange, formatDateWithPredicate, getEventDateInfo,
|
|
|
6
6
|
export { downloadJsonAsFile } from './helpers/downloadJsonAsFile';
|
|
7
7
|
export { computeFullname, formatDisplayName } from './helpers/name';
|
|
8
8
|
export { formatResourceName, type TriggerAttribute } from './helpers/resources';
|
|
9
|
-
export { createRoute, createTypedRoute, type GetParams, type Route } from './helpers/route';
|
|
10
9
|
export { getAvatarSrcFromRate, getParcelTrackingDetail, getParcelTrackingDetails, getShipmentRate, getShipmentRates, hasBeenPurchased, hasSingleTracking, type Rate, type TrackingDetail } from './helpers/tracking';
|
|
11
10
|
export { getUnitOfWeightName, getUnitsOfWeightForSelect, type UnitOfWeight } from './helpers/unitsOfWeight';
|
|
12
11
|
export { useClickAway } from './hooks/useClickAway';
|
|
@@ -19,7 +18,7 @@ export { CoreSdkProvider, useCoreApi, useCoreSdkProvider } from './providers/Cor
|
|
|
19
18
|
export { createApp, type ClAppKey, type ClAppProps } from './providers/createApp';
|
|
20
19
|
export { ErrorBoundary } from './providers/ErrorBoundary';
|
|
21
20
|
export { GTMProvider, useTagManager } from './providers/GTMProvider';
|
|
22
|
-
export { MetaTags, TokenProvider, useTokenProvider, type TokenProviderAllowedApp, type TokenProviderPermissionItem, type TokenProviderRoleActions, type TokenProviderRolePermissions, type TokenProviderTokenApplicationKind } from './providers/TokenProvider';
|
|
21
|
+
export { MetaTags, TokenProvider, encodeExtras, useTokenProvider, type TokenProviderAllowedApp, type TokenProviderExtras, type TokenProviderPermissionItem, type TokenProviderRoleActions, type TokenProviderRolePermissions, type TokenProviderTokenApplicationKind } from './providers/TokenProvider';
|
|
23
22
|
export { A, type AProps } from './ui/atoms/A';
|
|
24
23
|
export { Alert, type AlertProps } from './ui/atoms/Alert';
|
|
25
24
|
export { Avatar, type AvatarProps } from './ui/atoms/Avatar';
|
|
@@ -68,6 +67,7 @@ export { PageError, type PageErrorProps } from './ui/composite/PageError';
|
|
|
68
67
|
export { PageLayout, type PageLayoutProps } from './ui/composite/PageLayout';
|
|
69
68
|
export { PageSkeleton } from './ui/composite/PageSkeleton';
|
|
70
69
|
export { Report, type ReportProps } from './ui/composite/Report';
|
|
70
|
+
export { GenericPageNotFound, Routes, createRoute, createTypedRoute, type GetParams, type PageProps, type Route } from './ui/composite/Routes';
|
|
71
71
|
export { SearchBar, type SearchBarProps } from './ui/composite/SearchBar';
|
|
72
72
|
export { TableData, type TableDataProps } from './ui/composite/TableData';
|
|
73
73
|
export { Timeline, type TimelineEvent, type TimelineProps } from './ui/composite/Timeline';
|
|
@@ -93,6 +93,7 @@ export { HookedInputTextArea, InputTextArea, type HookedInputTextAreaProps, type
|
|
|
93
93
|
export { HookedInputToggleButton, InputToggleButton, type HookedInputToggleButtonProps, type InputToggleButtonProps } from './ui/forms/InputToggleButton';
|
|
94
94
|
export { Label, type LabelProps } from './ui/forms/Label';
|
|
95
95
|
export { Legend, type LegendProps } from './ui/forms/Legend';
|
|
96
|
+
export { HookedMarketWithCurrencySelector, type HookedMarketWithCurrencySelectorProps } from './ui/forms/MarketWithCurrencySelector';
|
|
96
97
|
export { HookedValidationApiError, HookedValidationError, setApiFormErrors, useValidationFeedback } from './ui/forms/ReactHookForm';
|
|
97
98
|
export { ResourceAddress, ResourceAddressFormFields, resourceAddressFormFieldsSchema, useResourceAddressOverlay, type ResourceAddressFormFieldsProps, type ResourceAddressProps } from './ui/resources/ResourceAddress';
|
|
98
99
|
export { ResourceLineItems, type ResourceLineItemsProps } from './ui/resources/ResourceLineItems';
|
package/dist/main.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
2
|
+
import { aD as s, bh as t, aE as o, aF as r, aG as n, aH as c, aI as u, aJ as i, aK as l, aL as p, bi as d, aM as b, aN as g, aO as S, as as m, bj as I, bk as k, bl as D, bm as T, aP as R, aw as y, ax as h, bw as C, aQ as A, aR as H, bn as F, bE as P, bF as f, bH as v, bJ as B, bL as O, bP as G, bR as L, bW as N, bY as w, b$ as E, c6 as x, c8 as V, ca as M, cc as W, ce as J, ci as U, cj as Y, ck as j, aS as q, aT as z, bG as K, bI as X, bK as Z, bM as _, bO as $, bQ as Q, bS as aa, bT as ea, bU as sa, bV as ta, bX as oa, bZ as ra, c0 as na, c7 as ca, c9 as ua, cb as ia, cd as la, cf as pa, cg as da, ch as ba, bo as ga, bp as Sa, bq as ma, br as Ia, az as ka, bs as Da, aU as Ta, bt as Ra, bu as ya, aV as ha, aW as Ca, aX as Aa, aY as Ha, bv as Fa, cn as Pa, co as fa, cr as va, cs as Ba, ct as Oa, cu as Ga, cv as La, cw as Na, cx as wa, bx as Ea, aZ as xa, bA as Va, a_ as Ma, a$ as Wa, b0 as Ja, b1 as Ua, b3 as Ya, b4 as ja, b5 as qa, b6 as za, b7 as Ka, bc as Xa, b8 as Za, bB as _a, bd as $a, be as Qa, b9 as ae, bf as ee, ba as se, bC as te, aA as oe, bD as re, bg as ne, bb as ce, aa as ue, av as ie, by as le, bz as pe, Z as de, _ as be, a9 as ge, aB as Se, c1 as me, bN as Ie, $ as ke, a0 as De, a1 as Te, ab as Re, ac as ye, ad as he, cz as Ce, cA as Ae, c2 as He, a2 as Fe, a3 as Pe, a4 as fe, cB as ve, cC as Be, cD as Oe, cE as Ge, cF as Le, ae as Ne, af as we, cG as Ee, cH as xe, cI as Ve, cJ as Me, ag as We, ah as Je, cK as Ue, cL as Ye, cM as je, ak as qe, al as ze, V as Ke, ai as Xe, aj as Ze, X as _e, c3 as $e, c4 as Qe, c5 as as, a5 as es, W as ss, Y as ts, a6 as os, cp as rs, cl as ns, a7 as cs, a8 as us, am as is, at as ls, au as ps, an as ds, ao as bs, b_ as gs, ap as Ss, aq as ms, ar as Is, cq as ks, cy as Ds, ay as Ts, aC as Rs, cm as ys, b2 as hs } from "./main-QhVMvWFU.js";
|
|
3
3
|
export {
|
|
4
4
|
s as A,
|
|
5
5
|
t as ActionButtons,
|
|
6
6
|
o as Alert,
|
|
7
7
|
r as Avatar,
|
|
8
8
|
n as AvatarLetter,
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
c as Badge,
|
|
10
|
+
u as Button,
|
|
11
11
|
i as ButtonFilter,
|
|
12
12
|
l as ButtonImageSelect,
|
|
13
13
|
p as Card,
|
|
14
14
|
d as CardDialog,
|
|
15
15
|
b as CodeBlock,
|
|
16
16
|
g as Container,
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
S as CopyToClipboard,
|
|
18
|
+
m as CoreSdkProvider,
|
|
19
19
|
I as Dropdown,
|
|
20
20
|
k as DropdownDivider,
|
|
21
21
|
D as DropdownItem,
|
|
@@ -23,162 +23,166 @@ export {
|
|
|
23
23
|
R as EmptyState,
|
|
24
24
|
y as ErrorBoundary,
|
|
25
25
|
h as GTMProvider,
|
|
26
|
-
C as
|
|
27
|
-
A as
|
|
28
|
-
H as
|
|
29
|
-
F as
|
|
30
|
-
P as
|
|
31
|
-
f as
|
|
32
|
-
v as
|
|
33
|
-
B as
|
|
34
|
-
O as
|
|
35
|
-
G as
|
|
36
|
-
L as
|
|
37
|
-
N as
|
|
38
|
-
w as
|
|
39
|
-
E as
|
|
26
|
+
C as GenericPageNotFound,
|
|
27
|
+
A as Grid,
|
|
28
|
+
H as Hint,
|
|
29
|
+
F as HomePageLayout,
|
|
30
|
+
P as HookedForm,
|
|
31
|
+
f as HookedInput,
|
|
32
|
+
v as HookedInputCheckbox,
|
|
33
|
+
B as HookedInputCheckboxGroup,
|
|
34
|
+
O as HookedInputCurrency,
|
|
35
|
+
G as HookedInputDate,
|
|
36
|
+
L as HookedInputDateRange,
|
|
37
|
+
N as HookedInputRadioGroup,
|
|
38
|
+
w as HookedInputResourceGroup,
|
|
39
|
+
E as HookedInputSelect,
|
|
40
|
+
x as HookedInputSimpleSelect,
|
|
40
41
|
V as HookedInputSpinner,
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
X as
|
|
51
|
-
Z as
|
|
52
|
-
_ as
|
|
53
|
-
$ as
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
ua as
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
ma as
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
Va as
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
Xa as
|
|
105
|
-
Za as
|
|
106
|
-
_a as
|
|
107
|
-
$a as
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
ue as
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
me as
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
Ve as
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
Xe as
|
|
159
|
-
Ze as
|
|
160
|
-
_e as
|
|
161
|
-
$e as
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
us as
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
ms as
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
42
|
+
M as HookedInputSwitch,
|
|
43
|
+
W as HookedInputTextArea,
|
|
44
|
+
J as HookedInputToggleButton,
|
|
45
|
+
U as HookedMarketWithCurrencySelector,
|
|
46
|
+
Y as HookedValidationApiError,
|
|
47
|
+
j as HookedValidationError,
|
|
48
|
+
q as Hr,
|
|
49
|
+
z as Icon,
|
|
50
|
+
K as Input,
|
|
51
|
+
X as InputCheckbox,
|
|
52
|
+
Z as InputCheckboxGroup,
|
|
53
|
+
_ as InputCurrency,
|
|
54
|
+
$ as InputCurrencyRange,
|
|
55
|
+
Q as InputDate,
|
|
56
|
+
aa as InputDateRange,
|
|
57
|
+
ea as InputFeedback,
|
|
58
|
+
sa as InputFile,
|
|
59
|
+
ta as InputJson,
|
|
60
|
+
oa as InputRadioGroup,
|
|
61
|
+
ra as InputResourceGroup,
|
|
62
|
+
na as InputSelect,
|
|
63
|
+
ca as InputSimpleSelect,
|
|
64
|
+
ua as InputSpinner,
|
|
65
|
+
ia as InputSwitch,
|
|
66
|
+
la as InputTextArea,
|
|
67
|
+
pa as InputToggleButton,
|
|
68
|
+
da as Label,
|
|
69
|
+
ba as Legend,
|
|
70
|
+
ga as List,
|
|
71
|
+
Sa as ListDetails,
|
|
72
|
+
ma as ListDetailsItem,
|
|
73
|
+
Ia as ListItem,
|
|
74
|
+
ka as MetaTags,
|
|
75
|
+
Da as PageError,
|
|
76
|
+
Ta as PageHeading,
|
|
77
|
+
Ra as PageLayout,
|
|
78
|
+
ya as PageSkeleton,
|
|
79
|
+
ha as Pagination,
|
|
80
|
+
Ca as Progress,
|
|
81
|
+
Aa as RadialProgress,
|
|
82
|
+
Ha as RemoveButton,
|
|
83
|
+
Fa as Report,
|
|
84
|
+
Pa as ResourceAddress,
|
|
85
|
+
fa as ResourceAddressFormFields,
|
|
86
|
+
va as ResourceLineItems,
|
|
87
|
+
Ba as ResourceList,
|
|
88
|
+
Oa as ResourceListItem,
|
|
89
|
+
Ga as ResourceMetadata,
|
|
90
|
+
La as ResourceOrderTimeline,
|
|
91
|
+
Na as ResourceShipmentParcels,
|
|
92
|
+
wa as ResourceTags,
|
|
93
|
+
Ea as Routes,
|
|
94
|
+
xa as ScrollToTop,
|
|
95
|
+
Va as SearchBar,
|
|
96
|
+
Ma as Section,
|
|
97
|
+
Wa as Skeleton,
|
|
98
|
+
Ja as SkeletonItem,
|
|
99
|
+
Ua as SkeletonTemplate,
|
|
100
|
+
Ya as Spacer,
|
|
101
|
+
ja as Stack,
|
|
102
|
+
qa as StatusDot,
|
|
103
|
+
za as StatusIcon,
|
|
104
|
+
Ka as Steps,
|
|
105
|
+
Xa as Tab,
|
|
106
|
+
Za as Table,
|
|
107
|
+
_a as TableData,
|
|
108
|
+
$a as Tabs,
|
|
109
|
+
Qa as Tag,
|
|
110
|
+
ae as Td,
|
|
111
|
+
ee as Text,
|
|
112
|
+
se as Th,
|
|
113
|
+
te as Timeline,
|
|
114
|
+
oe as TokenProvider,
|
|
115
|
+
re as Toolbar,
|
|
116
|
+
ne as Tooltip,
|
|
117
|
+
ce as Tr,
|
|
118
|
+
ue as computeFullname,
|
|
119
|
+
ie as createApp,
|
|
120
|
+
le as createRoute,
|
|
121
|
+
pe as createTypedRoute,
|
|
122
|
+
de as currencies,
|
|
123
|
+
be as currencyInputSelectOptions,
|
|
124
|
+
ge as downloadJsonAsFile,
|
|
125
|
+
Se as encodeExtras,
|
|
126
|
+
me as flatSelectValues,
|
|
127
|
+
Ie as formatCentsToCurrency,
|
|
128
|
+
ke as formatDate,
|
|
129
|
+
De as formatDateRange,
|
|
130
|
+
Te as formatDateWithPredicate,
|
|
131
|
+
Re as formatDisplayName,
|
|
132
|
+
ye as formatResourceName,
|
|
133
|
+
he as getAvatarSrcFromRate,
|
|
134
|
+
Ce as getCustomerDisplayStatus,
|
|
135
|
+
Ae as getCustomerStatusName,
|
|
136
|
+
He as getDefaultValueFromFlatten,
|
|
137
|
+
Fe as getEventDateInfo,
|
|
138
|
+
Pe as getIsoDateAtDayEdge,
|
|
139
|
+
fe as getIsoDateAtDaysBefore,
|
|
140
|
+
ve as getOrderDisplayStatus,
|
|
141
|
+
Be as getOrderFulfillmentStatusName,
|
|
142
|
+
Oe as getOrderPaymentStatusName,
|
|
143
|
+
Ge as getOrderStatusName,
|
|
144
|
+
Le as getOrderTransactionName,
|
|
145
|
+
Ne as getParcelTrackingDetail,
|
|
146
|
+
we as getParcelTrackingDetails,
|
|
147
|
+
Ee as getPromotionDisplayStatus,
|
|
148
|
+
xe as getReturnDisplayStatus,
|
|
149
|
+
Ve as getReturnStatusName,
|
|
150
|
+
Me as getShipmentDisplayStatus,
|
|
151
|
+
We as getShipmentRate,
|
|
152
|
+
Je as getShipmentRates,
|
|
153
|
+
Ue as getShipmentStatusName,
|
|
154
|
+
Ye as getStockTransferDisplayStatus,
|
|
155
|
+
je as getStockTransferStatusName,
|
|
156
|
+
qe as getUnitOfWeightName,
|
|
157
|
+
ze as getUnitsOfWeightForSelect,
|
|
158
|
+
Ke as goBack,
|
|
159
|
+
Xe as hasBeenPurchased,
|
|
160
|
+
Ze as hasSingleTracking,
|
|
161
|
+
_e as isAttachmentValidNote,
|
|
162
|
+
$e as isGroupedSelectValues,
|
|
163
|
+
Qe as isMultiValueSelected,
|
|
164
|
+
as as isSingleValueSelected,
|
|
165
|
+
es as makeDateYearsRange,
|
|
166
|
+
ss as navigateTo,
|
|
167
|
+
ts as referenceOrigins,
|
|
168
|
+
os as removeMillisecondsFromIsoDate,
|
|
169
|
+
rs as resourceAddressFormFieldsSchema,
|
|
170
|
+
ns as setApiFormErrors,
|
|
171
|
+
cs as sortAndGroupByDate,
|
|
172
|
+
us as timeSeparator,
|
|
173
|
+
is as useClickAway,
|
|
174
|
+
ls as useCoreApi,
|
|
175
|
+
ps as useCoreSdkProvider,
|
|
176
|
+
ds as useDelayShow,
|
|
177
|
+
bs as useEditMetadataOverlay,
|
|
178
|
+
gs as useInputResourceGroupOverlay,
|
|
179
|
+
Ss as useIsChanged,
|
|
180
|
+
ms as useOnBlurFromContainer,
|
|
181
|
+
Is as useOverlay,
|
|
182
|
+
ks as useResourceAddressOverlay,
|
|
183
|
+
Ds as useResourceFilters,
|
|
184
|
+
Ts as useTagManager,
|
|
185
|
+
Rs as useTokenProvider,
|
|
186
|
+
ys as useValidationFeedback,
|
|
187
|
+
hs as withSkeletonTemplate
|
|
184
188
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { TokenProviderTokenApplicationKind } from '.';
|
|
2
2
|
import { ListableResourceType, Organization } from '@commercelayer/sdk';
|
|
3
3
|
import { ReactNode } from 'react';
|
|
4
|
-
import { TokenProviderAllowedApp, TokenProviderAuthSettings, TokenProviderAuthUser, TokenProviderRoleActions } from './types';
|
|
4
|
+
import { TokenProviderAllowedApp, TokenProviderAuthSettings, TokenProviderAuthUser, TokenProviderExtras, TokenProviderRoleActions } from './types';
|
|
5
5
|
|
|
6
6
|
export interface TokenProviderValue {
|
|
7
7
|
settings: TokenProviderAuthSettings;
|
|
@@ -78,13 +78,7 @@ export interface TokenProviderProps {
|
|
|
78
78
|
* Optional. Extra data to pass from the dashboard or when the app is initialized.
|
|
79
79
|
* They will be received on app init and make available in the TokenProvider > settings context.
|
|
80
80
|
*/
|
|
81
|
-
extras?:
|
|
82
|
-
/** List of applications to be used inside the app. */
|
|
83
|
-
salesChannels?: Array<{
|
|
84
|
-
name: string;
|
|
85
|
-
client_id: string;
|
|
86
|
-
}>;
|
|
87
|
-
};
|
|
81
|
+
extras?: TokenProviderExtras;
|
|
88
82
|
}
|
|
89
83
|
export declare const AuthContext: import('react').Context<TokenProviderValue>;
|
|
90
84
|
export declare const useTokenProvider: () => TokenProviderValue;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { TokenProviderExtras } from './types';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Encodes the given extras object into a Base64 string.
|
|
5
|
+
* This ensures that the encoded string is safe for use in URLs.
|
|
6
|
+
*
|
|
7
|
+
* @param extras - The extras object to encode.
|
|
8
|
+
* @returns The Base64 encoded string representation of the extras object.
|
|
9
|
+
*/
|
|
10
|
+
export declare function encodeExtras(extras: TokenProviderExtras): string;
|
|
11
|
+
/**
|
|
12
|
+
* Decodes the given Base64 string back into the original extras object,
|
|
13
|
+
* which was encoded using `encodeExtras`.
|
|
14
|
+
*
|
|
15
|
+
* @param encodedExtras - The Base64 encoded string representation of the extras object.
|
|
16
|
+
* @returns The decoded extras object.
|
|
17
|
+
*/
|
|
18
|
+
export declare function decodeExtras(encodedExtras?: string | null): TokenProviderExtras | undefined;
|
|
19
|
+
/**
|
|
20
|
+
* Try to get the extras value from the URL params.
|
|
21
|
+
*/
|
|
22
|
+
export declare const getExtrasFromUrl: () => string | undefined;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export { encodeExtras } from './extras';
|
|
1
2
|
export { MetaTags } from './MetaTags';
|
|
2
3
|
export { TokenProvider, useTokenProvider } from './TokenProvider';
|
|
3
|
-
export {
|
|
4
|
+
export type { TokenProviderAllowedApp, TokenProviderExtras, TokenProviderPermissionItem, TokenProviderRoleActions, TokenProviderRolePermissions, TokenProviderTokenApplicationKind } from './types';
|
|
@@ -1,20 +1,27 @@
|
|
|
1
1
|
import { TokenProviderAllowedApp } from './types';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
type ItemType = 'accessToken' | 'extras';
|
|
4
|
+
export declare function makeStorageKey({ appSlug, organizationSlug, itemType }: {
|
|
4
5
|
appSlug: TokenProviderAllowedApp;
|
|
5
6
|
organizationSlug: string;
|
|
7
|
+
itemType: ItemType;
|
|
6
8
|
}): string;
|
|
7
|
-
export declare function
|
|
9
|
+
export declare function getPersistentJWT({ appSlug, organizationSlug, itemType }: {
|
|
8
10
|
/** The app for which to get the token. */
|
|
9
11
|
appSlug: TokenProviderAllowedApp;
|
|
10
12
|
/** The organization slug for the token we want to retrieve. */
|
|
11
13
|
organizationSlug?: string;
|
|
14
|
+
/** The JWT item type you want to retrieve. */
|
|
15
|
+
itemType: ItemType;
|
|
12
16
|
}): string | null;
|
|
13
|
-
export declare function
|
|
17
|
+
export declare function savePersistentJWT({ appSlug, jwt, organizationSlug, itemType }: {
|
|
14
18
|
/** The app for which to get the token. */
|
|
15
19
|
appSlug: TokenProviderAllowedApp;
|
|
16
20
|
/** The token to save. */
|
|
17
|
-
|
|
21
|
+
jwt: string;
|
|
18
22
|
/** The organization slug for the token we want to store. */
|
|
19
23
|
organizationSlug?: string;
|
|
24
|
+
/** The JWT item type you want to store. */
|
|
25
|
+
itemType: ItemType;
|
|
20
26
|
}): void;
|
|
27
|
+
export {};
|
|
@@ -116,12 +116,7 @@ export interface TokenProviderAuthSettings {
|
|
|
116
116
|
/**
|
|
117
117
|
* Extra data received from the outside and made available in the app.
|
|
118
118
|
*/
|
|
119
|
-
extras?:
|
|
120
|
-
salesChannels?: Array<{
|
|
121
|
-
name: string;
|
|
122
|
-
client_id: string;
|
|
123
|
-
}>;
|
|
124
|
-
};
|
|
119
|
+
extras?: TokenProviderExtras;
|
|
125
120
|
}
|
|
126
121
|
export interface TokenProviderAuthUser {
|
|
127
122
|
id: string;
|
|
@@ -132,4 +127,18 @@ export interface TokenProviderAuthUser {
|
|
|
132
127
|
fullName: string;
|
|
133
128
|
timezone: string;
|
|
134
129
|
}
|
|
130
|
+
export interface TokenProviderExtras {
|
|
131
|
+
/** List of sales channel to be used inside the app. */
|
|
132
|
+
salesChannels?: Array<{
|
|
133
|
+
name: string;
|
|
134
|
+
client_id: string;
|
|
135
|
+
}>;
|
|
136
|
+
/** Current user plan limits, received from provisioning API subscription, when available. */
|
|
137
|
+
limits?: {
|
|
138
|
+
markets?: number;
|
|
139
|
+
memberships?: number;
|
|
140
|
+
organizations?: number;
|
|
141
|
+
skus?: number;
|
|
142
|
+
};
|
|
143
|
+
}
|
|
135
144
|
export {};
|