@ontemper/sdk 0.9.0-oauth.2 → 0.9.0-oauth.4

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.
Files changed (43) hide show
  1. package/README.md +34 -19
  2. package/dist/AccessTokens.d.ts +10 -8
  3. package/dist/AccessTokens.d.ts.map +1 -1
  4. package/dist/AccessTokens.js +54 -25
  5. package/dist/AccessTokens.js.map +1 -1
  6. package/dist/Contract/RuntimeApi.d.ts +53 -0
  7. package/dist/Contract/RuntimeApi.d.ts.map +1 -1
  8. package/dist/Contract/RuntimeApi.js +64 -0
  9. package/dist/Contract/RuntimeApi.js.map +1 -1
  10. package/dist/Contract/index.d.ts +1 -1
  11. package/dist/Contract/index.d.ts.map +1 -1
  12. package/dist/Contract/index.js +1 -1
  13. package/dist/Contract/index.js.map +1 -1
  14. package/dist/HttpApiClient.d.ts +6 -4
  15. package/dist/HttpApiClient.d.ts.map +1 -1
  16. package/dist/HttpApiClient.js +25 -66
  17. package/dist/HttpApiClient.js.map +1 -1
  18. package/dist/HttpApiResource.d.ts +133 -0
  19. package/dist/HttpApiResource.d.ts.map +1 -1
  20. package/dist/HttpApiResource.js +31 -3
  21. package/dist/HttpApiResource.js.map +1 -1
  22. package/dist/Manifest.d.ts +1 -1
  23. package/dist/Manifest.js +1 -1
  24. package/dist/OAuthToken.d.ts +34 -6
  25. package/dist/OAuthToken.d.ts.map +1 -1
  26. package/dist/OAuthToken.js +65 -10
  27. package/dist/OAuthToken.js.map +1 -1
  28. package/dist/RuntimeResources.d.ts +8 -1
  29. package/dist/RuntimeResources.d.ts.map +1 -1
  30. package/dist/RuntimeResources.js +43 -10
  31. package/dist/RuntimeResources.js.map +1 -1
  32. package/dist/Workflow.d.ts.map +1 -1
  33. package/dist/Workflow.js +5 -3
  34. package/dist/Workflow.js.map +1 -1
  35. package/dist/index.d.ts +2 -2
  36. package/dist/index.d.ts.map +1 -1
  37. package/dist/index.js +1 -1
  38. package/dist/index.js.map +1 -1
  39. package/dist/testing.d.ts +9 -3
  40. package/dist/testing.d.ts.map +1 -1
  41. package/dist/testing.js +64 -6
  42. package/dist/testing.js.map +1 -1
  43. 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 2. `auth` is one of `none`, `basic`,
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`, 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`,
@@ -222,21 +223,33 @@ const response = yield * carrier.get('/v1/shipments');
222
223
  ```
223
224
 
224
225
  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 client requests the access token with the record's `tokenRequest`, including `private_key_jwt` client
228
- authentication, and keeps it in the memory of this VM. Another VM of the workflow requests its own.
229
- - The token request does not carry the record's `headers`, and it fails on a redirect: the client's
230
- credentials go only to the `tokenUrl` the record names. It fails when the token endpoint does not answer
231
- in 15 seconds. The record's `tls` and `proxy` settings apply to it, also when the `tokenUrl` names
232
- another host than the `baseUrl`.
233
- - A token belongs to one login: the resource key with the token URL, client, user, scope, audience, and extra
234
- parameters. Two records read under one key, such as two tenants, never share a token.
235
- - It reuses the token until 30 seconds before it expires. Concurrent calls for one login wait for one token
236
- request and share its token. A token answer without a positive `expires_in` is used for one call only.
237
- - A failed or interrupted token request keeps nothing, so the next call requests again.
238
- - After a 401 answer, the client requests a new token and sends the request one more time. A request with a
239
- stream body is not sent again: the workflow gets the 401, and the next call requests a new token.
226
+ For the two OAuth types, workflow code holds no token, and the VM never logs in to the partner:
227
+
228
+ - The Temper API logs in with the record's `tokenRequest`, including `private_key_jwt` client authentication and
229
+ the token-request `headers` (for example a login API key), and keeps the token in its memory. Every VM of
230
+ the organization that uses the same login gets that token until 60 seconds before it expires. Each API
231
+ process logs in on its own, so the partner must accept tokens from several API processes at the same time.
232
+ The client asks for the token at `POST /api/v1/runtime/resources/access-token`, within one 20-second deadline.
233
+ - The key must name a stored `http_api` record in the workflow's reach: the API resolves the key itself, so a
234
+ record that workflow code builds gets no token. On a stack whose Temper API does not have the route yet, the
235
+ call fails with a message that says so; update the API first.
236
+ - The client names the login identity of its record: a hash of the base URL, auth type, token URL, client id,
237
+ username, scope, audience, `extraParams`, and token-request `headers`, without the client secret, private key,
238
+ or password. When the key names a record with another identity, the call fails with
239
+ `Resource <key> changed since this workflow read it`. After an edit of one of these fields (a login header
240
+ value included, also a secret one), a running workflow gets this error until it reads the record again; the SDK
241
+ caches a resolved record for 30 seconds.
242
+ - The client keeps the token in the memory of this VM until 30 seconds before it expires, per resource key and
243
+ login identity. Two records read under one key, such as two tenants, never share a token. A rotated secret
244
+ keeps the held token until it expires or the partner answers 401. Concurrent calls for one login share one
245
+ request to the API. A token answer without a lifetime serves one call.
246
+ - A failed or interrupted request keeps no token, so the next call asks again. A failed partner login fails the
247
+ call with an `HttpClientError` that names the key, the partner's HTTP status, and its OAuth error code.
248
+ - After a 401 answer, the client tells the API which token the partner refused and sends the request one more
249
+ time with the token the API answers. A second 401 goes to the workflow. The API logs in again only for a
250
+ refused token whose login is 60 seconds old or more, at most once in 5 seconds; a login the partner refused
251
+ with 400, 401, or 403 answers with that failure for 60 seconds. A request with a stream body is not sent
252
+ again: the workflow gets the 401, and the next call asks the API again.
240
253
 
241
254
  A partner call follows redirects as `fetch` does. On a redirect to another origin, `fetch` removes
242
255
  `Authorization` only: an API key in another header, and the record's `headers`, go to that origin. To stop
@@ -244,8 +257,10 @@ that for a partner that redirects, provide `FetchHttpClient.RequestInit` with `r
244
257
 
245
258
  The client fails with `UnsupportedHttpApiResourceError` and sends nothing for a setting it cannot apply:
246
259
  `oauth2_jwt_bearer`, `oauth1_tba`, `aws_sigv4`, an auth type a newer platform added, and TLS or proxy settings
247
- outside the Bun runtime. The message is `Resource <key> uses <setting>, which the workflow HTTP client does not
248
- support.` In tests, `testPlatform({ fetch })` answers the token requests too.
260
+ outside the Bun runtime, and, on an OAuth record, TLS or proxy settings or a token URL that is not https. The
261
+ message is `Resource <key> uses <setting>, which the workflow HTTP client does not support.` In tests,
262
+ `testPlatform({ fetch, resources })` logs in for each token in memory: it sends the record's token request through
263
+ `fetch`.
249
264
 
250
265
  ## Invoke in a test
251
266
 
@@ -1,20 +1,22 @@
1
1
  import { Effect, Redacted } from 'effect';
2
- /** What a partner's token endpoint issued. */
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
- /** The partner's lifetime in seconds (`expires_in`). A value that is not a positive number means "use once". */
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
- * Concurrent calls for one login share one request. A failed or interrupted `request` keeps nothing.
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 never uses it again, and its next `get` replaces it. */
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
- /** Partner access tokens held in the memory of this VM and reused until they expire. */
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,EAAS,MAAM,EAAE,QAAQ,EAAa,MAAM,QAAQ,CAAC;AAM5D,8CAA8C;AAC9C,MAAM,WAAW,iBAAiB;IAChC,+EAA+E;IAC/E,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC1C,gHAAgH;IAChH,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,YAAY;IAC3B;;;OAGG;IACH,QAAQ,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,EACjB,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,iBAAiB,EAAE,CAAC,EAAE,CAAC,CAAC,KAC5C,MAAM,CAAC,MAAM,CAA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AM,gBAAgB,QAAO,YAyEnC,CAAC"}
@@ -1,39 +1,68 @@
1
- import { Clock, Effect, Redacted, Semaphore } from '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
- /** Partner access tokens held in the memory of this VM and reused until they expire. */
6
+ /** Platform-issued access tokens held in the memory of this VM and reused until they expire. */
7
7
  export const makeAccessTokens = () => {
8
- const held = new Map();
9
- const locks = new Map();
10
- const lockOf = (login) => {
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 lock = Semaphore.makeUnsafe(1);
15
- locks.set(login, lock);
16
- return lock;
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 local = held.get(login);
20
- if (local !== undefined && usable(local.expiresAt, yield* Clock.currentTimeMillis)) {
21
- return Redacted.make(local.token);
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
- // The lifetime counts from the start of the request: the partner's clock ran while its answer travelled.
24
- const requestedAt = yield* Clock.currentTimeMillis;
25
- const issued = yield* request;
26
- const token = Redacted.value(issued.token);
27
- yield* registerSecrets([token]);
28
- const expiresAt = requestedAt + issued.expiresIn * 1000;
29
- if (!Number.isFinite(expiresAt) || !usable(expiresAt, yield* Clock.currentTimeMillis))
30
- return issued.token;
31
- held.set(login, { token, expiresAt });
32
- return issued.token;
33
- }).pipe(Semaphore.withPermit(lockOf(login)));
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
- if (held.get(login)?.token === Redacted.value(token))
36
- held.delete(login);
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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C,CAAC;IAEL,MAAM,MAAM,GAA2B,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CACtD,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE;QACf,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;QAC7B,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QACpC,IAAI,KAAK,CAAC,IAAI,EAAE,KAAK,KAAK,KAAK;YAAE,KAAK,CAAC,IAAI,GAAG,SAAS,CAAC;QACxD,KAAK,CAAC,OAAO,GAAG,KAAK,CAAC;IACxB,CAAC,CAAC,CAAC;IAEL,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,CAAC;AACzB,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;AAUjG,eAAO,MAAM,gCAAgC;;;EAK3C,CAAC;AAmBH,yHAAyH;AACzH,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;EAyBzC,CAAC;AAOH,eAAO,MAAM,iCAAiC;;EAE5C,CAAC;;;;AAaH,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;AAmGJ,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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0E,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;AAEjG,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,GAAG,MAAM,CAAC,MAAM,CAAC;IAC1C,GAAG,EAAE,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,WAAW,EAAE,2BAA2B,EAAE,CAAC;CAC1E,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,gCAAgC,GAAG,MAAM,CAAC,MAAM,CAAC;IAC5D,eAAe,EAAE,MAAM,CAAC,MAAM;IAC9B,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC;QAC1D,WAAW,EAAE,qEA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OCOL_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, 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,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,mCAAmC,EACnC,iCAAiC,EACjC,gCAAgC,EAChC,gCAAgC,EAChC,iCAAiC,GAClC,MAAM,iBAAiB,CAAC"}
@@ -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, 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,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,mCAAmC,EACnC,iCAAiC,EACjC,gCAAgC,EAChC,gCAAgC,EAChC,iCAAiC,GAClC,MAAM,iBAAiB,CAAC"}
@@ -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 client requests the access token, reuses it in this VM until 30 seconds before it
16
- * expires, and after a 401 answer requests a new token and sends the request one more time.
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,EAAS,OAAO,EAAE,MAAM,EAAE,KAAK,EAAoB,MAAM,EAAE,MAAM,QAAQ,CAAC;AACjF,OAAO,EAAmB,UAAU,EAA0D,MAAM,aAAa,CAAC;AAGlH,OA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