@valon-technologies/gestalt 0.0.1-alpha.8 → 0.0.1-alpha.9

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/README.md CHANGED
@@ -21,7 +21,7 @@ property in `package.json`:
21
21
  "gestalt": {
22
22
  "provider": {
23
23
  "kind": "plugin",
24
- "target": "./provider.ts#provider"
24
+ "target": "./provider.ts#plugin"
25
25
  }
26
26
  }
27
27
  }
@@ -31,11 +31,9 @@ The target is a relative file path with an optional export suffix. The runtime
31
31
  accepts:
32
32
 
33
33
  - `gestalt.provider` as `{ "kind": "...", "target": "./file.ts#export" }`
34
- - `gestalt.provider` as a string like `"plugin:./provider.ts#provider"` or `"cache:./cache.ts#provider"`
35
- - legacy integration-only `gestalt.plugin`
34
+ - `gestalt.provider` as a string like `"plugin:./provider.ts#plugin"` or `"cache:./cache.ts#provider"`
36
35
 
37
- Use `"plugin"` as the kind token for executable integration providers. The
38
- older `"integration"` spelling is still accepted for compatibility.
36
+ Use `"plugin"` as the kind token for executable plugin providers.
39
37
 
40
38
  If the export suffix is omitted, the runtime looks for `provider`, then
41
39
  `plugin`, then the default export.
@@ -46,14 +44,14 @@ Use explicit runtime schemas to define plugin operation inputs and outputs:
46
44
 
47
45
  ```ts
48
46
  import {
49
- defineIntegrationProvider,
47
+ definePlugin,
50
48
  ok,
51
49
  operation,
52
50
  response,
53
51
  s,
54
52
  } from "@valon-technologies/gestalt";
55
53
 
56
- export const provider = defineIntegrationProvider({
54
+ export const plugin = definePlugin({
57
55
  displayName: "Example Provider",
58
56
  description: "A provider implemented with the Gestalt TypeScript SDK",
59
57
  configure(name, config) {
@@ -96,12 +94,12 @@ Use `ok(body)` for normal responses and `response(status, body)` when a handler
96
94
  needs to set a non-200 status. Plain objects with `status` and `body` fields
97
95
  are treated as user data.
98
96
 
99
- Auth providers, cache providers, and secrets providers use dedicated helpers:
97
+ Authentication providers, cache providers, and secrets providers use dedicated helpers:
100
98
 
101
99
  ```ts
102
100
  import {
103
101
  Cache,
104
- defineAuthProvider,
102
+ defineAuthenticationProvider,
105
103
  defineCacheProvider,
106
104
  defineSecretsProvider,
107
105
  } from "@valon-technologies/gestalt";
@@ -112,7 +110,7 @@ import {
112
110
  Source-mode runtime:
113
111
 
114
112
  ```sh
115
- gestalt-ts-runtime ROOT plugin:./provider.ts#provider
113
+ gestalt-ts-runtime ROOT plugin:./provider.ts#plugin
116
114
  ```
117
115
 
118
116
  Release build:
@@ -1,5 +1,5 @@
1
1
  // @generated by protoc-gen-es v2.11.0 with parameter "target=ts"
2
- // @generated from file v1/auth.proto (package gestalt.provider.v1, syntax proto3)
2
+ // @generated from file v1/authentication.proto (package gestalt.provider.v1, syntax proto3)
3
3
  /* eslint-disable */
4
4
 
5
5
  import type { GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv2";
@@ -9,12 +9,15 @@ import { file_google_protobuf_empty } from "@bufbuild/protobuf/wkt";
9
9
  import type { Message } from "@bufbuild/protobuf";
10
10
 
11
11
  /**
12
- * Describes the file v1/auth.proto.
12
+ * Describes the file v1/authentication.proto.
13
13
  */
14
- export const file_v1_auth: GenFile = /*@__PURE__*/
15
- fileDesc("Cg12MS9hdXRoLnByb3RvEhNnZXN0YWx0LnByb3ZpZGVyLnYxIugBChFBdXRoZW50aWNhdGVkVXNlchIPCgdzdWJqZWN0GAEgASgJEg0KBWVtYWlsGAIgASgJEhYKDmVtYWlsX3ZlcmlmaWVkGAMgASgIEhQKDGRpc3BsYXlfbmFtZRgEIAEoCRISCgphdmF0YXJfdXJsGAUgASgJEkIKBmNsYWltcxgGIAMoCzIyLmdlc3RhbHQucHJvdmlkZXIudjEuQXV0aGVudGljYXRlZFVzZXIuQ2xhaW1zRW50cnkaLQoLQ2xhaW1zRW50cnkSCwoDa2V5GAEgASgJEg0KBXZhbHVlGAIgASgJOgI4ASLDAQoRQmVnaW5Mb2dpblJlcXVlc3QSFAoMY2FsbGJhY2tfdXJsGAEgASgJEhIKC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XN0YWx0LnByb3ZpZGVyLnYxLkF1dGhlbnRpY2F0ZWRVc2VyElYKEkdldFNlc3Npb25TZXR0aW5ncxIWLmdvb2dsZS5wcm90b2J1Zi5FbXB0eRooLmdlc3RhbHQucHJvdmlkZXIudjEuQXV0aFNlc3Npb25TZXR0aW5nc0I7WjlnaXRodWIuY29tL3ZhbG9uLXRlY2hub2xvZ2llcy9nZXN0YWx0L3Nkay9nby9nZW4vdjE7cHJvdG9iBnByb3RvMw", [file_google_protobuf_empty]);
14
+ export const file_v1_authentication: GenFile = /*@__PURE__*/
15
+ fileDesc("Chd2MS9hdXRoZW50aWNhdGlvbi5wcm90bxITZ2VzdGFsdC5wcm92aWRlci52MSLoAQoRQXV0aGVudGljYXRlZFVzZXISDwoHc3ViamVjdBgBIAEoCRINCgVlbWFpbBgCIAEoCRIWCg5lbWFpbF92ZXJpZmllZBgDIAEoCBIUCgxkaXNwbGF5X25hbWUYBCABKAkSEgoKYXZhdGFyX3VybBgFIAEoCRJCCgZjbGFpbXMYBiADKAsyMi5nZXN0YWx0LnByb3ZpZGVyLnYxLkF1dGhlbnRpY2F0ZWRVc2VyLkNsYWltc0VudHJ5Gi0KC0NsYWltc0VudHJ5EgsKA2tleRgBIAEoCRINCgV2YWx1ZRgCIAEoCToCOAEiwwEKEUJlZ2luTG9naW5SZXF1ZXN0EhQKDGNhbGxiYWNrX3VybBgBIAEoCRISCgpob3N0X3N0YXRlGAIgASgJEg4KBnNjb3BlcxgDIAMoCRJECgdvcHRpb25zGAQgAygLMjMuZ2VzdGFsdC5wcm92aWRlci52MS5CZWdpbkxvZ2luUmVxdWVzdC5PcHRpb25zRW50cnkaLgoMT3B0aW9uc0VudHJ5EgsKA2tleRgBIAEoCRINCgV2YWx1ZRgCIAEoCToCOAEiRwoSQmVnaW5Mb2dpblJlc3BvbnNlEhkKEWF1dGhvcml6YXRpb25fdXJsGAEgASgJEhYKDnByb3ZpZGVyX3N0YXRlGAIgASgMIrcBChRDb21wbGV0ZUx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ized user identity returned by an authentication
19
+ * provider after a login or token-validation flow.
20
+ *
18
21
  * @generated from message gestalt.provider.v1.AuthenticatedUser
19
22
  */
20
23
  export type AuthenticatedUser = Message<"gestalt.provider.v1.AuthenticatedUser"> & {
@@ -54,28 +57,39 @@ export type AuthenticatedUser = Message<"gestalt.provider.v1.AuthenticatedUser">
54
57
  * Use `create(AuthenticatedUserSchema)` to create a new message.
55
58
  */
56
59
  export const AuthenticatedUserSchema: GenMessage<AuthenticatedUser> = /*@__PURE__*/
57
- messageDesc(file_v1_auth, 0);
60
+ messageDesc(file_v1_authentication, 0);
58
61
 
59
62
  /**
63
+ * BeginLoginRequest starts an interactive login flow.
64
+ *
60
65
  * @generated from message gestalt.provider.v1.BeginLoginRequest
61
66
  */
62
67
  export type BeginLoginRequest = Message<"gestalt.provider.v1.BeginLoginRequest"> & {
63
68
  /**
69
+ * callback_url is the host-managed URL the provider should redirect back to.
70
+ *
64
71
  * @generated from field: string callback_url = 1;
65
72
  */
66
73
  callbackUrl: string;
67
74
 
68
75
  /**
76
+ * host_state is opaque state generated by the host and echoed back on
77
+ * completion.
78
+ *
69
79
  * @generated from field: string host_state = 2;
70
80
  */
71
81
  hostState: string;
72
82
 
73
83
  /**
84
+ * scopes are the provider-specific scopes the host is requesting.
85
+ *
74
86
  * @generated from field: repeated string scopes = 3;
75
87
  */
76
88
  scopes: string[];
77
89
 
78
90
  /**
91
+ * options carries provider-specific login parameters.
92
+ *
79
93
  * @generated from field: map<string, string> options = 4;
80
94
  */
81
95
  options: { [key: string]: string };
@@ -86,9 +100,12 @@ export type BeginLoginRequest = Message<"gestalt.provider.v1.BeginLoginRequest">
86
100
  * Use `create(BeginLoginRequestSchema)` to create a new message.
87
101
  */
88
102
  export const BeginLoginRequestSchema: GenMessage<BeginLoginRequest> = /*@__PURE__*/
89
- messageDesc(file_v1_auth, 1);
103
+ messageDesc(file_v1_authentication, 1);
90
104
 
91
105
  /**
106
+ * BeginLoginResponse returns the provider-managed authorization URL and opaque
107
+ * provider state that must be preserved until completion.
108
+ *
92
109
  * @generated from message gestalt.provider.v1.BeginLoginResponse
93
110
  */
94
111
  export type BeginLoginResponse = Message<"gestalt.provider.v1.BeginLoginResponse"> & {
@@ -108,23 +125,32 @@ export type BeginLoginResponse = Message<"gestalt.provider.v1.BeginLoginResponse
108
125
  * Use `create(BeginLoginResponseSchema)` to create a new message.
109
126
  */
110
127
  export const BeginLoginResponseSchema: GenMessage<BeginLoginResponse> = /*@__PURE__*/
111
- messageDesc(file_v1_auth, 2);
128
+ messageDesc(file_v1_authentication, 2);
112
129
 
113
130
  /**
131
+ * CompleteLoginRequest finishes an interactive login flow.
132
+ *
114
133
  * @generated from message gestalt.provider.v1.CompleteLoginRequest
115
134
  */
116
135
  export type CompleteLoginRequest = Message<"gestalt.provider.v1.CompleteLoginRequest"> & {
117
136
  /**
137
+ * query contains the callback URL query parameters returned by the identity
138
+ * provider.
139
+ *
118
140
  * @generated from field: map<string, string> query = 1;
119
141
  */
120
142
  query: { [key: string]: string };
121
143
 
122
144
  /**
145
+ * provider_state is the opaque state returned from BeginLoginResponse.
146
+ *
123
147
  * @generated from field: bytes provider_state = 2;
124
148
  */
125
149
  providerState: Uint8Array;
126
150
 
127
151
  /**
152
+ * callback_url is the fully qualified callback URL used by the host.
153
+ *
128
154
  * @generated from field: string callback_url = 3;
129
155
  */
130
156
  callbackUrl: string;
@@ -135,9 +161,12 @@ export type CompleteLoginRequest = Message<"gestalt.provider.v1.CompleteLoginReq
135
161
  * Use `create(CompleteLoginRequestSchema)` to create a new message.
136
162
  */
137
163
  export const CompleteLoginRequestSchema: GenMessage<CompleteLoginRequest> = /*@__PURE__*/
138
- messageDesc(file_v1_auth, 3);
164
+ messageDesc(file_v1_authentication, 3);
139
165
 
140
166
  /**
167
+ * ValidateExternalTokenRequest asks the provider to validate a token minted
168
+ * outside the interactive login flow.
169
+ *
141
170
  * @generated from message gestalt.provider.v1.ValidateExternalTokenRequest
142
171
  */
143
172
  export type ValidateExternalTokenRequest = Message<"gestalt.provider.v1.ValidateExternalTokenRequest"> & {
@@ -152,9 +181,11 @@ export type ValidateExternalTokenRequest = Message<"gestalt.provider.v1.Validate
152
181
  * Use `create(ValidateExternalTokenRequestSchema)` to create a new message.
153
182
  */
154
183
  export const ValidateExternalTokenRequestSchema: GenMessage<ValidateExternalTokenRequest> = /*@__PURE__*/
155
- messageDesc(file_v1_auth, 4);
184
+ messageDesc(file_v1_authentication, 4);
156
185
 
157
186
  /**
187
+ * AuthSessionSettings configures how the host persists authenticated sessions.
188
+ *
158
189
  * @generated from message gestalt.provider.v1.AuthSessionSettings
159
190
  */
160
191
  export type AuthSessionSettings = Message<"gestalt.provider.v1.AuthSessionSettings"> & {
@@ -169,14 +200,17 @@ export type AuthSessionSettings = Message<"gestalt.provider.v1.AuthSessionSettin
169
200
  * Use `create(AuthSessionSettingsSchema)` to create a new message.
170
201
  */
171
202
  export const AuthSessionSettingsSchema: GenMessage<AuthSessionSettings> = /*@__PURE__*/
172
- messageDesc(file_v1_auth, 5);
203
+ messageDesc(file_v1_authentication, 5);
173
204
 
174
205
  /**
175
- * @generated from service gestalt.provider.v1.AuthProvider
206
+ * AuthenticationProvider models the shared Gestalt authentication-provider
207
+ * protocol.
208
+ *
209
+ * @generated from service gestalt.provider.v1.AuthenticationProvider
176
210
  */
177
- export const AuthProvider: GenService<{
211
+ export const AuthenticationProvider: GenService<{
178
212
  /**
179
- * @generated from rpc gestalt.provider.v1.AuthProvider.BeginLogin
213
+ * @generated from rpc gestalt.provider.v1.AuthenticationProvider.BeginLogin
180
214
  */
181
215
  beginLogin: {
182
216
  methodKind: "unary";
@@ -184,7 +218,7 @@ export const AuthProvider: GenService<{
184
218
  output: typeof BeginLoginResponseSchema;
185
219
  },
186
220
  /**
187
- * @generated from rpc gestalt.provider.v1.AuthProvider.CompleteLogin
221
+ * @generated from rpc gestalt.provider.v1.AuthenticationProvider.CompleteLogin
188
222
  */
189
223
  completeLogin: {
190
224
  methodKind: "unary";
@@ -192,7 +226,7 @@ export const AuthProvider: GenService<{
192
226
  output: typeof AuthenticatedUserSchema;
193
227
  },
194
228
  /**
195
- * @generated from rpc gestalt.provider.v1.AuthProvider.ValidateExternalToken
229
+ * @generated from rpc gestalt.provider.v1.AuthenticationProvider.ValidateExternalToken
196
230
  */
197
231
  validateExternalToken: {
198
232
  methodKind: "unary";
@@ -200,7 +234,7 @@ export const AuthProvider: GenService<{
200
234
  output: typeof AuthenticatedUserSchema;
201
235
  },
202
236
  /**
203
- * @generated from rpc gestalt.provider.v1.AuthProvider.GetSessionSettings
237
+ * @generated from rpc gestalt.provider.v1.AuthenticationProvider.GetSessionSettings
204
238
  */
205
239
  getSessionSettings: {
206
240
  methodKind: "unary";
@@ -208,5 +242,5 @@ export const AuthProvider: GenService<{
208
242
  output: typeof AuthSessionSettingsSchema;
209
243
  },
210
244
  }> = /*@__PURE__*/
211
- serviceDesc(file_v1_auth, 0);
245
+ serviceDesc(file_v1_authentication, 0);
212
246