@liquidmetal-ai/drizzle 0.0.1
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/.changeset/README.md +4 -0
- package/.changeset/config.json +11 -0
- package/.changeset/odd-plums-dress.md +7 -0
- package/.turbo/turbo-build.log +6 -0
- package/dist/appify/build.d.ts +130 -0
- package/dist/appify/build.d.ts.map +1 -0
- package/dist/appify/build.js +703 -0
- package/dist/appify/build.test.d.ts +2 -0
- package/dist/appify/build.test.d.ts.map +1 -0
- package/dist/appify/build.test.js +111 -0
- package/dist/appify/index.d.ts +8 -0
- package/dist/appify/index.d.ts.map +1 -0
- package/dist/appify/index.js +28 -0
- package/dist/appify/index.test.d.ts +2 -0
- package/dist/appify/index.test.d.ts.map +1 -0
- package/dist/appify/index.test.js +40 -0
- package/dist/appify/parse.d.ts +151 -0
- package/dist/appify/parse.d.ts.map +1 -0
- package/dist/appify/parse.js +579 -0
- package/dist/appify/parse.test.d.ts +2 -0
- package/dist/appify/parse.test.d.ts.map +1 -0
- package/dist/appify/parse.test.js +319 -0
- package/dist/appify/validate.d.ts +22 -0
- package/dist/appify/validate.d.ts.map +1 -0
- package/dist/appify/validate.js +346 -0
- package/dist/appify/validate.test.d.ts +2 -0
- package/dist/appify/validate.test.d.ts.map +1 -0
- package/dist/appify/validate.test.js +327 -0
- package/dist/codestore.d.ts +34 -0
- package/dist/codestore.d.ts.map +1 -0
- package/dist/codestore.js +54 -0
- package/dist/codestore.test.d.ts +2 -0
- package/dist/codestore.test.d.ts.map +1 -0
- package/dist/codestore.test.js +84 -0
- package/dist/liquidmetal/v1alpha1/catalog_connect.d.ts +147 -0
- package/dist/liquidmetal/v1alpha1/catalog_connect.d.ts.map +1 -0
- package/dist/liquidmetal/v1alpha1/catalog_connect.js +150 -0
- package/dist/liquidmetal/v1alpha1/catalog_pb.d.ts +965 -0
- package/dist/liquidmetal/v1alpha1/catalog_pb.d.ts.map +1 -0
- package/dist/liquidmetal/v1alpha1/catalog_pb.js +1486 -0
- package/dist/liquidmetal/v1alpha1/rainbow_auth_connect.d.ts +49 -0
- package/dist/liquidmetal/v1alpha1/rainbow_auth_connect.d.ts.map +1 -0
- package/dist/liquidmetal/v1alpha1/rainbow_auth_connect.js +52 -0
- package/dist/liquidmetal/v1alpha1/rainbow_auth_pb.d.ts +271 -0
- package/dist/liquidmetal/v1alpha1/rainbow_auth_pb.d.ts.map +1 -0
- package/dist/liquidmetal/v1alpha1/rainbow_auth_pb.js +381 -0
- package/dist/liquidmetal/v1alpha1/raindrop_pb.d.ts +38 -0
- package/dist/liquidmetal/v1alpha1/raindrop_pb.d.ts.map +1 -0
- package/dist/liquidmetal/v1alpha1/raindrop_pb.js +52 -0
- package/dist/unsafe/codestore.d.ts +10 -0
- package/dist/unsafe/codestore.d.ts.map +1 -0
- package/dist/unsafe/codestore.js +23 -0
- package/dist/unsafe/codestore.test.d.ts +2 -0
- package/dist/unsafe/codestore.test.d.ts.map +1 -0
- package/dist/unsafe/codestore.test.js +27 -0
- package/eslint.config.mjs +4 -0
- package/package.json +45 -0
- package/src/appify/build.test.ts +116 -0
- package/src/appify/build.ts +783 -0
- package/src/appify/index.test.ts +43 -0
- package/src/appify/index.ts +33 -0
- package/src/appify/parse.test.ts +337 -0
- package/src/appify/parse.ts +744 -0
- package/src/appify/validate.test.ts +341 -0
- package/src/appify/validate.ts +435 -0
- package/src/codestore.test.ts +98 -0
- package/src/codestore.ts +93 -0
- package/src/liquidmetal/v1alpha1/catalog_connect.ts +153 -0
- package/src/liquidmetal/v1alpha1/catalog_pb.ts +1827 -0
- package/src/liquidmetal/v1alpha1/rainbow_auth_connect.ts +55 -0
- package/src/liquidmetal/v1alpha1/rainbow_auth_pb.ts +476 -0
- package/src/liquidmetal/v1alpha1/raindrop_pb.ts +63 -0
- package/src/unsafe/codestore.test.ts +34 -0
- package/src/unsafe/codestore.ts +29 -0
- package/tsconfig.json +31 -0
- package/tsconfig.tsbuildinfo +1 -0
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
// @generated by protoc-gen-connect-es v1.4.0 with parameter "target=ts,import_extension=.js"
|
|
2
|
+
// @generated from file liquidmetal/v1alpha1/rainbow_auth.proto (package liquidmetal.v1alpha1, syntax proto3)
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
// @ts-nocheck
|
|
5
|
+
|
|
6
|
+
import { DeviceAccessTokenRequest, DeviceAccessTokenResponse, DeviceAuthorizationRequest, DeviceAuthorizationResponse, RefreshAccessTokenRequest, RefreshAccessTokenResponse } from "./rainbow_auth_pb.js";
|
|
7
|
+
import { MethodKind } from "@bufbuild/protobuf";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* @generated from service liquidmetal.v1alpha1.RainbowAuthService
|
|
11
|
+
*/
|
|
12
|
+
export const RainbowAuthService = {
|
|
13
|
+
typeName: "liquidmetal.v1alpha1.RainbowAuthService",
|
|
14
|
+
methods: {
|
|
15
|
+
/**
|
|
16
|
+
* DeviceAuthorization is similar to the RFC8628 Device Authorization Request
|
|
17
|
+
* and Response.
|
|
18
|
+
*
|
|
19
|
+
* https://datatracker.ietf.org/doc/html/rfc8628#section-3.1
|
|
20
|
+
*
|
|
21
|
+
* @generated from rpc liquidmetal.v1alpha1.RainbowAuthService.DeviceAuthorization
|
|
22
|
+
*/
|
|
23
|
+
deviceAuthorization: {
|
|
24
|
+
name: "DeviceAuthorization",
|
|
25
|
+
I: DeviceAuthorizationRequest,
|
|
26
|
+
O: DeviceAuthorizationResponse,
|
|
27
|
+
kind: MethodKind.Unary,
|
|
28
|
+
},
|
|
29
|
+
/**
|
|
30
|
+
* DeviceAccessToken is polled after a successful call to DeviceAuthorization
|
|
31
|
+
* awaiting the verification_uri_complete to have been followed allowing this
|
|
32
|
+
* RPC to return a BearerToken response.
|
|
33
|
+
*
|
|
34
|
+
* @generated from rpc liquidmetal.v1alpha1.RainbowAuthService.DeviceAccessToken
|
|
35
|
+
*/
|
|
36
|
+
deviceAccessToken: {
|
|
37
|
+
name: "DeviceAccessToken",
|
|
38
|
+
I: DeviceAccessTokenRequest,
|
|
39
|
+
O: DeviceAccessTokenResponse,
|
|
40
|
+
kind: MethodKind.Unary,
|
|
41
|
+
},
|
|
42
|
+
/**
|
|
43
|
+
* RefreshAccessToken is invoked when the access token expires.
|
|
44
|
+
*
|
|
45
|
+
* @generated from rpc liquidmetal.v1alpha1.RainbowAuthService.RefreshAccessToken
|
|
46
|
+
*/
|
|
47
|
+
refreshAccessToken: {
|
|
48
|
+
name: "RefreshAccessToken",
|
|
49
|
+
I: RefreshAccessTokenRequest,
|
|
50
|
+
O: RefreshAccessTokenResponse,
|
|
51
|
+
kind: MethodKind.Unary,
|
|
52
|
+
},
|
|
53
|
+
}
|
|
54
|
+
} as const;
|
|
55
|
+
|
|
@@ -0,0 +1,476 @@
|
|
|
1
|
+
// @generated by protoc-gen-es v1.10.0 with parameter "target=ts"
|
|
2
|
+
// @generated from file liquidmetal/v1alpha1/rainbow_auth.proto (package liquidmetal.v1alpha1, syntax proto3)
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
// @ts-nocheck
|
|
5
|
+
|
|
6
|
+
import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf";
|
|
7
|
+
import { Duration, Message, proto3, Timestamp } from "@bufbuild/protobuf";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* @generated from message liquidmetal.v1alpha1.DeviceAuthorizationRequest
|
|
11
|
+
*/
|
|
12
|
+
export class DeviceAuthorizationRequest extends Message<DeviceAuthorizationRequest> {
|
|
13
|
+
/**
|
|
14
|
+
* client_id should be the application name and version e.g. raindrop@v1.0.0
|
|
15
|
+
*
|
|
16
|
+
* @generated from field: string client_id = 1;
|
|
17
|
+
*/
|
|
18
|
+
clientId = "";
|
|
19
|
+
|
|
20
|
+
constructor(data?: PartialMessage<DeviceAuthorizationRequest>) {
|
|
21
|
+
super();
|
|
22
|
+
proto3.util.initPartial(data, this);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
static readonly runtime: typeof proto3 = proto3;
|
|
26
|
+
static readonly typeName = "liquidmetal.v1alpha1.DeviceAuthorizationRequest";
|
|
27
|
+
static readonly fields: FieldList = proto3.util.newFieldList(() => [
|
|
28
|
+
{ no: 1, name: "client_id", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
29
|
+
]);
|
|
30
|
+
|
|
31
|
+
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): DeviceAuthorizationRequest {
|
|
32
|
+
return new DeviceAuthorizationRequest().fromBinary(bytes, options);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): DeviceAuthorizationRequest {
|
|
36
|
+
return new DeviceAuthorizationRequest().fromJson(jsonValue, options);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): DeviceAuthorizationRequest {
|
|
40
|
+
return new DeviceAuthorizationRequest().fromJsonString(jsonString, options);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
static equals(a: DeviceAuthorizationRequest | PlainMessage<DeviceAuthorizationRequest> | undefined, b: DeviceAuthorizationRequest | PlainMessage<DeviceAuthorizationRequest> | undefined): boolean {
|
|
44
|
+
return proto3.util.equals(DeviceAuthorizationRequest, a, b);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* @generated from message liquidmetal.v1alpha1.DeviceAuthorizationResponse
|
|
50
|
+
*/
|
|
51
|
+
export class DeviceAuthorizationResponse extends Message<DeviceAuthorizationResponse> {
|
|
52
|
+
/**
|
|
53
|
+
* device_code is a name from RFC8628 that will be used by the invoker of
|
|
54
|
+
* DeviceAuthorization to continuously poll to see if the authorization has
|
|
55
|
+
* been granted.
|
|
56
|
+
*
|
|
57
|
+
* @generated from field: string device_code = 1;
|
|
58
|
+
*/
|
|
59
|
+
deviceCode = "";
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* verification_uri_complete is a URL that the caller should visit in order to
|
|
63
|
+
* initiate a login flow through a browser that will result in the device_code
|
|
64
|
+
* being associated with the login.
|
|
65
|
+
*
|
|
66
|
+
* as we do not support low-fidelity devices, we do not expose the RFC8628
|
|
67
|
+
* user_code nor the verification_uri. It is expected that the device can
|
|
68
|
+
* render a complex uri that the user can either click on or use a QR code
|
|
69
|
+
* scanner to complete rather than providing user-friendly small-length
|
|
70
|
+
* characters to type manually.
|
|
71
|
+
*
|
|
72
|
+
* @generated from field: string verification_uri_complete = 2;
|
|
73
|
+
*/
|
|
74
|
+
verificationUriComplete = "";
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* expires_at is when the device code is marked as expired
|
|
78
|
+
*
|
|
79
|
+
* @generated from field: google.protobuf.Timestamp expires_at = 3;
|
|
80
|
+
*/
|
|
81
|
+
expiresAt?: Timestamp;
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* interval is the minimum amount of time that the client should wait between
|
|
85
|
+
* polling requests
|
|
86
|
+
*
|
|
87
|
+
* @generated from field: google.protobuf.Duration interval = 4;
|
|
88
|
+
*/
|
|
89
|
+
interval?: Duration;
|
|
90
|
+
|
|
91
|
+
constructor(data?: PartialMessage<DeviceAuthorizationResponse>) {
|
|
92
|
+
super();
|
|
93
|
+
proto3.util.initPartial(data, this);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
static readonly runtime: typeof proto3 = proto3;
|
|
97
|
+
static readonly typeName = "liquidmetal.v1alpha1.DeviceAuthorizationResponse";
|
|
98
|
+
static readonly fields: FieldList = proto3.util.newFieldList(() => [
|
|
99
|
+
{ no: 1, name: "device_code", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
100
|
+
{ no: 2, name: "verification_uri_complete", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
101
|
+
{ no: 3, name: "expires_at", kind: "message", T: Timestamp },
|
|
102
|
+
{ no: 4, name: "interval", kind: "message", T: Duration },
|
|
103
|
+
]);
|
|
104
|
+
|
|
105
|
+
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): DeviceAuthorizationResponse {
|
|
106
|
+
return new DeviceAuthorizationResponse().fromBinary(bytes, options);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): DeviceAuthorizationResponse {
|
|
110
|
+
return new DeviceAuthorizationResponse().fromJson(jsonValue, options);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): DeviceAuthorizationResponse {
|
|
114
|
+
return new DeviceAuthorizationResponse().fromJsonString(jsonString, options);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
static equals(a: DeviceAuthorizationResponse | PlainMessage<DeviceAuthorizationResponse> | undefined, b: DeviceAuthorizationResponse | PlainMessage<DeviceAuthorizationResponse> | undefined): boolean {
|
|
118
|
+
return proto3.util.equals(DeviceAuthorizationResponse, a, b);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* @generated from message liquidmetal.v1alpha1.DeviceAccessTokenRequest
|
|
124
|
+
*/
|
|
125
|
+
export class DeviceAccessTokenRequest extends Message<DeviceAccessTokenRequest> {
|
|
126
|
+
/**
|
|
127
|
+
* @generated from field: string device_code = 1;
|
|
128
|
+
*/
|
|
129
|
+
deviceCode = "";
|
|
130
|
+
|
|
131
|
+
constructor(data?: PartialMessage<DeviceAccessTokenRequest>) {
|
|
132
|
+
super();
|
|
133
|
+
proto3.util.initPartial(data, this);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
static readonly runtime: typeof proto3 = proto3;
|
|
137
|
+
static readonly typeName = "liquidmetal.v1alpha1.DeviceAccessTokenRequest";
|
|
138
|
+
static readonly fields: FieldList = proto3.util.newFieldList(() => [
|
|
139
|
+
{ no: 1, name: "device_code", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
140
|
+
]);
|
|
141
|
+
|
|
142
|
+
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): DeviceAccessTokenRequest {
|
|
143
|
+
return new DeviceAccessTokenRequest().fromBinary(bytes, options);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): DeviceAccessTokenRequest {
|
|
147
|
+
return new DeviceAccessTokenRequest().fromJson(jsonValue, options);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): DeviceAccessTokenRequest {
|
|
151
|
+
return new DeviceAccessTokenRequest().fromJsonString(jsonString, options);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
static equals(a: DeviceAccessTokenRequest | PlainMessage<DeviceAccessTokenRequest> | undefined, b: DeviceAccessTokenRequest | PlainMessage<DeviceAccessTokenRequest> | undefined): boolean {
|
|
155
|
+
return proto3.util.equals(DeviceAccessTokenRequest, a, b);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* @generated from message liquidmetal.v1alpha1.DeviceAccessTokenResponse
|
|
161
|
+
*/
|
|
162
|
+
export class DeviceAccessTokenResponse extends Message<DeviceAccessTokenResponse> {
|
|
163
|
+
/**
|
|
164
|
+
* @generated from oneof liquidmetal.v1alpha1.DeviceAccessTokenResponse.response
|
|
165
|
+
*/
|
|
166
|
+
response: {
|
|
167
|
+
/**
|
|
168
|
+
* authorization_pending is returned when it is acceptable to continue
|
|
169
|
+
* polling for a token but the login has not yet completed.
|
|
170
|
+
*
|
|
171
|
+
* @generated from field: liquidmetal.v1alpha1.AuthorizationPending authorization_pending = 1;
|
|
172
|
+
*/
|
|
173
|
+
value: AuthorizationPending;
|
|
174
|
+
case: "authorizationPending";
|
|
175
|
+
} | {
|
|
176
|
+
/**
|
|
177
|
+
* bearer_token is a successful authorization where access may be granted by
|
|
178
|
+
* providing the access_token as a Bearer authentication header.
|
|
179
|
+
*
|
|
180
|
+
* @generated from field: liquidmetal.v1alpha1.BearerToken bearer_token = 2;
|
|
181
|
+
*/
|
|
182
|
+
value: BearerToken;
|
|
183
|
+
case: "bearerToken";
|
|
184
|
+
} | { case: undefined; value?: undefined } = { case: undefined };
|
|
185
|
+
|
|
186
|
+
constructor(data?: PartialMessage<DeviceAccessTokenResponse>) {
|
|
187
|
+
super();
|
|
188
|
+
proto3.util.initPartial(data, this);
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
static readonly runtime: typeof proto3 = proto3;
|
|
192
|
+
static readonly typeName = "liquidmetal.v1alpha1.DeviceAccessTokenResponse";
|
|
193
|
+
static readonly fields: FieldList = proto3.util.newFieldList(() => [
|
|
194
|
+
{ no: 1, name: "authorization_pending", kind: "message", T: AuthorizationPending, oneof: "response" },
|
|
195
|
+
{ no: 2, name: "bearer_token", kind: "message", T: BearerToken, oneof: "response" },
|
|
196
|
+
]);
|
|
197
|
+
|
|
198
|
+
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): DeviceAccessTokenResponse {
|
|
199
|
+
return new DeviceAccessTokenResponse().fromBinary(bytes, options);
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): DeviceAccessTokenResponse {
|
|
203
|
+
return new DeviceAccessTokenResponse().fromJson(jsonValue, options);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): DeviceAccessTokenResponse {
|
|
207
|
+
return new DeviceAccessTokenResponse().fromJsonString(jsonString, options);
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
static equals(a: DeviceAccessTokenResponse | PlainMessage<DeviceAccessTokenResponse> | undefined, b: DeviceAccessTokenResponse | PlainMessage<DeviceAccessTokenResponse> | undefined): boolean {
|
|
211
|
+
return proto3.util.equals(DeviceAccessTokenResponse, a, b);
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* @generated from message liquidmetal.v1alpha1.RefreshAccessTokenRequest
|
|
217
|
+
*/
|
|
218
|
+
export class RefreshAccessTokenRequest extends Message<RefreshAccessTokenRequest> {
|
|
219
|
+
/**
|
|
220
|
+
* @generated from field: string refresh_token = 1;
|
|
221
|
+
*/
|
|
222
|
+
refreshToken = "";
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* @generated from field: string organization_id = 2;
|
|
226
|
+
*/
|
|
227
|
+
organizationId = "";
|
|
228
|
+
|
|
229
|
+
constructor(data?: PartialMessage<RefreshAccessTokenRequest>) {
|
|
230
|
+
super();
|
|
231
|
+
proto3.util.initPartial(data, this);
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
static readonly runtime: typeof proto3 = proto3;
|
|
235
|
+
static readonly typeName = "liquidmetal.v1alpha1.RefreshAccessTokenRequest";
|
|
236
|
+
static readonly fields: FieldList = proto3.util.newFieldList(() => [
|
|
237
|
+
{ no: 1, name: "refresh_token", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
238
|
+
{ no: 2, name: "organization_id", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
239
|
+
]);
|
|
240
|
+
|
|
241
|
+
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): RefreshAccessTokenRequest {
|
|
242
|
+
return new RefreshAccessTokenRequest().fromBinary(bytes, options);
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): RefreshAccessTokenRequest {
|
|
246
|
+
return new RefreshAccessTokenRequest().fromJson(jsonValue, options);
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): RefreshAccessTokenRequest {
|
|
250
|
+
return new RefreshAccessTokenRequest().fromJsonString(jsonString, options);
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
static equals(a: RefreshAccessTokenRequest | PlainMessage<RefreshAccessTokenRequest> | undefined, b: RefreshAccessTokenRequest | PlainMessage<RefreshAccessTokenRequest> | undefined): boolean {
|
|
254
|
+
return proto3.util.equals(RefreshAccessTokenRequest, a, b);
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
/**
|
|
259
|
+
* @generated from message liquidmetal.v1alpha1.RefreshAccessTokenResponse
|
|
260
|
+
*/
|
|
261
|
+
export class RefreshAccessTokenResponse extends Message<RefreshAccessTokenResponse> {
|
|
262
|
+
/**
|
|
263
|
+
* @generated from field: liquidmetal.v1alpha1.BearerToken bearer_token = 1;
|
|
264
|
+
*/
|
|
265
|
+
bearerToken?: BearerToken;
|
|
266
|
+
|
|
267
|
+
constructor(data?: PartialMessage<RefreshAccessTokenResponse>) {
|
|
268
|
+
super();
|
|
269
|
+
proto3.util.initPartial(data, this);
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
static readonly runtime: typeof proto3 = proto3;
|
|
273
|
+
static readonly typeName = "liquidmetal.v1alpha1.RefreshAccessTokenResponse";
|
|
274
|
+
static readonly fields: FieldList = proto3.util.newFieldList(() => [
|
|
275
|
+
{ no: 1, name: "bearer_token", kind: "message", T: BearerToken },
|
|
276
|
+
]);
|
|
277
|
+
|
|
278
|
+
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): RefreshAccessTokenResponse {
|
|
279
|
+
return new RefreshAccessTokenResponse().fromBinary(bytes, options);
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): RefreshAccessTokenResponse {
|
|
283
|
+
return new RefreshAccessTokenResponse().fromJson(jsonValue, options);
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): RefreshAccessTokenResponse {
|
|
287
|
+
return new RefreshAccessTokenResponse().fromJsonString(jsonString, options);
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
static equals(a: RefreshAccessTokenResponse | PlainMessage<RefreshAccessTokenResponse> | undefined, b: RefreshAccessTokenResponse | PlainMessage<RefreshAccessTokenResponse> | undefined): boolean {
|
|
291
|
+
return proto3.util.equals(RefreshAccessTokenResponse, a, b);
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
/**
|
|
296
|
+
* @generated from message liquidmetal.v1alpha1.AuthorizationPending
|
|
297
|
+
*/
|
|
298
|
+
export class AuthorizationPending extends Message<AuthorizationPending> {
|
|
299
|
+
/**
|
|
300
|
+
* interval is the minimum amount of time that the client should wait between
|
|
301
|
+
* polling requests
|
|
302
|
+
*
|
|
303
|
+
* @generated from field: google.protobuf.Duration interval = 1;
|
|
304
|
+
*/
|
|
305
|
+
interval?: Duration;
|
|
306
|
+
|
|
307
|
+
constructor(data?: PartialMessage<AuthorizationPending>) {
|
|
308
|
+
super();
|
|
309
|
+
proto3.util.initPartial(data, this);
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
static readonly runtime: typeof proto3 = proto3;
|
|
313
|
+
static readonly typeName = "liquidmetal.v1alpha1.AuthorizationPending";
|
|
314
|
+
static readonly fields: FieldList = proto3.util.newFieldList(() => [
|
|
315
|
+
{ no: 1, name: "interval", kind: "message", T: Duration },
|
|
316
|
+
]);
|
|
317
|
+
|
|
318
|
+
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): AuthorizationPending {
|
|
319
|
+
return new AuthorizationPending().fromBinary(bytes, options);
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): AuthorizationPending {
|
|
323
|
+
return new AuthorizationPending().fromJson(jsonValue, options);
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): AuthorizationPending {
|
|
327
|
+
return new AuthorizationPending().fromJsonString(jsonString, options);
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
static equals(a: AuthorizationPending | PlainMessage<AuthorizationPending> | undefined, b: AuthorizationPending | PlainMessage<AuthorizationPending> | undefined): boolean {
|
|
331
|
+
return proto3.util.equals(AuthorizationPending, a, b);
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
/**
|
|
336
|
+
* @generated from message liquidmetal.v1alpha1.BearerToken
|
|
337
|
+
*/
|
|
338
|
+
export class BearerToken extends Message<BearerToken> {
|
|
339
|
+
/**
|
|
340
|
+
* access_token is the string to be provided as a Bearer to APIs
|
|
341
|
+
*
|
|
342
|
+
* @generated from field: string access_token = 1;
|
|
343
|
+
*/
|
|
344
|
+
accessToken = "";
|
|
345
|
+
|
|
346
|
+
/**
|
|
347
|
+
* access_token_expires_at is when the access token expires (though the
|
|
348
|
+
* access token happens to be a jwt and also includes an expires at field,
|
|
349
|
+
* this allows the client to use the access token without needing to know
|
|
350
|
+
* how to validate or parse it.)
|
|
351
|
+
*
|
|
352
|
+
* @generated from field: google.protobuf.Timestamp access_token_expires_at = 2;
|
|
353
|
+
*/
|
|
354
|
+
accessTokenExpiresAt?: Timestamp;
|
|
355
|
+
|
|
356
|
+
/**
|
|
357
|
+
* refresh_token is utilized when the access token expires to gain another
|
|
358
|
+
* access token. the value will be provided upon a new grant, and may be
|
|
359
|
+
* omitted upon refresh. whenever the value is provided, any previously stored
|
|
360
|
+
* refresh token must be discarded and replaced by this value.
|
|
361
|
+
*
|
|
362
|
+
* @generated from field: optional string refresh_token = 3;
|
|
363
|
+
*/
|
|
364
|
+
refreshToken?: string;
|
|
365
|
+
|
|
366
|
+
/**
|
|
367
|
+
* user_id, user_email, organization_id, and organization_name are surfaced
|
|
368
|
+
* for the client to present to the user for choosing which token to utilize
|
|
369
|
+
* or remove for cli use cases.
|
|
370
|
+
*
|
|
371
|
+
* @generated from field: string user_id = 4;
|
|
372
|
+
*/
|
|
373
|
+
userId = "";
|
|
374
|
+
|
|
375
|
+
/**
|
|
376
|
+
* @generated from field: string user_email = 5;
|
|
377
|
+
*/
|
|
378
|
+
userEmail = "";
|
|
379
|
+
|
|
380
|
+
/**
|
|
381
|
+
* @generated from field: string organization_id = 6;
|
|
382
|
+
*/
|
|
383
|
+
organizationId = "";
|
|
384
|
+
|
|
385
|
+
/**
|
|
386
|
+
* @generated from field: string organization_name = 7;
|
|
387
|
+
*/
|
|
388
|
+
organizationName = "";
|
|
389
|
+
|
|
390
|
+
/**
|
|
391
|
+
* catalog_service_base_url is used by the cli to determine which endpoint to
|
|
392
|
+
* address when speaking to this organization.
|
|
393
|
+
*
|
|
394
|
+
* @generated from field: string catalog_service_base_url = 8;
|
|
395
|
+
*/
|
|
396
|
+
catalogServiceBaseUrl = "";
|
|
397
|
+
|
|
398
|
+
constructor(data?: PartialMessage<BearerToken>) {
|
|
399
|
+
super();
|
|
400
|
+
proto3.util.initPartial(data, this);
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
static readonly runtime: typeof proto3 = proto3;
|
|
404
|
+
static readonly typeName = "liquidmetal.v1alpha1.BearerToken";
|
|
405
|
+
static readonly fields: FieldList = proto3.util.newFieldList(() => [
|
|
406
|
+
{ no: 1, name: "access_token", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
407
|
+
{ no: 2, name: "access_token_expires_at", kind: "message", T: Timestamp },
|
|
408
|
+
{ no: 3, name: "refresh_token", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
|
|
409
|
+
{ no: 4, name: "user_id", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
410
|
+
{ no: 5, name: "user_email", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
411
|
+
{ no: 6, name: "organization_id", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
412
|
+
{ no: 7, name: "organization_name", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
413
|
+
{ no: 8, name: "catalog_service_base_url", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
414
|
+
]);
|
|
415
|
+
|
|
416
|
+
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): BearerToken {
|
|
417
|
+
return new BearerToken().fromBinary(bytes, options);
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): BearerToken {
|
|
421
|
+
return new BearerToken().fromJson(jsonValue, options);
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): BearerToken {
|
|
425
|
+
return new BearerToken().fromJsonString(jsonString, options);
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
static equals(a: BearerToken | PlainMessage<BearerToken> | undefined, b: BearerToken | PlainMessage<BearerToken> | undefined): boolean {
|
|
429
|
+
return proto3.util.equals(BearerToken, a, b);
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
/**
|
|
434
|
+
* AuthenticationState is serialized and provided to WorkOS when redirecting the
|
|
435
|
+
* user to complete authentication, this state is then copied forward by WorkOS
|
|
436
|
+
* to the redirectUrl so it can be read again upon successful authentication.
|
|
437
|
+
*
|
|
438
|
+
* @generated from message liquidmetal.v1alpha1.AuthenticationState
|
|
439
|
+
*/
|
|
440
|
+
export class AuthenticationState extends Message<AuthenticationState> {
|
|
441
|
+
/**
|
|
442
|
+
* device_code is the RFC8628 code that the cli is polling for and the browser
|
|
443
|
+
* needs to know about once authentication from WorkOS completes.
|
|
444
|
+
*
|
|
445
|
+
* @generated from field: string device_code = 1;
|
|
446
|
+
*/
|
|
447
|
+
deviceCode = "";
|
|
448
|
+
|
|
449
|
+
constructor(data?: PartialMessage<AuthenticationState>) {
|
|
450
|
+
super();
|
|
451
|
+
proto3.util.initPartial(data, this);
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
static readonly runtime: typeof proto3 = proto3;
|
|
455
|
+
static readonly typeName = "liquidmetal.v1alpha1.AuthenticationState";
|
|
456
|
+
static readonly fields: FieldList = proto3.util.newFieldList(() => [
|
|
457
|
+
{ no: 1, name: "device_code", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
458
|
+
]);
|
|
459
|
+
|
|
460
|
+
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): AuthenticationState {
|
|
461
|
+
return new AuthenticationState().fromBinary(bytes, options);
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): AuthenticationState {
|
|
465
|
+
return new AuthenticationState().fromJson(jsonValue, options);
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): AuthenticationState {
|
|
469
|
+
return new AuthenticationState().fromJsonString(jsonString, options);
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
static equals(a: AuthenticationState | PlainMessage<AuthenticationState> | undefined, b: AuthenticationState | PlainMessage<AuthenticationState> | undefined): boolean {
|
|
473
|
+
return proto3.util.equals(AuthenticationState, a, b);
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
// @generated by protoc-gen-es v1.10.0 with parameter "target=ts"
|
|
2
|
+
// @generated from file liquidmetal/v1alpha1/raindrop.proto (package liquidmetal.v1alpha1, syntax proto3)
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
// @ts-nocheck
|
|
5
|
+
|
|
6
|
+
import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf";
|
|
7
|
+
import { Message, proto3 } from "@bufbuild/protobuf";
|
|
8
|
+
import { BearerToken } from "./rainbow_auth_pb.js";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* RaindropState represents the persisted state that raindrop utilizes to
|
|
12
|
+
* understand login information and current context.
|
|
13
|
+
*
|
|
14
|
+
* @generated from message liquidmetal.v1alpha1.RaindropState
|
|
15
|
+
*/
|
|
16
|
+
export class RaindropState extends Message<RaindropState> {
|
|
17
|
+
/**
|
|
18
|
+
* organization_id_to_bearer_token is a map of BearerToken credentials by
|
|
19
|
+
* organizationId. As tokens are refreshed, the value is replaced in this map.
|
|
20
|
+
* It is not possible to log into a single organization using separate
|
|
21
|
+
* credentials on the CLI.
|
|
22
|
+
*
|
|
23
|
+
* @generated from field: map<string, liquidmetal.v1alpha1.BearerToken> organization_id_to_bearer_token = 1;
|
|
24
|
+
*/
|
|
25
|
+
organizationIdToBearerToken: { [key: string]: BearerToken } = {};
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* current_organization_id is the organization that the cli is selected to
|
|
29
|
+
* operate against using the associated credentials.
|
|
30
|
+
*
|
|
31
|
+
* @generated from field: optional string current_organization_id = 2;
|
|
32
|
+
*/
|
|
33
|
+
currentOrganizationId?: string;
|
|
34
|
+
|
|
35
|
+
constructor(data?: PartialMessage<RaindropState>) {
|
|
36
|
+
super();
|
|
37
|
+
proto3.util.initPartial(data, this);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
static readonly runtime: typeof proto3 = proto3;
|
|
41
|
+
static readonly typeName = "liquidmetal.v1alpha1.RaindropState";
|
|
42
|
+
static readonly fields: FieldList = proto3.util.newFieldList(() => [
|
|
43
|
+
{ no: 1, name: "organization_id_to_bearer_token", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "message", T: BearerToken} },
|
|
44
|
+
{ no: 2, name: "current_organization_id", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
|
|
45
|
+
]);
|
|
46
|
+
|
|
47
|
+
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): RaindropState {
|
|
48
|
+
return new RaindropState().fromBinary(bytes, options);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): RaindropState {
|
|
52
|
+
return new RaindropState().fromJson(jsonValue, options);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): RaindropState {
|
|
56
|
+
return new RaindropState().fromJsonString(jsonString, options);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
static equals(a: RaindropState | PlainMessage<RaindropState> | undefined, b: RaindropState | PlainMessage<RaindropState> | undefined): boolean {
|
|
60
|
+
return proto3.util.equals(RaindropState, a, b);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import * as fs from 'node:fs/promises';
|
|
2
|
+
import * as path from 'node:path';
|
|
3
|
+
import * as os from 'os';
|
|
4
|
+
import { expect, test } from 'vitest';
|
|
5
|
+
import { FileSystemBundle } from './codestore.js';
|
|
6
|
+
|
|
7
|
+
test('FileSystemBundle maps to local files and their contents', async () => {
|
|
8
|
+
// Get a temporary directory.
|
|
9
|
+
const tmpDir = await fs.mkdtemp(path.join(os.tmpdir(), 'test'));
|
|
10
|
+
const bundle = new FileSystemBundle(tmpDir);
|
|
11
|
+
|
|
12
|
+
// Write
|
|
13
|
+
await bundle.write('a.txt', Buffer.from('a\n'));
|
|
14
|
+
await bundle.write('b.txt', Buffer.from('b\n'));
|
|
15
|
+
|
|
16
|
+
// List
|
|
17
|
+
const files = await bundle.list();
|
|
18
|
+
expect(files).toEqual(['a.txt', 'b.txt']);
|
|
19
|
+
|
|
20
|
+
// Read
|
|
21
|
+
const a = await bundle.read('a.txt');
|
|
22
|
+
expect(a.toString()).toEqual('a\n');
|
|
23
|
+
const b = await bundle.read('b.txt');
|
|
24
|
+
expect(b.toString()).toEqual('b\n');
|
|
25
|
+
|
|
26
|
+
// Delete
|
|
27
|
+
await bundle.delete('a.txt');
|
|
28
|
+
await bundle.delete('b.txt');
|
|
29
|
+
|
|
30
|
+
expect(await bundle.list()).toEqual([]);
|
|
31
|
+
|
|
32
|
+
// Cleanup
|
|
33
|
+
await fs.rmdir(tmpDir);
|
|
34
|
+
});
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as fs from 'node:fs/promises';
|
|
2
|
+
import * as path from 'node:path';
|
|
3
|
+
import { Bundle, BundleBase } from '../codestore.js';
|
|
4
|
+
|
|
5
|
+
// FileSystemBundle is a Bundle backed by the file system.
|
|
6
|
+
export class FileSystemBundle extends BundleBase implements Bundle {
|
|
7
|
+
private root: string;
|
|
8
|
+
|
|
9
|
+
constructor(root: string) {
|
|
10
|
+
super();
|
|
11
|
+
this.root = root;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
async list(): Promise<string[]> {
|
|
15
|
+
return fs.readdir(this.root, { recursive: true });
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
async read(name: string): Promise<Buffer> {
|
|
19
|
+
return fs.readFile(path.join(this.root, name));
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
async write(name: string, content: Buffer): Promise<void> {
|
|
23
|
+
await fs.writeFile(path.join(this.root, name), content);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
async delete(name: string): Promise<void> {
|
|
27
|
+
await fs.unlink(path.join(this.root, name));
|
|
28
|
+
}
|
|
29
|
+
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json.schemastore.org/tsconfig",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"declaration": true,
|
|
5
|
+
"declarationMap": true,
|
|
6
|
+
"esModuleInterop": true,
|
|
7
|
+
"incremental": false,
|
|
8
|
+
"isolatedModules": true,
|
|
9
|
+
"lib": [
|
|
10
|
+
"es2022",
|
|
11
|
+
"DOM",
|
|
12
|
+
"DOM.Iterable"
|
|
13
|
+
],
|
|
14
|
+
"lib": ["ESNext"],
|
|
15
|
+
"module" : "ESNext",
|
|
16
|
+
"moduleDetection": "force",
|
|
17
|
+
"moduleResolution": "bundler",
|
|
18
|
+
"noEmit": false,
|
|
19
|
+
"noUncheckedIndexedAccess": true,
|
|
20
|
+
"outDir": "dist",
|
|
21
|
+
"rootDir": "src",
|
|
22
|
+
"resolveJsonModule": true,
|
|
23
|
+
"skipLibCheck": true,
|
|
24
|
+
"strict": true,
|
|
25
|
+
"target": "ESNext",
|
|
26
|
+
"types": [
|
|
27
|
+
"@cloudflare/workers-types"
|
|
28
|
+
]
|
|
29
|
+
},
|
|
30
|
+
"exclude": ["eslint.config.js", "*.test.ts", "test", "tmp/**", "dist/**"]
|
|
31
|
+
}
|