@valon-technologies/gestalt 0.0.1-alpha.33 → 0.0.1-alpha.34

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.
@@ -14,18 +14,18 @@ const PROVIDER_KIND_DEFINITIONS = {
14
14
  defaultExportNames: ["provider", "app"],
15
15
  label: "app provider",
16
16
  },
17
- authentication: {
18
- tokens: ["authentication"],
19
- formatToken: "authentication",
20
- defaultExportNames: ["authentication", "provider"],
21
- label: "authentication provider",
22
- },
23
17
  authorization: {
24
18
  tokens: ["authorization"],
25
19
  formatToken: "authorization",
26
20
  defaultExportNames: ["authorization", "provider"],
27
21
  label: "authorization provider",
28
22
  },
23
+ authentication: {
24
+ tokens: ["authentication"],
25
+ formatToken: "authentication",
26
+ defaultExportNames: ["authentication", "provider"],
27
+ label: "authentication provider",
28
+ },
29
29
  cache: {
30
30
  tokens: ["cache"],
31
31
  formatToken: "cache",
package/src/provider.ts CHANGED
@@ -5,8 +5,8 @@ import type { MaybePromise } from "./api.ts";
5
5
  */
6
6
  export type ProviderKind =
7
7
  | "integration"
8
- | "authentication"
9
8
  | "authorization"
9
+ | "authentication"
10
10
  | "cache"
11
11
  | "secrets"
12
12
  | "s3"
package/src/runtime.ts CHANGED
@@ -17,6 +17,9 @@ import { connectNodeAdapter } from "@connectrpc/connect-node";
17
17
  import {
18
18
  AgentProvider as AgentProviderService,
19
19
  } from "./internal/gen/v1/agent_pb.ts";
20
+ import {
21
+ AuthorizationProvider as AuthorizationProviderService,
22
+ } from "./internal/gen/v1/authorization_pb.ts";
20
23
  import {
21
24
  AuthenticationProvider as AuthenticationProviderService,
22
25
  AuthSessionSettingsSchema,
@@ -25,7 +28,6 @@ import {
25
28
  type CompleteLoginRequest as AuthCompleteLoginRequest,
26
29
  type ValidateExternalTokenRequest,
27
30
  } from "./internal/gen/v1/authentication_pb.ts";
28
- import { AuthorizationProvider as AuthorizationProviderService } from "./internal/gen/v1/authorization_pb.ts";
29
31
  import {
30
32
  Cache as CacheService,
31
33
  CacheDeleteManyResponseSchema,
@@ -174,8 +176,8 @@ export type RuntimeArgs = {
174
176
  */
175
177
  export type LoadedProvider =
176
178
  | AppProvider
177
- | AuthenticationProvider
178
179
  | AuthorizationProvider
180
+ | AuthenticationProvider
179
181
  | CacheProvider
180
182
  | SecretsProvider
181
183
  | S3Provider
@@ -202,26 +204,25 @@ const PROVIDER_RUNTIME_ENTRIES: Partial<
202
204
  );
203
205
  },
204
206
  },
205
- authentication: {
207
+ authorization: {
206
208
  isProvider:
207
- isAuthenticationProvider as (value: unknown) => value is LoadedProvider,
208
- protoKind: ProtoProviderKind.AUTHENTICATION,
209
+ isAuthorizationProvider as (value: unknown) => value is LoadedProvider,
210
+ protoKind: ProtoProviderKind.AUTHORIZATION,
209
211
  registerService(router, provider) {
210
212
  router.service(
211
- AuthenticationProviderService,
212
- createAuthenticationService(provider as AuthenticationProvider),
213
+ AuthorizationProviderService,
214
+ createAuthorizationProviderService(provider as AuthorizationProvider),
213
215
  );
214
216
  },
215
217
  },
216
- authorization: {
217
- isProvider: isAuthorizationProvider as (
218
- value: unknown,
219
- ) => value is LoadedProvider,
220
- protoKind: ProtoProviderKind.AUTHORIZATION,
218
+ authentication: {
219
+ isProvider:
220
+ isAuthenticationProvider as (value: unknown) => value is LoadedProvider,
221
+ protoKind: ProtoProviderKind.AUTHENTICATION,
221
222
  registerService(router, provider) {
222
223
  router.service(
223
- AuthorizationProviderService,
224
- createAuthorizationProviderService(provider as AuthorizationProvider),
224
+ AuthenticationProviderService,
225
+ createAuthenticationService(provider as AuthenticationProvider),
225
226
  );
226
227
  },
227
228
  },
@@ -617,10 +618,7 @@ export function createProviderService(
617
618
  ? {
618
619
  subject: {
619
620
  id: subject.id,
620
- kind: subject.kind,
621
621
  credentialSubjectId: subject.credentialSubjectId ?? "",
622
- displayName: subject.displayName,
623
- authSource: subject.authSource,
624
622
  email: subject.email ?? "",
625
623
  },
626
624
  }
@@ -835,18 +833,12 @@ function providerRequest(
835
833
  },
836
834
  subject: {
837
835
  id: subject?.id ?? "",
838
- kind: subject?.kind ?? "",
839
836
  credentialSubjectId: subject?.credentialSubjectId ?? "",
840
- displayName: subject?.displayName ?? "",
841
- authSource: subject?.authSource ?? "",
842
837
  email: subject?.email ?? "",
843
838
  },
844
839
  agentSubject: {
845
840
  id: agentSubject?.id ?? "",
846
- kind: agentSubject?.kind ?? "",
847
841
  credentialSubjectId: agentSubject?.credentialSubjectId ?? "",
848
- displayName: agentSubject?.displayName ?? "",
849
- authSource: agentSubject?.authSource ?? "",
850
842
  email: agentSubject?.email ?? "",
851
843
  },
852
844
  credential: {