@ontemper/sdk 0.9.0-oauth.1 → 0.9.0-oauth.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +33 -17
- package/dist/AccessTokens.d.ts +10 -8
- package/dist/AccessTokens.d.ts.map +1 -1
- package/dist/AccessTokens.js +54 -25
- package/dist/AccessTokens.js.map +1 -1
- package/dist/Contract/RuntimeApi.d.ts +42 -0
- package/dist/Contract/RuntimeApi.d.ts.map +1 -1
- package/dist/Contract/RuntimeApi.js +51 -0
- package/dist/Contract/RuntimeApi.js.map +1 -1
- package/dist/Contract/index.d.ts +1 -1
- package/dist/Contract/index.d.ts.map +1 -1
- package/dist/Contract/index.js +1 -1
- package/dist/Contract/index.js.map +1 -1
- package/dist/HttpApiClient.d.ts +6 -4
- package/dist/HttpApiClient.d.ts.map +1 -1
- package/dist/HttpApiClient.js +25 -56
- package/dist/HttpApiClient.js.map +1 -1
- package/dist/HttpApiResource.d.ts +133 -0
- package/dist/HttpApiResource.d.ts.map +1 -1
- package/dist/HttpApiResource.js +16 -3
- package/dist/HttpApiResource.js.map +1 -1
- package/dist/Kafka.d.ts.map +1 -1
- package/dist/Kafka.js +1 -2
- package/dist/Kafka.js.map +1 -1
- package/dist/Manifest.d.ts +1 -1
- package/dist/Manifest.js +1 -1
- package/dist/OAuthToken.d.ts +33 -6
- package/dist/OAuthToken.d.ts.map +1 -1
- package/dist/OAuthToken.js +51 -10
- package/dist/OAuthToken.js.map +1 -1
- package/dist/RuntimeResources.d.ts +8 -1
- package/dist/RuntimeResources.d.ts.map +1 -1
- package/dist/RuntimeResources.js +33 -10
- package/dist/RuntimeResources.js.map +1 -1
- package/dist/Workflow.d.ts.map +1 -1
- package/dist/Workflow.js +5 -3
- package/dist/Workflow.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/testing.d.ts +9 -3
- package/dist/testing.d.ts.map +1 -1
- package/dist/testing.js +64 -6
- package/dist/testing.js.map +1 -1
- package/package.json +6 -2
package/README.md
CHANGED
|
@@ -150,11 +150,11 @@ const partners = yield * PartnerApis;
|
|
|
150
150
|
const { key, value } = yield * partners.select({ tenantKey }); // ResourceNotFoundError when no record matches
|
|
151
151
|
```
|
|
152
152
|
|
|
153
|
-
- `HttpApiResource` reads the `http_api` type at catalog revision
|
|
153
|
+
- `HttpApiResource` reads the `http_api` type at catalog revision 3. `auth` is one of `none`, `basic`,
|
|
154
154
|
`bearer`, `api_key`, `oauth2_client_credentials`, `oauth2_password`, `oauth2_jwt_bearer`, `oauth1_tba`,
|
|
155
155
|
or `aws_sigv4`. The two token-grant variants hold the client in `auth.tokenRequest`
|
|
156
156
|
(`OAuthTokenRequest`: `tokenUrl`, `clientId`, `clientAuthentication`, and `tokenRequestFormat`, `form`
|
|
157
|
-
by default). An auth `type` that a newer platform adds decodes as
|
|
157
|
+
by default; `HttpApiOAuthTokenRequest` adds the optional token-request `headers`). An auth `type` that a newer platform adds decodes as
|
|
158
158
|
`{ type: 'unsupported', variant, fields }`, with `fields` `Redacted`. A known type with a missing or
|
|
159
159
|
invalid field fails. The record can also carry `tls`, `proxy`, and `secondaryTenantKey`.
|
|
160
160
|
- Every `x-secret` field of a system type decodes to `Redacted`: for example `clientSecret`, `privateKey`,
|
|
@@ -222,24 +222,40 @@ const response = yield * carrier.get('/v1/shipments');
|
|
|
222
222
|
```
|
|
223
223
|
|
|
224
224
|
The client applies `none`, `basic`, `bearer`, `api_key`, `oauth2_client_credentials`, and `oauth2_password`.
|
|
225
|
-
For the two OAuth types, workflow code holds no token:
|
|
226
|
-
|
|
227
|
-
- The
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
225
|
+
For the two OAuth types, workflow code holds no token, and the VM never logs in to the partner:
|
|
226
|
+
|
|
227
|
+
- The Temper API logs in with the record's `tokenRequest`, including `private_key_jwt` client authentication and
|
|
228
|
+
the token-request `headers` (for example a login API key), and keeps the token in its memory. Every VM of
|
|
229
|
+
the organization that uses the same login gets that token until 60 seconds before it expires. Each API
|
|
230
|
+
process logs in on its own, so the partner must accept tokens from several API processes at the same time.
|
|
231
|
+
The client asks for the token at `POST /api/v1/runtime/resources/access-token`, within one 20-second deadline.
|
|
232
|
+
- The key must name a stored `http_api` record in the workflow's reach: the API resolves the key itself, so a
|
|
233
|
+
record that workflow code builds gets no token.
|
|
234
|
+
- The client names the login identity of its record: a hash of the base URL, auth type, token URL, client id,
|
|
235
|
+
and username, without secrets. When the key names a record with another identity, the call fails with
|
|
236
|
+
`Resource <key> changed since this workflow read it`.
|
|
237
|
+
- The client keeps the token in the memory of this VM until 30 seconds before it expires, per resource key and
|
|
238
|
+
login identity. Two records read under one key, such as two tenants, never share a token. A rotated secret
|
|
239
|
+
keeps the held token until it expires or the partner answers 401. Concurrent calls for one login share one
|
|
240
|
+
request to the API. A token answer without a lifetime serves one call.
|
|
241
|
+
- A failed or interrupted request keeps no token, so the next call asks again. A failed partner login fails the
|
|
242
|
+
call with an `HttpClientError` that names the key, the partner's HTTP status, and its OAuth error code.
|
|
243
|
+
- After a 401 answer, the client tells the API which token the partner refused and sends the request one more
|
|
244
|
+
time with the token the API answers. A second 401 goes to the workflow. The API logs in again only for a
|
|
245
|
+
refused token whose login is 60 seconds old or more, at most once in 5 seconds; a login the partner refused
|
|
246
|
+
with 400, 401, or 403 answers with that failure for 60 seconds. A request with a stream body is not sent
|
|
247
|
+
again: the workflow gets the 401, and the next call asks the API again.
|
|
248
|
+
|
|
249
|
+
A partner call follows redirects as `fetch` does. On a redirect to another origin, `fetch` removes
|
|
250
|
+
`Authorization` only: an API key in another header, and the record's `headers`, go to that origin. To stop
|
|
251
|
+
that for a partner that redirects, provide `FetchHttpClient.RequestInit` with `redirect: 'manual'` around the call.
|
|
238
252
|
|
|
239
253
|
The client fails with `UnsupportedHttpApiResourceError` and sends nothing for a setting it cannot apply:
|
|
240
254
|
`oauth2_jwt_bearer`, `oauth1_tba`, `aws_sigv4`, an auth type a newer platform added, and TLS or proxy settings
|
|
241
|
-
outside the Bun runtime
|
|
242
|
-
|
|
255
|
+
outside the Bun runtime, and, on an OAuth record, TLS or proxy settings or a token URL that is not https. The
|
|
256
|
+
message is `Resource <key> uses <setting>, which the workflow HTTP client does not support.` In tests,
|
|
257
|
+
`testPlatform({ fetch, resources })` logs in for each token in memory: it sends the record's token request through
|
|
258
|
+
`fetch`.
|
|
243
259
|
|
|
244
260
|
## Invoke in a test
|
|
245
261
|
|
package/dist/AccessTokens.d.ts
CHANGED
|
@@ -1,20 +1,22 @@
|
|
|
1
1
|
import { Effect, Redacted } from 'effect';
|
|
2
|
-
/**
|
|
2
|
+
/** A token the platform issued for one login. */
|
|
3
3
|
export interface IssuedAccessToken {
|
|
4
4
|
/** The credential as the workflow sends it, for example the `access_token`. */
|
|
5
5
|
readonly token: Redacted.Redacted<string>;
|
|
6
|
-
/**
|
|
7
|
-
readonly expiresIn: number;
|
|
6
|
+
/** Seconds of lifetime left when the request started. `null` means "use once"; a lifetime under 30 s is used once too. */
|
|
7
|
+
readonly expiresIn: number | null;
|
|
8
8
|
}
|
|
9
9
|
export interface AccessTokens {
|
|
10
10
|
/**
|
|
11
|
-
* A usable token for `login`: the one this VM holds, else a new one from `request
|
|
12
|
-
*
|
|
11
|
+
* A usable token for `login`: the one this VM holds, else a new one from `request`, which receives the token
|
|
12
|
+
* the partner last refused for this login. That refusal goes on one request only: it is cleared when the request
|
|
13
|
+
* settles, unless the request is interrupted. Concurrent calls for one login share one request, and its answer,
|
|
14
|
+
* also a use-once token. A failed or interrupted `request` keeps no token.
|
|
13
15
|
*/
|
|
14
|
-
readonly get: <E, R>(login: string, request: Effect.Effect<IssuedAccessToken, E, R>) => Effect.Effect<Redacted.Redacted<string>, E, R>;
|
|
15
|
-
/** Reports a token the partner refused (a 401): this VM
|
|
16
|
+
readonly get: <E, R>(login: string, request: (refused: string | undefined) => Effect.Effect<IssuedAccessToken, E, R>) => Effect.Effect<Redacted.Redacted<string>, E, R>;
|
|
17
|
+
/** Reports a token the partner refused (a 401): this VM drops it, and the next request names it. */
|
|
16
18
|
readonly refuse: (login: string, token: Redacted.Redacted<string>) => Effect.Effect<void>;
|
|
17
19
|
}
|
|
18
|
-
/**
|
|
20
|
+
/** Platform-issued access tokens held in the memory of this VM and reused until they expire. */
|
|
19
21
|
export declare const makeAccessTokens: () => AccessTokens;
|
|
20
22
|
//# sourceMappingURL=AccessTokens.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AccessTokens.d.ts","sourceRoot":"","sources":["../src/AccessTokens.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"AccessTokens.d.ts","sourceRoot":"","sources":["../src/AccessTokens.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0B,MAAM,EAAgB,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAMhF,iDAAiD;AACjD,MAAM,WAAW,iBAAiB;IAChC,+EAA+E;IAC/E,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC1C,0HAA0H;IAC1H,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CACnC;AAED,MAAM,WAAW,YAAY;IAC3B;;;;;OAKG;IACH,QAAQ,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,EACjB,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,KAAK,MAAM,CAAC,MAAM,CAAC,iBAAiB,EAAE,CAAC,EAAE,CAAC,CAAC,KAC7E,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IACpD,oGAAoG;IACpG,QAAQ,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;CAC3F;AAeD,gGAAgG;AAChG,eAAO,MAAM,gBAAgB,QAAO,YAyEnC,CAAC"}
|
package/dist/AccessTokens.js
CHANGED
|
@@ -1,39 +1,68 @@
|
|
|
1
|
-
import { Clock, Effect,
|
|
1
|
+
import { Cause, Clock, Deferred, Effect, Exit, Option, Redacted } from 'effect';
|
|
2
2
|
import { registerSecrets } from './Redaction.js';
|
|
3
3
|
// A token this close to its expiry could lapse mid-request, so it counts as spent (as in legacy `unnbound-env`).
|
|
4
4
|
const EXPIRY_MARGIN_MS = 30_000;
|
|
5
5
|
const usable = (expiresAt, now) => expiresAt - EXPIRY_MARGIN_MS > now;
|
|
6
|
-
/**
|
|
6
|
+
/** Platform-issued access tokens held in the memory of this VM and reused until they expire. */
|
|
7
7
|
export const makeAccessTokens = () => {
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
const existing = locks.get(login);
|
|
8
|
+
const logins = new Map();
|
|
9
|
+
const loginOf = (login) => {
|
|
10
|
+
const existing = logins.get(login);
|
|
12
11
|
if (existing !== undefined)
|
|
13
12
|
return existing;
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
return
|
|
13
|
+
const created = { held: undefined, refused: undefined, flight: undefined };
|
|
14
|
+
logins.set(login, created);
|
|
15
|
+
return created;
|
|
16
|
+
};
|
|
17
|
+
// The waiters of a request share its outcome; an interrupted request hands them none, and they start over.
|
|
18
|
+
const settle = (state, flight, refused, exit) => {
|
|
19
|
+
state.flight = undefined;
|
|
20
|
+
const interrupted = Exit.isFailure(exit) && Cause.hasInterruptsOnly(exit.cause);
|
|
21
|
+
// A refusal reported while the request ran is newer, so it stays for the next request.
|
|
22
|
+
if (!interrupted && state.refused === refused)
|
|
23
|
+
state.refused = undefined;
|
|
24
|
+
if (Exit.isSuccess(exit))
|
|
25
|
+
Deferred.doneUnsafe(flight, Exit.succeed(Option.some(exit.value)));
|
|
26
|
+
else if (interrupted)
|
|
27
|
+
Deferred.doneUnsafe(flight, Exit.succeed(Option.none()));
|
|
28
|
+
else
|
|
29
|
+
Deferred.doneUnsafe(flight, Exit.failCause(exit.cause));
|
|
17
30
|
};
|
|
18
31
|
const get = (login, request) => Effect.gen(function* () {
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
32
|
+
const state = loginOf(login);
|
|
33
|
+
const now = yield* Clock.currentTimeMillis;
|
|
34
|
+
if (state.held !== undefined && usable(state.held.expiresAt, now)) {
|
|
35
|
+
// A cached token may reach a request this VM serves later, so its mask registers on every hit.
|
|
36
|
+
yield* registerSecrets([state.held.token]);
|
|
37
|
+
return Redacted.make(state.held.token);
|
|
38
|
+
}
|
|
39
|
+
if (state.flight !== undefined) {
|
|
40
|
+
// SAFETY: one client builds every request of a login, so the flight fails only with that request's error type.
|
|
41
|
+
const shared = yield* Deferred.await(state.flight);
|
|
42
|
+
return Option.isSome(shared) ? Redacted.make(shared.value) : yield* get(login, request);
|
|
22
43
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
44
|
+
const flight = Deferred.makeUnsafe();
|
|
45
|
+
state.flight = flight;
|
|
46
|
+
const { refused } = state;
|
|
47
|
+
return yield* Effect.gen(function* () {
|
|
48
|
+
const issued = yield* request(refused);
|
|
49
|
+
const token = Redacted.value(issued.token);
|
|
50
|
+
yield* registerSecrets([token]);
|
|
51
|
+
// The lifetime counts from the start of the request: the platform's clock ran while its answer travelled.
|
|
52
|
+
const expiresAt = now + (issued.expiresIn ?? 0) * 1000;
|
|
53
|
+
state.held =
|
|
54
|
+
issued.expiresIn !== null && usable(expiresAt, yield* Clock.currentTimeMillis)
|
|
55
|
+
? { token, expiresAt }
|
|
56
|
+
: undefined;
|
|
57
|
+
return token;
|
|
58
|
+
}).pipe(Effect.onExit((exit) => Effect.sync(() => settle(state, flight, refused, exit))), Effect.map((token) => Redacted.make(token)));
|
|
59
|
+
});
|
|
34
60
|
const refuse = (login, token) => Effect.sync(() => {
|
|
35
|
-
|
|
36
|
-
|
|
61
|
+
const state = loginOf(login);
|
|
62
|
+
const value = Redacted.value(token);
|
|
63
|
+
if (state.held?.token === value)
|
|
64
|
+
state.held = undefined;
|
|
65
|
+
state.refused = value;
|
|
37
66
|
});
|
|
38
67
|
return { get, refuse };
|
|
39
68
|
};
|
package/dist/AccessTokens.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AccessTokens.js","sourceRoot":"","sources":["../src/AccessTokens.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"AccessTokens.js","sourceRoot":"","sources":["../src/AccessTokens.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAChF,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEjD,iHAAiH;AACjH,MAAM,gBAAgB,GAAG,MAAM,CAAC;AAoChC,MAAM,MAAM,GAAG,CAAC,SAAiB,EAAE,GAAW,EAAE,EAAE,CAAC,SAAS,GAAG,gBAAgB,GAAG,GAAG,CAAC;AAEtF,gGAAgG;AAChG,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAiB,EAAE;IACjD,MAAM,MAAM,GAAG,IAAI,GAAG,EAAiB,CAAC;IAExC,MAAM,OAAO,GAAG,CAAC,KAAa,EAAS,EAAE;QACvC,MAAM,QAAQ,GAAG,MAAM,CAAC,GAAG,CAAC,KAAK,CA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imeOutputSchema: Schema.Struct<{
|
|
32
32
|
readonly key: Schema.String;
|
|
33
33
|
}>;
|
|
34
|
+
/** A partner OAuth token the platform issued for the login identity the caller named. */
|
|
35
|
+
export declare const IssuedAccessTokenSchema: Schema.Struct<{
|
|
36
|
+
readonly token: Schema.String;
|
|
37
|
+
readonly expiresIn: Schema.NullOr<Schema.Number>;
|
|
38
|
+
readonly redactionMasks: Schema.$Array<Schema.String>;
|
|
39
|
+
}>;
|
|
40
|
+
/** The RFC 6749 section 5.2 error codes a partner refusal can name; any other code is left out. */
|
|
41
|
+
export declare const OAUTH_TOKEN_ERROR_CODES: readonly ['invalid_request', 'invalid_client', 'invalid_grant', 'unauthorized_client', 'unsupported_grant_type', 'invalid_scope'];
|
|
34
42
|
declare const RuntimeResourcesUnauthorizedError_base: Schema.Class<RuntimeResourcesUnauthorizedError, Schema.TaggedStruct<"RuntimeResourcesUnauthorizedError", {
|
|
35
43
|
readonly error: Schema.Literal<"Unauthorized">;
|
|
36
44
|
}>, import("effect/Cause").YieldableError>;
|
|
@@ -61,6 +69,14 @@ declare const RuntimeResourcesUnavailableError_base: Schema.Class<RuntimeResourc
|
|
|
61
69
|
}>, import("effect/Cause").YieldableError>;
|
|
62
70
|
export declare class RuntimeResourcesUnavailableError extends RuntimeResourcesUnavailableError_base {
|
|
63
71
|
}
|
|
72
|
+
declare const RuntimeResourcesPartnerLoginError_base: Schema.Class<RuntimeResourcesPartnerLoginError, Schema.TaggedStruct<"RuntimeResourcesPartnerLoginError", {
|
|
73
|
+
readonly error: Schema.String;
|
|
74
|
+
readonly partnerStatus: Schema.optionalKey<Schema.Number>;
|
|
75
|
+
readonly oauthError: Schema.optionalKey<Schema.Literals<readonly ["invalid_request", "invalid_client", "invalid_grant", "unauthorized_client", "unsupported_grant_type", "invalid_scope"]>>;
|
|
76
|
+
}>, import("effect/Cause").YieldableError>;
|
|
77
|
+
/** The platform's login to the partner token endpoint failed, now or inside the time its last failure still answers. */
|
|
78
|
+
export declare class RuntimeResourcesPartnerLoginError extends RuntimeResourcesPartnerLoginError_base {
|
|
79
|
+
}
|
|
64
80
|
export declare const ResourcesRuntimeApi: HttpApi.HttpApi<"resources-runtime-api", HttpApiGroup.HttpApiGroup<"resourcesRuntime", HttpApiEndpoint.HttpApiEndpoint<"inspectResource", "POST", "/api/v1/runtime/resources/inspect", never, never, Schema.toCodecJson<Schema.Struct<{
|
|
65
81
|
readonly key: Schema.String;
|
|
66
82
|
}>>, Schema.toCodecStringTree<Schema.Struct<{
|
|
@@ -97,6 +113,32 @@ export declare const ResourcesRuntimeApi: HttpApi.HttpApi<"resources-runtime-api
|
|
|
97
113
|
readonly error: Schema.String;
|
|
98
114
|
}>, never, never> | Schema.decodeTo<typeof RuntimeResourcesUnavailableError, Schema.Struct<{
|
|
99
115
|
readonly error: Schema.String;
|
|
116
|
+
}>, never, never>>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"issueAccessToken", "POST", "/api/v1/runtime/resources/access-token", never, never, Schema.toCodecJson<Schema.Struct<{
|
|
117
|
+
readonly key: Schema.String;
|
|
118
|
+
readonly identity: Schema.String;
|
|
119
|
+
readonly refused: Schema.optionalKey<Schema.String>;
|
|
120
|
+
}>>, Schema.toCodecStringTree<Schema.Struct<{
|
|
121
|
+
readonly authorization: Schema.optionalKey<Schema.String>;
|
|
122
|
+
}>>, Schema.toCodecJson<Schema.Struct<{
|
|
123
|
+
readonly token: Schema.String;
|
|
124
|
+
readonly expiresIn: Schema.NullOr<Schema.Number>;
|
|
125
|
+
readonly redactionMasks: Schema.$Array<Schema.String>;
|
|
126
|
+
}>>, Schema.toCodecJson<Schema.decodeTo<typeof RuntimeResourcesUnauthorizedError, Schema.Struct<{
|
|
127
|
+
readonly error: Schema.Literal<"Unauthorized">;
|
|
128
|
+
}>, never, never> | Schema.decodeTo<typeof RuntimeResourcesForbiddenError, Schema.Struct<{
|
|
129
|
+
readonly error: Schema.Literal<"Forbidden">;
|
|
130
|
+
}>, never, never> | Schema.decodeTo<typeof RuntimeResourcesNotFoundError, Schema.Struct<{
|
|
131
|
+
readonly error: Schema.Literal<"Not found">;
|
|
132
|
+
}>, never, never> | Schema.decodeTo<typeof RuntimeResourcesBadRequestError, Schema.Struct<{
|
|
133
|
+
readonly error: Schema.String;
|
|
134
|
+
}>, never, never> | Schema.decodeTo<typeof RuntimeResourcesConflictError, Schema.Struct<{
|
|
135
|
+
readonly error: Schema.String;
|
|
136
|
+
}>, never, never> | Schema.decodeTo<typeof RuntimeResourcesUnavailableError, Schema.Struct<{
|
|
137
|
+
readonly error: Schema.String;
|
|
138
|
+
}>, never, never> | Schema.decodeTo<typeof RuntimeResourcesPartnerLoginError, Schema.Struct<{
|
|
139
|
+
readonly error: Schema.String;
|
|
140
|
+
readonly partnerStatus: Schema.optionalKey<Schema.Number>;
|
|
141
|
+
readonly oauthError: Schema.optionalKey<Schema.Literals<readonly ["invalid_request", "invalid_client", "invalid_grant", "unauthorized_client", "unsupported_grant_type", "invalid_scope"]>>;
|
|
100
142
|
}>, never, never>>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"resolveResource", "POST", "/api/v1/runtime/resources/resolve", never, never, Schema.toCodecJson<Schema.Struct<{
|
|
101
143
|
readonly key: Schema.String;
|
|
102
144
|
}>>, Schema.toCodecStringTree<Schema.Struct<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RuntimeApi.d.ts","sourceRoot":"","sources":["../../src/Contract/RuntimeApi.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,MAAM,EAAgB,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,YAAY,EAA0B,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"RuntimeApi.d.ts","sourceRoot":"","sources":["../../src/Contract/RuntimeApi.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,MAAM,EAAgB,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,YAAY,EAA0B,MAAM,iBAAiB,CAAC;AAWjG,eAAO,MAAM,gCAAgC;;;EAK3C,CAAC;AAmBH,yHAAyH;AACzH,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;EAyBzC,CAAC;AAOH,eAAO,MAAM,iCAAiC;;EAE5C,CAAC;AAqBH,yFAAyF;AACzF,eAAO,MAAM,uBAAuB;;;;EAOlC,CAAC;AAEH,mGAAmG;AACnG,eAAO,MAAM,uBAAuB,YAClC,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EACf,qBAAqB,EACrB,wBAAwB,EACxB,eAAe,CACP,CAAC;;;;AAQX,qBAAa,iCAAkC,SAAQ,sCAGtD;CAAG;;;;AAEJ,qBAAa,8BAA+B,SAAQ,mCAGnD;CAAG;;;;AAEJ,qBAAa,6BAA8B,SAAQ,kCAGlD;CAAG;;;;AAEJ,qBAAa,+BAAgC,SAAQ,oCAGpD;CAAG;;;;AAEJ,qBAAa,6BAA8B,SAAQ,kCAGlD;CAAG;;;;AACJ,qBAAa,gCAAiC,SAAQ,qCAGrD;CAAG;;;;;;AASJ,wHAAwH;AACxH,qBAAa,iCAAkC,SAAQ,sCAGtD;CAAG;AAwHJ,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0CAA0E,CAAC"}
|
|
@@ -66,6 +66,32 @@ const SelectResourceRuntimeResponseSchema = Schema.Struct({
|
|
|
66
66
|
value: SelectResourceRuntimeOutputSchema,
|
|
67
67
|
...redactionMasksField,
|
|
68
68
|
});
|
|
69
|
+
const IssueAccessTokenInputSchema = Schema.Struct({
|
|
70
|
+
key: Schema.String.annotate({ description: 'Key of the http_api record whose OAuth login issues the token.' }),
|
|
71
|
+
identity: Schema.String.annotate({
|
|
72
|
+
description: 'Login identity of the record the caller read (httpApiLoginIdentity in @temper/workflow/oauth): "v1:" and the hex SHA-256 of the JSON array [baseUrl, auth.type, tokenUrl, clientId, username or null]. The v1 definition never changes. When the record the key names now has another identity, the answer is 409.',
|
|
73
|
+
}),
|
|
74
|
+
refused: Schema.optionalKey(Schema.String.annotate({
|
|
75
|
+
description: 'A token the partner refused (a 401). The platform serves it again until its login is 60 seconds old, then logs in again.',
|
|
76
|
+
})),
|
|
77
|
+
});
|
|
78
|
+
/** A partner OAuth token the platform issued for the login identity the caller named. */
|
|
79
|
+
export const IssuedAccessTokenSchema = Schema.Struct({
|
|
80
|
+
token: Schema.String.annotate({ description: 'The bearer access token.' }),
|
|
81
|
+
expiresIn: Schema.NullOr(Schema.Number).annotate({
|
|
82
|
+
description: 'Whole seconds of lifetime left, counted from the start of the partner login; always positive. Null: the partner stated none, so use the token once.',
|
|
83
|
+
}),
|
|
84
|
+
redactionMasks: Schema.Array(Schema.String),
|
|
85
|
+
});
|
|
86
|
+
/** The RFC 6749 section 5.2 error codes a partner refusal can name; any other code is left out. */
|
|
87
|
+
export const OAUTH_TOKEN_ERROR_CODES = [
|
|
88
|
+
'invalid_request',
|
|
89
|
+
'invalid_client',
|
|
90
|
+
'invalid_grant',
|
|
91
|
+
'unauthorized_client',
|
|
92
|
+
'unsupported_grant_type',
|
|
93
|
+
'invalid_scope',
|
|
94
|
+
];
|
|
69
95
|
const UnauthorizedBodySchema = Schema.Struct({ error: Schema.Literal('Unauthorized') });
|
|
70
96
|
const ForbiddenBodySchema = Schema.Struct({ error: Schema.Literal('Forbidden') });
|
|
71
97
|
const NotFoundBodySchema = Schema.Struct({ error: Schema.Literal('Not found') });
|
|
@@ -82,6 +108,14 @@ export class RuntimeResourcesConflictError extends Schema.TaggedError()('Runtime
|
|
|
82
108
|
}
|
|
83
109
|
export class RuntimeResourcesUnavailableError extends Schema.TaggedError()('RuntimeResourcesUnavailableError', { error: Schema.String }) {
|
|
84
110
|
}
|
|
111
|
+
const PartnerLoginBodySchema = Schema.Struct({
|
|
112
|
+
error: Schema.String.annotate({ description: 'A fixed message. It never holds a URL, a header, or a body.' }),
|
|
113
|
+
partnerStatus: Schema.optionalKey(Schema.Number.annotate({ description: 'The HTTP status the partner answered.' })),
|
|
114
|
+
oauthError: Schema.optionalKey(Schema.Literals(OAUTH_TOKEN_ERROR_CODES)),
|
|
115
|
+
});
|
|
116
|
+
/** The platform's login to the partner token endpoint failed, now or inside the time its last failure still answers. */
|
|
117
|
+
export class RuntimeResourcesPartnerLoginError extends Schema.TaggedError()('RuntimeResourcesPartnerLoginError', PartnerLoginBodySchema.fields) {
|
|
118
|
+
}
|
|
85
119
|
const unauthorizedError = UnauthorizedBodySchema.pipe(Schema.decodeTo(RuntimeResourcesUnauthorizedError, {
|
|
86
120
|
decode: SchemaGetter.transform(() => new RuntimeResourcesUnauthorizedError({ error: 'Unauthorized' })),
|
|
87
121
|
encode: SchemaGetter.transform((error) => ({ error: error.error })),
|
|
@@ -106,6 +140,17 @@ const unavailableError = ErrorBodySchema.pipe(Schema.decodeTo(RuntimeResourcesUn
|
|
|
106
140
|
decode: SchemaGetter.transform((body) => new RuntimeResourcesUnavailableError(body)),
|
|
107
141
|
encode: SchemaGetter.transform((error) => ({ error: error.error })),
|
|
108
142
|
}), HttpApiSchema.status(503));
|
|
143
|
+
const partnerLoginError = PartnerLoginBodySchema.pipe(Schema.decodeTo(RuntimeResourcesPartnerLoginError, {
|
|
144
|
+
decode: SchemaGetter.transform((body) => new RuntimeResourcesPartnerLoginError(body)),
|
|
145
|
+
encode: SchemaGetter.transform(({ error, partnerStatus, oauthError }) => {
|
|
146
|
+
const body = { error };
|
|
147
|
+
if (partnerStatus !== undefined)
|
|
148
|
+
body.partnerStatus = partnerStatus;
|
|
149
|
+
if (oauthError !== undefined)
|
|
150
|
+
body.oauthError = oauthError;
|
|
151
|
+
return body;
|
|
152
|
+
}),
|
|
153
|
+
}), HttpApiSchema.status(502));
|
|
109
154
|
const runtimeErrors = [
|
|
110
155
|
unauthorizedError,
|
|
111
156
|
forbiddenError,
|
|
@@ -138,6 +183,12 @@ const ResourcesRuntimeHttpApiGroup = HttpApiGroup.make('resourcesRuntime')
|
|
|
138
183
|
payload: SelectResourceRuntimeInputSchema,
|
|
139
184
|
success: SelectResourceRuntimeResponseSchema,
|
|
140
185
|
error: runtimeErrors,
|
|
186
|
+
}))
|
|
187
|
+
.add(HttpApiEndpoint.post('issueAccessToken', '/resources/access-token', {
|
|
188
|
+
headers: AuthorizationHeadersSchema,
|
|
189
|
+
payload: IssueAccessTokenInputSchema,
|
|
190
|
+
success: IssuedAccessTokenSchema,
|
|
191
|
+
error: [...runtimeErrors, partnerLoginError],
|
|
141
192
|
}))
|
|
142
193
|
.prefix('/api/v1/runtime')
|
|
143
194
|
.annotateMerge(OpenApi.annotations({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RuntimeApi.js","sourceRoot":"","sources":["../../src/Contract/RuntimeApi.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"RuntimeApi.js","sourceRoot":"","sources":["../../src/Contract/RuntimeApi.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAGjG,MAAM,0BAA0B,GAAG,MAAM,CAAC,MAAM,CAAC;IAC/C,aAAa,EAAE,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,MAAM,CAAC;CACjD,CAAC,CAAC;AAEH,MAAM,qBAAqB,GAA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AuB,CAAC,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC"}
|
package/dist/Contract/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { ANSWER_LENGTH_HEADER, ANSWER_STATUS_HEADER, type AnswerTrailer, type AnswerTrailerError, EARLY_ANSWER_PROTOCOL_VERSION, type InvocationResponsePolicy, MAX_ANSWER_BYTES, MAX_TRAILER_BYTES, RESPONSE_POLICY_HEADER, RUN_OUTCOME_HEADER, TRAILER_LENGTH_BYTES, } from './EarlyAnswer.js';
|
|
2
2
|
export type { InvocationContext, InvocationTriggerKind } from './Invocation.js';
|
|
3
3
|
export { concurrencyProblem, DEFAULT_EARLY_TRIGGER_CONCURRENCY, declaredRunBudgetSeconds, declaredTriggerConcurrency, MAX_TRIGGER_CONCURRENCY, runBudgetProblem, ManifestResource, ResponsePolicy, TriggerKind, TriggerMetadata, WorkflowManifest, WorkflowManifestEndpoint, } from './Manifest.js';
|
|
4
|
-
export { ResourcesRuntimeApi, RuntimeResourcesBadRequestError, RuntimeResourcesConflictError, RuntimeResourcesForbiddenError, RuntimeResourcesNotFoundError, RuntimeResourcesUnauthorizedError, RuntimeResourcesUnavailableError, SelectResourceRuntimeInputSchema, SelectResourceRuntimeOutputSchema, } from './RuntimeApi.js';
|
|
4
|
+
export { IssuedAccessTokenSchema, OAUTH_TOKEN_ERROR_CODES, ResourcesRuntimeApi, RuntimeResourcesBadRequestError, RuntimeResourcesConflictError, RuntimeResourcesForbiddenError, RuntimeResourcesNotFoundError, RuntimeResourcesPartnerLoginError, RuntimeResourcesUnauthorizedError, RuntimeResourcesUnavailableError, SelectResourceRuntimeInputSchema, SelectResourceRuntimeOutputSchema, } from './RuntimeApi.js';
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Contract/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACpB,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,6BAA6B,EAC7B,KAAK,wBAAwB,EAC7B,gBAAgB,EAChB,iBAAiB,EACjB,sBAAsB,EACtB,kBAAkB,EAClB,oBAAoB,GACrB,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAChF,OAAO,EACL,kBAAkB,EAClB,iCAAiC,EACjC,wBAAwB,EACxB,0BAA0B,EAC1B,uBAAuB,EACvB,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,EACd,WAAW,EACX,eAAe,EACf,gBAAgB,EAChB,wBAAwB,GACzB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,mBAAmB,EACnB,+BAA+B,EAC/B,6BAA6B,EAC7B,8BAA8B,EAC9B,6BAA6B,EAC7B,iCAAiC,EACjC,gCAAgC,EAChC,gCAAgC,EAChC,iCAAiC,GAClC,MAAM,iBAAiB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Contract/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACpB,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,6BAA6B,EAC7B,KAAK,wBAAwB,EAC7B,gBAAgB,EAChB,iBAAiB,EACjB,sBAAsB,EACtB,kBAAkB,EAClB,oBAAoB,GACrB,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAChF,OAAO,EACL,kBAAkB,EAClB,iCAAiC,EACjC,wBAAwB,EACxB,0BAA0B,EAC1B,uBAAuB,EACvB,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,EACd,WAAW,EACX,eAAe,EACf,gBAAgB,EAChB,wBAAwB,GACzB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,uBAAuB,EACvB,uBAAuB,EACvB,mBAAmB,EACnB,+BAA+B,EAC/B,6BAA6B,EAC7B,8BAA8B,EAC9B,6BAA6B,EAC7B,iCAAiC,EACjC,iCAAiC,EACjC,gCAAgC,EAChC,gCAAgC,EAChC,iCAAiC,GAClC,MAAM,iBAAiB,CAAC"}
|
package/dist/Contract/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { ANSWER_LENGTH_HEADER, ANSWER_STATUS_HEADER, EARLY_ANSWER_PROTOCOL_VERSION, MAX_ANSWER_BYTES, MAX_TRAILER_BYTES, RESPONSE_POLICY_HEADER, RUN_OUTCOME_HEADER, TRAILER_LENGTH_BYTES, } from './EarlyAnswer.js';
|
|
2
2
|
export { concurrencyProblem, DEFAULT_EARLY_TRIGGER_CONCURRENCY, declaredRunBudgetSeconds, declaredTriggerConcurrency, MAX_TRIGGER_CONCURRENCY, runBudgetProblem, ManifestResource, ResponsePolicy, TriggerKind, TriggerMetadata, WorkflowManifest, WorkflowManifestEndpoint, } from './Manifest.js';
|
|
3
|
-
export { ResourcesRuntimeApi, RuntimeResourcesBadRequestError, RuntimeResourcesConflictError, RuntimeResourcesForbiddenError, RuntimeResourcesNotFoundError, RuntimeResourcesUnauthorizedError, RuntimeResourcesUnavailableError, SelectResourceRuntimeInputSchema, SelectResourceRuntimeOutputSchema, } from './RuntimeApi.js';
|
|
3
|
+
export { IssuedAccessTokenSchema, OAUTH_TOKEN_ERROR_CODES, ResourcesRuntimeApi, RuntimeResourcesBadRequestError, RuntimeResourcesConflictError, RuntimeResourcesForbiddenError, RuntimeResourcesNotFoundError, RuntimeResourcesPartnerLoginError, RuntimeResourcesUnauthorizedError, RuntimeResourcesUnavailableError, SelectResourceRuntimeInputSchema, SelectResourceRuntimeOutputSchema, } from './RuntimeApi.js';
|
|
4
4
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Contract/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EAGpB,6BAA6B,EAE7B,gBAAgB,EAChB,iBAAiB,EACjB,sBAAsB,EACtB,kBAAkB,EAClB,oBAAoB,GACrB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,kBAAkB,EAClB,iCAAiC,EACjC,wBAAwB,EACxB,0BAA0B,EAC1B,uBAAuB,EACvB,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,EACd,WAAW,EACX,eAAe,EACf,gBAAgB,EAChB,wBAAwB,GACzB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,mBAAmB,EACnB,+BAA+B,EAC/B,6BAA6B,EAC7B,8BAA8B,EAC9B,6BAA6B,EAC7B,iCAAiC,EACjC,gCAAgC,EAChC,gCAAgC,EAChC,iCAAiC,GAClC,MAAM,iBAAiB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Contract/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EAGpB,6BAA6B,EAE7B,gBAAgB,EAChB,iBAAiB,EACjB,sBAAsB,EACtB,kBAAkB,EAClB,oBAAoB,GACrB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,kBAAkB,EAClB,iCAAiC,EACjC,wBAAwB,EACxB,0BAA0B,EAC1B,uBAAuB,EACvB,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,EACd,WAAW,EACX,eAAe,EACf,gBAAgB,EAChB,wBAAwB,GACzB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,uBAAuB,EACvB,uBAAuB,EACvB,mBAAmB,EACnB,+BAA+B,EAC/B,6BAA6B,EAC7B,8BAA8B,EAC9B,6BAA6B,EAC7B,iCAAiC,EACjC,iCAAiC,EACjC,gCAAgC,EAChC,gCAAgC,EAChC,iCAAiC,GAClC,MAAM,iBAAiB,CAAC"}
|
package/dist/HttpApiClient.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Context, Effect, Layer, Schema } from 'effect';
|
|
2
2
|
import { HttpClient } from 'effect/http';
|
|
3
3
|
import type { HttpApiResource } from './HttpApiResource.js';
|
|
4
|
+
import { RuntimeResources } from './RuntimeResources.js';
|
|
4
5
|
declare const UnsupportedHttpApiResourceError_base: Schema.Class<UnsupportedHttpApiResourceError, Schema.TaggedStruct<"UnsupportedHttpApiResourceError", {
|
|
5
6
|
readonly target: Schema.String;
|
|
6
7
|
readonly message: Schema.String;
|
|
@@ -12,17 +13,18 @@ export interface HttpApiClientsService {
|
|
|
12
13
|
/**
|
|
13
14
|
* An `HttpClient` for the `http_api` record at `resourceKey`. Each request joins the record's `baseUrl`,
|
|
14
15
|
* carries its headers and authentication, and uses its TLS and proxy settings. For `oauth2_client_credentials`
|
|
15
|
-
* and `oauth2_password` the
|
|
16
|
-
* expires, and after a 401
|
|
16
|
+
* and `oauth2_password` the platform issues the token for the record's login identity; the VM reuses it until 30 s
|
|
17
|
+
* before it expires, and after a 401 names the refused token and sends the request once more. An OAuth record
|
|
18
|
+
* with TLS or proxy settings, or a token URL that is not https, fails.
|
|
17
19
|
*/
|
|
18
20
|
readonly client: (resourceKey: string, record: HttpApiResource) => Effect.Effect<HttpClient.HttpClient, UnsupportedHttpApiResourceError>;
|
|
19
21
|
}
|
|
20
22
|
declare const HttpApiClients_base: Context.ServiceClass<HttpApiClients, "@temper/workflow/HttpApiClients", HttpApiClientsService>;
|
|
21
23
|
/** Authenticated partner clients built from `http_api` records. Contract: WFSDK-016 in docs/specs/workflow-sdk.md. */
|
|
22
24
|
export declare class HttpApiClients extends HttpApiClients_base {
|
|
23
|
-
static readonly layer: Layer.Layer<HttpApiClients, never, HttpClient.HttpClient>;
|
|
25
|
+
static readonly layer: Layer.Layer<HttpApiClients, never, HttpClient.HttpClient | RuntimeResources>;
|
|
24
26
|
}
|
|
25
27
|
/** The layer for a runtime whose `fetch` does (`bun`) or does not apply `tls` and `proxy`; not exported by the package. */
|
|
26
|
-
export declare const httpApiClientsLayer: (bun: boolean) => Layer.Layer<HttpApiClients, never, HttpClient.HttpClient>;
|
|
28
|
+
export declare const httpApiClientsLayer: (bun: boolean) => Layer.Layer<HttpApiClients, never, HttpClient.HttpClient | RuntimeResources>;
|
|
27
29
|
export {};
|
|
28
30
|
//# sourceMappingURL=HttpApiClient.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HttpApiClient.d.ts","sourceRoot":"","sources":["../src/HttpApiClient.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"HttpApiClient.d.ts","sourceRoot":"","sources":["../src/HttpApiClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAoB,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC1E,OAAO,EAAmB,UAAU,EAAsC,MAAM,aAAa,CAAC;AAG9F,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAG5D,OAAO,EAAuB,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;;;;;AAE9E,oHAAoH;AACpH,qBAAa,+BAAgC,SAAQ,oCAGpD;CAAG;AA8KJ,MAAM,WAAW,qBAAqB;IACpC;;;;;;OAMG;IACH,QAAQ,CAAC,MAAM,EAAE,CACf,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,eAAe,KACpB,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,UAAU,EAAE,+BAA+B,CAAC,CAAC;CAC5E;;AAaD,sHAAsH;AACtH,qBAAa,cAAe,SAAQ,mBAEnC;IAEC,MAAM,CAAC,QAAQ,CAAC,KAAK,+EAAkD;CACxE;AAED,2HAA2H;AAC3H,eAAO,MAAM,mBAAmB,QAAS,OAAO,iFAA4C,CAAC"}
|