@executor-js/cli 0.0.2 → 0.2.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/dist/index.js +610 -329
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -9,92 +9,103 @@ import fs from "fs/promises";
|
|
|
9
9
|
import path2 from "path";
|
|
10
10
|
import { Command } from "commander";
|
|
11
11
|
|
|
12
|
+
// ../sdk/src/index.ts
|
|
13
|
+
import { Context as Context2, Effect as Effect18, Layer as Layer5, Schema as Schema19, Data as Data6, Option as Option6 } from "effect";
|
|
14
|
+
import {
|
|
15
|
+
HttpApi,
|
|
16
|
+
HttpApiBuilder,
|
|
17
|
+
HttpApiClient,
|
|
18
|
+
HttpApiEndpoint,
|
|
19
|
+
HttpApiGroup,
|
|
20
|
+
HttpApiMiddleware,
|
|
21
|
+
HttpApiSchema
|
|
22
|
+
} from "effect/unstable/httpapi";
|
|
23
|
+
|
|
12
24
|
// ../storage-core/src/factory.ts
|
|
13
|
-
import { Effect } from "effect";
|
|
25
|
+
import { Effect, Option, Schema } from "effect";
|
|
14
26
|
|
|
15
27
|
// ../storage-core/src/errors.ts
|
|
16
28
|
import { Data } from "effect";
|
|
17
29
|
var StorageError = class extends Data.TaggedError("StorageError") {
|
|
18
30
|
};
|
|
19
|
-
var UniqueViolationError = class extends Data.TaggedError(
|
|
20
|
-
"UniqueViolationError"
|
|
21
|
-
) {
|
|
31
|
+
var UniqueViolationError = class extends Data.TaggedError("UniqueViolationError") {
|
|
22
32
|
};
|
|
23
33
|
|
|
34
|
+
// ../storage-core/src/factory.ts
|
|
35
|
+
var decodeJsonFromString = Schema.decodeUnknownOption(Schema.UnknownFromJsonString);
|
|
36
|
+
|
|
24
37
|
// ../sdk/src/ids.ts
|
|
25
|
-
import { Schema } from "effect";
|
|
26
|
-
var ScopeId =
|
|
27
|
-
var ToolId =
|
|
28
|
-
var SecretId =
|
|
29
|
-
var PolicyId =
|
|
30
|
-
var ConnectionId =
|
|
38
|
+
import { Schema as Schema2 } from "effect";
|
|
39
|
+
var ScopeId = Schema2.String.pipe(Schema2.brand("ScopeId"));
|
|
40
|
+
var ToolId = Schema2.String.pipe(Schema2.brand("ToolId"));
|
|
41
|
+
var SecretId = Schema2.String.pipe(Schema2.brand("SecretId"));
|
|
42
|
+
var PolicyId = Schema2.String.pipe(Schema2.brand("PolicyId"));
|
|
43
|
+
var ConnectionId = Schema2.String.pipe(Schema2.brand("ConnectionId"));
|
|
44
|
+
var CredentialBindingId = Schema2.String.pipe(Schema2.brand("CredentialBindingId"));
|
|
31
45
|
|
|
32
46
|
// ../sdk/src/scope.ts
|
|
33
|
-
import { Schema as
|
|
34
|
-
var Scope = class extends
|
|
47
|
+
import { Schema as Schema3 } from "effect";
|
|
48
|
+
var Scope = class extends Schema3.Class("Scope")({
|
|
35
49
|
id: ScopeId,
|
|
36
|
-
name:
|
|
37
|
-
createdAt:
|
|
50
|
+
name: Schema3.String,
|
|
51
|
+
createdAt: Schema3.Date
|
|
38
52
|
}) {
|
|
39
53
|
};
|
|
40
54
|
|
|
41
55
|
// ../sdk/src/errors.ts
|
|
42
|
-
import { Data as Data2, Schema as
|
|
43
|
-
var ToolNotFoundError = class extends
|
|
56
|
+
import { Data as Data2, Schema as Schema4 } from "effect";
|
|
57
|
+
var ToolNotFoundError = class extends Schema4.TaggedErrorClass()(
|
|
44
58
|
"ToolNotFoundError",
|
|
45
59
|
{ toolId: ToolId }
|
|
46
60
|
) {
|
|
47
61
|
};
|
|
48
62
|
var ToolInvocationError = class extends Data2.TaggedError("ToolInvocationError") {
|
|
49
63
|
};
|
|
50
|
-
var PluginNotLoadedError = class extends
|
|
64
|
+
var PluginNotLoadedError = class extends Schema4.TaggedErrorClass()(
|
|
51
65
|
"PluginNotLoadedError",
|
|
52
66
|
{
|
|
53
|
-
pluginId:
|
|
67
|
+
pluginId: Schema4.String,
|
|
54
68
|
toolId: ToolId
|
|
55
69
|
}
|
|
56
70
|
) {
|
|
57
71
|
};
|
|
58
|
-
var NoHandlerError = class extends
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
pluginId: Schema3.String
|
|
63
|
-
}
|
|
64
|
-
) {
|
|
72
|
+
var NoHandlerError = class extends Schema4.TaggedErrorClass()("NoHandlerError", {
|
|
73
|
+
toolId: ToolId,
|
|
74
|
+
pluginId: Schema4.String
|
|
75
|
+
}) {
|
|
65
76
|
};
|
|
66
|
-
var ToolBlockedError = class extends
|
|
77
|
+
var ToolBlockedError = class extends Schema4.TaggedErrorClass()(
|
|
67
78
|
"ToolBlockedError",
|
|
68
79
|
{
|
|
69
80
|
toolId: ToolId,
|
|
70
|
-
pattern:
|
|
81
|
+
pattern: Schema4.String
|
|
71
82
|
}
|
|
72
83
|
) {
|
|
73
84
|
};
|
|
74
|
-
var SourceNotFoundError = class extends
|
|
85
|
+
var SourceNotFoundError = class extends Schema4.TaggedErrorClass()(
|
|
75
86
|
"SourceNotFoundError",
|
|
76
|
-
{ sourceId:
|
|
87
|
+
{ sourceId: Schema4.String }
|
|
77
88
|
) {
|
|
78
89
|
};
|
|
79
|
-
var SourceRemovalNotAllowedError = class extends
|
|
90
|
+
var SourceRemovalNotAllowedError = class extends Schema4.TaggedErrorClass()(
|
|
80
91
|
"SourceRemovalNotAllowedError",
|
|
81
|
-
{ sourceId:
|
|
92
|
+
{ sourceId: Schema4.String }
|
|
82
93
|
) {
|
|
83
94
|
};
|
|
84
|
-
var SecretNotFoundError = class extends
|
|
95
|
+
var SecretNotFoundError = class extends Schema4.TaggedErrorClass()(
|
|
85
96
|
"SecretNotFoundError",
|
|
86
97
|
{ secretId: SecretId }
|
|
87
98
|
) {
|
|
88
99
|
};
|
|
89
|
-
var SecretResolutionError = class extends
|
|
100
|
+
var SecretResolutionError = class extends Schema4.TaggedErrorClass()(
|
|
90
101
|
"SecretResolutionError",
|
|
91
102
|
{
|
|
92
103
|
secretId: SecretId,
|
|
93
|
-
message:
|
|
104
|
+
message: Schema4.String
|
|
94
105
|
}
|
|
95
106
|
) {
|
|
96
107
|
};
|
|
97
|
-
var SecretOwnedByConnectionError = class extends
|
|
108
|
+
var SecretOwnedByConnectionError = class extends Schema4.TaggedErrorClass()(
|
|
98
109
|
"SecretOwnedByConnectionError",
|
|
99
110
|
{
|
|
100
111
|
secretId: SecretId,
|
|
@@ -102,72 +113,87 @@ var SecretOwnedByConnectionError = class extends Schema3.TaggedErrorClass()(
|
|
|
102
113
|
}
|
|
103
114
|
) {
|
|
104
115
|
};
|
|
105
|
-
var
|
|
116
|
+
var SecretInUseError = class extends Schema4.TaggedErrorClass()(
|
|
117
|
+
"SecretInUseError",
|
|
118
|
+
{
|
|
119
|
+
secretId: SecretId,
|
|
120
|
+
usageCount: Schema4.Number
|
|
121
|
+
}
|
|
122
|
+
) {
|
|
123
|
+
};
|
|
124
|
+
var ConnectionNotFoundError = class extends Schema4.TaggedErrorClass()(
|
|
106
125
|
"ConnectionNotFoundError",
|
|
107
126
|
{ connectionId: ConnectionId }
|
|
108
127
|
) {
|
|
109
128
|
};
|
|
110
|
-
var ConnectionProviderNotRegisteredError = class extends
|
|
129
|
+
var ConnectionProviderNotRegisteredError = class extends Schema4.TaggedErrorClass()(
|
|
111
130
|
"ConnectionProviderNotRegisteredError",
|
|
112
131
|
{
|
|
113
|
-
provider:
|
|
114
|
-
connectionId:
|
|
132
|
+
provider: Schema4.String,
|
|
133
|
+
connectionId: Schema4.optional(ConnectionId)
|
|
115
134
|
}
|
|
116
135
|
) {
|
|
117
136
|
};
|
|
118
|
-
var ConnectionRefreshNotSupportedError = class extends
|
|
137
|
+
var ConnectionRefreshNotSupportedError = class extends Schema4.TaggedErrorClass()(
|
|
119
138
|
"ConnectionRefreshNotSupportedError",
|
|
120
139
|
{
|
|
121
140
|
connectionId: ConnectionId,
|
|
122
|
-
provider:
|
|
141
|
+
provider: Schema4.String
|
|
123
142
|
}
|
|
124
143
|
) {
|
|
125
144
|
};
|
|
126
|
-
var ConnectionReauthRequiredError = class extends
|
|
145
|
+
var ConnectionReauthRequiredError = class extends Schema4.TaggedErrorClass()(
|
|
127
146
|
"ConnectionReauthRequiredError",
|
|
128
147
|
{
|
|
129
148
|
connectionId: ConnectionId,
|
|
130
|
-
provider:
|
|
131
|
-
message:
|
|
149
|
+
provider: Schema4.String,
|
|
150
|
+
message: Schema4.String
|
|
151
|
+
}
|
|
152
|
+
) {
|
|
153
|
+
};
|
|
154
|
+
var ConnectionInUseError = class extends Schema4.TaggedErrorClass()(
|
|
155
|
+
"ConnectionInUseError",
|
|
156
|
+
{
|
|
157
|
+
connectionId: ConnectionId,
|
|
158
|
+
usageCount: Schema4.Number
|
|
132
159
|
}
|
|
133
160
|
) {
|
|
134
161
|
};
|
|
135
162
|
|
|
136
163
|
// ../sdk/src/types.ts
|
|
137
|
-
import { Schema as
|
|
138
|
-
var ToolSchema = class extends
|
|
164
|
+
import { Schema as Schema5 } from "effect";
|
|
165
|
+
var ToolSchema = class extends Schema5.Class("ToolSchema")({
|
|
139
166
|
id: ToolId,
|
|
140
|
-
name:
|
|
141
|
-
description:
|
|
142
|
-
inputSchema:
|
|
143
|
-
outputSchema:
|
|
144
|
-
inputTypeScript:
|
|
145
|
-
outputTypeScript:
|
|
146
|
-
typeScriptDefinitions:
|
|
147
|
-
Schema4.Record(Schema4.String, Schema4.String)
|
|
148
|
-
)
|
|
167
|
+
name: Schema5.optional(Schema5.String),
|
|
168
|
+
description: Schema5.optional(Schema5.String),
|
|
169
|
+
inputSchema: Schema5.optional(Schema5.Unknown),
|
|
170
|
+
outputSchema: Schema5.optional(Schema5.Unknown),
|
|
171
|
+
inputTypeScript: Schema5.optional(Schema5.String),
|
|
172
|
+
outputTypeScript: Schema5.optional(Schema5.String),
|
|
173
|
+
typeScriptDefinitions: Schema5.optional(Schema5.Record(Schema5.String, Schema5.String))
|
|
149
174
|
}) {
|
|
150
175
|
};
|
|
151
|
-
var SourceDetectionResult = class extends
|
|
176
|
+
var SourceDetectionResult = class extends Schema5.Class(
|
|
152
177
|
"SourceDetectionResult"
|
|
153
178
|
)({
|
|
154
179
|
/** Plugin id that recognized the URL (e.g. "openapi", "graphql"). */
|
|
155
|
-
kind:
|
|
180
|
+
kind: Schema5.String,
|
|
156
181
|
/** Confidence tier — UI uses this to pick a winner when multiple
|
|
157
182
|
* plugins claim a URL. */
|
|
158
|
-
confidence:
|
|
183
|
+
confidence: Schema5.Literals(["high", "medium", "low"]),
|
|
159
184
|
/** The (possibly normalized) endpoint the plugin will use. */
|
|
160
|
-
endpoint:
|
|
185
|
+
endpoint: Schema5.String,
|
|
161
186
|
/** Human-readable name suggestion, typically derived from spec title
|
|
162
187
|
* or URL hostname. */
|
|
163
|
-
name:
|
|
188
|
+
name: Schema5.String,
|
|
164
189
|
/** Namespace suggestion — the plugin's recommendation for the source
|
|
165
190
|
* id. UI may override. */
|
|
166
|
-
namespace:
|
|
191
|
+
namespace: Schema5.String
|
|
167
192
|
}) {
|
|
168
193
|
};
|
|
169
194
|
|
|
170
195
|
// ../sdk/src/core-schema.ts
|
|
196
|
+
var credentialBindingKinds = ["text", "secret", "connection"];
|
|
171
197
|
var coreSchema = {
|
|
172
198
|
source: {
|
|
173
199
|
fields: {
|
|
@@ -277,9 +303,8 @@ var coreSchema = {
|
|
|
277
303
|
fields: {
|
|
278
304
|
id: { type: "string", required: true },
|
|
279
305
|
scope_id: { type: "string", required: true, index: true },
|
|
280
|
-
/** Routing key into `plugin.connectionProviders`.
|
|
281
|
-
*
|
|
282
|
-
* `google-discovery:google`). Mirrors `secret.provider`. */
|
|
306
|
+
/** Routing key into `plugin.connectionProviders`. OAuth2 connections
|
|
307
|
+
* use the shared `oauth2` provider. Mirrors `secret.provider`. */
|
|
283
308
|
provider: { type: "string", required: true, index: true },
|
|
284
309
|
/** Display label shown in the Connections UI. Usually the account
|
|
285
310
|
* email / handle / org name the user signed in as. */
|
|
@@ -319,6 +344,26 @@ var coreSchema = {
|
|
|
319
344
|
created_at: { type: "date", required: true }
|
|
320
345
|
}
|
|
321
346
|
},
|
|
347
|
+
// Shared credential slot bindings. Plugins keep source-specific semantics
|
|
348
|
+
// local, but credential ownership and resolution use one scoped shape.
|
|
349
|
+
credential_binding: {
|
|
350
|
+
fields: {
|
|
351
|
+
id: { type: "string", required: true },
|
|
352
|
+
scope_id: { type: "string", required: true, index: true },
|
|
353
|
+
plugin_id: { type: "string", required: true, index: true },
|
|
354
|
+
source_id: { type: "string", required: true, index: true },
|
|
355
|
+
source_scope_id: { type: "string", required: true, index: true },
|
|
356
|
+
slot_key: { type: "string", required: true, index: true },
|
|
357
|
+
/** "text" | "secret" | "connection". */
|
|
358
|
+
kind: { type: credentialBindingKinds, required: true, index: true },
|
|
359
|
+
text_value: { type: "string", required: false },
|
|
360
|
+
secret_id: { type: "string", required: false, index: true },
|
|
361
|
+
secret_scope_id: { type: "string", required: false, index: true },
|
|
362
|
+
connection_id: { type: "string", required: false, index: true },
|
|
363
|
+
created_at: { type: "date", required: true },
|
|
364
|
+
updated_at: { type: "date", required: true }
|
|
365
|
+
}
|
|
366
|
+
},
|
|
322
367
|
// User-authored overrides for tool permissions. Each row is one rule:
|
|
323
368
|
// a glob-ish pattern + an action (approve / require_approval / block).
|
|
324
369
|
// Resolution walks the scope stack innermost-first, then `position`
|
|
@@ -353,84 +398,223 @@ var coreSchema = {
|
|
|
353
398
|
};
|
|
354
399
|
|
|
355
400
|
// ../sdk/src/policies.ts
|
|
356
|
-
import { Schema as
|
|
357
|
-
var ToolPolicyActionSchema =
|
|
358
|
-
"approve",
|
|
359
|
-
"require_approval",
|
|
360
|
-
"block"
|
|
361
|
-
]);
|
|
401
|
+
import { Match, Schema as Schema6 } from "effect";
|
|
402
|
+
var ToolPolicyActionSchema = Schema6.Literals(["approve", "require_approval", "block"]);
|
|
362
403
|
|
|
363
404
|
// ../sdk/src/secrets.ts
|
|
364
|
-
import { Schema as
|
|
365
|
-
var SecretRef = class extends
|
|
405
|
+
import { Schema as Schema7 } from "effect";
|
|
406
|
+
var SecretRef = class extends Schema7.Class("SecretRef")({
|
|
366
407
|
id: SecretId,
|
|
367
408
|
scopeId: ScopeId,
|
|
368
409
|
/** Human-readable label (e.g. "Cloudflare API Token") */
|
|
369
|
-
name:
|
|
410
|
+
name: Schema7.String,
|
|
370
411
|
/** Which provider holds the value */
|
|
371
|
-
provider:
|
|
372
|
-
createdAt:
|
|
412
|
+
provider: Schema7.String,
|
|
413
|
+
createdAt: Schema7.Date
|
|
373
414
|
}) {
|
|
374
415
|
};
|
|
375
|
-
var SetSecretInput = class extends
|
|
376
|
-
"SetSecretInput"
|
|
377
|
-
)({
|
|
416
|
+
var SetSecretInput = class extends Schema7.Class("SetSecretInput")({
|
|
378
417
|
id: SecretId,
|
|
379
418
|
/** Scope id to own this secret. Must be one of the executor's
|
|
380
419
|
* configured scopes. */
|
|
381
420
|
scope: ScopeId,
|
|
382
421
|
/** Display name shown in secret-list UI. */
|
|
383
|
-
name:
|
|
422
|
+
name: Schema7.String,
|
|
384
423
|
/** The secret value itself — never persisted outside the provider. */
|
|
385
|
-
value:
|
|
424
|
+
value: Schema7.String,
|
|
386
425
|
/** Optional provider routing. If unset the executor picks the first
|
|
387
426
|
* writable provider in registration order. */
|
|
388
|
-
provider:
|
|
427
|
+
provider: Schema7.optional(Schema7.String)
|
|
428
|
+
}) {
|
|
429
|
+
};
|
|
430
|
+
var RemoveSecretInput = class extends Schema7.Class("RemoveSecretInput")({
|
|
431
|
+
id: SecretId,
|
|
432
|
+
/** Scope id whose secret row/value should be removed. Must be one of
|
|
433
|
+
* the executor's configured scopes. */
|
|
434
|
+
targetScope: ScopeId
|
|
389
435
|
}) {
|
|
390
436
|
};
|
|
391
437
|
|
|
392
438
|
// ../sdk/src/secret-backed-value.ts
|
|
393
|
-
import { Effect as Effect3, Schema as
|
|
394
|
-
var SecretBackedValue =
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
secretId:
|
|
398
|
-
prefix:
|
|
439
|
+
import { Effect as Effect3, Schema as Schema8 } from "effect";
|
|
440
|
+
var SecretBackedValue = Schema8.Union([
|
|
441
|
+
Schema8.String,
|
|
442
|
+
Schema8.Struct({
|
|
443
|
+
secretId: Schema8.String,
|
|
444
|
+
prefix: Schema8.optional(Schema8.String)
|
|
399
445
|
})
|
|
400
446
|
]);
|
|
401
|
-
var SecretBackedMap =
|
|
447
|
+
var SecretBackedMap = Schema8.Record(Schema8.String, SecretBackedValue);
|
|
448
|
+
|
|
449
|
+
// ../sdk/src/credential-bindings.ts
|
|
450
|
+
import { Match as Match2, Schema as Schema9 } from "effect";
|
|
451
|
+
var CredentialBindingKind = Schema9.Literals(credentialBindingKinds);
|
|
452
|
+
var CredentialBindingValue = Schema9.Union([
|
|
453
|
+
Schema9.Struct({
|
|
454
|
+
kind: Schema9.Literal("text"),
|
|
455
|
+
text: Schema9.String
|
|
456
|
+
}),
|
|
457
|
+
Schema9.Struct({
|
|
458
|
+
kind: Schema9.Literal("secret"),
|
|
459
|
+
secretId: SecretId,
|
|
460
|
+
secretScopeId: Schema9.optional(ScopeId)
|
|
461
|
+
}),
|
|
462
|
+
Schema9.Struct({
|
|
463
|
+
kind: Schema9.Literal("connection"),
|
|
464
|
+
connectionId: ConnectionId
|
|
465
|
+
})
|
|
466
|
+
]);
|
|
467
|
+
var ConfiguredCredentialBindingSchema = Schema9.Struct({
|
|
468
|
+
kind: Schema9.Literal("binding"),
|
|
469
|
+
slot: Schema9.String,
|
|
470
|
+
prefix: Schema9.optional(Schema9.String)
|
|
471
|
+
});
|
|
472
|
+
var ConfiguredCredentialBinding = class extends Schema9.Class(
|
|
473
|
+
"ConfiguredCredentialBinding"
|
|
474
|
+
)(ConfiguredCredentialBindingSchema.fields) {
|
|
475
|
+
};
|
|
476
|
+
var ConfiguredCredentialValue = Schema9.Union([Schema9.String, ConfiguredCredentialBinding]);
|
|
477
|
+
var ConfiguredCredentialValueSchema = Schema9.Union([
|
|
478
|
+
Schema9.String,
|
|
479
|
+
ConfiguredCredentialBindingSchema
|
|
480
|
+
]);
|
|
481
|
+
var ScopedSecretCredentialInput = Schema9.Struct({
|
|
482
|
+
secretId: Schema9.String,
|
|
483
|
+
prefix: Schema9.optional(Schema9.String),
|
|
484
|
+
targetScope: ScopeId,
|
|
485
|
+
secretScopeId: Schema9.optional(ScopeId)
|
|
486
|
+
});
|
|
487
|
+
var CredentialBindingRef = class extends Schema9.Class(
|
|
488
|
+
"CredentialBindingRef"
|
|
489
|
+
)({
|
|
490
|
+
id: CredentialBindingId,
|
|
491
|
+
scopeId: ScopeId,
|
|
492
|
+
pluginId: Schema9.String,
|
|
493
|
+
sourceId: Schema9.String,
|
|
494
|
+
sourceScopeId: ScopeId,
|
|
495
|
+
slotKey: Schema9.String,
|
|
496
|
+
value: CredentialBindingValue,
|
|
497
|
+
createdAt: Schema9.Date,
|
|
498
|
+
updatedAt: Schema9.Date
|
|
499
|
+
}) {
|
|
500
|
+
};
|
|
501
|
+
var SetCredentialBindingInput = class extends Schema9.Class(
|
|
502
|
+
"SetCredentialBindingInput"
|
|
503
|
+
)({
|
|
504
|
+
targetScope: ScopeId,
|
|
505
|
+
pluginId: Schema9.String,
|
|
506
|
+
sourceId: Schema9.String,
|
|
507
|
+
sourceScope: ScopeId,
|
|
508
|
+
slotKey: Schema9.String,
|
|
509
|
+
value: CredentialBindingValue
|
|
510
|
+
}) {
|
|
511
|
+
};
|
|
512
|
+
var CredentialBindingSourceInput = class extends Schema9.Class(
|
|
513
|
+
"CredentialBindingSourceInput"
|
|
514
|
+
)({
|
|
515
|
+
pluginId: Schema9.String,
|
|
516
|
+
sourceId: Schema9.String,
|
|
517
|
+
sourceScope: ScopeId
|
|
518
|
+
}) {
|
|
519
|
+
};
|
|
520
|
+
var CredentialBindingSlotInput = class extends Schema9.Class(
|
|
521
|
+
"CredentialBindingSlotInput"
|
|
522
|
+
)({
|
|
523
|
+
pluginId: Schema9.String,
|
|
524
|
+
sourceId: Schema9.String,
|
|
525
|
+
sourceScope: ScopeId,
|
|
526
|
+
slotKey: Schema9.String
|
|
527
|
+
}) {
|
|
528
|
+
};
|
|
529
|
+
var RemoveCredentialBindingInput = class extends Schema9.Class(
|
|
530
|
+
"RemoveCredentialBindingInput"
|
|
531
|
+
)({
|
|
532
|
+
targetScope: ScopeId,
|
|
533
|
+
pluginId: Schema9.String,
|
|
534
|
+
sourceId: Schema9.String,
|
|
535
|
+
sourceScope: ScopeId,
|
|
536
|
+
slotKey: Schema9.String
|
|
537
|
+
}) {
|
|
538
|
+
};
|
|
539
|
+
var ReplaceCredentialBindingValue = class extends Schema9.Class(
|
|
540
|
+
"ReplaceCredentialBindingValue"
|
|
541
|
+
)({
|
|
542
|
+
slotKey: Schema9.String,
|
|
543
|
+
value: CredentialBindingValue
|
|
544
|
+
}) {
|
|
545
|
+
};
|
|
546
|
+
var ReplaceCredentialBindingsInput = class extends Schema9.Class(
|
|
547
|
+
"ReplaceCredentialBindingsInput"
|
|
548
|
+
)({
|
|
549
|
+
targetScope: ScopeId,
|
|
550
|
+
pluginId: Schema9.String,
|
|
551
|
+
sourceId: Schema9.String,
|
|
552
|
+
sourceScope: ScopeId,
|
|
553
|
+
slotPrefixes: Schema9.Array(Schema9.String),
|
|
554
|
+
bindings: Schema9.Array(ReplaceCredentialBindingValue)
|
|
555
|
+
}) {
|
|
556
|
+
};
|
|
557
|
+
var CredentialBindingResolutionStatus = Schema9.Literals([
|
|
558
|
+
"resolved",
|
|
559
|
+
"missing",
|
|
560
|
+
"blocked"
|
|
561
|
+
]);
|
|
562
|
+
var ResolvedCredentialSlot = class extends Schema9.Class(
|
|
563
|
+
"ResolvedCredentialSlot"
|
|
564
|
+
)({
|
|
565
|
+
pluginId: Schema9.String,
|
|
566
|
+
sourceId: Schema9.String,
|
|
567
|
+
sourceScopeId: ScopeId,
|
|
568
|
+
slotKey: Schema9.String,
|
|
569
|
+
bindingScopeId: Schema9.NullOr(ScopeId),
|
|
570
|
+
kind: Schema9.NullOr(CredentialBindingKind),
|
|
571
|
+
status: CredentialBindingResolutionStatus
|
|
572
|
+
}) {
|
|
573
|
+
};
|
|
574
|
+
|
|
575
|
+
// ../sdk/src/usages.ts
|
|
576
|
+
import { Schema as Schema10 } from "effect";
|
|
577
|
+
var Usage = class extends Schema10.Class("Usage")({
|
|
578
|
+
pluginId: Schema10.String,
|
|
579
|
+
scopeId: ScopeId,
|
|
580
|
+
ownerKind: Schema10.String,
|
|
581
|
+
ownerId: Schema10.String,
|
|
582
|
+
ownerName: Schema10.NullOr(Schema10.String),
|
|
583
|
+
slot: Schema10.String
|
|
584
|
+
}) {
|
|
585
|
+
};
|
|
402
586
|
|
|
403
587
|
// ../sdk/src/connections.ts
|
|
404
|
-
import { Data as Data3, Schema as
|
|
405
|
-
var ConnectionProviderState =
|
|
406
|
-
var ConnectionRef = class extends
|
|
588
|
+
import { Data as Data3, Schema as Schema11 } from "effect";
|
|
589
|
+
var ConnectionProviderState = Schema11.Record(Schema11.String, Schema11.Unknown);
|
|
590
|
+
var ConnectionRef = class extends Schema11.Class("ConnectionRef")({
|
|
407
591
|
id: ConnectionId,
|
|
408
592
|
scopeId: ScopeId,
|
|
409
|
-
provider:
|
|
410
|
-
identityLabel:
|
|
593
|
+
provider: Schema11.String,
|
|
594
|
+
identityLabel: Schema11.NullOr(Schema11.String),
|
|
411
595
|
accessTokenSecretId: SecretId,
|
|
412
|
-
refreshTokenSecretId:
|
|
596
|
+
refreshTokenSecretId: Schema11.NullOr(SecretId),
|
|
413
597
|
/** Epoch ms when the access token expires; null if not declared. */
|
|
414
|
-
expiresAt:
|
|
598
|
+
expiresAt: Schema11.NullOr(Schema11.Number),
|
|
415
599
|
/** OAuth-style scope string as returned by the token endpoint. Named
|
|
416
600
|
* `oauthScope` to avoid collision with the executor scope id. */
|
|
417
|
-
oauthScope:
|
|
418
|
-
providerState:
|
|
419
|
-
createdAt:
|
|
420
|
-
updatedAt:
|
|
601
|
+
oauthScope: Schema11.NullOr(Schema11.String),
|
|
602
|
+
providerState: Schema11.NullOr(ConnectionProviderState),
|
|
603
|
+
createdAt: Schema11.Date,
|
|
604
|
+
updatedAt: Schema11.Date
|
|
421
605
|
}) {
|
|
422
606
|
};
|
|
423
|
-
var TokenMaterial = class extends
|
|
607
|
+
var TokenMaterial = class extends Schema11.Class("TokenMaterial")({
|
|
424
608
|
/** Target secret id. Plugins typically derive this from the source id
|
|
425
609
|
* + a stable suffix (e.g. `${sourceId}.access_token`). */
|
|
426
610
|
secretId: SecretId,
|
|
427
611
|
/** Display name stamped on the secret row. Only visible to code — the
|
|
428
612
|
* Connections UI hides connection-owned secrets. */
|
|
429
|
-
name:
|
|
430
|
-
value:
|
|
613
|
+
name: Schema11.String,
|
|
614
|
+
value: Schema11.String
|
|
431
615
|
}) {
|
|
432
616
|
};
|
|
433
|
-
var CreateConnectionInput = class extends
|
|
617
|
+
var CreateConnectionInput = class extends Schema11.Class(
|
|
434
618
|
"CreateConnectionInput"
|
|
435
619
|
)({
|
|
436
620
|
id: ConnectionId,
|
|
@@ -438,300 +622,377 @@ var CreateConnectionInput = class extends Schema8.Class(
|
|
|
438
622
|
* secrets. This is the sharing boundary: a user scope is personal,
|
|
439
623
|
* an org/workspace scope is shared with descendants. */
|
|
440
624
|
scope: ScopeId,
|
|
441
|
-
provider:
|
|
442
|
-
identityLabel:
|
|
625
|
+
provider: Schema11.String,
|
|
626
|
+
identityLabel: Schema11.NullOr(Schema11.String),
|
|
443
627
|
accessToken: TokenMaterial,
|
|
444
|
-
refreshToken:
|
|
445
|
-
expiresAt:
|
|
628
|
+
refreshToken: Schema11.NullOr(TokenMaterial),
|
|
629
|
+
expiresAt: Schema11.NullOr(Schema11.Number),
|
|
446
630
|
/** OAuth-style scope string. Distinct from the executor scope above. */
|
|
447
|
-
oauthScope:
|
|
448
|
-
providerState:
|
|
631
|
+
oauthScope: Schema11.NullOr(Schema11.String),
|
|
632
|
+
providerState: Schema11.NullOr(ConnectionProviderState)
|
|
449
633
|
}) {
|
|
450
634
|
};
|
|
451
|
-
var ConnectionRefreshError = class extends Data3.TaggedError(
|
|
452
|
-
"ConnectionRefreshError"
|
|
453
|
-
) {
|
|
635
|
+
var ConnectionRefreshError = class extends Data3.TaggedError("ConnectionRefreshError") {
|
|
454
636
|
};
|
|
455
|
-
var UpdateConnectionTokensInput = class extends
|
|
637
|
+
var UpdateConnectionTokensInput = class extends Schema11.Class(
|
|
456
638
|
"UpdateConnectionTokensInput"
|
|
457
639
|
)({
|
|
458
640
|
id: ConnectionId,
|
|
459
|
-
accessToken:
|
|
460
|
-
refreshToken:
|
|
461
|
-
expiresAt:
|
|
462
|
-
oauthScope:
|
|
463
|
-
providerState:
|
|
464
|
-
identityLabel:
|
|
641
|
+
accessToken: Schema11.String,
|
|
642
|
+
refreshToken: Schema11.optional(Schema11.NullOr(Schema11.String)),
|
|
643
|
+
expiresAt: Schema11.optional(Schema11.NullOr(Schema11.Number)),
|
|
644
|
+
oauthScope: Schema11.optional(Schema11.NullOr(Schema11.String)),
|
|
645
|
+
providerState: Schema11.optional(Schema11.NullOr(ConnectionProviderState)),
|
|
646
|
+
identityLabel: Schema11.optional(Schema11.NullOr(Schema11.String))
|
|
647
|
+
}) {
|
|
648
|
+
};
|
|
649
|
+
var RemoveConnectionInput = class extends Schema11.Class(
|
|
650
|
+
"RemoveConnectionInput"
|
|
651
|
+
)({
|
|
652
|
+
id: ConnectionId,
|
|
653
|
+
/** Scope id whose connection row and owned token secrets should be removed. */
|
|
654
|
+
targetScope: ScopeId
|
|
465
655
|
}) {
|
|
466
656
|
};
|
|
467
657
|
|
|
468
658
|
// ../sdk/src/elicitation.ts
|
|
469
|
-
import { Schema as
|
|
470
|
-
var FormElicitation = class extends
|
|
471
|
-
message:
|
|
659
|
+
import { Schema as Schema12 } from "effect";
|
|
660
|
+
var FormElicitation = class extends Schema12.TaggedClass()("FormElicitation", {
|
|
661
|
+
message: Schema12.String,
|
|
472
662
|
/** JSON Schema describing the fields to collect */
|
|
473
|
-
requestedSchema:
|
|
663
|
+
requestedSchema: Schema12.Record(Schema12.String, Schema12.Unknown)
|
|
474
664
|
}) {
|
|
475
665
|
};
|
|
476
|
-
var UrlElicitation = class extends
|
|
477
|
-
message:
|
|
478
|
-
url:
|
|
666
|
+
var UrlElicitation = class extends Schema12.TaggedClass()("UrlElicitation", {
|
|
667
|
+
message: Schema12.String,
|
|
668
|
+
url: Schema12.String,
|
|
479
669
|
/** Unique ID so the host can correlate the callback */
|
|
480
|
-
elicitationId:
|
|
670
|
+
elicitationId: Schema12.String
|
|
481
671
|
}) {
|
|
482
672
|
};
|
|
483
|
-
var ElicitationAction =
|
|
484
|
-
var ElicitationResponse = class extends
|
|
673
|
+
var ElicitationAction = Schema12.Literals(["accept", "decline", "cancel"]);
|
|
674
|
+
var ElicitationResponse = class extends Schema12.Class("ElicitationResponse")({
|
|
485
675
|
action: ElicitationAction,
|
|
486
676
|
/** Present when action is "accept" — the data the user provided */
|
|
487
|
-
content:
|
|
677
|
+
content: Schema12.optional(Schema12.Record(Schema12.String, Schema12.Unknown))
|
|
488
678
|
}) {
|
|
489
679
|
};
|
|
490
|
-
var ElicitationDeclinedError = class extends
|
|
680
|
+
var ElicitationDeclinedError = class extends Schema12.TaggedErrorClass()(
|
|
491
681
|
"ElicitationDeclinedError",
|
|
492
682
|
{
|
|
493
683
|
toolId: ToolId,
|
|
494
|
-
action:
|
|
684
|
+
action: Schema12.Literals(["decline", "cancel"])
|
|
495
685
|
}
|
|
496
686
|
) {
|
|
497
687
|
};
|
|
498
688
|
|
|
499
689
|
// ../sdk/src/blob.ts
|
|
500
|
-
import { Effect as
|
|
690
|
+
import { Effect as Effect7 } from "effect";
|
|
501
691
|
|
|
502
692
|
// ../sdk/src/oauth.ts
|
|
503
|
-
import { Effect as
|
|
504
|
-
var OAuthDynamicDcrStrategy =
|
|
505
|
-
kind:
|
|
693
|
+
import { Effect as Effect8, Schema as Schema13 } from "effect";
|
|
694
|
+
var OAuthDynamicDcrStrategy = Schema13.Struct({
|
|
695
|
+
kind: Schema13.Literal("dynamic-dcr"),
|
|
506
696
|
/** Scopes to request. Defaults to whatever `scopes_supported`
|
|
507
697
|
* advertises; caller can narrow or extend. */
|
|
508
|
-
scopes:
|
|
698
|
+
scopes: Schema13.optional(Schema13.Array(Schema13.String))
|
|
509
699
|
});
|
|
510
|
-
var OAuthAuthorizationCodeStrategy =
|
|
511
|
-
kind:
|
|
512
|
-
authorizationEndpoint:
|
|
513
|
-
tokenEndpoint:
|
|
700
|
+
var OAuthAuthorizationCodeStrategy = Schema13.Struct({
|
|
701
|
+
kind: Schema13.Literal("authorization-code"),
|
|
702
|
+
authorizationEndpoint: Schema13.String,
|
|
703
|
+
tokenEndpoint: Schema13.String,
|
|
514
704
|
/** Expected authorization-server issuer for ID token validation. Some
|
|
515
705
|
* providers use a token endpoint host that differs from issuer, or a
|
|
516
706
|
* path-scoped issuer such as Okta custom authorization servers. */
|
|
517
|
-
issuerUrl:
|
|
707
|
+
issuerUrl: Schema13.optional(Schema13.NullOr(Schema13.String)),
|
|
518
708
|
/** Secret id holding the `client_id`. Using a secret row rather than
|
|
519
709
|
* an inline string so the value lives at the scope where the caller
|
|
520
710
|
* configured it and shadowing behaves consistently. */
|
|
521
|
-
clientIdSecretId:
|
|
711
|
+
clientIdSecretId: Schema13.String,
|
|
522
712
|
/** Secret id for `client_secret`. Null for public clients using
|
|
523
713
|
* PKCE without a confidential secret. */
|
|
524
|
-
clientSecretSecretId:
|
|
525
|
-
scopes:
|
|
714
|
+
clientSecretSecretId: Schema13.NullOr(Schema13.String),
|
|
715
|
+
scopes: Schema13.Array(Schema13.String),
|
|
526
716
|
/** Separator between scopes. RFC 6749 says space; some providers
|
|
527
717
|
* (GitHub classic) use comma. */
|
|
528
|
-
scopeSeparator:
|
|
718
|
+
scopeSeparator: Schema13.optional(Schema13.String),
|
|
529
719
|
/** Provider-specific params injected at authorization URL build time
|
|
530
720
|
* (Google's `access_type=offline`, `prompt=consent`, ...). */
|
|
531
|
-
extraAuthorizationParams:
|
|
532
|
-
Schema10.Record(Schema10.String, Schema10.String)
|
|
533
|
-
),
|
|
721
|
+
extraAuthorizationParams: Schema13.optional(Schema13.Record(Schema13.String, Schema13.String)),
|
|
534
722
|
/** `"body"` (default) sends client creds in the form body; `"basic"`
|
|
535
723
|
* uses HTTP Basic auth. Stripe-style servers require basic. */
|
|
536
|
-
clientAuth:
|
|
724
|
+
clientAuth: Schema13.optional(Schema13.Literals(["body", "basic"]))
|
|
537
725
|
});
|
|
538
|
-
var OAuthClientCredentialsStrategy =
|
|
539
|
-
kind:
|
|
540
|
-
tokenEndpoint:
|
|
541
|
-
clientIdSecretId:
|
|
542
|
-
clientSecretSecretId:
|
|
543
|
-
scopes:
|
|
544
|
-
scopeSeparator:
|
|
545
|
-
clientAuth:
|
|
726
|
+
var OAuthClientCredentialsStrategy = Schema13.Struct({
|
|
727
|
+
kind: Schema13.Literal("client-credentials"),
|
|
728
|
+
tokenEndpoint: Schema13.String,
|
|
729
|
+
clientIdSecretId: Schema13.String,
|
|
730
|
+
clientSecretSecretId: Schema13.String,
|
|
731
|
+
scopes: Schema13.optional(Schema13.Array(Schema13.String)),
|
|
732
|
+
scopeSeparator: Schema13.optional(Schema13.String),
|
|
733
|
+
clientAuth: Schema13.optional(Schema13.Literals(["body", "basic"]))
|
|
546
734
|
});
|
|
547
|
-
var OAuthStrategy =
|
|
735
|
+
var OAuthStrategy = Schema13.Union([
|
|
548
736
|
OAuthDynamicDcrStrategy,
|
|
549
737
|
OAuthAuthorizationCodeStrategy,
|
|
550
738
|
OAuthClientCredentialsStrategy
|
|
551
739
|
]);
|
|
552
|
-
var OAuthProviderState =
|
|
553
|
-
|
|
554
|
-
kind:
|
|
555
|
-
tokenEndpoint:
|
|
556
|
-
issuerUrl:
|
|
557
|
-
authorizationServerUrl:
|
|
558
|
-
authorizationServerMetadataUrl:
|
|
559
|
-
idTokenSigningAlgValuesSupported:
|
|
560
|
-
Schema10.Array(Schema10.String)
|
|
561
|
-
),
|
|
740
|
+
var OAuthProviderState = Schema13.Union([
|
|
741
|
+
Schema13.Struct({
|
|
742
|
+
kind: Schema13.Literal("dynamic-dcr"),
|
|
743
|
+
tokenEndpoint: Schema13.String,
|
|
744
|
+
issuerUrl: Schema13.optional(Schema13.NullOr(Schema13.String)),
|
|
745
|
+
authorizationServerUrl: Schema13.optional(Schema13.NullOr(Schema13.String)),
|
|
746
|
+
authorizationServerMetadataUrl: Schema13.NullOr(Schema13.String),
|
|
747
|
+
idTokenSigningAlgValuesSupported: Schema13.optional(Schema13.Array(Schema13.String)),
|
|
562
748
|
/** DCR-minted client_id. Embedded inline (not a secret) — DCR
|
|
563
749
|
* clients are public-ish by design; the secret part (if the AS
|
|
564
750
|
* issued one) is a separate secret row. */
|
|
565
|
-
clientId:
|
|
566
|
-
clientSecretSecretId:
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
751
|
+
clientId: Schema13.String,
|
|
752
|
+
clientSecretSecretId: Schema13.NullOr(Schema13.String),
|
|
753
|
+
clientSecretSecretScopeId: Schema13.optional(Schema13.NullOr(Schema13.String)),
|
|
754
|
+
clientAuth: Schema13.Literals(["body", "basic"]),
|
|
755
|
+
scopes: Schema13.Array(Schema13.String).pipe(Schema13.withDecodingDefaultType(Effect8.succeed([]))),
|
|
756
|
+
scopeSeparator: Schema13.optional(Schema13.String),
|
|
757
|
+
scope: Schema13.NullOr(Schema13.String),
|
|
758
|
+
/** RFC 8707 canonical resource URL. Replayed on refresh so the new
|
|
759
|
+
* access token's audience stays bound to the same resource. */
|
|
760
|
+
resource: Schema13.optional(Schema13.NullOr(Schema13.String))
|
|
571
761
|
}),
|
|
572
|
-
|
|
573
|
-
kind:
|
|
574
|
-
tokenEndpoint:
|
|
575
|
-
issuerUrl:
|
|
576
|
-
clientIdSecretId:
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
762
|
+
Schema13.Struct({
|
|
763
|
+
kind: Schema13.Literal("authorization-code"),
|
|
764
|
+
tokenEndpoint: Schema13.String,
|
|
765
|
+
issuerUrl: Schema13.optional(Schema13.NullOr(Schema13.String)),
|
|
766
|
+
clientIdSecretId: Schema13.String,
|
|
767
|
+
clientIdSecretScopeId: Schema13.optional(Schema13.NullOr(Schema13.String)),
|
|
768
|
+
clientSecretSecretId: Schema13.NullOr(Schema13.String),
|
|
769
|
+
clientSecretSecretScopeId: Schema13.optional(Schema13.NullOr(Schema13.String)),
|
|
770
|
+
clientAuth: Schema13.Literals(["body", "basic"]),
|
|
771
|
+
scopes: Schema13.Array(Schema13.String).pipe(Schema13.withDecodingDefaultType(Effect8.succeed([]))),
|
|
772
|
+
scopeSeparator: Schema13.optional(Schema13.String),
|
|
773
|
+
scope: Schema13.NullOr(Schema13.String),
|
|
774
|
+
resource: Schema13.optional(Schema13.NullOr(Schema13.String))
|
|
582
775
|
}),
|
|
583
|
-
|
|
584
|
-
kind:
|
|
585
|
-
tokenEndpoint:
|
|
586
|
-
clientIdSecretId:
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
776
|
+
Schema13.Struct({
|
|
777
|
+
kind: Schema13.Literal("client-credentials"),
|
|
778
|
+
tokenEndpoint: Schema13.String,
|
|
779
|
+
clientIdSecretId: Schema13.String,
|
|
780
|
+
clientIdSecretScopeId: Schema13.optional(Schema13.NullOr(Schema13.String)),
|
|
781
|
+
clientSecretSecretId: Schema13.String,
|
|
782
|
+
clientSecretSecretScopeId: Schema13.optional(Schema13.NullOr(Schema13.String)),
|
|
783
|
+
scopes: Schema13.Array(Schema13.String),
|
|
784
|
+
scopeSeparator: Schema13.optional(Schema13.String),
|
|
785
|
+
clientAuth: Schema13.Literals(["body", "basic"]),
|
|
786
|
+
scope: Schema13.NullOr(Schema13.String)
|
|
592
787
|
})
|
|
593
788
|
]);
|
|
594
|
-
var OAuthProbeError = class extends
|
|
789
|
+
var OAuthProbeError = class extends Schema13.TaggedErrorClass()(
|
|
595
790
|
"OAuthProbeError",
|
|
596
791
|
{
|
|
597
|
-
message:
|
|
598
|
-
}
|
|
792
|
+
message: Schema13.String
|
|
793
|
+
},
|
|
794
|
+
{ httpApiStatus: 400 }
|
|
599
795
|
) {
|
|
600
|
-
static annotations = { httpApiStatus: 400 };
|
|
601
796
|
};
|
|
602
|
-
var OAuthStartError = class extends
|
|
797
|
+
var OAuthStartError = class extends Schema13.TaggedErrorClass()(
|
|
603
798
|
"OAuthStartError",
|
|
604
799
|
{
|
|
605
|
-
message:
|
|
606
|
-
|
|
800
|
+
message: Schema13.String,
|
|
801
|
+
/** RFC 6749 §5.2 / RFC 7591 §3.2.2 error code propagated up from the
|
|
802
|
+
* authorization server (e.g. `invalid_client_metadata`). UI surfaces
|
|
803
|
+
* it as the structured "AS rejected the registration" reason. */
|
|
804
|
+
error: Schema13.optional(Schema13.String),
|
|
805
|
+
errorDescription: Schema13.optional(Schema13.String)
|
|
806
|
+
},
|
|
807
|
+
{ httpApiStatus: 400 }
|
|
607
808
|
) {
|
|
608
|
-
static annotations = { httpApiStatus: 400 };
|
|
609
809
|
};
|
|
610
|
-
var OAuthCompleteError = class extends
|
|
810
|
+
var OAuthCompleteError = class extends Schema13.TaggedErrorClass()(
|
|
611
811
|
"OAuthCompleteError",
|
|
612
812
|
{
|
|
613
|
-
message:
|
|
813
|
+
message: Schema13.String,
|
|
614
814
|
/** RFC 6749 §5.2 error code, when the token endpoint returned one.
|
|
615
815
|
* Callers distinguish terminal failures (`invalid_grant` ⇒
|
|
616
816
|
* re-auth required) from transient ones. */
|
|
617
|
-
code:
|
|
618
|
-
}
|
|
817
|
+
code: Schema13.optional(Schema13.String)
|
|
818
|
+
},
|
|
819
|
+
{ httpApiStatus: 400 }
|
|
619
820
|
) {
|
|
620
|
-
static annotations = { httpApiStatus: 400 };
|
|
621
821
|
};
|
|
622
|
-
var OAuthSessionNotFoundError = class extends
|
|
822
|
+
var OAuthSessionNotFoundError = class extends Schema13.TaggedErrorClass()(
|
|
623
823
|
"OAuthSessionNotFoundError",
|
|
624
824
|
{
|
|
625
|
-
sessionId:
|
|
626
|
-
}
|
|
825
|
+
sessionId: Schema13.String
|
|
826
|
+
},
|
|
827
|
+
{ httpApiStatus: 404 }
|
|
627
828
|
) {
|
|
628
|
-
static annotations = { httpApiStatus: 404 };
|
|
629
829
|
};
|
|
630
830
|
var OAUTH2_SESSION_TTL_MS = 15 * 60 * 1e3;
|
|
631
831
|
|
|
632
832
|
// ../sdk/src/oauth-helpers.ts
|
|
633
|
-
import { Data as Data4, Effect as
|
|
833
|
+
import { Data as Data4, Effect as Effect9, Predicate } from "effect";
|
|
634
834
|
var OAuth2Error = class extends Data4.TaggedError("OAuth2Error") {
|
|
635
835
|
};
|
|
836
|
+
var isOAuth2Error = Predicate.isTagged("OAuth2Error");
|
|
636
837
|
|
|
637
838
|
// ../sdk/src/oauth-service.ts
|
|
638
|
-
import { Effect as
|
|
839
|
+
import { Duration as Duration2, Effect as Effect11, Match as Match3, Option as Option3, Schema as Schema15 } from "effect";
|
|
840
|
+
import { FetchHttpClient as FetchHttpClient2, HttpClient as HttpClient2, HttpClientRequest as HttpClientRequest2 } from "effect/unstable/http";
|
|
639
841
|
|
|
640
842
|
// ../sdk/src/oauth-discovery.ts
|
|
641
|
-
import { Data as Data5, Effect as
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
) {
|
|
843
|
+
import { Data as Data5, Duration, Effect as Effect10, Option as Option2, Predicate as Predicate2, Result, Schema as Schema14 } from "effect";
|
|
844
|
+
import { FetchHttpClient, HttpClient, HttpClientRequest } from "effect/unstable/http";
|
|
845
|
+
var OAuthDiscoveryError = class extends Data5.TaggedError("OAuthDiscoveryError") {
|
|
645
846
|
};
|
|
646
|
-
var StringArray =
|
|
647
|
-
var OAuthProtectedResourceMetadataSchema =
|
|
648
|
-
resource:
|
|
649
|
-
authorization_servers:
|
|
650
|
-
scopes_supported:
|
|
651
|
-
bearer_methods_supported:
|
|
652
|
-
resource_documentation:
|
|
847
|
+
var StringArray = Schema14.Array(Schema14.String);
|
|
848
|
+
var OAuthProtectedResourceMetadataSchema = Schema14.Struct({
|
|
849
|
+
resource: Schema14.optional(Schema14.String),
|
|
850
|
+
authorization_servers: Schema14.optional(StringArray),
|
|
851
|
+
scopes_supported: Schema14.optional(StringArray),
|
|
852
|
+
bearer_methods_supported: Schema14.optional(StringArray),
|
|
853
|
+
resource_documentation: Schema14.optional(Schema14.String)
|
|
653
854
|
}).annotate({ identifier: "OAuthProtectedResourceMetadata" });
|
|
654
|
-
var OAuthAuthorizationServerMetadataSchema =
|
|
655
|
-
issuer:
|
|
656
|
-
authorization_endpoint:
|
|
657
|
-
token_endpoint:
|
|
658
|
-
registration_endpoint:
|
|
659
|
-
scopes_supported:
|
|
660
|
-
response_types_supported:
|
|
661
|
-
grant_types_supported:
|
|
662
|
-
code_challenge_methods_supported:
|
|
663
|
-
token_endpoint_auth_methods_supported:
|
|
664
|
-
revocation_endpoint:
|
|
665
|
-
introspection_endpoint:
|
|
666
|
-
userinfo_endpoint:
|
|
667
|
-
id_token_signing_alg_values_supported:
|
|
855
|
+
var OAuthAuthorizationServerMetadataSchema = Schema14.Struct({
|
|
856
|
+
issuer: Schema14.String,
|
|
857
|
+
authorization_endpoint: Schema14.String,
|
|
858
|
+
token_endpoint: Schema14.String,
|
|
859
|
+
registration_endpoint: Schema14.optional(Schema14.String),
|
|
860
|
+
scopes_supported: Schema14.optional(StringArray),
|
|
861
|
+
response_types_supported: Schema14.optional(StringArray),
|
|
862
|
+
grant_types_supported: Schema14.optional(StringArray),
|
|
863
|
+
code_challenge_methods_supported: Schema14.optional(StringArray),
|
|
864
|
+
token_endpoint_auth_methods_supported: Schema14.optional(StringArray),
|
|
865
|
+
revocation_endpoint: Schema14.optional(Schema14.String),
|
|
866
|
+
introspection_endpoint: Schema14.optional(Schema14.String),
|
|
867
|
+
userinfo_endpoint: Schema14.optional(Schema14.String),
|
|
868
|
+
id_token_signing_alg_values_supported: Schema14.optional(StringArray)
|
|
668
869
|
}).annotate({ identifier: "OAuthAuthorizationServerMetadata" });
|
|
669
|
-
var OAuthClientInformationSchema =
|
|
670
|
-
client_id:
|
|
671
|
-
client_secret:
|
|
672
|
-
client_id_issued_at:
|
|
673
|
-
client_secret_expires_at:
|
|
674
|
-
registration_access_token:
|
|
675
|
-
registration_client_uri:
|
|
676
|
-
token_endpoint_auth_method:
|
|
677
|
-
grant_types:
|
|
678
|
-
response_types:
|
|
679
|
-
redirect_uris:
|
|
680
|
-
client_name:
|
|
681
|
-
scope:
|
|
870
|
+
var OAuthClientInformationSchema = Schema14.Struct({
|
|
871
|
+
client_id: Schema14.String,
|
|
872
|
+
client_secret: Schema14.optional(Schema14.String),
|
|
873
|
+
client_id_issued_at: Schema14.optional(Schema14.Number),
|
|
874
|
+
client_secret_expires_at: Schema14.optional(Schema14.Number),
|
|
875
|
+
registration_access_token: Schema14.optional(Schema14.String),
|
|
876
|
+
registration_client_uri: Schema14.optional(Schema14.String),
|
|
877
|
+
token_endpoint_auth_method: Schema14.optional(Schema14.String),
|
|
878
|
+
grant_types: Schema14.optional(StringArray),
|
|
879
|
+
response_types: Schema14.optional(StringArray),
|
|
880
|
+
redirect_uris: Schema14.optional(StringArray),
|
|
881
|
+
client_name: Schema14.optional(Schema14.String),
|
|
882
|
+
scope: Schema14.optional(Schema14.String)
|
|
682
883
|
}).annotate({ identifier: "OAuthClientInformation" });
|
|
683
|
-
var
|
|
684
|
-
OAuthProtectedResourceMetadataSchema
|
|
884
|
+
var decodeResourceMetadataJson = Schema14.decodeUnknownEffect(
|
|
885
|
+
Schema14.fromJsonString(OAuthProtectedResourceMetadataSchema)
|
|
685
886
|
);
|
|
686
|
-
var decodeAuthServerMetadata =
|
|
687
|
-
|
|
688
|
-
)
|
|
689
|
-
var decodeClientInformation = Schema11.decodeUnknownEffect(
|
|
690
|
-
OAuthClientInformationSchema
|
|
887
|
+
var decodeAuthServerMetadata = Schema14.decodeUnknownEffect(OAuthAuthorizationServerMetadataSchema);
|
|
888
|
+
var decodeClientInformationJson = Schema14.decodeUnknownEffect(
|
|
889
|
+
Schema14.fromJsonString(OAuthClientInformationSchema)
|
|
691
890
|
);
|
|
891
|
+
var DcrErrorBody = class extends Data5.TaggedError("DcrErrorBody") {
|
|
892
|
+
};
|
|
893
|
+
var DcrTransport = class extends Data5.TaggedError("DcrTransport") {
|
|
894
|
+
};
|
|
895
|
+
var DcrErrorBodyJson = Schema14.Struct({
|
|
896
|
+
error: Schema14.String,
|
|
897
|
+
error_description: Schema14.optional(Schema14.String)
|
|
898
|
+
});
|
|
899
|
+
var decodeDcrErrorBodyJson = Schema14.decodeUnknownOption(Schema14.fromJsonString(DcrErrorBodyJson));
|
|
692
900
|
|
|
693
901
|
// ../sdk/src/oauth-service.ts
|
|
694
|
-
var OAuthAuthorizationServerMetadataJson =
|
|
695
|
-
var OAuthClientInformationJson =
|
|
696
|
-
var DynamicDcrSessionPayload =
|
|
697
|
-
kind:
|
|
698
|
-
identityLabel:
|
|
699
|
-
codeVerifier:
|
|
700
|
-
authorizationServerUrl:
|
|
701
|
-
authorizationServerMetadataUrl:
|
|
902
|
+
var OAuthAuthorizationServerMetadataJson = Schema15.Record(Schema15.String, Schema15.Unknown);
|
|
903
|
+
var OAuthClientInformationJson = Schema15.Record(Schema15.String, Schema15.Unknown);
|
|
904
|
+
var DynamicDcrSessionPayload = Schema15.Struct({
|
|
905
|
+
kind: Schema15.Literal("dynamic-dcr"),
|
|
906
|
+
identityLabel: Schema15.NullOr(Schema15.String),
|
|
907
|
+
codeVerifier: Schema15.String,
|
|
908
|
+
authorizationServerUrl: Schema15.String,
|
|
909
|
+
authorizationServerMetadataUrl: Schema15.String,
|
|
702
910
|
authorizationServerMetadata: OAuthAuthorizationServerMetadataJson,
|
|
703
911
|
clientInformation: OAuthClientInformationJson,
|
|
704
|
-
resourceMetadataUrl:
|
|
705
|
-
resourceMetadata:
|
|
706
|
-
|
|
707
|
-
)
|
|
708
|
-
scopes: Schema12.Array(Schema12.String)
|
|
912
|
+
resourceMetadataUrl: Schema15.NullOr(Schema15.String),
|
|
913
|
+
resourceMetadata: Schema15.NullOr(Schema15.Record(Schema15.String, Schema15.Unknown)),
|
|
914
|
+
scopes: Schema15.Array(Schema15.String),
|
|
915
|
+
resource: Schema15.NullOr(Schema15.String).pipe(Schema15.withDecodingDefaultType(Effect11.succeed(null)))
|
|
709
916
|
});
|
|
710
|
-
var AuthorizationCodeSessionPayload =
|
|
711
|
-
kind:
|
|
712
|
-
identityLabel:
|
|
713
|
-
codeVerifier:
|
|
714
|
-
authorizationEndpoint:
|
|
715
|
-
tokenEndpoint:
|
|
716
|
-
issuerUrl:
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
917
|
+
var AuthorizationCodeSessionPayload = Schema15.Struct({
|
|
918
|
+
kind: Schema15.Literal("authorization-code"),
|
|
919
|
+
identityLabel: Schema15.NullOr(Schema15.String),
|
|
920
|
+
codeVerifier: Schema15.String,
|
|
921
|
+
authorizationEndpoint: Schema15.String,
|
|
922
|
+
tokenEndpoint: Schema15.String,
|
|
923
|
+
issuerUrl: Schema15.NullOr(Schema15.String).pipe(
|
|
924
|
+
Schema15.withDecodingDefaultType(Effect11.succeed(null))
|
|
925
|
+
),
|
|
926
|
+
clientIdSecretId: Schema15.String,
|
|
927
|
+
clientIdSecretScopeId: Schema15.NullOr(Schema15.String).pipe(
|
|
928
|
+
Schema15.withDecodingDefaultType(Effect11.succeed(null))
|
|
929
|
+
),
|
|
930
|
+
clientSecretSecretId: Schema15.NullOr(Schema15.String),
|
|
931
|
+
clientSecretSecretScopeId: Schema15.NullOr(Schema15.String).pipe(
|
|
932
|
+
Schema15.withDecodingDefaultType(Effect11.succeed(null))
|
|
933
|
+
),
|
|
934
|
+
scopes: Schema15.Array(Schema15.String),
|
|
935
|
+
scopeSeparator: Schema15.optional(Schema15.String),
|
|
936
|
+
clientAuth: Schema15.Literals(["body", "basic"])
|
|
722
937
|
});
|
|
723
|
-
var OAuthSessionPayload =
|
|
938
|
+
var OAuthSessionPayload = Schema15.Union([
|
|
724
939
|
DynamicDcrSessionPayload,
|
|
725
940
|
AuthorizationCodeSessionPayload
|
|
726
941
|
]);
|
|
727
|
-
var decodeSessionPayload =
|
|
728
|
-
var encodeSessionPayload =
|
|
942
|
+
var decodeSessionPayload = Schema15.decodeUnknownSync(OAuthSessionPayload);
|
|
943
|
+
var encodeSessionPayload = Schema15.encodeSync(OAuthSessionPayload);
|
|
944
|
+
var UnknownFromJsonString = Schema15.fromJsonString(Schema15.Unknown);
|
|
945
|
+
var decodeUnknownJsonOption = Schema15.decodeUnknownOption(UnknownFromJsonString);
|
|
946
|
+
var decodeProviderStateSync = Schema15.decodeUnknownSync(OAuthProviderState);
|
|
947
|
+
var encodeProviderStateSync = Schema15.encodeSync(OAuthProviderState);
|
|
948
|
+
|
|
949
|
+
// ../sdk/src/hosted-http-client.ts
|
|
950
|
+
import { Effect as Effect12, Layer as Layer3, Schema as Schema16 } from "effect";
|
|
951
|
+
import { FetchHttpClient as FetchHttpClient3 } from "effect/unstable/http";
|
|
952
|
+
var HostedOutboundRequestBlocked = class extends Schema16.TaggedErrorClass()(
|
|
953
|
+
"HostedOutboundRequestBlocked",
|
|
954
|
+
{
|
|
955
|
+
url: Schema16.String,
|
|
956
|
+
reason: Schema16.String
|
|
957
|
+
}
|
|
958
|
+
) {
|
|
959
|
+
};
|
|
960
|
+
|
|
961
|
+
// ../sdk/src/plugin.ts
|
|
962
|
+
import { Effect as Effect13 } from "effect";
|
|
963
|
+
function definePlugin(authorFactory) {
|
|
964
|
+
return (options) => {
|
|
965
|
+
const {
|
|
966
|
+
storage: storageOverride,
|
|
967
|
+
...rest
|
|
968
|
+
} = options ?? {};
|
|
969
|
+
const hasAuthorOptions = Object.keys(rest).length > 0;
|
|
970
|
+
const spec = authorFactory(hasAuthorOptions ? rest : void 0);
|
|
971
|
+
return {
|
|
972
|
+
...spec,
|
|
973
|
+
storage: storageOverride ?? spec.storage
|
|
974
|
+
};
|
|
975
|
+
};
|
|
976
|
+
}
|
|
729
977
|
|
|
730
978
|
// ../sdk/src/executor.ts
|
|
731
|
-
import {
|
|
979
|
+
import {
|
|
980
|
+
Context,
|
|
981
|
+
Deferred,
|
|
982
|
+
Effect as Effect15,
|
|
983
|
+
Match as Match5,
|
|
984
|
+
Option as Option5,
|
|
985
|
+
Result as Result2,
|
|
986
|
+
Schema as Schema17,
|
|
987
|
+
Semaphore
|
|
988
|
+
} from "effect";
|
|
989
|
+
import { FetchHttpClient as FetchHttpClient4 } from "effect/unstable/http";
|
|
990
|
+
|
|
991
|
+
// ../sdk/src/schema-types.ts
|
|
992
|
+
import { Match as Match4, Option as Option4 } from "effect";
|
|
732
993
|
|
|
733
994
|
// ../sdk/src/scoped-adapter.ts
|
|
734
|
-
import { Effect as
|
|
995
|
+
import { Effect as Effect14 } from "effect";
|
|
735
996
|
|
|
736
997
|
// ../sdk/src/executor.ts
|
|
737
998
|
var collectSchemas = (plugins) => {
|
|
@@ -740,22 +1001,68 @@ var collectSchemas = (plugins) => {
|
|
|
740
1001
|
if (!plugin.schema) continue;
|
|
741
1002
|
for (const [modelKey, model] of Object.entries(plugin.schema)) {
|
|
742
1003
|
if (merged[modelKey]) {
|
|
743
|
-
throw new
|
|
744
|
-
`Duplicate model "${modelKey}" contributed by plugin "${plugin.id}" (reserved by core or another plugin)
|
|
745
|
-
|
|
1004
|
+
throw new StorageError({
|
|
1005
|
+
message: `Duplicate model "${modelKey}" contributed by plugin "${plugin.id}" (reserved by core or another plugin)`,
|
|
1006
|
+
cause: void 0
|
|
1007
|
+
});
|
|
746
1008
|
}
|
|
747
1009
|
merged[modelKey] = model;
|
|
748
1010
|
}
|
|
749
1011
|
}
|
|
750
1012
|
return merged;
|
|
751
1013
|
};
|
|
752
|
-
var
|
|
753
|
-
|
|
754
|
-
|
|
1014
|
+
var decodeJsonFromString2 = Schema17.decodeUnknownOption(Schema17.UnknownFromJsonString);
|
|
1015
|
+
var decodeProviderState = Schema17.decodeUnknownOption(ConnectionProviderState);
|
|
1016
|
+
var activeAdapterRef = Context.Reference("executor/ActiveAdapter", {
|
|
1017
|
+
defaultValue: () => null
|
|
1018
|
+
});
|
|
1019
|
+
var activeRawAdapterRef = Context.Reference(
|
|
1020
|
+
"executor/ActiveRawAdapter",
|
|
1021
|
+
{
|
|
1022
|
+
defaultValue: () => null
|
|
1023
|
+
}
|
|
755
1024
|
);
|
|
756
1025
|
|
|
757
1026
|
// ../storage-core/src/testing/memory.ts
|
|
758
|
-
import { Effect as
|
|
1027
|
+
import { Effect as Effect16, Match as Match6 } from "effect";
|
|
1028
|
+
|
|
1029
|
+
// ../sdk/src/test-config.ts
|
|
1030
|
+
import { Effect as Effect17 } from "effect";
|
|
1031
|
+
var memorySecretsPlugin = definePlugin(() => {
|
|
1032
|
+
const store = /* @__PURE__ */ new Map();
|
|
1033
|
+
const provider = {
|
|
1034
|
+
key: "memory",
|
|
1035
|
+
writable: true,
|
|
1036
|
+
get: (id, scope) => Effect17.sync(() => store.get(`${scope}\0${id}`) ?? null),
|
|
1037
|
+
set: (id, value, scope) => Effect17.sync(() => {
|
|
1038
|
+
store.set(`${scope}\0${id}`, value);
|
|
1039
|
+
}),
|
|
1040
|
+
delete: (id, scope) => Effect17.sync(() => store.delete(`${scope}\0${id}`)),
|
|
1041
|
+
list: () => Effect17.sync(
|
|
1042
|
+
() => Array.from(store.keys()).map((key) => {
|
|
1043
|
+
const name = key.split("\0", 2)[1] ?? key;
|
|
1044
|
+
return { id: name, name };
|
|
1045
|
+
})
|
|
1046
|
+
)
|
|
1047
|
+
};
|
|
1048
|
+
return {
|
|
1049
|
+
id: "memory-secrets",
|
|
1050
|
+
storage: () => ({}),
|
|
1051
|
+
secretProviders: [provider]
|
|
1052
|
+
};
|
|
1053
|
+
});
|
|
1054
|
+
|
|
1055
|
+
// ../sdk/src/api-errors.ts
|
|
1056
|
+
import { Schema as Schema18 } from "effect";
|
|
1057
|
+
var InternalError = class extends Schema18.TaggedErrorClass()(
|
|
1058
|
+
"InternalError",
|
|
1059
|
+
{
|
|
1060
|
+
/** Opaque correlation id for backend lookup (Sentry event id, log line, etc.). */
|
|
1061
|
+
traceId: Schema18.String
|
|
1062
|
+
},
|
|
1063
|
+
{ httpApiStatus: 500 }
|
|
1064
|
+
) {
|
|
1065
|
+
};
|
|
759
1066
|
|
|
760
1067
|
// src/utils/get-config.ts
|
|
761
1068
|
import { existsSync } from "fs";
|
|
@@ -811,9 +1118,7 @@ var getType = (name, field, dialect) => {
|
|
|
811
1118
|
mysql: `mysqlEnum([${type.map((x) => `'${x}'`).join(", ")}])`
|
|
812
1119
|
}[dialect];
|
|
813
1120
|
}
|
|
814
|
-
throw new TypeError(
|
|
815
|
-
`Invalid field type for field ${name}`
|
|
816
|
-
);
|
|
1121
|
+
throw new TypeError(`Invalid field type for field ${name}`);
|
|
817
1122
|
}
|
|
818
1123
|
const typeMap = {
|
|
819
1124
|
string: {
|
|
@@ -854,17 +1159,11 @@ var getType = (name, field, dialect) => {
|
|
|
854
1159
|
};
|
|
855
1160
|
const dbTypeMap = typeMap[type];
|
|
856
1161
|
if (!dbTypeMap) {
|
|
857
|
-
throw new Error(
|
|
858
|
-
`Unsupported field type '${field.type}' for field '${name}'.`
|
|
859
|
-
);
|
|
1162
|
+
throw new Error(`Unsupported field type '${field.type}' for field '${name}'.`);
|
|
860
1163
|
}
|
|
861
1164
|
return dbTypeMap[dialect];
|
|
862
1165
|
};
|
|
863
|
-
var generateDrizzleSchema = async ({
|
|
864
|
-
schema,
|
|
865
|
-
dialect,
|
|
866
|
-
file
|
|
867
|
-
}) => {
|
|
1166
|
+
var generateDrizzleSchema = async ({ schema, dialect, file }) => {
|
|
868
1167
|
const filePath = file || "./executor-schema.ts";
|
|
869
1168
|
const fileExist = existsSync2(filePath);
|
|
870
1169
|
let code = generateImport({ dialect, schema });
|
|
@@ -1017,10 +1316,7 @@ ${block}
|
|
|
1017
1316
|
const hasOne = singleRelations.length > 0;
|
|
1018
1317
|
const hasMany = manyRelations.length > 0;
|
|
1019
1318
|
if (hasOne || hasMany) {
|
|
1020
|
-
const destructured = [
|
|
1021
|
-
hasOne ? "one" : "",
|
|
1022
|
-
hasMany ? "many" : ""
|
|
1023
|
-
].filter(Boolean).join(", ");
|
|
1319
|
+
const destructured = [hasOne ? "one" : "", hasMany ? "many" : ""].filter(Boolean).join(", ");
|
|
1024
1320
|
const body = [
|
|
1025
1321
|
...singleRelations.filter((r) => r.reference).map(
|
|
1026
1322
|
(r) => ` ${r.key}: one(${r.model}, {
|
|
@@ -1028,9 +1324,7 @@ ${block}
|
|
|
1028
1324
|
references: [${r.reference.references}],
|
|
1029
1325
|
})`
|
|
1030
1326
|
),
|
|
1031
|
-
...manyRelations.map(
|
|
1032
|
-
({ key, model }) => ` ${key}: many(${model})`
|
|
1033
|
-
)
|
|
1327
|
+
...manyRelations.map(({ key, model }) => ` ${key}: many(${model})`)
|
|
1034
1328
|
].join(",\n");
|
|
1035
1329
|
const block = `export const ${modelName}Relations = relations(${modelName}, ({ ${destructured} }) => ({
|
|
1036
1330
|
${body}
|
|
@@ -1048,10 +1342,7 @@ ${relationsString}`;
|
|
|
1048
1342
|
overwrite: fileExist
|
|
1049
1343
|
};
|
|
1050
1344
|
};
|
|
1051
|
-
function generateImport({
|
|
1052
|
-
dialect,
|
|
1053
|
-
schema
|
|
1054
|
-
}) {
|
|
1345
|
+
function generateImport({ dialect, schema }) {
|
|
1055
1346
|
const rootImports = [];
|
|
1056
1347
|
const coreImports = [];
|
|
1057
1348
|
let hasBigint = false;
|
|
@@ -1138,7 +1429,7 @@ async function generateAction(opts) {
|
|
|
1138
1429
|
);
|
|
1139
1430
|
process.exit(1);
|
|
1140
1431
|
}
|
|
1141
|
-
const schema = collectSchemas(config.plugins);
|
|
1432
|
+
const schema = collectSchemas(config.plugins());
|
|
1142
1433
|
const result = await generateDrizzleSchema({
|
|
1143
1434
|
schema,
|
|
1144
1435
|
dialect: config.dialect,
|
|
@@ -1156,17 +1447,7 @@ async function generateAction(opts) {
|
|
|
1156
1447
|
await fs.writeFile(outPath, result.code);
|
|
1157
1448
|
console.log(`Schema generated: ${path2.relative(cwd, outPath)}`);
|
|
1158
1449
|
}
|
|
1159
|
-
var generate = new Command("generate").description("Generate a drizzle schema file from the executor config").option(
|
|
1160
|
-
"-c, --cwd <cwd>",
|
|
1161
|
-
"the working directory",
|
|
1162
|
-
process.cwd()
|
|
1163
|
-
).option(
|
|
1164
|
-
"--config <config>",
|
|
1165
|
-
"path to the executor config file"
|
|
1166
|
-
).option(
|
|
1167
|
-
"--output <output>",
|
|
1168
|
-
"output file path for the generated schema"
|
|
1169
|
-
).action(generateAction);
|
|
1450
|
+
var generate = new Command("generate").description("Generate a drizzle schema file from the executor config").option("-c, --cwd <cwd>", "the working directory", process.cwd()).option("--config <config>", "path to the executor config file").option("--output <output>", "output file path for the generated schema").action(generateAction);
|
|
1170
1451
|
|
|
1171
1452
|
// src/index.ts
|
|
1172
1453
|
process.on("SIGINT", () => process.exit(0));
|