@valon-technologies/gestalt 0.0.1-alpha.1 → 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 +8 -26
- package/gen/v1/{auth_pb.ts → authentication_pb.ts} +51 -17
- package/gen/v1/authorization_pb.ts +857 -0
- package/gen/v1/cache_pb.ts +32 -0
- package/gen/v1/datastore_pb.ts +62 -0
- package/gen/v1/plugin_pb.ts +216 -18
- package/gen/v1/runtime_pb.ts +27 -3
- package/gen/v1/s3_pb.ts +39 -0
- package/gen/v1/secrets_pb.ts +6 -0
- package/gen/v1/workflow_pb.ts +1372 -0
- package/package.json +12 -10
- package/src/api.ts +56 -0
- package/src/auth.ts +67 -16
- package/src/build.ts +37 -21
- package/src/cache.ts +32 -0
- package/src/catalog.ts +27 -0
- package/src/index.ts +87 -18
- package/src/indexeddb.ts +166 -0
- package/src/invoker.ts +124 -0
- package/src/plugin.ts +93 -38
- package/src/provider-kind.ts +107 -0
- package/src/provider.ts +32 -1
- package/src/runtime.ts +233 -218
- package/src/s3.ts +135 -20
- package/src/schema.ts +46 -0
- package/src/secrets.ts +12 -0
- package/src/target.ts +58 -60
- package/src/workflow-manager.ts +131 -0
- package/src/workflow.ts +479 -0
- package/tsconfig.json +1 -0
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#
|
|
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#
|
|
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
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
97
|
+
Authentication providers, cache providers, and secrets providers use dedicated helpers:
|
|
100
98
|
|
|
101
99
|
```ts
|
|
102
100
|
import {
|
|
103
101
|
Cache,
|
|
104
|
-
|
|
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#
|
|
113
|
+
gestalt-ts-runtime ROOT plugin:./provider.ts#plugin
|
|
116
114
|
```
|
|
117
115
|
|
|
118
116
|
Release build:
|
|
@@ -142,19 +140,3 @@ bun install
|
|
|
142
140
|
bun run build:proto
|
|
143
141
|
bun run check
|
|
144
142
|
```
|
|
145
|
-
|
|
146
|
-
## Publishing
|
|
147
|
-
|
|
148
|
-
The SDK is published to npm as `@valon-technologies/gestalt`.
|
|
149
|
-
|
|
150
|
-
Release tags stay aligned with the repo's SDK tag convention:
|
|
151
|
-
|
|
152
|
-
- `sdk/typescript/v0.0.1`
|
|
153
|
-
- `sdk/typescript/v0.0.1-alpha.1`
|
|
154
|
-
- `sdk/typescript/v0.0.1-beta.1`
|
|
155
|
-
- `sdk/typescript/v0.0.1-rc.1`
|
|
156
|
-
|
|
157
|
-
The release workflow uses Bun for installation and validation, then publishes
|
|
158
|
-
with npm Trusted Publishing from GitHub Actions. Stable releases use the
|
|
159
|
-
default `latest` dist-tag; prereleases are published under `alpha`, `beta`, or
|
|
160
|
-
`rc`.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @generated by protoc-gen-es v2.11.0 with parameter "target=ts"
|
|
2
|
-
// @generated from file v1/
|
|
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/
|
|
12
|
+
* Describes the file v1/authentication.proto.
|
|
13
13
|
*/
|
|
14
|
-
export const
|
|
15
|
-
fileDesc("
|
|
14
|
+
export const file_v1_authentication: GenFile = /*@__PURE__*/
|
|
15
|
+
fileDesc("Chd2MS9hdXRoZW50aWNhdGlvbi5wcm90bxITZ2VzdGFsdC5wcm92aWRlci52MSLoAQoRQXV0aG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pZGVyEl0KCkJlZ2luTG9naW4SJi5nZXN0YWx0LnByb3ZpZGVyLnYxLkJlZ2luTG9naW5SZXF1ZXN0GicuZ2VzdGFsdC5wcm92aWRlci52MS5CZWdpbkxvZ2luUmVzcG9uc2USYgoNQ29tcGxldGVMb2dpbhIpLmdlc3RhbHQucHJvdmlkZXIudjEuQ29tcGxldGVMb2dpblJlcXVlc3QaJi5nZXN0YWx0LnByb3ZpZGVyLnYxLkF1dGhlbnRpY2F0ZWRVc2VyEnIKFVZhbGlkYXRlRXh0ZXJuYWxUb2tlbhIxLmdlc3RhbHQucHJvdmlkZXIudjEuVmFsaWRhdGVFeHRlcm5hbFRva2VuUmVxdWVzdBomLmdlc3RhbHQucHJvdmlkZXIudjEuQXV0aGVudGljYXRlZFVzZXISVgoSR2V0U2Vzc2lvblNldHRpbmdzEhYuZ29vZ2xlLnByb3RvYnVmLkVtcHR5GiguZ2VzdGFsdC5wcm92aWRlci52MS5BdXRoU2Vzc2lvblNldHRpbmdzQjtaOWdpdGh1Yi5jb20vdmFsb24tdGVjaG5vbG9naWVzL2dlc3RhbHQvc2RrL2dvL2dlbi92MTtwcm90b2IGcHJvdG8z", [file_google_protobuf_empty]);
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
|
+
* AuthenticatedUser is the normalized 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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
203
|
+
messageDesc(file_v1_authentication, 5);
|
|
173
204
|
|
|
174
205
|
/**
|
|
175
|
-
*
|
|
206
|
+
* AuthenticationProvider models the shared Gestalt authentication-provider
|
|
207
|
+
* protocol.
|
|
208
|
+
*
|
|
209
|
+
* @generated from service gestalt.provider.v1.AuthenticationProvider
|
|
176
210
|
*/
|
|
177
|
-
export const
|
|
211
|
+
export const AuthenticationProvider: GenService<{
|
|
178
212
|
/**
|
|
179
|
-
* @generated from rpc gestalt.provider.v1.
|
|
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.
|
|
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.
|
|
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.
|
|
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(
|
|
245
|
+
serviceDesc(file_v1_authentication, 0);
|
|
212
246
|
|