@raystack/frontier 0.96.1 → 0.97.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/admin/dist/index.js +550 -605
- package/admin/dist/index.mjs +448 -503
- package/hooks/dist/index.d.ts +13 -0
- package/hooks/dist/index.js +33 -2
- package/hooks/dist/index.mjs +33 -3
- package/package.json +4 -4
- package/react/dist/index.d.ts +31 -2
- package/react/dist/index.js +4493 -916
- package/react/dist/index.mjs +4688 -906
package/hooks/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
export { createConnectQueryKey, useInfiniteQuery, useMutation, useQuery, useTransport } from '@connectrpc/connect-query';
|
|
2
|
+
import { ConnectError } from '@connectrpc/connect';
|
|
2
3
|
export { Code, ConnectError } from '@connectrpc/connect';
|
|
3
4
|
export { FrontierServiceQueries } from '@raystack/proton/frontier';
|
|
4
5
|
export { useQueryClient } from '@tanstack/react-query';
|
|
5
6
|
export { create } from '@bufbuild/protobuf';
|
|
7
|
+
|
|
8
|
+
type ErrorHandler = (error: ConnectError) => void;
|
|
9
|
+
type ErrorHandlerMap = {
|
|
10
|
+
AlreadyExists?: ErrorHandler;
|
|
11
|
+
InvalidArgument?: ErrorHandler;
|
|
12
|
+
PermissionDenied?: ErrorHandler;
|
|
13
|
+
NotFound?: ErrorHandler;
|
|
14
|
+
Default?: ErrorHandler;
|
|
15
|
+
};
|
|
16
|
+
declare function handleConnectError(error: unknown, handlers?: ErrorHandlerMap): void;
|
|
17
|
+
|
|
18
|
+
export { handleConnectError };
|
package/hooks/dist/index.js
CHANGED
|
@@ -21,11 +21,12 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
21
21
|
// hooks/index.ts
|
|
22
22
|
var hooks_exports = {};
|
|
23
23
|
__export(hooks_exports, {
|
|
24
|
-
Code: () =>
|
|
25
|
-
ConnectError: () =>
|
|
24
|
+
Code: () => import_connect2.Code,
|
|
25
|
+
ConnectError: () => import_connect2.ConnectError,
|
|
26
26
|
FrontierServiceQueries: () => import_frontier.FrontierServiceQueries,
|
|
27
27
|
create: () => import_protobuf.create,
|
|
28
28
|
createConnectQueryKey: () => import_connect_query.createConnectQueryKey,
|
|
29
|
+
handleConnectError: () => handleConnectError,
|
|
29
30
|
useInfiniteQuery: () => import_connect_query.useInfiniteQuery,
|
|
30
31
|
useMutation: () => import_connect_query.useMutation,
|
|
31
32
|
useQuery: () => import_connect_query.useQuery,
|
|
@@ -34,7 +35,36 @@ __export(hooks_exports, {
|
|
|
34
35
|
});
|
|
35
36
|
module.exports = __toCommonJS(hooks_exports);
|
|
36
37
|
var import_connect_query = require("@connectrpc/connect-query");
|
|
38
|
+
var import_connect2 = require("@connectrpc/connect");
|
|
39
|
+
|
|
40
|
+
// utils/error.ts
|
|
37
41
|
var import_connect = require("@connectrpc/connect");
|
|
42
|
+
var DEFAULT_ERROR_MESSAGE = "Something went wrong";
|
|
43
|
+
function handleConnectError(error, handlers) {
|
|
44
|
+
var _a;
|
|
45
|
+
const connectError = error instanceof import_connect.ConnectError ? error : new import_connect.ConnectError(
|
|
46
|
+
typeof error === "string" ? error : error instanceof Error ? error.message : DEFAULT_ERROR_MESSAGE
|
|
47
|
+
);
|
|
48
|
+
const defaultHandler = (_a = handlers == null ? void 0 : handlers.Default) != null ? _a : (err) => console.error(err.message);
|
|
49
|
+
switch (connectError.code) {
|
|
50
|
+
case import_connect.Code.AlreadyExists:
|
|
51
|
+
(handlers == null ? void 0 : handlers.AlreadyExists) ? handlers.AlreadyExists(connectError) : defaultHandler(connectError);
|
|
52
|
+
break;
|
|
53
|
+
case import_connect.Code.InvalidArgument:
|
|
54
|
+
(handlers == null ? void 0 : handlers.InvalidArgument) ? handlers.InvalidArgument(connectError) : defaultHandler(connectError);
|
|
55
|
+
break;
|
|
56
|
+
case import_connect.Code.PermissionDenied:
|
|
57
|
+
(handlers == null ? void 0 : handlers.PermissionDenied) ? handlers.PermissionDenied(connectError) : defaultHandler(connectError);
|
|
58
|
+
break;
|
|
59
|
+
case import_connect.Code.NotFound:
|
|
60
|
+
(handlers == null ? void 0 : handlers.NotFound) ? handlers.NotFound(connectError) : defaultHandler(connectError);
|
|
61
|
+
break;
|
|
62
|
+
default:
|
|
63
|
+
defaultHandler(connectError);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// hooks/index.ts
|
|
38
68
|
var import_frontier = require("@raystack/proton/frontier");
|
|
39
69
|
var import_react_query = require("@tanstack/react-query");
|
|
40
70
|
var import_protobuf = require("@bufbuild/protobuf");
|
|
@@ -45,6 +75,7 @@ var import_protobuf = require("@bufbuild/protobuf");
|
|
|
45
75
|
FrontierServiceQueries,
|
|
46
76
|
create,
|
|
47
77
|
createConnectQueryKey,
|
|
78
|
+
handleConnectError,
|
|
48
79
|
useInfiniteQuery,
|
|
49
80
|
useMutation,
|
|
50
81
|
useQuery,
|
package/hooks/dist/index.mjs
CHANGED
|
@@ -8,16 +8,46 @@ import {
|
|
|
8
8
|
useTransport,
|
|
9
9
|
createConnectQueryKey
|
|
10
10
|
} from "@connectrpc/connect-query";
|
|
11
|
-
import { ConnectError, Code } from "@connectrpc/connect";
|
|
11
|
+
import { ConnectError as ConnectError2, Code as Code2 } from "@connectrpc/connect";
|
|
12
|
+
|
|
13
|
+
// utils/error.ts
|
|
14
|
+
import { Code, ConnectError } from "@connectrpc/connect";
|
|
15
|
+
var DEFAULT_ERROR_MESSAGE = "Something went wrong";
|
|
16
|
+
function handleConnectError(error, handlers) {
|
|
17
|
+
var _a;
|
|
18
|
+
const connectError = error instanceof ConnectError ? error : new ConnectError(
|
|
19
|
+
typeof error === "string" ? error : error instanceof Error ? error.message : DEFAULT_ERROR_MESSAGE
|
|
20
|
+
);
|
|
21
|
+
const defaultHandler = (_a = handlers == null ? void 0 : handlers.Default) != null ? _a : (err) => console.error(err.message);
|
|
22
|
+
switch (connectError.code) {
|
|
23
|
+
case Code.AlreadyExists:
|
|
24
|
+
(handlers == null ? void 0 : handlers.AlreadyExists) ? handlers.AlreadyExists(connectError) : defaultHandler(connectError);
|
|
25
|
+
break;
|
|
26
|
+
case Code.InvalidArgument:
|
|
27
|
+
(handlers == null ? void 0 : handlers.InvalidArgument) ? handlers.InvalidArgument(connectError) : defaultHandler(connectError);
|
|
28
|
+
break;
|
|
29
|
+
case Code.PermissionDenied:
|
|
30
|
+
(handlers == null ? void 0 : handlers.PermissionDenied) ? handlers.PermissionDenied(connectError) : defaultHandler(connectError);
|
|
31
|
+
break;
|
|
32
|
+
case Code.NotFound:
|
|
33
|
+
(handlers == null ? void 0 : handlers.NotFound) ? handlers.NotFound(connectError) : defaultHandler(connectError);
|
|
34
|
+
break;
|
|
35
|
+
default:
|
|
36
|
+
defaultHandler(connectError);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// hooks/index.ts
|
|
12
41
|
import { FrontierServiceQueries } from "@raystack/proton/frontier";
|
|
13
42
|
import { useQueryClient } from "@tanstack/react-query";
|
|
14
43
|
import { create } from "@bufbuild/protobuf";
|
|
15
44
|
export {
|
|
16
|
-
Code,
|
|
17
|
-
ConnectError,
|
|
45
|
+
Code2 as Code,
|
|
46
|
+
ConnectError2 as ConnectError,
|
|
18
47
|
FrontierServiceQueries,
|
|
19
48
|
create,
|
|
20
49
|
createConnectQueryKey,
|
|
50
|
+
handleConnectError,
|
|
21
51
|
useInfiniteQuery,
|
|
22
52
|
useMutation,
|
|
23
53
|
useQuery,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@raystack/frontier",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.97.0",
|
|
4
4
|
"description": "A js library for frontier",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -101,17 +101,17 @@
|
|
|
101
101
|
"@connectrpc/connect-query": "2.1.1",
|
|
102
102
|
"@connectrpc/connect-web": "2.1.1",
|
|
103
103
|
"@hookform/resolvers": "^3.10.0",
|
|
104
|
-
"@raystack/
|
|
104
|
+
"@raystack/apsara-v1": "npm:@raystack/apsara@1.0.0-rc.2",
|
|
105
|
+
"@raystack/proton": "0.1.0-ac2df1932fcddcd7f7ff1af0ded07b14d73b781b",
|
|
105
106
|
"@tanstack/react-query": "^5.90.2",
|
|
106
107
|
"@tanstack/react-router": "^1.168.3",
|
|
107
108
|
"axios": "^1.9.0",
|
|
108
|
-
"@raystack/apsara-v1": "npm:@raystack/apsara@1.0.0-rc.2",
|
|
109
109
|
"class-variance-authority": "^0.7.1",
|
|
110
110
|
"dayjs": "^1.11.13",
|
|
111
111
|
"lodash": "^4.17.21",
|
|
112
112
|
"query-string": "^8.2.0",
|
|
113
113
|
"react-hook-form": "^7.57.0",
|
|
114
|
-
"react-image-crop": "^
|
|
114
|
+
"react-image-crop": "^11.0.10",
|
|
115
115
|
"slugify": "^1.6.6",
|
|
116
116
|
"uuid": "^10.0.0",
|
|
117
117
|
"validator": "^13.15.15",
|
package/react/dist/index.d.ts
CHANGED
|
@@ -247,7 +247,6 @@ interface FrontierClientCustomizationOptions {
|
|
|
247
247
|
};
|
|
248
248
|
}
|
|
249
249
|
interface FrontierClientOptions {
|
|
250
|
-
endpoint: string;
|
|
251
250
|
locale?: string;
|
|
252
251
|
connectEndpoint?: string;
|
|
253
252
|
redirectSignup?: string;
|
|
@@ -492,6 +491,36 @@ interface ProjectDetailsViewProps {
|
|
|
492
491
|
}
|
|
493
492
|
declare function ProjectDetailsView({ projectId, projectsLabel, onNavigateToProjects, onDeleteSuccess }: ProjectDetailsViewProps): react_jsx_runtime.JSX.Element;
|
|
494
493
|
|
|
494
|
+
declare function TokensView(): react_jsx_runtime.JSX.Element;
|
|
495
|
+
|
|
496
|
+
interface TeamsViewProps {
|
|
497
|
+
title?: string;
|
|
498
|
+
description?: string;
|
|
499
|
+
onTeamClick?: (teamId: string) => void;
|
|
500
|
+
}
|
|
501
|
+
declare function TeamsView({ title, description, onTeamClick }: TeamsViewProps): react_jsx_runtime.JSX.Element;
|
|
502
|
+
|
|
503
|
+
interface TeamDetailsViewProps {
|
|
504
|
+
teamId: string;
|
|
505
|
+
teamsLabel?: string;
|
|
506
|
+
onNavigateToTeams?: () => void;
|
|
507
|
+
onDeleteSuccess?: () => void;
|
|
508
|
+
}
|
|
509
|
+
declare function TeamDetailsView({ teamId, teamsLabel, onNavigateToTeams, onDeleteSuccess }: TeamDetailsViewProps): react_jsx_runtime.JSX.Element;
|
|
510
|
+
|
|
511
|
+
interface ServiceAccountsViewProps {
|
|
512
|
+
onServiceAccountClick?: (id: string) => void;
|
|
513
|
+
}
|
|
514
|
+
declare function ServiceAccountsView({ onServiceAccountClick }: ServiceAccountsViewProps): react_jsx_runtime.JSX.Element;
|
|
515
|
+
|
|
516
|
+
interface ServiceAccountDetailsViewProps {
|
|
517
|
+
serviceAccountId: string;
|
|
518
|
+
serviceAccountsLabel?: string;
|
|
519
|
+
onNavigateToServiceAccounts?: () => void;
|
|
520
|
+
onDeleteSuccess?: () => void;
|
|
521
|
+
}
|
|
522
|
+
declare function ServiceAccountDetailsView({ serviceAccountId, serviceAccountsLabel, onNavigateToServiceAccounts, onDeleteSuccess }: ServiceAccountDetailsViewProps): react_jsx_runtime.JSX.Element;
|
|
523
|
+
|
|
495
524
|
declare const PREFERENCE_OPTIONS: {
|
|
496
525
|
readonly NEWSLETTER: "newsletter";
|
|
497
526
|
};
|
|
@@ -510,4 +539,4 @@ declare function timestampToDayjs(timestamp?: Timestamp): Dayjs | null;
|
|
|
510
539
|
declare function isNullTimestamp(timestamp?: Timestamp): boolean;
|
|
511
540
|
type TimeStamp = Timestamp;
|
|
512
541
|
|
|
513
|
-
export { AvatarUpload, Container, CreateOrganization, CustomizationProvider, FrontierClientBillingOptions, FrontierClientCustomizationOptions, FrontierClientOptions, FrontierProvider, GeneralView, Header, ImageUpload, Layout, MagicLink, MagicLinkVerify, MembersView, OrganizationProfile, PREFERENCE_OPTIONS, PageHeader, PreferenceRow, PreferencesView, ProfileView, ProjectDetailsView, ProjectsView, SecurityView, SessionsView, SignIn, SignUp, Subscribe, TimeStamp, Updates, ViewContainer, ViewHeader, Window, isNullTimestamp, queryClient, timestampToDate, timestampToDayjs, useBillingPermission, useConnectQueryPolling, useFrontier, usePreferences, useTerminology, useTokens };
|
|
542
|
+
export { AvatarUpload, Container, CreateOrganization, CustomizationProvider, FrontierClientBillingOptions, FrontierClientCustomizationOptions, FrontierClientOptions, FrontierProvider, GeneralView, Header, ImageUpload, Layout, MagicLink, MagicLinkVerify, MembersView, OrganizationProfile, PREFERENCE_OPTIONS, PageHeader, PreferenceRow, PreferencesView, ProfileView, ProjectDetailsView, ProjectsView, SecurityView, ServiceAccountDetailsView, ServiceAccountsView, SessionsView, SignIn, SignUp, Subscribe, TeamDetailsView, TeamsView, TimeStamp, TokensView, Updates, ViewContainer, ViewHeader, Window, isNullTimestamp, queryClient, timestampToDate, timestampToDayjs, useBillingPermission, useConnectQueryPolling, useFrontier, usePreferences, useTerminology, useTokens };
|