@executor-js/sdk 1.4.28 → 1.4.30
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/blob.d.ts +2 -1
- package/dist/blob.d.ts.map +1 -1
- package/dist/chunk-2LU3SC64.js +7 -0
- package/dist/chunk-2LU3SC64.js.map +1 -0
- package/dist/chunk-7D4SUZUM.js +38 -0
- package/dist/chunk-7D4SUZUM.js.map +1 -0
- package/dist/chunk-B4YGTZF6.js +22 -0
- package/dist/chunk-B4YGTZF6.js.map +1 -0
- package/dist/chunk-BZNIRSMG.js +7873 -0
- package/dist/chunk-BZNIRSMG.js.map +1 -0
- package/dist/chunk-ECMCGZYE.js +5814 -0
- package/dist/chunk-ECMCGZYE.js.map +1 -0
- package/dist/{chunk-6SQWMOM4.js → chunk-MLNVNVRI.js} +2 -6
- package/dist/chunk-MLNVNVRI.js.map +1 -0
- package/dist/chunk-P2WKYAC5.js +1 -0
- package/dist/chunk-P2WKYAC5.js.map +1 -0
- package/dist/chunk-ZANQD7E2.js +1035 -0
- package/dist/chunk-ZANQD7E2.js.map +1 -0
- package/dist/client.d.ts +3 -0
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +2 -0
- package/dist/client.js.map +1 -1
- package/dist/config.d.ts +3 -7
- package/dist/config.d.ts.map +1 -1
- package/dist/core-schema.d.ts +283 -408
- package/dist/core-schema.d.ts.map +1 -1
- package/dist/core-tools.d.ts +6 -0
- package/dist/core-tools.d.ts.map +1 -0
- package/dist/core.js +120 -168
- package/dist/core.js.map +1 -1
- package/dist/credential-bindings.d.ts +86 -24
- package/dist/credential-bindings.d.ts.map +1 -1
- package/dist/errors.d.ts +1 -0
- package/dist/errors.d.ts.map +1 -1
- package/dist/executor.d.ts +46 -12
- package/dist/executor.d.ts.map +1 -1
- package/dist/fuma-runtime.d.ts +50 -0
- package/dist/fuma-runtime.d.ts.map +1 -0
- package/dist/http-source.d.ts +109 -0
- package/dist/http-source.d.ts.map +1 -0
- package/dist/http-source.js +155 -0
- package/dist/http-source.js.map +1 -0
- package/dist/index.d.ts +17 -12
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +44 -21
- package/dist/index.js.map +1 -1
- package/dist/oauth-service.d.ts +2 -10
- package/dist/oauth-service.d.ts.map +1 -1
- package/dist/oauth.d.ts +9 -1
- package/dist/oauth.d.ts.map +1 -1
- package/dist/plugin-storage.d.ts +40 -0
- package/dist/plugin-storage.d.ts.map +1 -0
- package/dist/plugin.d.ts +110 -34
- package/dist/plugin.d.ts.map +1 -1
- package/dist/promise-executor.d.ts +33 -8
- package/dist/promise-executor.d.ts.map +1 -1
- package/dist/promise.d.ts +3 -3
- package/dist/promise.d.ts.map +1 -1
- package/dist/schema-refs.d.ts +1 -0
- package/dist/schema-refs.d.ts.map +1 -1
- package/dist/schema-refs.test.d.ts +2 -0
- package/dist/schema-refs.test.d.ts.map +1 -0
- package/dist/schema-types.d.ts +22 -8
- package/dist/schema-types.d.ts.map +1 -1
- package/dist/scope-policy.d.ts +23 -0
- package/dist/scope-policy.d.ts.map +1 -0
- package/dist/scope-policy.test.d.ts +2 -0
- package/dist/scope-policy.test.d.ts.map +1 -0
- package/dist/scope.d.ts +10 -0
- package/dist/scope.d.ts.map +1 -1
- package/dist/secrets.d.ts +1 -1
- package/dist/secrets.d.ts.map +1 -1
- package/dist/shared.d.ts +13 -0
- package/dist/shared.d.ts.map +1 -0
- package/dist/shared.js +103 -0
- package/dist/shared.js.map +1 -0
- package/dist/sqlite-test-db-OK2WQNR5.js +8 -0
- package/dist/sqlite-test-db-OK2WQNR5.js.map +1 -0
- package/dist/sqlite-test-db.d.ts +22 -0
- package/dist/sqlite-test-db.d.ts.map +1 -0
- package/dist/test-config.d.ts +45 -4
- package/dist/test-config.d.ts.map +1 -1
- package/dist/testing/oauth-test-server.d.ts +80 -0
- package/dist/testing/oauth-test-server.d.ts.map +1 -0
- package/dist/testing.d.ts +4 -1
- package/dist/testing.d.ts.map +1 -1
- package/dist/testing.js +706 -18
- package/dist/testing.js.map +1 -1
- package/dist/testing.test.d.ts +2 -0
- package/dist/testing.test.d.ts.map +1 -0
- package/dist/tool-result.d.ts +22 -0
- package/dist/tool-result.d.ts.map +1 -0
- package/dist/tool-result.test.d.ts +2 -0
- package/dist/tool-result.test.d.ts.map +1 -0
- package/dist/types.d.ts +1 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/vendor/json-schema-to-typescript/applySchemaTyping.d.ts +3 -0
- package/dist/vendor/json-schema-to-typescript/applySchemaTyping.d.ts.map +1 -0
- package/dist/vendor/json-schema-to-typescript/compat.d.ts +10 -0
- package/dist/vendor/json-schema-to-typescript/compat.d.ts.map +1 -0
- package/dist/vendor/json-schema-to-typescript/formatter.d.ts +3 -0
- package/dist/vendor/json-schema-to-typescript/formatter.d.ts.map +1 -0
- package/dist/vendor/json-schema-to-typescript/generator.d.ts +7 -0
- package/dist/vendor/json-schema-to-typescript/generator.d.ts.map +1 -0
- package/dist/vendor/json-schema-to-typescript/index.d.ts +93 -0
- package/dist/vendor/json-schema-to-typescript/index.d.ts.map +1 -0
- package/dist/vendor/json-schema-to-typescript/linker.d.ts +8 -0
- package/dist/vendor/json-schema-to-typescript/linker.d.ts.map +1 -0
- package/dist/vendor/json-schema-to-typescript/normalizer.d.ts +5 -0
- package/dist/vendor/json-schema-to-typescript/normalizer.d.ts.map +1 -0
- package/dist/vendor/json-schema-to-typescript/optimizer.d.ts +4 -0
- package/dist/vendor/json-schema-to-typescript/optimizer.d.ts.map +1 -0
- package/dist/vendor/json-schema-to-typescript/optionValidator.d.ts +3 -0
- package/dist/vendor/json-schema-to-typescript/optionValidator.d.ts.map +1 -0
- package/dist/vendor/json-schema-to-typescript/parser.d.ts +8 -0
- package/dist/vendor/json-schema-to-typescript/parser.d.ts.map +1 -0
- package/dist/vendor/json-schema-to-typescript/resolver.d.ts +7 -0
- package/dist/vendor/json-schema-to-typescript/resolver.d.ts.map +1 -0
- package/dist/vendor/json-schema-to-typescript/types/AST.d.ts +108 -0
- package/dist/vendor/json-schema-to-typescript/types/AST.d.ts.map +1 -0
- package/dist/vendor/json-schema-to-typescript/types/JSONSchema.d.ts +103 -0
- package/dist/vendor/json-schema-to-typescript/types/JSONSchema.d.ts.map +1 -0
- package/dist/vendor/json-schema-to-typescript/types/json-schema.d.ts +34 -0
- package/dist/vendor/json-schema-to-typescript/types/json-schema.d.ts.map +1 -0
- package/dist/vendor/json-schema-to-typescript/typesOfSchema.d.ts +11 -0
- package/dist/vendor/json-schema-to-typescript/typesOfSchema.d.ts.map +1 -0
- package/dist/vendor/json-schema-to-typescript/utils.d.ts +30 -0
- package/dist/vendor/json-schema-to-typescript/utils.d.ts.map +1 -0
- package/dist/vendor/json-schema-to-typescript/validator.d.ts +3 -0
- package/dist/vendor/json-schema-to-typescript/validator.d.ts.map +1 -0
- package/package.json +17 -2
- package/dist/chunk-6SQWMOM4.js.map +0 -1
- package/dist/chunk-I2OEQ2GJ.js +0 -103
- package/dist/chunk-I2OEQ2GJ.js.map +0 -1
- package/dist/chunk-OIJL6F6M.js +0 -5507
- package/dist/chunk-OIJL6F6M.js.map +0 -1
- package/dist/error-handling.test.d.ts +0 -2
- package/dist/error-handling.test.d.ts.map +0 -1
- package/dist/scoped-adapter.d.ts +0 -28
- package/dist/scoped-adapter.d.ts.map +0 -1
- package/dist/scoped-adapter.test.d.ts +0 -2
- package/dist/scoped-adapter.test.d.ts.map +0 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Effect, Schema } from "effect";
|
|
2
|
-
import type { StorageFailure } from "
|
|
2
|
+
import type { StorageFailure } from "./fuma-runtime";
|
|
3
3
|
import { type CredentialBindingRow } from "./core-schema";
|
|
4
|
-
import { CredentialBindingId } from "./ids";
|
|
4
|
+
import { CredentialBindingId, ScopeId } from "./ids";
|
|
5
5
|
import type { Usage } from "./usages";
|
|
6
|
-
export declare const CredentialBindingKind: Schema.Literals<["text", "secret", "connection"]>;
|
|
6
|
+
export declare const CredentialBindingKind: Schema.Literals<readonly ["text", "secret", "connection"]>;
|
|
7
7
|
export type CredentialBindingKind = typeof CredentialBindingKind.Type;
|
|
8
8
|
export declare const CredentialBindingValue: Schema.Union<readonly [Schema.Struct<{
|
|
9
9
|
readonly kind: Schema.Literal<"text">;
|
|
@@ -58,25 +58,14 @@ export declare const CredentialBindingRef: Schema.Struct<{
|
|
|
58
58
|
readonly updatedAt: Schema.Date;
|
|
59
59
|
}>;
|
|
60
60
|
export type CredentialBindingRef = typeof CredentialBindingRef.Type;
|
|
61
|
-
export
|
|
62
|
-
readonly targetScope:
|
|
63
|
-
readonly pluginId:
|
|
64
|
-
readonly sourceId:
|
|
65
|
-
readonly sourceScope:
|
|
66
|
-
readonly slotKey:
|
|
67
|
-
readonly value:
|
|
68
|
-
|
|
69
|
-
readonly text: Schema.String;
|
|
70
|
-
}>, Schema.Struct<{
|
|
71
|
-
readonly kind: Schema.Literal<"secret">;
|
|
72
|
-
readonly secretId: Schema.brand<Schema.String, "SecretId">;
|
|
73
|
-
readonly secretScopeId: Schema.optional<Schema.brand<Schema.String, "ScopeId">>;
|
|
74
|
-
}>, Schema.Struct<{
|
|
75
|
-
readonly kind: Schema.Literal<"connection">;
|
|
76
|
-
readonly connectionId: Schema.brand<Schema.String, "ConnectionId">;
|
|
77
|
-
}>]>;
|
|
78
|
-
}>;
|
|
79
|
-
export type SetCredentialBindingInput = typeof SetCredentialBindingInput.Type;
|
|
61
|
+
export type SetPluginCredentialBindingInput = {
|
|
62
|
+
readonly targetScope: ScopeId;
|
|
63
|
+
readonly pluginId: string;
|
|
64
|
+
readonly sourceId: string;
|
|
65
|
+
readonly sourceScope: ScopeId;
|
|
66
|
+
readonly slotKey: string;
|
|
67
|
+
readonly value: CredentialBindingValue;
|
|
68
|
+
};
|
|
80
69
|
export declare const CredentialBindingSourceInput: Schema.Struct<{
|
|
81
70
|
readonly pluginId: Schema.String;
|
|
82
71
|
readonly sourceId: Schema.String;
|
|
@@ -135,6 +124,78 @@ export declare const ReplaceCredentialBindingsInput: Schema.Struct<{
|
|
|
135
124
|
}>>;
|
|
136
125
|
}>;
|
|
137
126
|
export type ReplaceCredentialBindingsInput = typeof ReplaceCredentialBindingsInput.Type;
|
|
127
|
+
export declare const SourceCredentialBindingSource: Schema.Struct<{
|
|
128
|
+
readonly id: Schema.String;
|
|
129
|
+
readonly scope: Schema.brand<Schema.String, "ScopeId">;
|
|
130
|
+
}>;
|
|
131
|
+
export type SourceCredentialBindingSource = typeof SourceCredentialBindingSource.Type;
|
|
132
|
+
export declare const SourceCredentialBindingSourceInput: Schema.Struct<{
|
|
133
|
+
readonly source: Schema.Struct<{
|
|
134
|
+
readonly id: Schema.String;
|
|
135
|
+
readonly scope: Schema.brand<Schema.String, "ScopeId">;
|
|
136
|
+
}>;
|
|
137
|
+
}>;
|
|
138
|
+
export type SourceCredentialBindingSourceInput = typeof SourceCredentialBindingSourceInput.Type;
|
|
139
|
+
export declare const SourceCredentialBindingSlotInput: Schema.Struct<{
|
|
140
|
+
readonly source: Schema.Struct<{
|
|
141
|
+
readonly id: Schema.String;
|
|
142
|
+
readonly scope: Schema.brand<Schema.String, "ScopeId">;
|
|
143
|
+
}>;
|
|
144
|
+
readonly slotKey: Schema.String;
|
|
145
|
+
}>;
|
|
146
|
+
export type SourceCredentialBindingSlotInput = typeof SourceCredentialBindingSlotInput.Type;
|
|
147
|
+
export declare const SetSourceCredentialBindingInput: Schema.Struct<{
|
|
148
|
+
readonly scope: Schema.brand<Schema.String, "ScopeId">;
|
|
149
|
+
readonly source: Schema.Struct<{
|
|
150
|
+
readonly id: Schema.String;
|
|
151
|
+
readonly scope: Schema.brand<Schema.String, "ScopeId">;
|
|
152
|
+
}>;
|
|
153
|
+
readonly slotKey: Schema.String;
|
|
154
|
+
readonly value: Schema.Union<readonly [Schema.Struct<{
|
|
155
|
+
readonly kind: Schema.Literal<"text">;
|
|
156
|
+
readonly text: Schema.String;
|
|
157
|
+
}>, Schema.Struct<{
|
|
158
|
+
readonly kind: Schema.Literal<"secret">;
|
|
159
|
+
readonly secretId: Schema.brand<Schema.String, "SecretId">;
|
|
160
|
+
readonly secretScopeId: Schema.optional<Schema.brand<Schema.String, "ScopeId">>;
|
|
161
|
+
}>, Schema.Struct<{
|
|
162
|
+
readonly kind: Schema.Literal<"connection">;
|
|
163
|
+
readonly connectionId: Schema.brand<Schema.String, "ConnectionId">;
|
|
164
|
+
}>]>;
|
|
165
|
+
}>;
|
|
166
|
+
export type SetSourceCredentialBindingInput = typeof SetSourceCredentialBindingInput.Type;
|
|
167
|
+
export declare const RemoveSourceCredentialBindingInput: Schema.Struct<{
|
|
168
|
+
readonly scope: Schema.brand<Schema.String, "ScopeId">;
|
|
169
|
+
readonly source: Schema.Struct<{
|
|
170
|
+
readonly id: Schema.String;
|
|
171
|
+
readonly scope: Schema.brand<Schema.String, "ScopeId">;
|
|
172
|
+
}>;
|
|
173
|
+
readonly slotKey: Schema.String;
|
|
174
|
+
}>;
|
|
175
|
+
export type RemoveSourceCredentialBindingInput = typeof RemoveSourceCredentialBindingInput.Type;
|
|
176
|
+
export declare const ReplaceSourceCredentialBindingsInput: Schema.Struct<{
|
|
177
|
+
readonly scope: Schema.brand<Schema.String, "ScopeId">;
|
|
178
|
+
readonly source: Schema.Struct<{
|
|
179
|
+
readonly id: Schema.String;
|
|
180
|
+
readonly scope: Schema.brand<Schema.String, "ScopeId">;
|
|
181
|
+
}>;
|
|
182
|
+
readonly slotPrefixes: Schema.$Array<Schema.String>;
|
|
183
|
+
readonly bindings: Schema.$Array<Schema.Struct<{
|
|
184
|
+
readonly slotKey: Schema.String;
|
|
185
|
+
readonly value: Schema.Union<readonly [Schema.Struct<{
|
|
186
|
+
readonly kind: Schema.Literal<"text">;
|
|
187
|
+
readonly text: Schema.String;
|
|
188
|
+
}>, Schema.Struct<{
|
|
189
|
+
readonly kind: Schema.Literal<"secret">;
|
|
190
|
+
readonly secretId: Schema.brand<Schema.String, "SecretId">;
|
|
191
|
+
readonly secretScopeId: Schema.optional<Schema.brand<Schema.String, "ScopeId">>;
|
|
192
|
+
}>, Schema.Struct<{
|
|
193
|
+
readonly kind: Schema.Literal<"connection">;
|
|
194
|
+
readonly connectionId: Schema.brand<Schema.String, "ConnectionId">;
|
|
195
|
+
}>]>;
|
|
196
|
+
}>>;
|
|
197
|
+
}>;
|
|
198
|
+
export type ReplaceSourceCredentialBindingsInput = typeof ReplaceSourceCredentialBindingsInput.Type;
|
|
138
199
|
export declare const CredentialBindingResolutionStatus: Schema.Literals<readonly ["resolved", "missing", "blocked"]>;
|
|
139
200
|
export type CredentialBindingResolutionStatus = typeof CredentialBindingResolutionStatus.Type;
|
|
140
201
|
export declare const ResolvedCredentialSlot: Schema.Struct<{
|
|
@@ -143,14 +204,15 @@ export declare const ResolvedCredentialSlot: Schema.Struct<{
|
|
|
143
204
|
readonly sourceScopeId: Schema.brand<Schema.String, "ScopeId">;
|
|
144
205
|
readonly slotKey: Schema.String;
|
|
145
206
|
readonly bindingScopeId: Schema.NullOr<Schema.brand<Schema.String, "ScopeId">>;
|
|
146
|
-
readonly kind: Schema.NullOr<Schema.Literals<["text", "secret", "connection"]>>;
|
|
207
|
+
readonly kind: Schema.NullOr<Schema.Literals<readonly ["text", "secret", "connection"]>>;
|
|
147
208
|
readonly status: Schema.Literals<readonly ["resolved", "missing", "blocked"]>;
|
|
148
209
|
}>;
|
|
149
210
|
export type ResolvedCredentialSlot = typeof ResolvedCredentialSlot.Type;
|
|
150
211
|
export interface CredentialBindingsFacade {
|
|
151
212
|
readonly listForSource: (input: CredentialBindingSourceInput) => Effect.Effect<readonly CredentialBindingRef[], StorageFailure>;
|
|
213
|
+
readonly resolveBinding: (input: CredentialBindingSlotInput) => Effect.Effect<CredentialBindingRef | null, StorageFailure>;
|
|
152
214
|
readonly resolve: (input: CredentialBindingSlotInput) => Effect.Effect<ResolvedCredentialSlot, StorageFailure>;
|
|
153
|
-
readonly set: (input:
|
|
215
|
+
readonly set: (input: SetPluginCredentialBindingInput) => Effect.Effect<CredentialBindingRef, StorageFailure>;
|
|
154
216
|
readonly remove: (input: RemoveCredentialBindingInput) => Effect.Effect<void, StorageFailure>;
|
|
155
217
|
readonly replaceForSource: (input: ReplaceCredentialBindingsInput) => Effect.Effect<readonly CredentialBindingRef[], StorageFailure>;
|
|
156
218
|
readonly removeForSource: (input: CredentialBindingSourceInput) => Effect.Effect<void, StorageFailure>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credential-bindings.d.ts","sourceRoot":"","sources":["../src/credential-bindings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAS,MAAM,EAAE,MAAM,QAAQ,CAAC;AAE/C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"credential-bindings.d.ts","sourceRoot":"","sources":["../src/credential-bindings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAS,MAAM,EAAE,MAAM,QAAQ,CAAC;AAE/C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAErD,OAAO,EAA0B,KAAK,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAClF,OAAO,EAAgB,mBAAmB,EAAE,OAAO,EAAY,MAAM,OAAO,CAAC;AAC7E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEtC,eAAO,MAAM,qBAAqB,4DAA0C,CAAC;AAC7E,MAAM,MAAM,qBAAqB,GAAG,OAAO,qBAAqB,CAAC,IAAI,CAAC;AAEtE,eAAO,MAAM,sBAAsB;;;;;;;;;;IAcjC,CAAC;AACH,MAAM,MAAM,sBAAsB,GAAG,OAAO,sBAAsB,CAAC,IAAI,CAAC;AAExE,eAAO,MAAM,2BAA2B;;;;EAItC,CAAC;AACH,MAAM,MAAM,2BAA2B,GAAG,OAAO,2BAA2B,CAAC,IAAI,CAAC;AAElF,eAAO,MAAM,yBAAyB;;;;IAA6D,CAAC;AACpG,MAAM,MAAM,yBA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,sBAgBvE,CAAC;AAEJ,eAAO,MAAM,yBAAyB,GAAI,KAAK,oBAAoB,KAAG,oBAarE,CAAC"}
|
package/dist/errors.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { Schema } from "effect";
|
|
|
2
2
|
import { ToolId } from "./ids";
|
|
3
3
|
declare const ToolNotFoundError_base: Schema.Class<ToolNotFoundError, Schema.TaggedStruct<"ToolNotFoundError", {
|
|
4
4
|
readonly toolId: Schema.brand<Schema.String, "ToolId">;
|
|
5
|
+
readonly suggestions: Schema.optional<Schema.$Array<Schema.brand<Schema.String, "ToolId">>>;
|
|
5
6
|
}>, import("effect/Cause").YieldableError>;
|
|
6
7
|
export declare class ToolNotFoundError extends ToolNotFoundError_base {
|
|
7
8
|
}
|
package/dist/errors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEtC,OAAO,EAAgB,MAAM,EAAY,MAAM,OAAO,CAAC
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEtC,OAAO,EAAgB,MAAM,EAAY,MAAM,OAAO,CAAC;;;;;AAMvD,qBAAa,iBAAkB,SAAQ,sBAMtC;CAAG;;;;AAEJ,qBAAa,mBAAoB,SAAQ,yBAAwC;IAC/E,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;CAC1B,CAAC;CAAG;;;;;AAEL;;2EAE2E;AAC3E,qBAAa,oBAAqB,SAAQ,yBAMzC;CAAG;;;;;AAEJ;;;wBAGwB;AACxB,qBAAa,cAAe,SAAQ,mBAGlC;CAAG;;;;;AAEL;;;4CAG4C;AAC5C,qBAAa,gBAAiB,SAAQ,qBAMrC;CAAG;;;;AAMJ,qBAAa,mBAAoB,SAAQ,wBAGxC;CAAG;;;;AAEJ;;;cAGc;AACd,qBAAa,4BAA6B,SAAQ,iCAGjD;CAAG;;;;AAMJ,qBAAa,mBAAoB,SAAQ,wBAGxC;CAAG;;;;;AAEJ,qBAAa,qBAAsB,SAAQ,0BAM1C;CAAG;;;;;AAEJ;;;yCAGyC;AACzC,qBAAa,4BAA6B,SAAQ,iCAMjD;CAAG;;;;;AAEJ;;;;;;mEAMmE;AACnE,qBAAa,gBAAiB,SAAQ,qBAMrC;CAAG;;;;AAMJ,qBAAa,uBAAwB,SAAQ,4BAG5C;CAAG;;;;;AAEJ,qBAAa,oCAAqC,SAAQ,yCAMzD;CAAG;;;;;AAEJ,qBAAa,kCAAmC,SAAQ,uCAMvD;CAAG;;;;;;AAEJ;;;;;;;;GAQG;AACH,qBAAa,6BAA8B,SAAQ,kCAOlD;CAAG;;;;;AAEJ;0EAC0E;AAC1E,qBAAa,oBAAqB,SAAQ,yBAMzC;CAAG;AAMJ,MAAM,MAAM,aAAa,GACrB,iBAAiB,GACjB,mBAAmB,GACnB,oBAAoB,GACpB,cAAc,GACd,gBAAgB,GAChB,mBAAmB,GACnB,4BAA4B,GAC5B,mBAAmB,GACnB,qBAAqB,GACrB,4BAA4B,GAC5B,gBAAgB,GAChB,uBAAuB,GACvB,oCAAoC,GACpC,kCAAkC,GAClC,6BAA6B,GAC7B,oBAAoB,CAAC"}
|
package/dist/executor.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { Duration, Effect, Layer } from "effect";
|
|
2
2
|
import { type HttpClient } from "effect/unstable/http";
|
|
3
3
|
import type { OAuthEndpointUrlPolicy } from "./oauth-helpers";
|
|
4
|
-
import { type
|
|
5
|
-
import { type BlobStore } from "./blob";
|
|
4
|
+
import { type FumaDb, type FumaTables, type StorageFailure } from "./fuma-runtime";
|
|
6
5
|
import { ConnectionRef, ConnectionRefreshError, type CreateConnectionInput, type RemoveConnectionInput, type UpdateConnectionTokensInput } from "./connections";
|
|
7
|
-
import { type CredentialBindingsFacade } from "./credential-bindings";
|
|
6
|
+
import { type CredentialBindingRef, type CredentialBindingsFacade, type RemoveSourceCredentialBindingInput, type ReplaceSourceCredentialBindingsInput, type SetSourceCredentialBindingInput, type SourceCredentialBindingSlotInput, type SourceCredentialBindingSourceInput } from "./credential-bindings";
|
|
8
7
|
import { ElicitationDeclinedError, type ElicitationHandler } from "./elicitation";
|
|
9
8
|
import { ConnectionInUseError, ConnectionNotFoundError, ConnectionProviderNotRegisteredError, ConnectionReauthRequiredError, ConnectionRefreshNotSupportedError, NoHandlerError, PluginNotLoadedError, SecretInUseError, SecretOwnedByConnectionError, SourceRemovalNotAllowedError, ToolBlockedError, ToolInvocationError, ToolNotFoundError } from "./errors";
|
|
9
|
+
import { ScopeId } from "./ids";
|
|
10
10
|
import type { OAuthService } from "./oauth";
|
|
11
11
|
import { type CreateToolPolicyInput, type PolicyMatch, type RemoveToolPolicyInput, type ToolPolicy, type UpdateToolPolicyInput } from "./policies";
|
|
12
12
|
import type { AnyPlugin, PluginExtensions } from "./plugin";
|
|
@@ -19,7 +19,7 @@ export interface InvokeOptions {
|
|
|
19
19
|
/** Override the executor-level handler for this single call. */
|
|
20
20
|
readonly onElicitation?: OnElicitation;
|
|
21
21
|
}
|
|
22
|
-
export type Executor<TPlugins extends readonly AnyPlugin[] = []> = {
|
|
22
|
+
export type Executor<TPlugins extends readonly AnyPlugin[] = readonly []> = {
|
|
23
23
|
/**
|
|
24
24
|
* Precedence-ordered scope stack this executor was configured with.
|
|
25
25
|
* Innermost first. Consumers that need "the display scope" typically
|
|
@@ -30,10 +30,9 @@ export type Executor<TPlugins extends readonly AnyPlugin[] = []> = {
|
|
|
30
30
|
readonly scopes: readonly Scope[];
|
|
31
31
|
readonly tools: {
|
|
32
32
|
readonly list: (filter?: ToolListFilter) => Effect.Effect<readonly Tool[], StorageFailure>;
|
|
33
|
-
/** Fetch a tool's
|
|
33
|
+
/** Fetch a tool's schema view: JSON schemas with `$defs`
|
|
34
34
|
* attached from the core `definition` table, plus TypeScript
|
|
35
|
-
* preview strings
|
|
36
|
-
* tool ids. */
|
|
35
|
+
* preview strings. Returns `null` for unknown tool ids. */
|
|
37
36
|
readonly schema: (toolId: string) => Effect.Effect<ToolSchema | null, StorageFailure>;
|
|
38
37
|
/** Every `$defs` entry across every source, grouped by source id.
|
|
39
38
|
* Used for bulk schema export and downstream TypeScript rendering. */
|
|
@@ -50,6 +49,20 @@ export type Executor<TPlugins extends readonly AnyPlugin[] = []> = {
|
|
|
50
49
|
readonly detect: (url: string) => Effect.Effect<readonly SourceDetectionResult[], StorageFailure>;
|
|
51
50
|
/** All `$defs` registered for a single source, keyed by def name. */
|
|
52
51
|
readonly definitions: (sourceId: string) => Effect.Effect<Record<string, unknown>, StorageFailure>;
|
|
52
|
+
readonly configure: (input: {
|
|
53
|
+
readonly source: {
|
|
54
|
+
readonly id: string;
|
|
55
|
+
readonly scope: ScopeId | string;
|
|
56
|
+
};
|
|
57
|
+
readonly scope: ScopeId | string;
|
|
58
|
+
readonly type?: string;
|
|
59
|
+
readonly config: unknown;
|
|
60
|
+
}) => Effect.Effect<unknown, StorageFailure>;
|
|
61
|
+
readonly listBindings: (input: SourceCredentialBindingSourceInput) => Effect.Effect<readonly CredentialBindingRef[], StorageFailure>;
|
|
62
|
+
readonly resolveBinding: (input: SourceCredentialBindingSlotInput) => Effect.Effect<CredentialBindingRef | null, StorageFailure>;
|
|
63
|
+
readonly setBinding: (input: SetSourceCredentialBindingInput) => Effect.Effect<CredentialBindingRef, StorageFailure>;
|
|
64
|
+
readonly removeBinding: (input: RemoveSourceCredentialBindingInput) => Effect.Effect<void, StorageFailure>;
|
|
65
|
+
readonly replaceBindings: (input: ReplaceSourceCredentialBindingsInput) => Effect.Effect<readonly CredentialBindingRef[], StorageFailure>;
|
|
53
66
|
};
|
|
54
67
|
readonly secrets: {
|
|
55
68
|
readonly get: (id: string) => Effect.Effect<string | null, SecretOwnedByConnectionError | StorageFailure>;
|
|
@@ -118,7 +131,15 @@ export type Executor<TPlugins extends readonly AnyPlugin[] = []> = {
|
|
|
118
131
|
};
|
|
119
132
|
readonly close: () => Effect.Effect<void, StorageFailure>;
|
|
120
133
|
} & PluginExtensions<TPlugins>;
|
|
121
|
-
export interface
|
|
134
|
+
export interface ExecutorDb {
|
|
135
|
+
readonly db: FumaDb<any>;
|
|
136
|
+
readonly close?: () => Effect.Effect<void, StorageFailure> | Promise<void> | void;
|
|
137
|
+
}
|
|
138
|
+
export type ExecutorDbInput = FumaDb<any> | ExecutorDb;
|
|
139
|
+
export type ExecutorDbFactory = (config: {
|
|
140
|
+
readonly tables: FumaTables;
|
|
141
|
+
}) => ExecutorDbInput | Effect.Effect<ExecutorDbInput, StorageFailure>;
|
|
142
|
+
export interface ExecutorConfig<TPlugins extends readonly AnyPlugin[] = readonly []> {
|
|
122
143
|
/**
|
|
123
144
|
* Precedence-ordered scope stack. Innermost first; typical shape is
|
|
124
145
|
* `[userInOrgScope, orgScope]`. Reads on scoped tables walk the
|
|
@@ -127,8 +148,7 @@ export interface ExecutorConfig<TPlugins extends readonly AnyPlugin[] = []> {
|
|
|
127
148
|
* Must be non-empty.
|
|
128
149
|
*/
|
|
129
150
|
readonly scopes: readonly Scope[];
|
|
130
|
-
readonly
|
|
131
|
-
readonly blobs: BlobStore;
|
|
151
|
+
readonly db?: ExecutorDbInput | ExecutorDbFactory;
|
|
132
152
|
readonly plugins?: TPlugins;
|
|
133
153
|
/**
|
|
134
154
|
* How to respond when a tool requests user input mid-invocation. Pass
|
|
@@ -147,7 +167,21 @@ export interface ExecutorConfig<TPlugins extends readonly AnyPlugin[] = []> {
|
|
|
147
167
|
readonly timeout?: Duration.Input;
|
|
148
168
|
readonly hostedOutboundPolicy?: boolean;
|
|
149
169
|
};
|
|
170
|
+
/**
|
|
171
|
+
* Enable the built-in `core-tools` plugin which contributes
|
|
172
|
+
* agent-facing static tools (`scopes.list`, `secrets.list`,
|
|
173
|
+
* `secrets.create`). The `webBaseUrl` is where the executor's web
|
|
174
|
+
* UI lives; `secrets.create` builds a URL elicitation that points
|
|
175
|
+
* the user at `${webBaseUrl}/secrets?...` so the plaintext value
|
|
176
|
+
* never crosses the agent.
|
|
177
|
+
*
|
|
178
|
+
* Omit to skip registration (tests, MCP-only hosts that don't
|
|
179
|
+
* surface a web UI, etc.).
|
|
180
|
+
*/
|
|
181
|
+
readonly coreTools?: {
|
|
182
|
+
readonly webBaseUrl: string;
|
|
183
|
+
};
|
|
150
184
|
}
|
|
151
|
-
export declare const
|
|
152
|
-
export declare const createExecutor: <const TPlugins extends readonly AnyPlugin[] = []>(config: ExecutorConfig<TPlugins>) => Effect.Effect<Executor<TPlugins>, StorageFailure>;
|
|
185
|
+
export declare const collectTables: (plugins: readonly AnyPlugin[]) => FumaTables;
|
|
186
|
+
export declare const createExecutor: <const TPlugins extends readonly AnyPlugin[] = readonly []>(config: ExecutorConfig<TPlugins>) => Effect.Effect<Executor<TPlugins>, StorageFailure>;
|
|
153
187
|
//# sourceMappingURL=executor.d.ts.map
|
package/dist/executor.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executor.d.ts","sourceRoot":"","sources":["../src/executor.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"executor.d.ts","sourceRoot":"","sources":["../src/executor.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,QAAQ,EACR,MAAM,EACN,KAAK,EAON,MAAM,QAAQ,CAAC;AAChB,OAAO,EAAmB,KAAK,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAMxE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAE9D,OAAO,EAIL,KAAK,MAAM,EAEX,KAAK,UAAU,EACf,KAAK,cAAc,EACpB,MAAM,gBAA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;;;OAMG;IACH,QAAQ,CAAC,aAAa,EAAE,aAAa,CAAC;IACtC,QAAQ,CAAC,eAAe,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;IAC9D,QAAQ,CAAC,sBAAsB,CAAC,EAAE,sBAAsB,CAAC;IACzD,QAAQ,CAAC,eAAe,CAAC,EAAE;QACzB,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;QAC/B,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;QAC/B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;QAC7B,QAAQ,CAAC,OAAO,CAAC,EAAE,QAAQ,CAAC,KAAK,CAAC;QAClC,QAAQ,CAAC,oBAAoB,CAAC,EAAE,OAAO,CAAC;KACzC,CAAC;IACF;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE;QACnB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;KAC7B,CAAC;CACH;AAOD,eAAO,MAAM,aAAa,GAAI,SAAS,SAAS,SAAS,EAAE,KAAG,UAqB7D,CAAC;AA+mBF,eAAO,MAAM,cAAc,GAAI,KAAK,CAAC,QAAQ,SAAS,SAAS,SAAS,EAAE,GAAG,SAAS,EAAE,EACtF,QAAQ,cAAc,CAAC,QAAQ,CAAC,KAC/B,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,cAAc,CAkkG/C,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { Cause, Context, Effect, Layer } from "effect";
|
|
2
|
+
import type { AbstractQuery } from "fumadb/query";
|
|
3
|
+
import type { AnySchema, AnyTable, Schema as FumaSchema } from "fumadb/schema";
|
|
4
|
+
declare const StorageError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => Cause.YieldableError & {
|
|
5
|
+
readonly _tag: "StorageError";
|
|
6
|
+
} & Readonly<A>;
|
|
7
|
+
export declare class StorageError extends StorageError_base<{
|
|
8
|
+
readonly message: string;
|
|
9
|
+
readonly cause: unknown;
|
|
10
|
+
}> {
|
|
11
|
+
}
|
|
12
|
+
declare const UniqueViolationError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => Cause.YieldableError & {
|
|
13
|
+
readonly _tag: "UniqueViolationError";
|
|
14
|
+
} & Readonly<A>;
|
|
15
|
+
export declare class UniqueViolationError extends UniqueViolationError_base<{
|
|
16
|
+
readonly model?: string;
|
|
17
|
+
}> {
|
|
18
|
+
}
|
|
19
|
+
export type StorageFailure = StorageError | UniqueViolationError;
|
|
20
|
+
export type FumaTables = Record<string, AnyTable>;
|
|
21
|
+
type EmptyFumaSchema = FumaSchema<"latest", Record<never, never>>;
|
|
22
|
+
export type TablesToFumaSchema<TTables extends FumaTables | undefined> = TTables extends FumaTables ? string extends keyof TTables ? AnySchema : FumaSchema<"latest", TTables> : EmptyFumaSchema;
|
|
23
|
+
export type FumaDb<TSchema extends AnySchema = AnySchema> = AbstractQuery<TSchema>;
|
|
24
|
+
export type FumaQuery<TSchema extends AnySchema = AnySchema> = Omit<AbstractQuery<TSchema>, "internal" | "withContext" | "transaction"> & {
|
|
25
|
+
readonly transaction: <A>(run: (db: FumaQuery<TSchema>) => Promise<A>) => Promise<A>;
|
|
26
|
+
};
|
|
27
|
+
export type FumaRow<TTable extends AnyTable> = Omit<{
|
|
28
|
+
readonly [K in keyof TTable["columns"]]: TTable["columns"][K]["$out"];
|
|
29
|
+
}, "row_id">;
|
|
30
|
+
export declare const isStorageFailure: (error: unknown) => error is StorageFailure;
|
|
31
|
+
export declare const fumaFailureFromCause: (label: string, cause: unknown) => StorageFailure;
|
|
32
|
+
export declare const fumaEffect: <A>(label: string, run: () => Promise<A>) => Effect.Effect<A, StorageFailure>;
|
|
33
|
+
export declare const activeFumaDbRef: Context.Reference<FumaDb<AnySchema> | null>;
|
|
34
|
+
export type IFumaClient<TSchema extends AnySchema = AnySchema> = Readonly<{
|
|
35
|
+
use: <A>(label: string, fn: (db: FumaQuery<TSchema>) => Promise<A>) => Effect.Effect<A, StorageFailure>;
|
|
36
|
+
transaction: <A, E>(effect: Effect.Effect<A, E>) => Effect.Effect<A, E | StorageFailure>;
|
|
37
|
+
}>;
|
|
38
|
+
export interface MakeFumaClientOptions {
|
|
39
|
+
readonly tables?: ReadonlySet<string>;
|
|
40
|
+
}
|
|
41
|
+
export declare const makeFumaClient: (db: FumaDb, options?: MakeFumaClientOptions) => IFumaClient;
|
|
42
|
+
declare const FumaClient_base: Context.ServiceClass<FumaClient, "executor/FumaClient", Readonly<{
|
|
43
|
+
use: <A>(label: string, fn: (db: FumaQuery<AnySchema>) => Promise<A>) => Effect.Effect<A, StorageFailure, never>;
|
|
44
|
+
transaction: <A, E>(effect: Effect.Effect<A, E>) => Effect.Effect<A, E | StorageFailure>;
|
|
45
|
+
}>>;
|
|
46
|
+
export declare class FumaClient extends FumaClient_base {
|
|
47
|
+
static layer: (db: FumaDb) => Layer.Layer<FumaClient, never, never>;
|
|
48
|
+
}
|
|
49
|
+
export {};
|
|
50
|
+
//# sourceMappingURL=fuma-runtime.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fuma-runtime.d.ts","sourceRoot":"","sources":["../src/fuma-runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,OAAO,EAAQ,MAAM,EAAQ,KAAK,EAAa,MAAM,QAAQ,CAAC;AAC9E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,eAAe,CAAC;;;;AAE/E,qBAAa,YAAa,SAAQ,kBAAiC;IACjE,QAAQ,CAAC,OAAO,EAAE,MAA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F,qBAAa,UAAW,SAAQ,eAAiE;IAC/F,MAAM,CAAC,KAAK,GAAI,IAAI,MAAM,2CAA6C;CACxE"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { type ConfiguredCredentialValue, type CredentialBindingValue, type ScopedSecretCredentialInput } from "./shared";
|
|
3
|
+
export declare const HttpCredentialInput: Schema.Union<readonly [Schema.String, Schema.Struct<{
|
|
4
|
+
readonly kind: Schema.Literal<"text">;
|
|
5
|
+
readonly text: Schema.String;
|
|
6
|
+
readonly prefix: Schema.optional<Schema.String>;
|
|
7
|
+
}>, Schema.Struct<{
|
|
8
|
+
readonly kind: Schema.Literal<"secret">;
|
|
9
|
+
readonly secretId: Schema.String;
|
|
10
|
+
readonly secretScope: Schema.optional<Schema.String>;
|
|
11
|
+
readonly prefix: Schema.optional<Schema.String>;
|
|
12
|
+
}>, Schema.Struct<{
|
|
13
|
+
readonly kind: Schema.Literal<"connection">;
|
|
14
|
+
readonly connectionId: Schema.String;
|
|
15
|
+
}>]>;
|
|
16
|
+
export type HttpCredentialInput = typeof HttpCredentialInput.Type;
|
|
17
|
+
export type HttpCredentialInputType = HttpCredentialInput;
|
|
18
|
+
export declare const HttpConfiguredValueInput: Schema.Union<readonly [Schema.String, Schema.Struct<{
|
|
19
|
+
readonly kind: Schema.Literal<"secret">;
|
|
20
|
+
readonly prefix: Schema.optional<Schema.String>;
|
|
21
|
+
}>]>;
|
|
22
|
+
export type HttpConfiguredValueInput = typeof HttpConfiguredValueInput.Type;
|
|
23
|
+
export type HttpConfiguredValueInputType = HttpConfiguredValueInput;
|
|
24
|
+
export declare const OAuth2Flow: Schema.Literals<readonly ["authorizationCode", "clientCredentials"]>;
|
|
25
|
+
export type OAuth2Flow = typeof OAuth2Flow.Type;
|
|
26
|
+
export type OAuth2FlowType = OAuth2Flow;
|
|
27
|
+
export declare const OAuth2SourceConfig: Schema.Struct<{
|
|
28
|
+
readonly kind: Schema.Literal<"oauth2">;
|
|
29
|
+
readonly securitySchemeName: Schema.String;
|
|
30
|
+
readonly flow: Schema.Literals<readonly ["authorizationCode", "clientCredentials"]>;
|
|
31
|
+
readonly tokenUrl: Schema.String;
|
|
32
|
+
readonly authorizationUrl: Schema.withDecodingDefault<Schema.optional<Schema.NullOr<Schema.String>>>;
|
|
33
|
+
readonly issuerUrl: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
34
|
+
readonly clientIdSlot: Schema.String;
|
|
35
|
+
readonly clientSecretSlot: Schema.NullOr<Schema.String>;
|
|
36
|
+
readonly connectionSlot: Schema.String;
|
|
37
|
+
readonly scopes: Schema.$Array<Schema.String>;
|
|
38
|
+
}>;
|
|
39
|
+
export type OAuth2SourceConfig = typeof OAuth2SourceConfig.Type;
|
|
40
|
+
export type OAuth2SourceConfigType = OAuth2SourceConfig;
|
|
41
|
+
export declare const HttpOAuthConfigureInput: Schema.Struct<{
|
|
42
|
+
readonly clientId: Schema.optional<Schema.Union<readonly [Schema.String, Schema.Struct<{
|
|
43
|
+
readonly kind: Schema.Literal<"text">;
|
|
44
|
+
readonly text: Schema.String;
|
|
45
|
+
readonly prefix: Schema.optional<Schema.String>;
|
|
46
|
+
}>, Schema.Struct<{
|
|
47
|
+
readonly kind: Schema.Literal<"secret">;
|
|
48
|
+
readonly secretId: Schema.String;
|
|
49
|
+
readonly secretScope: Schema.optional<Schema.String>;
|
|
50
|
+
readonly prefix: Schema.optional<Schema.String>;
|
|
51
|
+
}>, Schema.Struct<{
|
|
52
|
+
readonly kind: Schema.Literal<"connection">;
|
|
53
|
+
readonly connectionId: Schema.String;
|
|
54
|
+
}>]>>;
|
|
55
|
+
readonly clientSecret: Schema.optional<Schema.NullOr<Schema.Union<readonly [Schema.String, Schema.Struct<{
|
|
56
|
+
readonly kind: Schema.Literal<"text">;
|
|
57
|
+
readonly text: Schema.String;
|
|
58
|
+
readonly prefix: Schema.optional<Schema.String>;
|
|
59
|
+
}>, Schema.Struct<{
|
|
60
|
+
readonly kind: Schema.Literal<"secret">;
|
|
61
|
+
readonly secretId: Schema.String;
|
|
62
|
+
readonly secretScope: Schema.optional<Schema.String>;
|
|
63
|
+
readonly prefix: Schema.optional<Schema.String>;
|
|
64
|
+
}>, Schema.Struct<{
|
|
65
|
+
readonly kind: Schema.Literal<"connection">;
|
|
66
|
+
readonly connectionId: Schema.String;
|
|
67
|
+
}>]>>>;
|
|
68
|
+
readonly connection: Schema.optional<Schema.Union<readonly [Schema.String, Schema.Struct<{
|
|
69
|
+
readonly kind: Schema.Literal<"text">;
|
|
70
|
+
readonly text: Schema.String;
|
|
71
|
+
readonly prefix: Schema.optional<Schema.String>;
|
|
72
|
+
}>, Schema.Struct<{
|
|
73
|
+
readonly kind: Schema.Literal<"secret">;
|
|
74
|
+
readonly secretId: Schema.String;
|
|
75
|
+
readonly secretScope: Schema.optional<Schema.String>;
|
|
76
|
+
readonly prefix: Schema.optional<Schema.String>;
|
|
77
|
+
}>, Schema.Struct<{
|
|
78
|
+
readonly kind: Schema.Literal<"connection">;
|
|
79
|
+
readonly connectionId: Schema.String;
|
|
80
|
+
}>]>>;
|
|
81
|
+
}>;
|
|
82
|
+
export type HttpOAuthConfigureInput = typeof HttpOAuthConfigureInput.Type;
|
|
83
|
+
export type HttpOAuthConfigureInputType = HttpOAuthConfigureInput;
|
|
84
|
+
export type HttpCredentialSection = "request" | "specFetch" | "introspection";
|
|
85
|
+
export type HttpCredentialPlacement = "headers" | "query";
|
|
86
|
+
export declare const httpCredentialSlotKey: (section: HttpCredentialSection, placement: HttpCredentialPlacement, name: string) => string;
|
|
87
|
+
export declare const httpHeaderSlotKey: (section: HttpCredentialSection, name: string) => string;
|
|
88
|
+
export declare const httpQuerySlotKey: (section: HttpCredentialSection, name: string) => string;
|
|
89
|
+
export declare const httpOAuthConnectionSlotKey: (section: HttpCredentialSection) => string;
|
|
90
|
+
export declare const httpOAuthClientIdSlotKey: (section: HttpCredentialSection) => string;
|
|
91
|
+
export declare const httpOAuthClientSecretSlotKey: (section: HttpCredentialSection) => string;
|
|
92
|
+
export declare const httpSectionSlotPrefix: (section: HttpCredentialSection) => string;
|
|
93
|
+
export type HttpNamedCredentialInput = ConfiguredCredentialValue | ScopedSecretCredentialInput | {
|
|
94
|
+
readonly secretId: string;
|
|
95
|
+
readonly prefix?: string;
|
|
96
|
+
readonly targetScope?: string;
|
|
97
|
+
readonly secretScopeId?: string;
|
|
98
|
+
};
|
|
99
|
+
export interface CompiledHttpNamedCredentialBinding {
|
|
100
|
+
readonly slot: string;
|
|
101
|
+
readonly value: CredentialBindingValue;
|
|
102
|
+
readonly targetScope?: string;
|
|
103
|
+
}
|
|
104
|
+
export declare const compileHttpNamedCredentialMap: (values: Record<string, HttpNamedCredentialInput | HttpCredentialInput> | undefined, slotForName: (name: string) => string) => {
|
|
105
|
+
readonly values: Record<string, ConfiguredCredentialValue>;
|
|
106
|
+
readonly bindings: readonly CompiledHttpNamedCredentialBinding[];
|
|
107
|
+
};
|
|
108
|
+
export declare const httpCredentialInputToBindingValue: (input: HttpCredentialInput) => CredentialBindingValue;
|
|
109
|
+
//# sourceMappingURL=http-source.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http-source.d.ts","sourceRoot":"","sources":["../src/http-source.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,MAAM,EAAE,MAAM,QAAQ,CAAC;AAExC,OAAO,EAIL,KAAK,yBAAyB,EAC9B,KAAK,sBAAsB,EAC3B,KAAK,2BAA2B,EAGjC,MAAM,UAAU,CAAC;AAElB,eAAO,MAAM,mBAAmB;;;;;;;;;;;;IAiB9B,CAAC;AACH,MAAM,MAAM,mBAAmB,GAAG,OAAO,mBAAmB,CAAC,IAAI,CAAC;AAClE,MAAM,MAAM,uBAAuB,GAAG,mBAAmB,CAAC;AAE1D,eAAO,MAAM,wBAAwB;;;IAMnC,CAAC;AACH,MAAM,MAAM,wBAAwB,GAAG,OAAO,wBAAwB,CAAC,IAAI,CAAC;AAC5E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