@ontemper/sdk 0.9.0 → 0.10.0-oauth.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/README.md +58 -2
- package/dist/AccessTokens.d.ts +22 -0
- package/dist/AccessTokens.d.ts.map +1 -0
- package/dist/AccessTokens.js +69 -0
- package/dist/AccessTokens.js.map +1 -0
- package/dist/As2Transport.d.ts +7 -2
- package/dist/As2Transport.d.ts.map +1 -1
- package/dist/As2Transport.js.map +1 -1
- package/dist/Contract/RuntimeApi.d.ts +53 -0
- package/dist/Contract/RuntimeApi.d.ts.map +1 -1
- package/dist/Contract/RuntimeApi.js +64 -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 +30 -0
- package/dist/HttpApiClient.d.ts.map +1 -0
- package/dist/HttpApiClient.js +142 -0
- package/dist/HttpApiClient.js.map +1 -0
- package/dist/HttpApiResource.d.ts +133 -0
- package/dist/HttpApiResource.d.ts.map +1 -1
- package/dist/HttpApiResource.js +31 -3
- package/dist/HttpApiResource.js.map +1 -1
- package/dist/Kafka.d.ts.map +1 -1
- package/dist/Kafka.js +6 -73
- package/dist/Kafka.js.map +1 -1
- package/dist/Manifest.d.ts +1 -1
- package/dist/Manifest.d.ts.map +1 -1
- package/dist/Manifest.js +1 -1
- package/dist/Manifest.js.map +1 -1
- package/dist/OAuthToken.d.ts +46 -0
- package/dist/OAuthToken.d.ts.map +1 -0
- package/dist/OAuthToken.js +132 -0
- package/dist/OAuthToken.js.map +1 -0
- package/dist/Redaction.d.ts.map +1 -1
- package/dist/Redaction.js +1 -0
- package/dist/Redaction.js.map +1 -1
- package/dist/RuntimeResources.d.ts +8 -1
- package/dist/RuntimeResources.d.ts.map +1 -1
- package/dist/RuntimeResources.js +43 -10
- package/dist/RuntimeResources.js.map +1 -1
- package/dist/Workflow.d.ts +2 -1
- package/dist/Workflow.d.ts.map +1 -1
- package/dist/Workflow.js +6 -3
- package/dist/Workflow.js.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -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,12 @@ 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
|
|
157
|
+
by default; `HttpApiOAuthTokenRequest` adds the optional token-request `headers`, and refuses a header that
|
|
158
|
+
the platform's login sets or that controls the connection, such as `Accept` or `Transfer-Encoding`). An auth `type` that a newer platform adds decodes as
|
|
158
159
|
`{ type: 'unsupported', variant, fields }`, with `fields` `Redacted`. A known type with a missing or
|
|
159
160
|
invalid field fails. The record can also carry `tls`, `proxy`, and `secondaryTenantKey`.
|
|
160
161
|
- Every `x-secret` field of a system type decodes to `Redacted`: for example `clientSecret`, `privateKey`,
|
|
@@ -313,6 +314,61 @@ function, still writes its lines, also with an id or kind that the build refuses
|
|
|
313
314
|
process, as in a test, gets the same closed catalog. Keep a step's `id` when you change its title: the platform keys Run state on the id.
|
|
314
315
|
`sdk/workflow-examples/step-flow` is a complete example.
|
|
315
316
|
|
|
317
|
+
### Partner clients for `http_api` records
|
|
318
|
+
|
|
319
|
+
`HttpApiClients` gives an `HttpClient` for one `http_api` record. Each request joins the record's `baseUrl`
|
|
320
|
+
and carries its headers, authentication, TLS, and proxy settings. A header that the request sets wins over the
|
|
321
|
+
record's header. Read the service where the handler group is built, and build the client where the record is read:
|
|
322
|
+
|
|
323
|
+
```ts
|
|
324
|
+
import { HttpApiClients } from '@temper/workflow';
|
|
325
|
+
|
|
326
|
+
const clients = yield * HttpApiClients; // in the Effect that builds the handler group
|
|
327
|
+
|
|
328
|
+
const carrier = yield * clients.client('carrier', yield * CarrierApi); // in a request
|
|
329
|
+
const response = yield * carrier.get('/v1/shipments');
|
|
330
|
+
```
|
|
331
|
+
|
|
332
|
+
The client applies `none`, `basic`, `bearer`, `api_key`, `oauth2_client_credentials`, and `oauth2_password`.
|
|
333
|
+
For the two OAuth types, workflow code holds no token, and the VM never logs in to the partner:
|
|
334
|
+
|
|
335
|
+
- The Temper API logs in with the record's `tokenRequest`, including `private_key_jwt` client authentication and
|
|
336
|
+
the token-request `headers` (for example a login API key), and keeps the token in its memory. Every VM of
|
|
337
|
+
the organization that uses the same login gets that token until 60 seconds before it expires. Each API
|
|
338
|
+
process logs in on its own, so the partner must accept tokens from several API processes at the same time.
|
|
339
|
+
The client asks for the token at `POST /api/v1/runtime/resources/access-token`, within one 20-second deadline.
|
|
340
|
+
- The key must name a stored `http_api` record in the workflow's reach: the API resolves the key itself, so a
|
|
341
|
+
record that workflow code builds gets no token. On a stack whose Temper API does not have the route yet, the
|
|
342
|
+
call fails with a message that says so; update the API first.
|
|
343
|
+
- The client names the login identity of its record: a hash of the base URL, auth type, token URL, client id,
|
|
344
|
+
username, scope, audience, `extraParams`, and token-request `headers`, without the client secret, private key,
|
|
345
|
+
or password. When the key names a record with another identity, the call fails with
|
|
346
|
+
`Resource <key> changed since this workflow read it`. After an edit of one of these fields (a login header
|
|
347
|
+
value included, also a secret one), a running workflow gets this error until it reads the record again; the SDK
|
|
348
|
+
caches a resolved record for 30 seconds.
|
|
349
|
+
- The client keeps the token in the memory of this VM until 30 seconds before it expires, per resource key and
|
|
350
|
+
login identity. Two records read under one key, such as two tenants, never share a token. A rotated secret
|
|
351
|
+
keeps the held token until it expires or the partner answers 401. Concurrent calls for one login share one
|
|
352
|
+
request to the API. A token answer without a lifetime serves one call.
|
|
353
|
+
- A failed or interrupted request keeps no token, so the next call asks again. A failed partner login fails the
|
|
354
|
+
call with an `HttpClientError` that names the key, the partner's HTTP status, and its OAuth error code.
|
|
355
|
+
- After a 401 answer, the client tells the API which token the partner refused and sends the request one more
|
|
356
|
+
time with the token the API answers. A second 401 goes to the workflow. The API logs in again only for a
|
|
357
|
+
refused token whose login is 60 seconds old or more, at most once in 5 seconds; a login the partner refused
|
|
358
|
+
with 400, 401, or 403 answers with that failure for 60 seconds. A request with a stream body is not sent
|
|
359
|
+
again: the workflow gets the 401, and the next call asks the API again.
|
|
360
|
+
|
|
361
|
+
A partner call follows redirects as `fetch` does. On a redirect to another origin, `fetch` removes
|
|
362
|
+
`Authorization` only: an API key in another header, and the record's `headers`, go to that origin. To stop
|
|
363
|
+
that for a partner that redirects, provide `FetchHttpClient.RequestInit` with `redirect: 'manual'` around the call.
|
|
364
|
+
|
|
365
|
+
The client fails with `UnsupportedHttpApiResourceError` and sends nothing for a setting it cannot apply:
|
|
366
|
+
`oauth2_jwt_bearer`, `oauth1_tba`, `aws_sigv4`, an auth type a newer platform added, and TLS or proxy settings
|
|
367
|
+
outside the Bun runtime, and, on an OAuth record, TLS or proxy settings or a token URL that is not https. The
|
|
368
|
+
message is `Resource <key> uses <setting>, which the workflow HTTP client does not support.` In tests,
|
|
369
|
+
`testPlatform({ fetch, resources })` logs in for each token in memory: it sends the record's token request through
|
|
370
|
+
`fetch`.
|
|
371
|
+
|
|
316
372
|
## Invoke in a test
|
|
317
373
|
|
|
318
374
|
```ts
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Effect, Redacted } from 'effect';
|
|
2
|
+
/** A token the platform issued for one login. */
|
|
3
|
+
export interface IssuedAccessToken {
|
|
4
|
+
/** The credential as the workflow sends it, for example the `access_token`. */
|
|
5
|
+
readonly token: Redacted.Redacted<string>;
|
|
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
|
+
}
|
|
9
|
+
export interface AccessTokens {
|
|
10
|
+
/**
|
|
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.
|
|
15
|
+
*/
|
|
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. */
|
|
18
|
+
readonly refuse: (login: string, token: Redacted.Redacted<string>) => Effect.Effect<void>;
|
|
19
|
+
}
|
|
20
|
+
/** Platform-issued access tokens held in the memory of this VM and reused until they expire. */
|
|
21
|
+
export declare const makeAccessTokens: () => AccessTokens;
|
|
22
|
+
//# sourceMappingURL=AccessTokens.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { Cause, Clock, Deferred, Effect, Exit, Option, Redacted } from 'effect';
|
|
2
|
+
import { registerSecrets } from './Redaction.js';
|
|
3
|
+
// A token this close to its expiry could lapse mid-request, so it counts as spent (as in legacy `unnbound-env`).
|
|
4
|
+
const EXPIRY_MARGIN_MS = 30_000;
|
|
5
|
+
const usable = (expiresAt, now) => expiresAt - EXPIRY_MARGIN_MS > now;
|
|
6
|
+
/** Platform-issued access tokens held in the memory of this VM and reused until they expire. */
|
|
7
|
+
export const makeAccessTokens = () => {
|
|
8
|
+
const logins = new Map();
|
|
9
|
+
const loginOf = (login) => {
|
|
10
|
+
const existing = logins.get(login);
|
|
11
|
+
if (existing !== undefined)
|
|
12
|
+
return existing;
|
|
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));
|
|
30
|
+
};
|
|
31
|
+
const get = (login, request) => Effect.gen(function* () {
|
|
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);
|
|
43
|
+
}
|
|
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
|
+
});
|
|
60
|
+
const refuse = (login, token) => Effect.sync(() => {
|
|
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;
|
|
66
|
+
});
|
|
67
|
+
return { get, refuse };
|
|
68
|
+
};
|
|
69
|
+
//# sourceMappingURL=AccessTokens.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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,CAAC,CAAC;QACnC,IAAI,QAAQ,KAAK,SAAS;Y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{ BunTransport } from './HttpClient.js';
|
|
3
3
|
/** A partner's delivery connection: the Bun `fetch` options that apply its settings, or why they cannot apply. */
|
|
4
4
|
export type As2DeliveryTransport = {
|
|
@@ -9,13 +9,18 @@ export type As2DeliveryTransport = {
|
|
|
9
9
|
readonly code: string;
|
|
10
10
|
readonly message: string;
|
|
11
11
|
};
|
|
12
|
+
/** The connection settings an `as2_partner` and an `http_api` record share. */
|
|
13
|
+
export interface TransportSettings {
|
|
14
|
+
readonly tls?: TlsSettings | undefined;
|
|
15
|
+
readonly proxy?: HttpProxy | undefined;
|
|
16
|
+
}
|
|
12
17
|
/** True where the global `fetch` is Bun's, the only one that takes `tls` and `proxy`. */
|
|
13
18
|
export declare const bunFetch: () => boolean;
|
|
14
19
|
/**
|
|
15
20
|
* Legacy `@ontemper/as2` checks and connection options for one delivery URL, on Bun's `fetch`. Another runtime's
|
|
16
21
|
* `fetch` skips `tls` and `proxy` without an error, so a partner that sets either is refused there.
|
|
17
22
|
*/
|
|
18
|
-
export declare const deliveryTransport: (partner:
|
|
23
|
+
export declare const deliveryTransport: (partner: TransportSettings, url: URL, bun: boolean) => As2DeliveryTransport;
|
|
19
24
|
/** A request to the address the destination check approved, in place of the name in its URL. */
|
|
20
25
|
export interface PinnedDestination {
|
|
21
26
|
readonly url: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"As2Transport.d.ts","sourceRoot":"","sources":["../src/As2Transport.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"As2Transport.d.ts","sourceRoot":"","sources":["../src/As2Transport.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEpD,kHAAkH;AAClH,MAAM,MAAM,oBAAoB,GAC5B;IAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,SAAS,EAAE,YAAY,CAAA;CAAE,GAC5D;IAAE,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAIlF,+EAA+E;AAC/E,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,GAAG,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC;IACvC,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;CACxC;AAeD,yFAAyF;AACzF,eAAO,MAAM,QAAQ,QAAO,OAA8B,CAAC;AAE3D;;;GAGG;AACH,eAAO,MAAM,iBAAiB,YAAa,iBAAiB,OAAO,GAAG,OAAO,OAAO,KAAG,oBA+DtF,CAAC;AAEF,gGAAgG;AAChG,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,SAAS,EAAE,YAAY,CAAC;CAClC;AAED;;;GAGG;AACH,eAAO,MAAM,iBAAiB,QAAS,GAAG,WAAW,MAAM,KAAG,iBAO7D,CAAC"}
|
package/dist/As2Transport.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"As2Transport.js","sourceRoot":"","sources":["../src/As2Transport.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"As2Transport.js","sourceRoot":"","sources":["../src/As2Transport.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAiBlC,mHAAmH;AACnH,MAAM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IAAI,KAAK,OAAO;QAAE,SAAS,CAAC,GAAG,GAAG,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC;IACxF,OAAO,EAAE,GAAG,EAAE,MAAM,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,SAAS,EAAE,CAAC;AACzD,CAAC,CAAC"}
|
|
@@ -31,6 +31,14 @@ export declare const RuntimeInspectedResourceSchema: Schema.Struct<{
|
|
|
31
31
|
export declare const SelectResourceRuntimeOutputSchema: 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>;
|
|
@@ -46,6 +54,15 @@ declare const RuntimeResourcesNotFoundError_base: Schema.Class<RuntimeResourcesN
|
|
|
46
54
|
}>, import("effect/Cause").YieldableError>;
|
|
47
55
|
export declare class RuntimeResourcesNotFoundError extends RuntimeResourcesNotFoundError_base {
|
|
48
56
|
}
|
|
57
|
+
declare const RuntimeResourcesRecordNotFoundError_base: Schema.Class<RuntimeResourcesRecordNotFoundError, Schema.TaggedStruct<"RuntimeResourcesRecordNotFoundError", {
|
|
58
|
+
readonly error: Schema.Literal<"Resource not found">;
|
|
59
|
+
}>, import("effect/Cause").YieldableError>;
|
|
60
|
+
/**
|
|
61
|
+
* The access-token route's 404: no record of the key in reach, or a Variable it points at is missing. Its body differs
|
|
62
|
+
* from the API's answer for a route it does not have, `{ error: 'Not found' }`, so a client can tell them apart.
|
|
63
|
+
*/
|
|
64
|
+
export declare class RuntimeResourcesRecordNotFoundError extends RuntimeResourcesRecordNotFoundError_base {
|
|
65
|
+
}
|
|
49
66
|
declare const RuntimeResourcesBadRequestError_base: Schema.Class<RuntimeResourcesBadRequestError, Schema.TaggedStruct<"RuntimeResourcesBadRequestError", {
|
|
50
67
|
readonly error: Schema.String;
|
|
51
68
|
}>, import("effect/Cause").YieldableError>;
|
|
@@ -61,6 +78,14 @@ declare const RuntimeResourcesUnavailableError_base: Schema.Class<RuntimeResourc
|
|
|
61
78
|
}>, import("effect/Cause").YieldableError>;
|
|
62
79
|
export declare class RuntimeResourcesUnavailableError extends RuntimeResourcesUnavailableError_base {
|
|
63
80
|
}
|
|
81
|
+
declare const RuntimeResourcesPartnerLoginError_base: Schema.Class<RuntimeResourcesPartnerLoginError, Schema.TaggedStruct<"RuntimeResourcesPartnerLoginError", {
|
|
82
|
+
readonly error: Schema.String;
|
|
83
|
+
readonly partnerStatus: Schema.optionalKey<Schema.Number>;
|
|
84
|
+
readonly oauthError: Schema.optionalKey<Schema.Literals<readonly ["invalid_request", "invalid_client", "invalid_grant", "unauthorized_client", "unsupported_grant_type", "invalid_scope"]>>;
|
|
85
|
+
}>, import("effect/Cause").YieldableError>;
|
|
86
|
+
/** The platform's login to the partner token endpoint failed, now or inside the time its last failure still answers. */
|
|
87
|
+
export declare class RuntimeResourcesPartnerLoginError extends RuntimeResourcesPartnerLoginError_base {
|
|
88
|
+
}
|
|
64
89
|
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
90
|
readonly key: Schema.String;
|
|
66
91
|
}>>, Schema.toCodecStringTree<Schema.Struct<{
|
|
@@ -97,6 +122,34 @@ export declare const ResourcesRuntimeApi: HttpApi.HttpApi<"resources-runtime-api
|
|
|
97
122
|
readonly error: Schema.String;
|
|
98
123
|
}>, never, never> | Schema.decodeTo<typeof RuntimeResourcesUnavailableError, Schema.Struct<{
|
|
99
124
|
readonly error: Schema.String;
|
|
125
|
+
}>, never, never>>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"issueAccessToken", "POST", "/api/v1/runtime/resources/access-token", never, never, Schema.toCodecJson<Schema.Struct<{
|
|
126
|
+
readonly key: Schema.String;
|
|
127
|
+
readonly identity: Schema.String;
|
|
128
|
+
readonly refused: Schema.optionalKey<Schema.String>;
|
|
129
|
+
}>>, Schema.toCodecStringTree<Schema.Struct<{
|
|
130
|
+
readonly authorization: Schema.optionalKey<Schema.String>;
|
|
131
|
+
}>>, Schema.toCodecJson<Schema.Struct<{
|
|
132
|
+
readonly token: Schema.String;
|
|
133
|
+
readonly expiresIn: Schema.NullOr<Schema.Number>;
|
|
134
|
+
readonly redactionMasks: Schema.$Array<Schema.String>;
|
|
135
|
+
}>>, Schema.toCodecJson<Schema.decodeTo<typeof RuntimeResourcesUnauthorizedError, Schema.Struct<{
|
|
136
|
+
readonly error: Schema.Literal<"Unauthorized">;
|
|
137
|
+
}>, never, never> | Schema.decodeTo<typeof RuntimeResourcesForbiddenError, Schema.Struct<{
|
|
138
|
+
readonly error: Schema.Literal<"Forbidden">;
|
|
139
|
+
}>, never, never> | Schema.decodeTo<typeof RuntimeResourcesNotFoundError, Schema.Struct<{
|
|
140
|
+
readonly error: Schema.Literal<"Not found">;
|
|
141
|
+
}>, never, never> | Schema.decodeTo<typeof RuntimeResourcesRecordNotFoundError, Schema.Struct<{
|
|
142
|
+
readonly error: Schema.Literal<"Resource not found">;
|
|
143
|
+
}>, never, never> | Schema.decodeTo<typeof RuntimeResourcesBadRequestError, Schema.Struct<{
|
|
144
|
+
readonly error: Schema.String;
|
|
145
|
+
}>, never, never> | Schema.decodeTo<typeof RuntimeResourcesConflictError, Schema.Struct<{
|
|
146
|
+
readonly error: Schema.String;
|
|
147
|
+
}>, never, never> | Schema.decodeTo<typeof RuntimeResourcesUnavailableError, Schema.Struct<{
|
|
148
|
+
readonly error: Schema.String;
|
|
149
|
+
}>, never, never> | Schema.decodeTo<typeof RuntimeResourcesPartnerLoginError, Schema.Struct<{
|
|
150
|
+
readonly error: Schema.String;
|
|
151
|
+
readonly partnerStatus: Schema.optionalKey<Schema.Number>;
|
|
152
|
+
readonly oauthError: Schema.optionalKey<Schema.Literals<readonly ["invalid_request", "invalid_client", "invalid_grant", "unauthorized_client", "unsupported_grant_type", "invalid_scope"]>>;
|
|
100
153
|
}>, never, never>>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"resolveResource", "POST", "/api/v1/runtime/resources/resolve", never, never, Schema.toCodecJson<Schema.Struct<{
|
|
101
154
|
readonly key: Schema.String;
|
|
102
155
|
}>>, 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;;;;AASX,qBAAa,iCAAkC,SAAQ,sCAGtD;CAAG;;;;AAEJ,qBAAa,8BAA+B,SAAQ,mCAGnD;CAAG;;;;AAEJ,qBAAa,6BAA8B,SAAQ,kCAGlD;CAAG;;;;AAEJ;;;GAGG;AACH,qBAAa,mCAAoC,SAAQ,wCAGxD;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;AAkIJ,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0CAA0E,CAAC"}
|
|
@@ -66,9 +66,36 @@ 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, scope or null, audience or null, extraParams entries sorted by name, token-request header entries sorted by lowercased name]. No client secret, private key, or password. 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') });
|
|
98
|
+
const RecordNotFoundBodySchema = Schema.Struct({ error: Schema.Literal('Resource not found') });
|
|
72
99
|
const ErrorBodySchema = Schema.Struct({ error: Schema.String });
|
|
73
100
|
export class RuntimeResourcesUnauthorizedError extends Schema.TaggedError()('RuntimeResourcesUnauthorizedError', { error: Schema.Literal('Unauthorized') }) {
|
|
74
101
|
}
|
|
@@ -76,12 +103,26 @@ export class RuntimeResourcesForbiddenError extends Schema.TaggedError()('Runtim
|
|
|
76
103
|
}
|
|
77
104
|
export class RuntimeResourcesNotFoundError extends Schema.TaggedError()('RuntimeResourcesNotFoundError', { error: Schema.Literal('Not found') }) {
|
|
78
105
|
}
|
|
106
|
+
/**
|
|
107
|
+
* The access-token route's 404: no record of the key in reach, or a Variable it points at is missing. Its body differs
|
|
108
|
+
* from the API's answer for a route it does not have, `{ error: 'Not found' }`, so a client can tell them apart.
|
|
109
|
+
*/
|
|
110
|
+
export class RuntimeResourcesRecordNotFoundError extends Schema.TaggedError()('RuntimeResourcesRecordNotFoundError', { error: Schema.Literal('Resource not found') }) {
|
|
111
|
+
}
|
|
79
112
|
export class RuntimeResourcesBadRequestError extends Schema.TaggedError()('RuntimeResourcesBadRequestError', { error: Schema.String }) {
|
|
80
113
|
}
|
|
81
114
|
export class RuntimeResourcesConflictError extends Schema.TaggedError()('RuntimeResourcesConflictError', { error: Schema.String }) {
|
|
82
115
|
}
|
|
83
116
|
export class RuntimeResourcesUnavailableError extends Schema.TaggedError()('RuntimeResourcesUnavailableError', { error: Schema.String }) {
|
|
84
117
|
}
|
|
118
|
+
const PartnerLoginBodySchema = Schema.Struct({
|
|
119
|
+
error: Schema.String.annotate({ description: 'A fixed message. It never holds a URL, a header, or a body.' }),
|
|
120
|
+
partnerStatus: Schema.optionalKey(Schema.Number.annotate({ description: 'The HTTP status the partner answered.' })),
|
|
121
|
+
oauthError: Schema.optionalKey(Schema.Literals(OAUTH_TOKEN_ERROR_CODES)),
|
|
122
|
+
});
|
|
123
|
+
/** The platform's login to the partner token endpoint failed, now or inside the time its last failure still answers. */
|
|
124
|
+
export class RuntimeResourcesPartnerLoginError extends Schema.TaggedError()('RuntimeResourcesPartnerLoginError', PartnerLoginBodySchema.fields) {
|
|
125
|
+
}
|
|
85
126
|
const unauthorizedError = UnauthorizedBodySchema.pipe(Schema.decodeTo(RuntimeResourcesUnauthorizedError, {
|
|
86
127
|
decode: SchemaGetter.transform(() => new RuntimeResourcesUnauthorizedError({ error: 'Unauthorized' })),
|
|
87
128
|
encode: SchemaGetter.transform((error) => ({ error: error.error })),
|
|
@@ -94,6 +135,10 @@ const notFoundError = NotFoundBodySchema.pipe(Schema.decodeTo(RuntimeResourcesNo
|
|
|
94
135
|
decode: SchemaGetter.transform(() => new RuntimeResourcesNotFoundError({ error: 'Not found' })),
|
|
95
136
|
encode: SchemaGetter.transform((error) => ({ error: error.error })),
|
|
96
137
|
}), HttpApiSchema.status(404));
|
|
138
|
+
const recordNotFoundError = RecordNotFoundBodySchema.pipe(Schema.decodeTo(RuntimeResourcesRecordNotFoundError, {
|
|
139
|
+
decode: SchemaGetter.transform(() => new RuntimeResourcesRecordNotFoundError({ error: 'Resource not found' })),
|
|
140
|
+
encode: SchemaGetter.transform((error) => ({ error: error.error })),
|
|
141
|
+
}), HttpApiSchema.status(404));
|
|
97
142
|
const badRequestError = ErrorBodySchema.pipe(Schema.decodeTo(RuntimeResourcesBadRequestError, {
|
|
98
143
|
decode: SchemaGetter.transform((body) => new RuntimeResourcesBadRequestError(body)),
|
|
99
144
|
encode: SchemaGetter.transform((error) => ({ error: error.error })),
|
|
@@ -106,6 +151,17 @@ const unavailableError = ErrorBodySchema.pipe(Schema.decodeTo(RuntimeResourcesUn
|
|
|
106
151
|
decode: SchemaGetter.transform((body) => new RuntimeResourcesUnavailableError(body)),
|
|
107
152
|
encode: SchemaGetter.transform((error) => ({ error: error.error })),
|
|
108
153
|
}), HttpApiSchema.status(503));
|
|
154
|
+
const partnerLoginError = PartnerLoginBodySchema.pipe(Schema.decodeTo(RuntimeResourcesPartnerLoginError, {
|
|
155
|
+
decode: SchemaGetter.transform((body) => new RuntimeResourcesPartnerLoginError(body)),
|
|
156
|
+
encode: SchemaGetter.transform(({ error, partnerStatus, oauthError }) => {
|
|
157
|
+
const body = { error };
|
|
158
|
+
if (partnerStatus !== undefined)
|
|
159
|
+
body.partnerStatus = partnerStatus;
|
|
160
|
+
if (oauthError !== undefined)
|
|
161
|
+
body.oauthError = oauthError;
|
|
162
|
+
return body;
|
|
163
|
+
}),
|
|
164
|
+
}), HttpApiSchema.status(502));
|
|
109
165
|
const runtimeErrors = [
|
|
110
166
|
unauthorizedError,
|
|
111
167
|
forbiddenError,
|
|
@@ -138,6 +194,14 @@ const ResourcesRuntimeHttpApiGroup = HttpApiGroup.make('resourcesRuntime')
|
|
|
138
194
|
payload: SelectResourceRuntimeInputSchema,
|
|
139
195
|
success: SelectResourceRuntimeResponseSchema,
|
|
140
196
|
error: runtimeErrors,
|
|
197
|
+
}))
|
|
198
|
+
.add(HttpApiEndpoint.post('issueAccessToken', '/resources/access-token', {
|
|
199
|
+
headers: AuthorizationHeadersSchema,
|
|
200
|
+
payload: IssueAccessTokenInputSchema,
|
|
201
|
+
success: IssuedAccessTokenSchema,
|
|
202
|
+
// The route answers a missing record with `recordNotFoundError`; `Not found` stays declared so a client reads an
|
|
203
|
+
// API without this route, which answers `{ error: 'Not found' }`.
|
|
204
|
+
error: [...runtimeErrors, recordNotFoundError, partnerLoginError],
|
|
141
205
|
}))
|
|
142
206
|
.prefix('/api/v1/runtime')
|
|
143
207
|
.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.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ER_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, type BuiltWorkflowManifest, decodeWorkflowSteps, FlowStep, FlowStepKind, ManifestResource, ResponsePolicy, TriggerKind, STEP_DETAIL_RUNS, STEP_EXTRA_FAILED_LINES, STEP_LOG_FIELDS, type StepLogEvent, TriggerMetadata, WorkflowManifest, WorkflowManifestEndpoint, WorkflowSteps, } 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, RuntimeResourcesRecordNotFoundError, 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,KAAK,qBAAqB,EAC1B,mBAAmB,EACnB,QAAQ,EACR,YAAY,EACZ,gBAAgB,EAChB,cAAc,EACd,WAAW,EACX,gBAAgB,EAChB,uBAAuB,EACvB,eAAe,EACf,KAAK,YAAY,EACjB,eAAe,EACf,gBAAgB,EAChB,wBAAwB,EACxB,aAAa,GACd,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,KAAK,qBAAqB,EAC1B,mBAAmB,EACnB,QAAQ,EACR,YAAY,EACZ,gBAAgB,EAChB,cAAc,EACd,WAAW,EACX,gBAAgB,EAChB,uBAAuB,EACvB,eAAe,EACf,KAAK,YAAY,EACjB,eAAe,EACf,gBAAgB,EAChB,wBAAwB,EACxB,aAAa,GACd,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,uBAAuB,EACvB,uBAAuB,EACvB,mBAAmB,EACnB,+BAA+B,EAC/B,6BAA6B,EAC7B,8BAA8B,EAC9B,6BAA6B,EAC7B,iCAAiC,EACjC,mCAAmC,EACnC,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, decodeWorkflowSteps, FlowStep, FlowStepKind, ManifestResource, ResponsePolicy, TriggerKind, STEP_DETAIL_RUNS, STEP_EXTRA_FAILED_LINES, STEP_LOG_FIELDS, TriggerMetadata, WorkflowManifest, WorkflowManifestEndpoint, WorkflowSteps, } 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, RuntimeResourcesRecordNotFoundError, 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,EAEhB,mBAAmB,EACnB,QAAQ,EACR,YAAY,EACZ,gBAAgB,EAChB,cAAc,EACd,WAAW,EACX,gBAAgB,EAChB,uBAAuB,EACvB,eAAe,EAEf,eAAe,EACf,gBAAgB,EAChB,wBAAwB,EACxB,aAAa,GACd,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,EAEhB,mBAAmB,EACnB,QAAQ,EACR,YAAY,EACZ,gBAAgB,EAChB,cAAc,EACd,WAAW,EACX,gBAAgB,EAChB,uBAAuB,EACvB,eAAe,EAEf,eAAe,EACf,gBAAgB,EAChB,wBAAwB,EACxB,aAAa,GACd,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,uBAAuB,EACvB,uBAAuB,EACvB,mBAAmB,EACnB,+BAA+B,EAC/B,6BAA6B,EAC7B,8BAA8B,EAC9B,6BAA6B,EAC7B,iCAAiC,EACjC,mCAAmC,EACnC,iCAAiC,EACjC,gCAAgC,EAChC,gCAAgC,EAChC,iCAAiC,GAClC,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Context, Effect, Layer, Schema } from 'effect';
|
|
2
|
+
import { HttpClient } from 'effect/http';
|
|
3
|
+
import type { HttpApiResource } from './HttpApiResource.js';
|
|
4
|
+
import { RuntimeResources } from './RuntimeResources.js';
|
|
5
|
+
declare const UnsupportedHttpApiResourceError_base: Schema.Class<UnsupportedHttpApiResourceError, Schema.TaggedStruct<"UnsupportedHttpApiResourceError", {
|
|
6
|
+
readonly target: Schema.String;
|
|
7
|
+
readonly message: Schema.String;
|
|
8
|
+
}>, import("effect/Cause").YieldableError>;
|
|
9
|
+
/** The record names an authentication or connection setting this client cannot apply; it never sends without it. */
|
|
10
|
+
export declare class UnsupportedHttpApiResourceError extends UnsupportedHttpApiResourceError_base {
|
|
11
|
+
}
|
|
12
|
+
export interface HttpApiClientsService {
|
|
13
|
+
/**
|
|
14
|
+
* An `HttpClient` for the `http_api` record at `resourceKey`. Each request joins the record's `baseUrl`,
|
|
15
|
+
* carries its headers and authentication, and uses its TLS and proxy settings. For `oauth2_client_credentials`
|
|
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.
|
|
19
|
+
*/
|
|
20
|
+
readonly client: (resourceKey: string, record: HttpApiResource) => Effect.Effect<HttpClient.HttpClient, UnsupportedHttpApiResourceError>;
|
|
21
|
+
}
|
|
22
|
+
declare const HttpApiClients_base: Context.ServiceClass<HttpApiClients, "@temper/workflow/HttpApiClients", HttpApiClientsService>;
|
|
23
|
+
/** Authenticated partner clients built from `http_api` records. Contract: WFSDK-016 in docs/specs/workflow-sdk.md. */
|
|
24
|
+
export declare class HttpApiClients extends HttpApiClients_base {
|
|
25
|
+
static readonly layer: Layer.Layer<HttpApiClients, never, HttpClient.HttpClient | RuntimeResources>;
|
|
26
|
+
}
|
|
27
|
+
/** The layer for a runtime whose `fetch` does (`bun`) or does not apply `tls` and `proxy`; not exported by the package. */
|
|
28
|
+
export declare const httpApiClientsLayer: (bun: boolean) => Layer.Layer<HttpApiClients, never, HttpClient.HttpClient | RuntimeResources>;
|
|
29
|
+
export {};
|
|
30
|
+
//# sourceMappingURL=HttpApiClient.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|