@hearth-auth/sdk 0.0.1 → 1.0.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/dist/admin.d.ts +43 -0
- package/dist/admin.js +126 -0
- package/dist/admin.js.map +1 -0
- package/dist/browser-auth.d.ts +32 -0
- package/dist/browser-auth.js +99 -0
- package/dist/browser-auth.js.map +1 -0
- package/dist/claims.d.ts +86 -0
- package/dist/claims.js +137 -0
- package/dist/claims.js.map +1 -0
- package/dist/client.d.ts +77 -0
- package/dist/client.js +190 -0
- package/dist/client.js.map +1 -0
- package/dist/errors.d.ts +114 -0
- package/{src/errors.ts → dist/errors.js} +83 -97
- package/dist/errors.js.map +1 -0
- package/dist/hearth-client.d.ts +133 -0
- package/dist/hearth-client.js +192 -0
- package/dist/hearth-client.js.map +1 -0
- package/dist/hearth.d.ts +105 -0
- package/dist/hearth.js +109 -0
- package/dist/hearth.js.map +1 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.js +22 -0
- package/dist/index.js.map +1 -0
- package/dist/introspection-client.d.ts +59 -0
- package/dist/introspection-client.js +36 -0
- package/dist/introspection-client.js.map +1 -0
- package/dist/jwks-client.d.ts +28 -0
- package/dist/jwks-client.js +28 -0
- package/dist/jwks-client.js.map +1 -0
- package/dist/middleware.d.ts +38 -0
- package/dist/middleware.js +51 -0
- package/dist/middleware.js.map +1 -0
- package/dist/pkce.d.ts +64 -0
- package/dist/pkce.js +64 -0
- package/dist/pkce.js.map +1 -0
- package/dist/react.d.ts +32 -0
- package/dist/react.js +41 -0
- package/dist/react.js.map +1 -0
- package/dist/session-version-cache.d.ts +50 -0
- package/dist/session-version-cache.js +129 -0
- package/dist/session-version-cache.js.map +1 -0
- package/dist/types.d.ts +168 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/package.json +13 -4
- package/CHANGELOG.md +0 -12
- package/src/admin.ts +0 -157
- package/src/browser-auth.ts +0 -130
- package/src/claims.ts +0 -180
- package/src/client.ts +0 -251
- package/src/generated/google/api/annotations_pb.ts +0 -44
- package/src/generated/google/api/http_pb.ts +0 -467
- package/src/generated/hearth/authz/v1/authz_pb.ts +0 -593
- package/src/generated/hearth/cluster/v1/raft_pb.ts +0 -183
- package/src/generated/hearth/events/v1/audit_pb.ts +0 -886
- package/src/generated/hearth/identity/v1/identity_pb.ts +0 -1673
- package/src/generated/hearth/identity/v1/oauth_pb.ts +0 -1138
- package/src/generated/hearth/rbac/v1/rbac_pb.ts +0 -2000
- package/src/hearth-client.ts +0 -288
- package/src/hearth.ts +0 -224
- package/src/index.ts +0 -106
- package/src/introspection-client.ts +0 -83
- package/src/jwks-client.ts +0 -45
- package/src/middleware.ts +0 -82
- package/src/pkce.ts +0 -129
- package/src/react.tsx +0 -57
- package/src/session-version-cache.ts +0 -167
- package/src/types.ts +0 -188
- package/tests/admin-crud.test.ts +0 -97
- package/tests/auth-flow.test.ts +0 -75
- package/tests/authorize.test.ts +0 -386
- package/tests/claims.test.ts +0 -159
- package/tests/hasPermission.test.ts +0 -152
- package/tests/hearth-client.test.ts +0 -243
- package/tests/helpers.ts +0 -90
- package/tests/jwks.test.ts +0 -62
- package/tests/pkce.test.ts +0 -210
- package/tests/react-useHasPermission.test.tsx +0 -92
- package/tests/required-action.test.ts +0 -276
- package/tests/session-version.test.ts +0 -391
- package/tsconfig.json +0 -16
- package/vitest.config.ts +0 -8
|
@@ -1,183 +0,0 @@
|
|
|
1
|
-
// @generated by protoc-gen-es v2.12.0 with parameter "target=ts"
|
|
2
|
-
// @generated from file hearth/cluster/v1/raft.proto (package hearth.cluster.v1, syntax proto3)
|
|
3
|
-
/* eslint-disable */
|
|
4
|
-
|
|
5
|
-
import type { GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv2";
|
|
6
|
-
import { fileDesc, messageDesc, serviceDesc } from "@bufbuild/protobuf/codegenv2";
|
|
7
|
-
import type { Message } from "@bufbuild/protobuf";
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Describes the file hearth/cluster/v1/raft.proto.
|
|
11
|
-
*/
|
|
12
|
-
export const file_hearth_cluster_v1_raft: GenFile = /*@__PURE__*/
|
|
13
|
-
fileDesc("ChxoZWFydGgvY2x1c3Rlci92MS9yYWZ0LnByb3RvEhFoZWFydGguY2x1c3Rlci52MSInChRBcHBlbmRFbnRyaWVzUmVxdWVzdBIPCgdwYXlsb2FkGAEgASgMIigKFUFwcGVuZEVudHJpZXNSZXNwb25zZRIPCgdwYXlsb2FkGAEgASgMIh4KC1ZvdGVSZXF1ZXN0Eg8KB3BheWxvYWQYASABKAwiHwoMVm90ZVJlc3BvbnNlEg8KB3BheWxvYWQYASABKAwiKQoWSW5zdGFsbFNuYXBzaG90UmVxdWVzdBIPCgdwYXlsb2FkGAEgASgMIioKF0luc3RhbGxTbmFwc2hvdFJlc3BvbnNlEg8KB3BheWxvYWQYASABKAwypAIKC1JhZnRTZXJ2aWNlEmIKDUFwcGVuZEVudHJpZXMSJy5oZWFydGguY2x1c3Rlci52MS5BcHBlbmRFbnRyaWVzUmVxdWVzdBooLmhlYXJ0aC5jbHVzdGVyLnYxLkFwcGVuZEVudHJpZXNSZXNwb25zZRJHCgRWb3RlEh4uaGVhcnRoLmNsdXN0ZXIudjEuVm90ZVJlcXVlc3QaHy5oZWFydGguY2x1c3Rlci52MS5Wb3RlUmVzcG9uc2USaAoPSW5zdGFsbFNuYXBzaG90EikuaGVhcnRoLmNsdXN0ZXIudjEuSW5zdGFsbFNuYXBzaG90UmVxdWVzdBoqLmhlYXJ0aC5jbHVzdGVyLnYxLkluc3RhbGxTbmFwc2hvdFJlc3BvbnNlQkNaQWdpdGh1Yi5jb20vaGVhcnRoZGIvaGVhcnRoL3Nka3MvZ28vZ2VuZXJhdGVkL2NsdXN0ZXIvdjE7Y2x1c3RlcnYxYgZwcm90bzM");
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* AppendEntries RPC request.
|
|
17
|
-
* Payload is serde_json-encoded openraft::AppendEntriesRequest<HearthRaftConfig>.
|
|
18
|
-
*
|
|
19
|
-
* @generated from message hearth.cluster.v1.AppendEntriesRequest
|
|
20
|
-
*/
|
|
21
|
-
export type AppendEntriesRequest = Message<"hearth.cluster.v1.AppendEntriesRequest"> & {
|
|
22
|
-
/**
|
|
23
|
-
* @generated from field: bytes payload = 1;
|
|
24
|
-
*/
|
|
25
|
-
payload: Uint8Array;
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Describes the message hearth.cluster.v1.AppendEntriesRequest.
|
|
30
|
-
* Use `create(AppendEntriesRequestSchema)` to create a new message.
|
|
31
|
-
*/
|
|
32
|
-
export const AppendEntriesRequestSchema: GenMessage<AppendEntriesRequest> = /*@__PURE__*/
|
|
33
|
-
messageDesc(file_hearth_cluster_v1_raft, 0);
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* AppendEntries RPC response.
|
|
37
|
-
* Payload is serde_json-encoded openraft::AppendEntriesResponse<u64>.
|
|
38
|
-
*
|
|
39
|
-
* @generated from message hearth.cluster.v1.AppendEntriesResponse
|
|
40
|
-
*/
|
|
41
|
-
export type AppendEntriesResponse = Message<"hearth.cluster.v1.AppendEntriesResponse"> & {
|
|
42
|
-
/**
|
|
43
|
-
* @generated from field: bytes payload = 1;
|
|
44
|
-
*/
|
|
45
|
-
payload: Uint8Array;
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Describes the message hearth.cluster.v1.AppendEntriesResponse.
|
|
50
|
-
* Use `create(AppendEntriesResponseSchema)` to create a new message.
|
|
51
|
-
*/
|
|
52
|
-
export const AppendEntriesResponseSchema: GenMessage<AppendEntriesResponse> = /*@__PURE__*/
|
|
53
|
-
messageDesc(file_hearth_cluster_v1_raft, 1);
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* Vote RPC request.
|
|
57
|
-
* Payload is serde_json-encoded openraft::VoteRequest<u64>.
|
|
58
|
-
*
|
|
59
|
-
* @generated from message hearth.cluster.v1.VoteRequest
|
|
60
|
-
*/
|
|
61
|
-
export type VoteRequest = Message<"hearth.cluster.v1.VoteRequest"> & {
|
|
62
|
-
/**
|
|
63
|
-
* @generated from field: bytes payload = 1;
|
|
64
|
-
*/
|
|
65
|
-
payload: Uint8Array;
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* Describes the message hearth.cluster.v1.VoteRequest.
|
|
70
|
-
* Use `create(VoteRequestSchema)` to create a new message.
|
|
71
|
-
*/
|
|
72
|
-
export const VoteRequestSchema: GenMessage<VoteRequest> = /*@__PURE__*/
|
|
73
|
-
messageDesc(file_hearth_cluster_v1_raft, 2);
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
* Vote RPC response.
|
|
77
|
-
* Payload is serde_json-encoded openraft::VoteResponse<u64>.
|
|
78
|
-
*
|
|
79
|
-
* @generated from message hearth.cluster.v1.VoteResponse
|
|
80
|
-
*/
|
|
81
|
-
export type VoteResponse = Message<"hearth.cluster.v1.VoteResponse"> & {
|
|
82
|
-
/**
|
|
83
|
-
* @generated from field: bytes payload = 1;
|
|
84
|
-
*/
|
|
85
|
-
payload: Uint8Array;
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
/**
|
|
89
|
-
* Describes the message hearth.cluster.v1.VoteResponse.
|
|
90
|
-
* Use `create(VoteResponseSchema)` to create a new message.
|
|
91
|
-
*/
|
|
92
|
-
export const VoteResponseSchema: GenMessage<VoteResponse> = /*@__PURE__*/
|
|
93
|
-
messageDesc(file_hearth_cluster_v1_raft, 3);
|
|
94
|
-
|
|
95
|
-
/**
|
|
96
|
-
* InstallSnapshot RPC request (one chunk per call).
|
|
97
|
-
* Payload is serde_json-encoded openraft::InstallSnapshotRequest<HearthRaftConfig>.
|
|
98
|
-
*
|
|
99
|
-
* @generated from message hearth.cluster.v1.InstallSnapshotRequest
|
|
100
|
-
*/
|
|
101
|
-
export type InstallSnapshotRequest = Message<"hearth.cluster.v1.InstallSnapshotRequest"> & {
|
|
102
|
-
/**
|
|
103
|
-
* @generated from field: bytes payload = 1;
|
|
104
|
-
*/
|
|
105
|
-
payload: Uint8Array;
|
|
106
|
-
};
|
|
107
|
-
|
|
108
|
-
/**
|
|
109
|
-
* Describes the message hearth.cluster.v1.InstallSnapshotRequest.
|
|
110
|
-
* Use `create(InstallSnapshotRequestSchema)` to create a new message.
|
|
111
|
-
*/
|
|
112
|
-
export const InstallSnapshotRequestSchema: GenMessage<InstallSnapshotRequest> = /*@__PURE__*/
|
|
113
|
-
messageDesc(file_hearth_cluster_v1_raft, 4);
|
|
114
|
-
|
|
115
|
-
/**
|
|
116
|
-
* InstallSnapshot RPC response.
|
|
117
|
-
* Payload is serde_json-encoded openraft::InstallSnapshotResponse<u64>.
|
|
118
|
-
*
|
|
119
|
-
* @generated from message hearth.cluster.v1.InstallSnapshotResponse
|
|
120
|
-
*/
|
|
121
|
-
export type InstallSnapshotResponse = Message<"hearth.cluster.v1.InstallSnapshotResponse"> & {
|
|
122
|
-
/**
|
|
123
|
-
* @generated from field: bytes payload = 1;
|
|
124
|
-
*/
|
|
125
|
-
payload: Uint8Array;
|
|
126
|
-
};
|
|
127
|
-
|
|
128
|
-
/**
|
|
129
|
-
* Describes the message hearth.cluster.v1.InstallSnapshotResponse.
|
|
130
|
-
* Use `create(InstallSnapshotResponseSchema)` to create a new message.
|
|
131
|
-
*/
|
|
132
|
-
export const InstallSnapshotResponseSchema: GenMessage<InstallSnapshotResponse> = /*@__PURE__*/
|
|
133
|
-
messageDesc(file_hearth_cluster_v1_raft, 5);
|
|
134
|
-
|
|
135
|
-
/**
|
|
136
|
-
* Raft consensus peer-to-peer RPC service.
|
|
137
|
-
*
|
|
138
|
-
* All messages carry opaque JSON-encoded payloads to decouple the transport
|
|
139
|
-
* schema from openraft's internal types. This keeps the wire format stable
|
|
140
|
-
* across openraft version upgrades.
|
|
141
|
-
*
|
|
142
|
-
* InstallSnapshot is a unary RPC: openraft's default full_snapshot
|
|
143
|
-
* implementation already chunks the snapshot and calls install_snapshot once
|
|
144
|
-
* per chunk (with offset/done fields inside the payload), so there is no need
|
|
145
|
-
* for a streaming RPC at this layer.
|
|
146
|
-
*
|
|
147
|
-
* @generated from service hearth.cluster.v1.RaftService
|
|
148
|
-
*/
|
|
149
|
-
export const RaftService: GenService<{
|
|
150
|
-
/**
|
|
151
|
-
* Leader replicates log entries to a follower or candidate.
|
|
152
|
-
*
|
|
153
|
-
* @generated from rpc hearth.cluster.v1.RaftService.AppendEntries
|
|
154
|
-
*/
|
|
155
|
-
appendEntries: {
|
|
156
|
-
methodKind: "unary";
|
|
157
|
-
input: typeof AppendEntriesRequestSchema;
|
|
158
|
-
output: typeof AppendEntriesResponseSchema;
|
|
159
|
-
},
|
|
160
|
-
/**
|
|
161
|
-
* Candidate requests a vote from a peer during leader election.
|
|
162
|
-
*
|
|
163
|
-
* @generated from rpc hearth.cluster.v1.RaftService.Vote
|
|
164
|
-
*/
|
|
165
|
-
vote: {
|
|
166
|
-
methodKind: "unary";
|
|
167
|
-
input: typeof VoteRequestSchema;
|
|
168
|
-
output: typeof VoteResponseSchema;
|
|
169
|
-
},
|
|
170
|
-
/**
|
|
171
|
-
* Leader sends one snapshot chunk to a follower.
|
|
172
|
-
* Called once per chunk by openraft's Chunked snapshot transport.
|
|
173
|
-
*
|
|
174
|
-
* @generated from rpc hearth.cluster.v1.RaftService.InstallSnapshot
|
|
175
|
-
*/
|
|
176
|
-
installSnapshot: {
|
|
177
|
-
methodKind: "unary";
|
|
178
|
-
input: typeof InstallSnapshotRequestSchema;
|
|
179
|
-
output: typeof InstallSnapshotResponseSchema;
|
|
180
|
-
},
|
|
181
|
-
}> = /*@__PURE__*/
|
|
182
|
-
serviceDesc(file_hearth_cluster_v1_raft, 0);
|
|
183
|
-
|