@xemahq/app-platform-internal-api-client 0.3.9 → 0.3.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/custom-fetch.d.ts +22 -0
- package/dist/custom-fetch.js +27 -0
- package/dist/endpoints/apps/apps.d.ts +1 -1
- package/dist/endpoints/apps/apps.js +1 -1
- package/dist/models/appDto.d.ts +5 -3
- package/dist/models/appsControllerListParams.d.ts +7 -0
- package/dist/models/audiencePolicyDto.d.ts +4 -3
- package/dist/models/createAppDto.d.ts +3 -3
- package/dist/models/createAudiencePolicyDto.d.ts +3 -1
- package/dist/models/index.d.ts +0 -2
- package/dist/models/index.js +0 -2
- package/dist/models/updateAppDto.d.ts +3 -3
- package/dist/models/updateAudiencePolicyDto.d.ts +2 -3
- package/package.json +2 -2
- package/dist/models/audiencePolicyDtoRateLimitPerHourPerSubject.d.ts +0 -11
- package/dist/models/audiencePolicyDtoRateLimitPerHourPerSubject.js +0 -7
- package/dist/models/updateAudiencePolicyDtoRateLimitPerHourPerSubject.d.ts +0 -11
- package/dist/models/updateAudiencePolicyDtoRateLimitPerHourPerSubject.js +0 -7
package/dist/custom-fetch.d.ts
CHANGED
|
@@ -47,6 +47,28 @@ export interface ClientConfig {
|
|
|
47
47
|
getAuthToken?: () => Promise<string>;
|
|
48
48
|
/** Optional callback returning headers to inject on every request. Per-call headers take precedence. */
|
|
49
49
|
getHeaders?: () => Record<string, string> | Promise<Record<string, string>>;
|
|
50
|
+
/**
|
|
51
|
+
* Optional resolver for the CORRELATION ID of the request being made — the
|
|
52
|
+
* handle that ties one causal chain together across every service hop.
|
|
53
|
+
*
|
|
54
|
+
* WHY IT IS A CALLBACK AND NOT A VALUE. `ClientConfig` is process-global
|
|
55
|
+
* (`configureClient` is called once at wiring time), and a correlation id is
|
|
56
|
+
* per-request. This is invoked INSIDE the request, so a server can point it
|
|
57
|
+
* at whatever carries its ambient request context and get the CURRENT id
|
|
58
|
+
* rather than the one that happened to be live at boot.
|
|
59
|
+
*
|
|
60
|
+
* WHY THE TRANSPORT DOES NOT MINT ONE. Returning `undefined` sends no header,
|
|
61
|
+
* and the receiving service's `RequestContextMiddleware` mints its own — a
|
|
62
|
+
* new trace, which is honest. A transport that minted per call would produce
|
|
63
|
+
* a FRESH id on every hop while looking like propagation, which is strictly
|
|
64
|
+
* worse than none: every row would carry a correlation id and no two rows
|
|
65
|
+
* that belong together would share one. That is the exact defect this exists
|
|
66
|
+
* to fix, so the transport must not reproduce it one layer down.
|
|
67
|
+
*
|
|
68
|
+
* A caller-supplied `X-Correlation-Id` header always wins, and so does one
|
|
69
|
+
* from `getHeaders`.
|
|
70
|
+
*/
|
|
71
|
+
getCorrelationId?: () => string | undefined | Promise<string | undefined>;
|
|
50
72
|
/**
|
|
51
73
|
* Optional callback invoked on a 401 before ONE re-attempt. Supplying it is
|
|
52
74
|
* what opts this client into that re-attempt; without it a 401 comes back to
|
package/dist/custom-fetch.js
CHANGED
|
@@ -89,6 +89,16 @@ function getClientConfig() {
|
|
|
89
89
|
*/
|
|
90
90
|
/** The only statuses that state the request was NOT processed. See above. */
|
|
91
91
|
const RETRYABLE_STATUSES = [429, 503];
|
|
92
|
+
/**
|
|
93
|
+
* The platform's correlation header, spelled once.
|
|
94
|
+
*
|
|
95
|
+
* Value-identical to what `RequestContextMiddleware` reads in
|
|
96
|
+
* `@xemahq/platform-common`. It is a literal here rather than an import
|
|
97
|
+
* because this file has ZERO imports on purpose: it ships byte-identical into
|
|
98
|
+
* browser-target clients as well as server-target ones, and a dependency on a
|
|
99
|
+
* NestJS-peer package would follow it into every one of them.
|
|
100
|
+
*/
|
|
101
|
+
const CORRELATION_ID_HEADER = 'X-Correlation-Id';
|
|
92
102
|
/** Backoff floor, doubling per attempt up to {@link MAX_BACKOFF_MS}. */
|
|
93
103
|
const BASE_BACKOFF_MS = 1000;
|
|
94
104
|
/** Ceiling on a single backoff, however many attempts have elapsed. */
|
|
@@ -104,6 +114,23 @@ async function buildHeaders(config, callerHeaders) {
|
|
|
104
114
|
}
|
|
105
115
|
}
|
|
106
116
|
}
|
|
117
|
+
// Correlation id (caller and global headers still take precedence).
|
|
118
|
+
//
|
|
119
|
+
// Without this, every server-to-server hop through a generated client started
|
|
120
|
+
// a NEW trace: the id is read-or-minted per hop by the receiving service's
|
|
121
|
+
// RequestContextMiddleware, and nothing carried it outbound — so an audit
|
|
122
|
+
// journal could record a whole causal chain and offer no way to join it back
|
|
123
|
+
// together.
|
|
124
|
+
//
|
|
125
|
+
// Absent resolver, or a resolver that answers `undefined`: NO header. The
|
|
126
|
+
// receiver mints and a new trace begins, which is the truthful outcome when
|
|
127
|
+
// there is nothing to continue.
|
|
128
|
+
if (config.getCorrelationId && !headers.has(CORRELATION_ID_HEADER)) {
|
|
129
|
+
const correlationId = await Promise.resolve(config.getCorrelationId());
|
|
130
|
+
if (correlationId) {
|
|
131
|
+
headers.set(CORRELATION_ID_HEADER, correlationId);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
107
134
|
// Auth token (caller or global headers take precedence)
|
|
108
135
|
if (config.getAuthToken && !headers.has('Authorization')) {
|
|
109
136
|
const token = await config.getAuthToken();
|
|
@@ -11,7 +11,7 @@ export declare const getAppsControllerCreateUrl: () => string;
|
|
|
11
11
|
export declare const appsControllerCreate: (createAppDto: CreateAppDto, options?: RequestInit) => Promise<AppDtoDataEnvelope>;
|
|
12
12
|
export declare const getAppsControllerListUrl: (params?: AppsControllerListParams) => string;
|
|
13
13
|
/**
|
|
14
|
-
* @summary List Apps (filtered by orgId, projectId, portalOnly, and/or slug).
|
|
14
|
+
* @summary List Apps (filtered by orgId, projectId, portalOnly, and/or slug). Archived Apps are excluded unless `includeArchived=true`.
|
|
15
15
|
*/
|
|
16
16
|
export declare const appsControllerList: (params?: AppsControllerListParams, options?: RequestInit) => Promise<AppDtoDataArrayEnvelope>;
|
|
17
17
|
export declare const getAppsControllerGetByIdUrl: (id: string) => string;
|
|
@@ -42,7 +42,7 @@ const getAppsControllerListUrl = (params) => {
|
|
|
42
42
|
};
|
|
43
43
|
exports.getAppsControllerListUrl = getAppsControllerListUrl;
|
|
44
44
|
/**
|
|
45
|
-
* @summary List Apps (filtered by orgId, projectId, portalOnly, and/or slug).
|
|
45
|
+
* @summary List Apps (filtered by orgId, projectId, portalOnly, and/or slug). Archived Apps are excluded unless `includeArchived=true`.
|
|
46
46
|
*/
|
|
47
47
|
const appsControllerList = async (params, options) => {
|
|
48
48
|
return (0, custom_fetch_1.customFetch)((0, exports.getAppsControllerListUrl)(params), {
|
package/dist/models/appDto.d.ts
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* OpenAPI spec version: 0.1.2
|
|
5
5
|
*/
|
|
6
6
|
import type { AppLockfileDto } from './appLockfileDto.js';
|
|
7
|
+
import type { AudienceKind } from './audienceKind.js';
|
|
7
8
|
import type { BiomeInstallDto } from './biomeInstallDto.js';
|
|
8
9
|
import type { BrandingConfigDto } from './brandingConfigDto.js';
|
|
9
10
|
import type { CapabilityPolicyOverrideDto } from './capabilityPolicyOverrideDto.js';
|
|
@@ -22,13 +23,14 @@ export interface AppDto {
|
|
|
22
23
|
lockfile: AppLockfileDto;
|
|
23
24
|
installedBiomes: BiomeInstallDto[];
|
|
24
25
|
capabilityPolicy: CapabilityPolicyOverrideDto[];
|
|
25
|
-
/**
|
|
26
|
-
subdomain: string | null;
|
|
26
|
+
/** Whether this App is reachable on a public host. The host itself is DERIVED (see `codedAppSubdomain`), never tenant-chosen — this is the switch for WHETHER, not WHERE. */
|
|
27
27
|
subdomainEnabled: boolean;
|
|
28
|
-
defaultAudience:
|
|
28
|
+
defaultAudience: AudienceKind;
|
|
29
29
|
archived: boolean;
|
|
30
30
|
/** Provisioning ownership marker. `iac` = managed by the declarative control plane (Terraform / xema.yaml); `seeder` = a distribution default; `ui` = hand-managed (or adopted from iac/seeder via a UI edit); `system` = platform-shipped; null = unmanaged/legacy. Lets a console badge an IaC-owned resource and surface an "export as code" affordance. */
|
|
31
31
|
managedBy: ResourceManagedBy | null;
|
|
32
|
+
/** Whether this App can be handed back to the portal reconciler — the exact precondition of POST /bff/portals/:id/readopt (true iff the row carries the reconciler natural key). Read-only, server-derived. A `ui`-managed App with readoptable=false was hand-created and was never reconciler-owned; with readoptable=true it is an adopted default portal, and readopt restores automatic updates. */
|
|
33
|
+
readoptable: boolean;
|
|
32
34
|
createdAt: string;
|
|
33
35
|
updatedAt: string;
|
|
34
36
|
}
|
|
@@ -7,5 +7,12 @@ export type AppsControllerListParams = {
|
|
|
7
7
|
orgId?: string;
|
|
8
8
|
projectId?: string;
|
|
9
9
|
slug?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Restrict to ORG-scoped Apps (projectId IS NULL).
|
|
12
|
+
*/
|
|
10
13
|
portalOnly?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Include archived Apps. Default false — an archived App is refused by public ingress and by every external-auth flow, so it is out of the listing unless explicitly asked for.
|
|
16
|
+
*/
|
|
17
|
+
includeArchived?: boolean;
|
|
11
18
|
};
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
* OpenAPI spec version: 0.1.2
|
|
5
5
|
*/
|
|
6
6
|
import type { AudienceKind } from './audienceKind.js';
|
|
7
|
-
import type { AudiencePolicyDtoRateLimitPerHourPerSubject } from './audiencePolicyDtoRateLimitPerHourPerSubject.js';
|
|
8
7
|
import type { AudienceUpstreamDto } from './audienceUpstreamDto.js';
|
|
9
8
|
export interface AudiencePolicyDto {
|
|
10
9
|
id: string;
|
|
@@ -12,8 +11,10 @@ export interface AudiencePolicyDto {
|
|
|
12
11
|
kind: AudienceKind;
|
|
13
12
|
allowedEnvironments: string[];
|
|
14
13
|
authUpstream?: AudienceUpstreamDto | null;
|
|
15
|
-
/**
|
|
16
|
-
rateLimitPerHourPerSubject
|
|
14
|
+
/** Session opens per hour for ONE identified external subject. Never null: a null used to mean "no limit", so an audience created without one was uncapped while reading as configured. */
|
|
15
|
+
rateLimitPerHourPerSubject: number;
|
|
16
|
+
/** Session opens per hour for the whole AppClient, across subjects. This is the cap the ANONYMOUS door is measured against — an anon subject is minted fresh on every call, so no per-subject bucket can bound it. */
|
|
17
|
+
rateLimitPerHourPerClient: number;
|
|
17
18
|
createdAt: string;
|
|
18
19
|
updatedAt: string;
|
|
19
20
|
}
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* OpenAPI spec version: 0.1.2
|
|
5
5
|
*/
|
|
6
6
|
import type { AppLockfileDto } from './appLockfileDto.js';
|
|
7
|
+
import type { AudienceKind } from './audienceKind.js';
|
|
7
8
|
import type { BiomeInstallDto } from './biomeInstallDto.js';
|
|
8
9
|
import type { BrandingConfigDto } from './brandingConfigDto.js';
|
|
9
10
|
import type { CapabilityPolicyOverrideDto } from './capabilityPolicyOverrideDto.js';
|
|
@@ -24,10 +25,9 @@ export interface CreateAppDto {
|
|
|
24
25
|
lockfile: AppLockfileDto;
|
|
25
26
|
installedBiomes: BiomeInstallDto[];
|
|
26
27
|
capabilityPolicy: CapabilityPolicyOverrideDto[];
|
|
27
|
-
/**
|
|
28
|
-
subdomain?: string | null;
|
|
28
|
+
/** Whether this App is reachable on a public host. The host itself is DERIVED, never tenant-chosen — this is the switch for WHETHER, not WHERE. */
|
|
29
29
|
subdomainEnabled?: boolean;
|
|
30
|
-
defaultAudience?:
|
|
30
|
+
defaultAudience?: AudienceKind;
|
|
31
31
|
archived?: boolean;
|
|
32
32
|
/** Authoring tier. `declared` (the default) and `composed` Apps ARE their JSON definition. A `coded` App is one the platform hosts but does not author — a Webapp Studio session builds a container image from the user's own repo, and every release of it carries that image coordinate. Immutable after creation: the tier decides what a release IS, so changing it would leave existing releases describing the wrong thing. */
|
|
33
33
|
surface?: SurfaceKind;
|
|
@@ -10,6 +10,8 @@ export interface CreateAudiencePolicyDto {
|
|
|
10
10
|
/** ExecutionEnvironmentRef slugs this audience may invoke. Required. */
|
|
11
11
|
allowedEnvironments: string[];
|
|
12
12
|
authUpstream?: AudienceUpstreamDto;
|
|
13
|
-
/**
|
|
13
|
+
/** Session opens per hour for ONE identified external subject. Omitted means the column default, NOT "unlimited" — there is no value that means unlimited. */
|
|
14
14
|
rateLimitPerHourPerSubject?: number;
|
|
15
|
+
/** Session opens per hour for the whole AppClient, across subjects. This is the cap the ANONYMOUS door is measured against — an anon subject is minted fresh on every call, so no per-subject bucket can bound it. Omitted means the column default, NOT "unlimited". */
|
|
16
|
+
rateLimitPerHourPerClient?: number;
|
|
15
17
|
}
|
package/dist/models/index.d.ts
CHANGED
|
@@ -29,7 +29,6 @@ export * from './audienceKind';
|
|
|
29
29
|
export * from './audiencePolicyDto';
|
|
30
30
|
export * from './audiencePolicyDtoDataArrayEnvelope';
|
|
31
31
|
export * from './audiencePolicyDtoDataEnvelope';
|
|
32
|
-
export * from './audiencePolicyDtoRateLimitPerHourPerSubject';
|
|
33
32
|
export * from './audienceUpstreamDto';
|
|
34
33
|
export * from './audienceUpstreamDtoMetadata';
|
|
35
34
|
export * from './audienceUpstreamType';
|
|
@@ -64,7 +63,6 @@ export * from './spaceKind';
|
|
|
64
63
|
export * from './surfaceKind';
|
|
65
64
|
export * from './updateAppDto';
|
|
66
65
|
export * from './updateAudiencePolicyDto';
|
|
67
|
-
export * from './updateAudiencePolicyDtoRateLimitPerHourPerSubject';
|
|
68
66
|
export * from './xemaObjectKind';
|
|
69
67
|
export * from './xemaObjectResponseDto';
|
|
70
68
|
export * from './xemaObjectResponseDtoPayload';
|
package/dist/models/index.js
CHANGED
|
@@ -46,7 +46,6 @@ __exportStar(require("./audienceKind"), exports);
|
|
|
46
46
|
__exportStar(require("./audiencePolicyDto"), exports);
|
|
47
47
|
__exportStar(require("./audiencePolicyDtoDataArrayEnvelope"), exports);
|
|
48
48
|
__exportStar(require("./audiencePolicyDtoDataEnvelope"), exports);
|
|
49
|
-
__exportStar(require("./audiencePolicyDtoRateLimitPerHourPerSubject"), exports);
|
|
50
49
|
__exportStar(require("./audienceUpstreamDto"), exports);
|
|
51
50
|
__exportStar(require("./audienceUpstreamDtoMetadata"), exports);
|
|
52
51
|
__exportStar(require("./audienceUpstreamType"), exports);
|
|
@@ -81,7 +80,6 @@ __exportStar(require("./spaceKind"), exports);
|
|
|
81
80
|
__exportStar(require("./surfaceKind"), exports);
|
|
82
81
|
__exportStar(require("./updateAppDto"), exports);
|
|
83
82
|
__exportStar(require("./updateAudiencePolicyDto"), exports);
|
|
84
|
-
__exportStar(require("./updateAudiencePolicyDtoRateLimitPerHourPerSubject"), exports);
|
|
85
83
|
__exportStar(require("./xemaObjectKind"), exports);
|
|
86
84
|
__exportStar(require("./xemaObjectResponseDto"), exports);
|
|
87
85
|
__exportStar(require("./xemaObjectResponseDtoPayload"), exports);
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* OpenAPI spec version: 0.1.2
|
|
5
5
|
*/
|
|
6
6
|
import type { AppLockfileDto } from './appLockfileDto.js';
|
|
7
|
+
import type { AudienceKind } from './audienceKind.js';
|
|
7
8
|
import type { BiomeInstallDto } from './biomeInstallDto.js';
|
|
8
9
|
import type { BrandingConfigDto } from './brandingConfigDto.js';
|
|
9
10
|
import type { CapabilityPolicyOverrideDto } from './capabilityPolicyOverrideDto.js';
|
|
@@ -14,8 +15,7 @@ export interface UpdateAppDto {
|
|
|
14
15
|
lockfile?: AppLockfileDto;
|
|
15
16
|
installedBiomes?: BiomeInstallDto[];
|
|
16
17
|
capabilityPolicy?: CapabilityPolicyOverrideDto[];
|
|
17
|
-
/**
|
|
18
|
-
subdomain?: string | null;
|
|
18
|
+
/** Whether this App is reachable on a public host. The host itself is DERIVED, never tenant-chosen — this is the switch for WHETHER, not WHERE. */
|
|
19
19
|
subdomainEnabled?: boolean;
|
|
20
|
-
defaultAudience?:
|
|
20
|
+
defaultAudience?: AudienceKind;
|
|
21
21
|
}
|
|
@@ -4,10 +4,9 @@
|
|
|
4
4
|
* OpenAPI spec version: 0.1.2
|
|
5
5
|
*/
|
|
6
6
|
import type { AudienceUpstreamDto } from './audienceUpstreamDto.js';
|
|
7
|
-
import type { UpdateAudiencePolicyDtoRateLimitPerHourPerSubject } from './updateAudiencePolicyDtoRateLimitPerHourPerSubject.js';
|
|
8
7
|
export interface UpdateAudiencePolicyDto {
|
|
9
8
|
allowedEnvironments?: string[];
|
|
10
9
|
authUpstream?: AudienceUpstreamDto | null;
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
rateLimitPerHourPerSubject?: number;
|
|
11
|
+
rateLimitPerHourPerClient?: number;
|
|
13
12
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xemahq/app-platform-internal-api-client",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.13",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"service": "app-platform-api",
|
|
20
20
|
"biome": "app-platform",
|
|
21
21
|
"target": "server",
|
|
22
|
-
"generator": "@xemahq/api-client-generator@0.
|
|
22
|
+
"generator": "@xemahq/api-client-generator@0.14.1",
|
|
23
23
|
"source": "openapi.internal.json"
|
|
24
24
|
},
|
|
25
25
|
"license": "LicenseRef-Xema-BSL-1.1",
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Generated by @xemahq/api-client-generator — do not edit manually.
|
|
3
|
-
* App Runtime API
|
|
4
|
-
* OpenAPI spec version: 0.1.2
|
|
5
|
-
*/
|
|
6
|
-
/**
|
|
7
|
-
* @nullable
|
|
8
|
-
*/
|
|
9
|
-
export type UpdateAudiencePolicyDtoRateLimitPerHourPerSubject = {
|
|
10
|
-
[key: string]: unknown;
|
|
11
|
-
} | null;
|