axiam-sdk 1.0.0 → 1.1.0
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 +91 -12
- package/dist/browser/index.d.cts +1 -1
- package/dist/browser/index.d.ts +1 -1
- package/dist/{client-yD0eMwHQ.d.cts → client-7ZKtfXW-.d.cts} +640 -14
- package/dist/{client-0WJkblDE.d.ts → client-Putxo-yi.d.ts} +640 -14
- package/dist/{cookieJar-hWRmZkhe.d.ts → cookieJar-Cw6Zdeec.d.ts} +1 -1
- package/dist/{cookieJar-CTD5jOmd.d.cts → cookieJar-DkGcIr-i.d.cts} +1 -1
- package/dist/{errors-m0Tue_pE.d.cts → errors-CtP_lviy.d.cts} +15 -1
- package/dist/{errors-CmBvsxV0.d.ts → errors-VpViVRSx.d.ts} +15 -1
- package/dist/grpc/index.d.cts +3 -3
- package/dist/grpc/index.d.ts +3 -3
- package/dist/grpc/index.js +572 -14
- package/dist/grpc/index.js.map +1 -1
- package/dist/grpc/index.mjs +572 -14
- package/dist/grpc/index.mjs.map +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +594 -15
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +592 -16
- package/dist/index.mjs.map +1 -1
- package/dist/middleware/index.d.cts +3 -3
- package/dist/middleware/index.d.ts +3 -3
- package/dist/middleware/index.js +26 -3
- package/dist/middleware/index.js.map +1 -1
- package/dist/middleware/index.mjs +26 -3
- package/dist/middleware/index.mjs.map +1 -1
- package/dist/node/index.d.cts +3 -3
- package/dist/node/index.d.ts +3 -3
- package/dist/node/index.js +598 -17
- package/dist/node/index.js.map +1 -1
- package/dist/node/index.mjs +598 -17
- package/dist/node/index.mjs.map +1 -1
- package/dist/{oidcState-mQLVn3-A.d.cts → oidcState-Cz6erz0g.d.cts} +24 -3
- package/dist/{oidcState-DOSCgnMG.d.ts → oidcState-zGt6VU6v.d.ts} +24 -3
- package/dist/rest/index.d.cts +58 -7
- package/dist/rest/index.d.ts +58 -7
- package/dist/rest/index.js +594 -15
- package/dist/rest/index.js.map +1 -1
- package/dist/rest/index.mjs +592 -16
- package/dist/rest/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -771,6 +771,12 @@ var SKIP_REFRESH = [
|
|
|
771
771
|
// regardless of what session state came before it.
|
|
772
772
|
"/api/v1/auth/device",
|
|
773
773
|
"/oauth2/token",
|
|
774
|
+
// CONTRACT.md §14.2 rule 5 (contract 1.62): a client that fails to
|
|
775
|
+
// authenticate at the device endpoints is `401 invalid_client`, which is not
|
|
776
|
+
// an expired session and which refreshing cannot fix. `/oauth2/token` (the
|
|
777
|
+
// poll) was already here; the authorization endpoint now authenticates the
|
|
778
|
+
// client too, so its 401 must not enter the §9 guard either.
|
|
779
|
+
"/oauth2/device_authorization",
|
|
774
780
|
"/oauth2/introspect",
|
|
775
781
|
"/oauth2/revoke"
|
|
776
782
|
];
|
|
@@ -832,6 +838,13 @@ function installRefreshInterceptor(axiosInstance, session) {
|
|
|
832
838
|
}
|
|
833
839
|
);
|
|
834
840
|
}
|
|
841
|
+
function isOAuth2Endpoint(url) {
|
|
842
|
+
if (!url) {
|
|
843
|
+
return false;
|
|
844
|
+
}
|
|
845
|
+
const path = url.split(/[?#]/, 1)[0] ?? "";
|
|
846
|
+
return path.includes("/oauth2/");
|
|
847
|
+
}
|
|
835
848
|
function installDeviceTokenInterceptor(axiosInstance, session) {
|
|
836
849
|
axiosInstance.interceptors.request.use((config) => {
|
|
837
850
|
const deviceToken = session.deviceAccessToken;
|
|
@@ -841,6 +854,9 @@ function installDeviceTokenInterceptor(axiosInstance, session) {
|
|
|
841
854
|
const noCred = session.noCredentialsConfig();
|
|
842
855
|
Object.assign(config, noCred);
|
|
843
856
|
config.headers = config.headers ?? {};
|
|
857
|
+
if (isOAuth2Endpoint(config.url)) {
|
|
858
|
+
return config;
|
|
859
|
+
}
|
|
844
860
|
config.headers["Authorization"] = `Bearer ${deviceToken.expose()}`;
|
|
845
861
|
config.headers["Cookie"] = "";
|
|
846
862
|
return config;
|
|
@@ -1802,10 +1818,25 @@ var NotFoundError = class _NotFoundError extends AuthzError {
|
|
|
1802
1818
|
var ConflictError = class _ConflictError extends AuthzError {
|
|
1803
1819
|
/** The registry operation that conflicted. */
|
|
1804
1820
|
operation;
|
|
1805
|
-
|
|
1821
|
+
/**
|
|
1822
|
+
* The body's `reason_code`, as the server spelled it (contract 1.62, §36.4),
|
|
1823
|
+
* or `undefined` when the body carries none (a server that predates it, or a
|
|
1824
|
+
* `409` of an operation that does not name one).
|
|
1825
|
+
*
|
|
1826
|
+
* The `409` of every `network` operation says which conflict it is:
|
|
1827
|
+
* `stale_version`, `strands_profile`, `has_children`, `site_gone`,
|
|
1828
|
+
* `duplicate_name`, `duplicate_vlan`, `duplicate_rank`, `profile_exists` or
|
|
1829
|
+
* `other` (§36.3 rule 2). The vocabulary is **open**: a value this SDK does
|
|
1830
|
+
* not know is surfaced verbatim, and a caller branches on this member —
|
|
1831
|
+
* never on `message`, which an SDK must not parse. It is not the `reason` of
|
|
1832
|
+
* an authorization decision (§3), which is a human string.
|
|
1833
|
+
*/
|
|
1834
|
+
reasonCode;
|
|
1835
|
+
constructor(operation, message, reasonCode) {
|
|
1806
1836
|
super(message);
|
|
1807
1837
|
this.name = "ConflictError";
|
|
1808
1838
|
this.operation = operation;
|
|
1839
|
+
this.reasonCode = reasonCode;
|
|
1809
1840
|
Object.setPrototypeOf(this, _ConflictError.prototype);
|
|
1810
1841
|
}
|
|
1811
1842
|
};
|
|
@@ -2094,6 +2125,14 @@ function omitEmptyTenantScope(body) {
|
|
|
2094
2125
|
}
|
|
2095
2126
|
return body;
|
|
2096
2127
|
}
|
|
2128
|
+
function omitNullMembers(body, members) {
|
|
2129
|
+
if (!body || typeof body !== "object") return body;
|
|
2130
|
+
const record = body;
|
|
2131
|
+
if (!members.some((m) => m in record && record[m] === null)) return body;
|
|
2132
|
+
const copy = { ...record };
|
|
2133
|
+
for (const m of members) if (copy[m] === null) delete copy[m];
|
|
2134
|
+
return copy;
|
|
2135
|
+
}
|
|
2097
2136
|
function roleAssignmentInherits(assignment) {
|
|
2098
2137
|
return assignment.inherit ?? true;
|
|
2099
2138
|
}
|
|
@@ -2570,7 +2609,8 @@ function failure(report) {
|
|
|
2570
2609
|
);
|
|
2571
2610
|
if (!found) return void 0;
|
|
2572
2611
|
const message = found.outcome.status === "rebind-failed" ? `${found.outcome.message}${found.outcome.restoreSucceeded ? " (previous binding restored)" : ` (restore also failed: ${found.outcome.restoreMessage ?? "unknown error"})`}` : found.outcome.message;
|
|
2573
|
-
|
|
2612
|
+
const reasonCode = found.outcome.status === "failed" ? found.outcome.reasonCode : void 0;
|
|
2613
|
+
return reasonCode === void 0 ? { action: found.action, message } : { action: found.action, message, reasonCode };
|
|
2574
2614
|
}
|
|
2575
2615
|
function isComplete(report) {
|
|
2576
2616
|
return failure(report) === void 0;
|
|
@@ -2588,6 +2628,7 @@ function validate(manifest) {
|
|
|
2588
2628
|
const groups = manifest.groups ?? [];
|
|
2589
2629
|
const users = manifest.users ?? [];
|
|
2590
2630
|
const serviceAccounts = manifest.serviceAccounts ?? [];
|
|
2631
|
+
const network = manifest.network;
|
|
2591
2632
|
const resourceKeys = new Set(resources.map((r) => r.key));
|
|
2592
2633
|
const scopeKeys = new Set(resources.flatMap((r) => (r.scopes ?? []).map((s) => s.key)));
|
|
2593
2634
|
const permissionKeys = new Set(permissions.map((p) => p.key));
|
|
@@ -2601,6 +2642,7 @@ function validate(manifest) {
|
|
|
2601
2642
|
duplicates("group", groups.map((g) => g.key), problems);
|
|
2602
2643
|
duplicates("user", users.map((u) => u.key), problems);
|
|
2603
2644
|
duplicates("service account", serviceAccounts.map((s) => s.key), problems);
|
|
2645
|
+
if (network !== void 0) validateNetwork(network, problems);
|
|
2604
2646
|
for (const resource of resources) {
|
|
2605
2647
|
if (resource.parent && !resourceKeys.has(resource.parent)) {
|
|
2606
2648
|
problems.push(
|
|
@@ -2680,6 +2722,46 @@ function validate(manifest) {
|
|
|
2680
2722
|
}
|
|
2681
2723
|
}
|
|
2682
2724
|
var q = (s) => JSON.stringify(s);
|
|
2725
|
+
function validateNetwork(network, problems) {
|
|
2726
|
+
if (Array.isArray(network.policy)) {
|
|
2727
|
+
problems.push("network declares more than one policy; the tenant has exactly one");
|
|
2728
|
+
}
|
|
2729
|
+
const segments = network.segments ?? [];
|
|
2730
|
+
const profiles = network.profiles ?? [];
|
|
2731
|
+
duplicates("network segment", segments.map((s) => s.key), problems);
|
|
2732
|
+
const naturalKeys = /* @__PURE__ */ new Set();
|
|
2733
|
+
for (const segment of segments) {
|
|
2734
|
+
const natural = `${segment.site}/${segment.kind}/${segment.name}`;
|
|
2735
|
+
if (naturalKeys.has(natural)) {
|
|
2736
|
+
problems.push(
|
|
2737
|
+
`network segment ${q(natural)} (site, kind, name) is declared more than once`
|
|
2738
|
+
);
|
|
2739
|
+
}
|
|
2740
|
+
naturalKeys.add(natural);
|
|
2741
|
+
const seenFilters = /* @__PURE__ */ new Set();
|
|
2742
|
+
for (const filter of segment.filterIds ?? []) {
|
|
2743
|
+
if (seenFilters.has(filter)) {
|
|
2744
|
+
problems.push(
|
|
2745
|
+
`network segment ${q(segment.key)} lists Filter-Id ${q(filter)} more than once in filterIds`
|
|
2746
|
+
);
|
|
2747
|
+
}
|
|
2748
|
+
seenFilters.add(filter);
|
|
2749
|
+
}
|
|
2750
|
+
}
|
|
2751
|
+
const segmentKeys = new Set(segments.map((s) => s.key));
|
|
2752
|
+
const profiled = /* @__PURE__ */ new Set();
|
|
2753
|
+
for (const profile of profiles) {
|
|
2754
|
+
if (!segmentKeys.has(profile.segment)) {
|
|
2755
|
+
problems.push(
|
|
2756
|
+
`network profile names segment ${q(profile.segment)}, which no network segment declares`
|
|
2757
|
+
);
|
|
2758
|
+
}
|
|
2759
|
+
if (profiled.has(profile.segment)) {
|
|
2760
|
+
problems.push(`network segment ${q(profile.segment)} has more than one profile in the manifest`);
|
|
2761
|
+
}
|
|
2762
|
+
profiled.add(profile.segment);
|
|
2763
|
+
}
|
|
2764
|
+
}
|
|
2683
2765
|
function duplicates(kind, keys, problems) {
|
|
2684
2766
|
const seen = /* @__PURE__ */ new Set();
|
|
2685
2767
|
for (const key of keys) {
|
|
@@ -2725,7 +2807,9 @@ var emptyResolved = () => ({
|
|
|
2725
2807
|
roles: /* @__PURE__ */ new Map(),
|
|
2726
2808
|
groups: /* @__PURE__ */ new Map(),
|
|
2727
2809
|
users: /* @__PURE__ */ new Map(),
|
|
2728
|
-
serviceAccounts: /* @__PURE__ */ new Map()
|
|
2810
|
+
serviceAccounts: /* @__PURE__ */ new Map(),
|
|
2811
|
+
segments: /* @__PURE__ */ new Map(),
|
|
2812
|
+
segmentVersions: /* @__PURE__ */ new Map()
|
|
2729
2813
|
});
|
|
2730
2814
|
var ManifestApi = class {
|
|
2731
2815
|
#client;
|
|
@@ -2758,6 +2842,23 @@ var ManifestApi = class {
|
|
|
2758
2842
|
async #read(manifest) {
|
|
2759
2843
|
const c = this.#client;
|
|
2760
2844
|
const start = { limit: PLAN_PAGE };
|
|
2845
|
+
if (manifest.network !== void 0 && !hasShapeSections(manifest)) {
|
|
2846
|
+
return {
|
|
2847
|
+
resources: [],
|
|
2848
|
+
scopes: /* @__PURE__ */ new Map(),
|
|
2849
|
+
permissions: [],
|
|
2850
|
+
roles: [],
|
|
2851
|
+
groups: [],
|
|
2852
|
+
users: [],
|
|
2853
|
+
serviceAccounts: [],
|
|
2854
|
+
roleGrants: /* @__PURE__ */ new Map(),
|
|
2855
|
+
roleUserBindings: /* @__PURE__ */ new Map(),
|
|
2856
|
+
roleGroupBindings: /* @__PURE__ */ new Map(),
|
|
2857
|
+
roleServiceAccountBindings: /* @__PURE__ */ new Map(),
|
|
2858
|
+
groupMembers: /* @__PURE__ */ new Map(),
|
|
2859
|
+
network: await this.#readNetwork(manifest.network, start)
|
|
2860
|
+
};
|
|
2861
|
+
}
|
|
2761
2862
|
const resources = await c.resources.listAll(start);
|
|
2762
2863
|
const permissions = await c.permissions.listAll(start);
|
|
2763
2864
|
const roles = await c.roles.listAll(start);
|
|
@@ -2813,9 +2914,29 @@ var ManifestApi = class {
|
|
|
2813
2914
|
roleUserBindings,
|
|
2814
2915
|
roleGroupBindings,
|
|
2815
2916
|
roleServiceAccountBindings,
|
|
2816
|
-
groupMembers
|
|
2917
|
+
groupMembers,
|
|
2918
|
+
network: manifest.network ? await this.#readNetwork(manifest.network, start) : void 0
|
|
2817
2919
|
};
|
|
2818
2920
|
}
|
|
2921
|
+
/**
|
|
2922
|
+
* §27.6.2 item 3: `get_policy`, `list_segments` and `list_profiles`, each
|
|
2923
|
+
* list walked to exhaustion, and nothing else — `plan` issues `GET`s only.
|
|
2924
|
+
* A section that states no policy does not read it; one that states no
|
|
2925
|
+
* profile does not list them.
|
|
2926
|
+
*/
|
|
2927
|
+
async #readNetwork(spec, start) {
|
|
2928
|
+
const c = this.#client;
|
|
2929
|
+
const policy = spec.policy ? await c.network.getPolicy() : void 0;
|
|
2930
|
+
const wantSegments = (spec.segments ?? []).length > 0 || (spec.profiles ?? []).length > 0;
|
|
2931
|
+
const segments = wantSegments ? await c.network.listSegmentsAll(void 0, start) : [];
|
|
2932
|
+
const profiles = /* @__PURE__ */ new Map();
|
|
2933
|
+
if ((spec.profiles ?? []).length) {
|
|
2934
|
+
for (const profile of await c.network.listProfilesAll(start)) {
|
|
2935
|
+
profiles.set(profile.segment_id, profile);
|
|
2936
|
+
}
|
|
2937
|
+
}
|
|
2938
|
+
return { policy, segments, profiles };
|
|
2939
|
+
}
|
|
2819
2940
|
// -------------------------------------------------------------------
|
|
2820
2941
|
// Plan
|
|
2821
2942
|
// -------------------------------------------------------------------
|
|
@@ -3086,8 +3207,97 @@ var ManifestApi = class {
|
|
|
3086
3207
|
push
|
|
3087
3208
|
);
|
|
3088
3209
|
}
|
|
3210
|
+
if (manifest.network && snapshot.network) {
|
|
3211
|
+
this.#networkSteps(manifest.network, snapshot.network, resolved, push);
|
|
3212
|
+
}
|
|
3089
3213
|
return out;
|
|
3090
3214
|
}
|
|
3215
|
+
/**
|
|
3216
|
+
* §27.6.2 — the `network` section: the policy, then the segments, then the
|
|
3217
|
+
* profiles, a profile after its segment (item 2). Every comparison is with
|
|
3218
|
+
* the value **as the read returns it** (item 3): a profile's effective
|
|
3219
|
+
* (clamped) `session_timeout_secs`, a segment's `filter_ids` as a set.
|
|
3220
|
+
* Silence is not an assertion (rule 3): a member left off never drifts, and
|
|
3221
|
+
* the `Update` body carries the read's value for it (item 4).
|
|
3222
|
+
*/
|
|
3223
|
+
#networkSteps(spec, read, resolved, push) {
|
|
3224
|
+
if (spec.policy) {
|
|
3225
|
+
const current = read.policy;
|
|
3226
|
+
const drifted = current.session_timeout_max_secs !== spec.policy.sessionTimeoutMaxSecs;
|
|
3227
|
+
push(
|
|
3228
|
+
drifted ? "update" : "no-change",
|
|
3229
|
+
"network-policy",
|
|
3230
|
+
"network.policy",
|
|
3231
|
+
"network policy (Session-Timeout cap)",
|
|
3232
|
+
drifted ? {
|
|
3233
|
+
kind: "update-network-policy",
|
|
3234
|
+
body: {
|
|
3235
|
+
session_timeout_max_secs: spec.policy.sessionTimeoutMaxSecs,
|
|
3236
|
+
version: current.version
|
|
3237
|
+
}
|
|
3238
|
+
} : { kind: "noop" }
|
|
3239
|
+
);
|
|
3240
|
+
}
|
|
3241
|
+
const segments = spec.segments ?? [];
|
|
3242
|
+
for (const segment of segments) {
|
|
3243
|
+
const found = read.segments.find(
|
|
3244
|
+
(r) => r.site_key === segment.site && r.kind === segment.kind && r.name === segment.name
|
|
3245
|
+
);
|
|
3246
|
+
const summary = `network segment ${JSON.stringify(`${segment.site}/${segment.kind}/${segment.name}`)}`;
|
|
3247
|
+
if (!found) {
|
|
3248
|
+
push("create", "network-segment", segment.key, summary, {
|
|
3249
|
+
kind: "create-network-segment",
|
|
3250
|
+
key: segment.key,
|
|
3251
|
+
body: segmentCreateBody(segment)
|
|
3252
|
+
});
|
|
3253
|
+
continue;
|
|
3254
|
+
}
|
|
3255
|
+
resolved.segments.set(segment.key, found.id);
|
|
3256
|
+
resolved.segmentVersions.set(segment.key, found.version);
|
|
3257
|
+
const drifted = segmentDrifted(segment, found);
|
|
3258
|
+
push(
|
|
3259
|
+
drifted ? "update" : "no-change",
|
|
3260
|
+
"network-segment",
|
|
3261
|
+
segment.key,
|
|
3262
|
+
summary,
|
|
3263
|
+
drifted ? {
|
|
3264
|
+
kind: "update-network-segment",
|
|
3265
|
+
key: segment.key,
|
|
3266
|
+
id: found.id,
|
|
3267
|
+
body: segmentReplaceBody(segment, found)
|
|
3268
|
+
} : { kind: "noop" }
|
|
3269
|
+
);
|
|
3270
|
+
}
|
|
3271
|
+
const bySegment = new Map((spec.profiles ?? []).map((p) => [p.segment, p]));
|
|
3272
|
+
for (const segment of segments) {
|
|
3273
|
+
const profile = bySegment.get(segment.key);
|
|
3274
|
+
if (!profile) continue;
|
|
3275
|
+
const segmentId = resolved.segments.get(segment.key);
|
|
3276
|
+
const found = segmentId ? read.profiles.get(segmentId) : void 0;
|
|
3277
|
+
const summary = `network profile of ${JSON.stringify(`${segment.site}/${segment.kind}/${segment.name}`)}`;
|
|
3278
|
+
if (!found) {
|
|
3279
|
+
push("create", "network-profile", segment.key, summary, {
|
|
3280
|
+
kind: "create-network-profile",
|
|
3281
|
+
segment: segment.key,
|
|
3282
|
+
profile: profileCreateInput(profile)
|
|
3283
|
+
});
|
|
3284
|
+
continue;
|
|
3285
|
+
}
|
|
3286
|
+
const drifted = profileDrifted(profile, found);
|
|
3287
|
+
push(
|
|
3288
|
+
drifted ? "update" : "no-change",
|
|
3289
|
+
"network-profile",
|
|
3290
|
+
segment.key,
|
|
3291
|
+
summary,
|
|
3292
|
+
drifted ? {
|
|
3293
|
+
kind: "update-network-profile",
|
|
3294
|
+
segment: segment.key,
|
|
3295
|
+
version: found.version,
|
|
3296
|
+
profile: profileReplaceInput(profile, found)
|
|
3297
|
+
} : { kind: "noop" }
|
|
3298
|
+
);
|
|
3299
|
+
}
|
|
3300
|
+
}
|
|
3091
3301
|
/**
|
|
3092
3302
|
* §27.6.1 item 2 — one subject's `roles[]` against the server's existing
|
|
3093
3303
|
* bindings for it. Shared by groups, users and service accounts: the
|
|
@@ -3155,9 +3365,14 @@ var ManifestApi = class {
|
|
|
3155
3365
|
}
|
|
3156
3366
|
} catch (err) {
|
|
3157
3367
|
stopped = true;
|
|
3368
|
+
const reasonCode = err instanceof ConflictError ? err.reasonCode : void 0;
|
|
3158
3369
|
out.push({
|
|
3159
3370
|
action,
|
|
3160
|
-
outcome: {
|
|
3371
|
+
outcome: {
|
|
3372
|
+
status: "failed",
|
|
3373
|
+
message: err instanceof Error ? err.message : String(err),
|
|
3374
|
+
...reasonCode === void 0 ? {} : { reasonCode }
|
|
3375
|
+
}
|
|
3161
3376
|
});
|
|
3162
3377
|
}
|
|
3163
3378
|
}
|
|
@@ -3264,6 +3479,34 @@ var ManifestApi = class {
|
|
|
3264
3479
|
description: step.description
|
|
3265
3480
|
});
|
|
3266
3481
|
return void 0;
|
|
3482
|
+
case "update-network-policy":
|
|
3483
|
+
await c.network.replacePolicy(step.body);
|
|
3484
|
+
return void 0;
|
|
3485
|
+
case "create-network-segment": {
|
|
3486
|
+
const created = await c.network.createSegment(step.body);
|
|
3487
|
+
resolved.segments.set(step.key, created.id);
|
|
3488
|
+
resolved.segmentVersions.set(step.key, created.version);
|
|
3489
|
+
return void 0;
|
|
3490
|
+
}
|
|
3491
|
+
case "update-network-segment": {
|
|
3492
|
+
const replaced = await c.network.replaceSegment(step.id, step.body);
|
|
3493
|
+
resolved.segmentVersions.set(step.key, replaced.version);
|
|
3494
|
+
return void 0;
|
|
3495
|
+
}
|
|
3496
|
+
case "create-network-profile":
|
|
3497
|
+
await c.network.createProfile({
|
|
3498
|
+
segment_id: lookup(resolved.segments, step.segment, "network segment"),
|
|
3499
|
+
segment_version: lookupVersion(resolved.segmentVersions, step.segment),
|
|
3500
|
+
profile: step.profile
|
|
3501
|
+
});
|
|
3502
|
+
return void 0;
|
|
3503
|
+
case "update-network-profile":
|
|
3504
|
+
await c.network.replaceProfile(lookup(resolved.segments, step.segment, "network segment"), {
|
|
3505
|
+
version: step.version,
|
|
3506
|
+
segment_version: lookupVersion(resolved.segmentVersions, step.segment),
|
|
3507
|
+
profile: step.profile
|
|
3508
|
+
});
|
|
3509
|
+
return void 0;
|
|
3267
3510
|
case "assign-role":
|
|
3268
3511
|
await this.#assign(step, resolved);
|
|
3269
3512
|
return void 0;
|
|
@@ -3401,6 +3644,94 @@ function lookup(map, key, kind) {
|
|
|
3401
3644
|
}
|
|
3402
3645
|
return id;
|
|
3403
3646
|
}
|
|
3647
|
+
function hasShapeSections(manifest) {
|
|
3648
|
+
return [
|
|
3649
|
+
manifest.resources,
|
|
3650
|
+
manifest.permissions,
|
|
3651
|
+
manifest.roles,
|
|
3652
|
+
manifest.groups,
|
|
3653
|
+
manifest.users,
|
|
3654
|
+
manifest.serviceAccounts
|
|
3655
|
+
].some((section) => (section ?? []).length > 0);
|
|
3656
|
+
}
|
|
3657
|
+
function lookupVersion(map, key) {
|
|
3658
|
+
const version = map.get(key);
|
|
3659
|
+
if (version === void 0) {
|
|
3660
|
+
throw new NetworkError(
|
|
3661
|
+
`internal: network segment key ${JSON.stringify(key)} has no version; its segment write did not run`
|
|
3662
|
+
);
|
|
3663
|
+
}
|
|
3664
|
+
return version;
|
|
3665
|
+
}
|
|
3666
|
+
function sameSet(a, b) {
|
|
3667
|
+
if (a.length !== b.length) return false;
|
|
3668
|
+
const left = new Set(a);
|
|
3669
|
+
return left.size === new Set(b).size && b.every((name2) => left.has(name2));
|
|
3670
|
+
}
|
|
3671
|
+
function sameOptional(stated, read) {
|
|
3672
|
+
return (stated ?? null) === (read ?? null);
|
|
3673
|
+
}
|
|
3674
|
+
function segmentCreateBody(spec) {
|
|
3675
|
+
const body = {
|
|
3676
|
+
kind: spec.kind,
|
|
3677
|
+
site_key: spec.site,
|
|
3678
|
+
name: spec.name,
|
|
3679
|
+
vlan_id: spec.vlanId
|
|
3680
|
+
};
|
|
3681
|
+
if (spec.filterIds !== void 0) body.filter_ids = [...spec.filterIds];
|
|
3682
|
+
if (spec.rank !== void 0 && spec.rank !== null) body.rank = spec.rank;
|
|
3683
|
+
if (spec.enabled !== void 0) body.enabled = spec.enabled;
|
|
3684
|
+
return body;
|
|
3685
|
+
}
|
|
3686
|
+
function segmentDrifted(spec, read) {
|
|
3687
|
+
if (spec.vlanId !== read.vlan_id) return true;
|
|
3688
|
+
if (spec.rank !== void 0 && !sameOptional(spec.rank, read.rank)) return true;
|
|
3689
|
+
if (spec.enabled !== void 0 && spec.enabled !== read.enabled) return true;
|
|
3690
|
+
if (spec.filterIds !== void 0 && !sameSet(spec.filterIds, read.filter_ids)) return true;
|
|
3691
|
+
return false;
|
|
3692
|
+
}
|
|
3693
|
+
function segmentReplaceBody(spec, read) {
|
|
3694
|
+
const body = {
|
|
3695
|
+
version: read.version,
|
|
3696
|
+
vlan_id: spec.vlanId,
|
|
3697
|
+
filter_ids: [...spec.filterIds ?? read.filter_ids],
|
|
3698
|
+
enabled: spec.enabled ?? read.enabled
|
|
3699
|
+
};
|
|
3700
|
+
const rank = spec.rank === void 0 ? read.rank : spec.rank;
|
|
3701
|
+
if (rank !== void 0 && rank !== null) body.rank = rank;
|
|
3702
|
+
return body;
|
|
3703
|
+
}
|
|
3704
|
+
function profileCreateInput(spec) {
|
|
3705
|
+
const profile = { session_timeout_secs: spec.sessionTimeoutSecs };
|
|
3706
|
+
if (spec.terminationAction != null) profile.termination_action = spec.terminationAction;
|
|
3707
|
+
if (spec.idleTimeoutSecs != null) profile.idle_timeout_secs = spec.idleTimeoutSecs;
|
|
3708
|
+
if (spec.filterId != null) profile.filter_id = spec.filterId;
|
|
3709
|
+
if (spec.serviceType != null) profile.service_type = spec.serviceType;
|
|
3710
|
+
return profile;
|
|
3711
|
+
}
|
|
3712
|
+
function profileDrifted(spec, read) {
|
|
3713
|
+
if (spec.sessionTimeoutSecs !== read.session_timeout_secs) return true;
|
|
3714
|
+
if (spec.terminationAction !== void 0 && spec.terminationAction !== null && spec.terminationAction !== read.termination_action) return true;
|
|
3715
|
+
if (spec.idleTimeoutSecs !== void 0 && !sameOptional(spec.idleTimeoutSecs, read.idle_timeout_secs)) return true;
|
|
3716
|
+
if (spec.filterId !== void 0 && !sameOptional(spec.filterId, read.filter_id)) return true;
|
|
3717
|
+
if (spec.serviceType !== void 0 && !sameOptional(spec.serviceType, read.service_type)) return true;
|
|
3718
|
+
return false;
|
|
3719
|
+
}
|
|
3720
|
+
function profileReplaceInput(spec, read) {
|
|
3721
|
+
const profile = {
|
|
3722
|
+
dictionary: read.dictionary,
|
|
3723
|
+
session_timeout_secs: spec.sessionTimeoutSecs
|
|
3724
|
+
};
|
|
3725
|
+
const termination = spec.terminationAction === void 0 ? read.termination_action : spec.terminationAction;
|
|
3726
|
+
if (termination != null) profile.termination_action = termination;
|
|
3727
|
+
const idle = spec.idleTimeoutSecs === void 0 ? read.idle_timeout_secs : spec.idleTimeoutSecs;
|
|
3728
|
+
if (idle != null) profile.idle_timeout_secs = idle;
|
|
3729
|
+
const filter = spec.filterId === void 0 ? read.filter_id : spec.filterId;
|
|
3730
|
+
if (filter != null) profile.filter_id = filter;
|
|
3731
|
+
const serviceType = spec.serviceType === void 0 ? read.service_type : spec.serviceType;
|
|
3732
|
+
if (serviceType != null) profile.service_type = serviceType;
|
|
3733
|
+
return profile;
|
|
3734
|
+
}
|
|
3404
3735
|
function bindingOf(assignment) {
|
|
3405
3736
|
return {
|
|
3406
3737
|
resourceId: assignment.resource_id ?? void 0,
|
|
@@ -3521,7 +3852,12 @@ function mapManagementError(operation, err) {
|
|
|
3521
3852
|
);
|
|
3522
3853
|
}
|
|
3523
3854
|
if (status === 409) {
|
|
3524
|
-
|
|
3855
|
+
const code = body?.reason_code;
|
|
3856
|
+
return new ConflictError(
|
|
3857
|
+
operation,
|
|
3858
|
+
`${operation}: conflict${detail}`,
|
|
3859
|
+
typeof code === "string" ? code : void 0
|
|
3860
|
+
);
|
|
3525
3861
|
}
|
|
3526
3862
|
if (status === 400 || status === 422) {
|
|
3527
3863
|
return new ValidationError(
|
|
@@ -3531,7 +3867,7 @@ function mapManagementError(operation, err) {
|
|
|
3531
3867
|
parseFieldErrors(body)
|
|
3532
3868
|
);
|
|
3533
3869
|
}
|
|
3534
|
-
return mapHttpStatusToError(status, `${operation}${detail}`, { cause: err });
|
|
3870
|
+
return mapHttpStatusToError(status, `${operation}${detail}`, { cause: err, body });
|
|
3535
3871
|
}
|
|
3536
3872
|
function describe(body) {
|
|
3537
3873
|
if (typeof body === "string" && body) return `: ${body}`;
|
|
@@ -4825,7 +5161,7 @@ var CertificatesApi = class {
|
|
|
4825
5161
|
method: "POST",
|
|
4826
5162
|
pathTemplate: "/api/v1/certificates",
|
|
4827
5163
|
path: "/api/v1/certificates",
|
|
4828
|
-
body
|
|
5164
|
+
body: omitNullMembers(body, ["user_id"])
|
|
4829
5165
|
});
|
|
4830
5166
|
return generatedCertificateFromWire(wire);
|
|
4831
5167
|
}
|
|
@@ -4842,7 +5178,7 @@ var CertificatesApi = class {
|
|
|
4842
5178
|
method: "POST",
|
|
4843
5179
|
pathTemplate: "/api/v1/certificates/sign-csr",
|
|
4844
5180
|
path: "/api/v1/certificates/sign-csr",
|
|
4845
|
-
body
|
|
5181
|
+
body: omitNullMembers(body, ["user_id"])
|
|
4846
5182
|
});
|
|
4847
5183
|
return wire;
|
|
4848
5184
|
}
|
|
@@ -5979,12 +6315,29 @@ function ssfStreamInputFrom(stream) {
|
|
|
5979
6315
|
endpoint_url: stream.endpoint_url ?? null,
|
|
5980
6316
|
events_allowed: [...stream.events_allowed],
|
|
5981
6317
|
events_requested: [...stream.events_requested],
|
|
6318
|
+
expected_updated_at: stream.updated_at,
|
|
5982
6319
|
receiver_client_id: stream.receiver_client_id,
|
|
5983
6320
|
status: stream.status,
|
|
5984
6321
|
status_reason: stream.status_reason ?? null,
|
|
5985
6322
|
subject_format: stream.subject_format
|
|
5986
6323
|
};
|
|
5987
6324
|
}
|
|
6325
|
+
function ssfStreamInputWith(stream, changes2 = {}) {
|
|
6326
|
+
const body = ssfStreamInputFrom(stream);
|
|
6327
|
+
const named = Object.entries(changes2).filter(([, v]) => v !== void 0);
|
|
6328
|
+
const record = body;
|
|
6329
|
+
for (const [key, value] of named) record[key] = value;
|
|
6330
|
+
const names = new Set(named.map(([key]) => key));
|
|
6331
|
+
if (names.has("events_allowed") && !names.has("events_requested")) {
|
|
6332
|
+
const ceiling = new Set(body.events_allowed);
|
|
6333
|
+
body.events_requested = stream.events_requested.filter(
|
|
6334
|
+
(e) => ceiling.has(e)
|
|
6335
|
+
);
|
|
6336
|
+
}
|
|
6337
|
+
if (body.events_requested === null) delete body.events_requested;
|
|
6338
|
+
if (body.expected_updated_at === null) delete body.expected_updated_at;
|
|
6339
|
+
return body;
|
|
6340
|
+
}
|
|
5988
6341
|
function scimTargetInputFrom(target) {
|
|
5989
6342
|
return {
|
|
5990
6343
|
auth: { ...target.auth },
|
|
@@ -6308,7 +6661,7 @@ var SsfApi = class _SsfApi {
|
|
|
6308
6661
|
method: "POST",
|
|
6309
6662
|
pathTemplate: "/api/v1/tenants/{tenant_id}/ssf/streams",
|
|
6310
6663
|
path: `/api/v1/tenants/${tenantId}/ssf/streams`,
|
|
6311
|
-
body: ssfStreamInputToWire(body)
|
|
6664
|
+
body: omitNullMembers(ssfStreamInputToWire(body), ["expected_updated_at"])
|
|
6312
6665
|
});
|
|
6313
6666
|
return scrubSsfStream(wire);
|
|
6314
6667
|
}
|
|
@@ -6331,8 +6684,19 @@ var SsfApi = class _SsfApi {
|
|
|
6331
6684
|
* update moves `endpoint_url` to another scheme, host or port while a header
|
|
6332
6685
|
* is stored: then it must carry `authorization_header` again or
|
|
6333
6686
|
* `clear_authorization_header: true`, else `400` (§32.3 rule 5). Start from
|
|
6334
|
-
* `
|
|
6335
|
-
*
|
|
6687
|
+
* `ssfStreamInputWith(await ssf.getStream(id), changes)`, which sends the
|
|
6688
|
+
* `events_requested` and `expected_updated_at` it read and cuts
|
|
6689
|
+
* `events_requested` to a lowered `events_allowed` (or from the plain
|
|
6690
|
+
* converter `ssfStreamInputFrom`, where the cut is yours). An update
|
|
6691
|
+
* overtaken by the receiver's own write is `409`: read the stream again.
|
|
6692
|
+
* **`events_requested` has three meanings on an update** (§32.2, contract
|
|
6693
|
+
* 1.62): **absent resets** the stream to every event of `events_allowed` —
|
|
6694
|
+
* widening what the receiver narrowed; **`[]` is stored as the receiver's
|
|
6695
|
+
* "none"** and the stream carries nothing; **a list is stored as given** and
|
|
6696
|
+
* refused (`400`) if any entry is outside `events_allowed`. A raw API client
|
|
6697
|
+
* is bound by the same meaning: an `events_requested` left out of the `PUT`
|
|
6698
|
+
* resets the stream. `expected_updated_at` is the `updated_at` you read, as
|
|
6699
|
+
* the server's own string; an assigned `null` is "none" and is not sent.
|
|
6336
6700
|
*
|
|
6337
6701
|
* **This is a replacement, not a patch** (§27.4 rule 5). Only the required
|
|
6338
6702
|
* members must be set, but what you do not carry over from a prior read is
|
|
@@ -6350,7 +6714,7 @@ var SsfApi = class _SsfApi {
|
|
|
6350
6714
|
method: "PUT",
|
|
6351
6715
|
pathTemplate: "/api/v1/tenants/{tenant_id}/ssf/streams/{stream_id}",
|
|
6352
6716
|
path: `/api/v1/tenants/${tenantId}/ssf/streams/${encodeURIComponent(streamId)}`,
|
|
6353
|
-
body: ssfStreamInputToWire(body)
|
|
6717
|
+
body: omitNullMembers(ssfStreamInputToWire(body), ["expected_updated_at"])
|
|
6354
6718
|
});
|
|
6355
6719
|
return scrubSsfStream(wire);
|
|
6356
6720
|
}
|
|
@@ -6418,7 +6782,7 @@ var ScimTargetsApi = class {
|
|
|
6418
6782
|
method: "POST",
|
|
6419
6783
|
pathTemplate: "/api/v1/scim-targets",
|
|
6420
6784
|
path: "/api/v1/scim-targets",
|
|
6421
|
-
body: scimTargetInputToWire(body)
|
|
6785
|
+
body: omitNullMembers(scimTargetInputToWire(body), ["expected_updated_at"])
|
|
6422
6786
|
});
|
|
6423
6787
|
return scrubScimTargetResponse(wire);
|
|
6424
6788
|
}
|
|
@@ -6465,7 +6829,7 @@ var ScimTargetsApi = class {
|
|
|
6465
6829
|
method: "PUT",
|
|
6466
6830
|
pathTemplate: "/api/v1/scim-targets/{id}",
|
|
6467
6831
|
path: `/api/v1/scim-targets/${encodeURIComponent(id)}`,
|
|
6468
|
-
body: scimTargetInputToWire(body)
|
|
6832
|
+
body: omitNullMembers(scimTargetInputToWire(body), ["expected_updated_at"])
|
|
6469
6833
|
});
|
|
6470
6834
|
return scrubScimTargetResponse(wire);
|
|
6471
6835
|
}
|
|
@@ -6509,6 +6873,215 @@ var ScimTargetsApi = class {
|
|
|
6509
6873
|
}
|
|
6510
6874
|
};
|
|
6511
6875
|
|
|
6876
|
+
// src/management/ops/network.ts
|
|
6877
|
+
var NetworkApi = class {
|
|
6878
|
+
#client;
|
|
6879
|
+
#scope;
|
|
6880
|
+
/** @internal — reached through `client.<namespace>`, never constructed directly. */
|
|
6881
|
+
constructor(client, scope = {}) {
|
|
6882
|
+
this.#client = client;
|
|
6883
|
+
this.#scope = scope;
|
|
6884
|
+
}
|
|
6885
|
+
/** `GET /api/v1/network/segments` */
|
|
6886
|
+
async listSegments(site, page = {}) {
|
|
6887
|
+
const wire = await sendManagement(this.#client, {
|
|
6888
|
+
operation: "network.list_segments",
|
|
6889
|
+
method: "GET",
|
|
6890
|
+
pathTemplate: "/api/v1/network/segments",
|
|
6891
|
+
path: "/api/v1/network/segments",
|
|
6892
|
+
query: { ...pageQuery(page), "site": site }
|
|
6893
|
+
});
|
|
6894
|
+
return wire;
|
|
6895
|
+
}
|
|
6896
|
+
/**
|
|
6897
|
+
* Walk `network.list_segments` to exhaustion, concatenating every page.
|
|
6898
|
+
*
|
|
6899
|
+
* The auto-paging form §27.4 rule 4 requires. It stops on an empty page even
|
|
6900
|
+
* if `total` disagrees, so a misreporting server costs one wasted request
|
|
6901
|
+
* rather than an unbounded loop.
|
|
6902
|
+
*/
|
|
6903
|
+
listSegmentsAll(site, start = {}) {
|
|
6904
|
+
return collectPages(start, (p) => this.listSegments(site, p));
|
|
6905
|
+
}
|
|
6906
|
+
/**
|
|
6907
|
+
* `POST /api/v1/network/segments`
|
|
6908
|
+
*
|
|
6909
|
+
* Not retried on failure (§27.4 rule 8): every write on this surface is
|
|
6910
|
+
* issued exactly once, including the ones that look idempotent.
|
|
6911
|
+
*/
|
|
6912
|
+
async createSegment(body) {
|
|
6913
|
+
const wire = await sendManagement(this.#client, {
|
|
6914
|
+
operation: "network.create_segment",
|
|
6915
|
+
method: "POST",
|
|
6916
|
+
pathTemplate: "/api/v1/network/segments",
|
|
6917
|
+
path: "/api/v1/network/segments",
|
|
6918
|
+
body
|
|
6919
|
+
});
|
|
6920
|
+
return wire;
|
|
6921
|
+
}
|
|
6922
|
+
/** `GET /api/v1/network/segments/{id}` */
|
|
6923
|
+
async getSegment(id) {
|
|
6924
|
+
const wire = await sendManagement(this.#client, {
|
|
6925
|
+
operation: "network.get_segment",
|
|
6926
|
+
method: "GET",
|
|
6927
|
+
pathTemplate: "/api/v1/network/segments/{id}",
|
|
6928
|
+
path: `/api/v1/network/segments/${encodeURIComponent(id)}`
|
|
6929
|
+
});
|
|
6930
|
+
return wire;
|
|
6931
|
+
}
|
|
6932
|
+
/**
|
|
6933
|
+
* `PUT /api/v1/network/segments/{id}`
|
|
6934
|
+
*
|
|
6935
|
+
* **This is a replacement, not a patch** (§27.4 rule 5). Only the required
|
|
6936
|
+
* members must be set, but what you do not carry over from a prior read is
|
|
6937
|
+
* not preserved: an optional member left out is overwritten with its
|
|
6938
|
+
* default, not kept (except where noted above). Read first, change the field
|
|
6939
|
+
* you mean, send the whole thing back.
|
|
6940
|
+
*
|
|
6941
|
+
* Not retried on failure (§27.4 rule 8): every write on this surface is
|
|
6942
|
+
* issued exactly once, including the ones that look idempotent.
|
|
6943
|
+
*/
|
|
6944
|
+
async replaceSegment(id, body) {
|
|
6945
|
+
const wire = await sendManagement(this.#client, {
|
|
6946
|
+
operation: "network.replace_segment",
|
|
6947
|
+
method: "PUT",
|
|
6948
|
+
pathTemplate: "/api/v1/network/segments/{id}",
|
|
6949
|
+
path: `/api/v1/network/segments/${encodeURIComponent(id)}`,
|
|
6950
|
+
body
|
|
6951
|
+
});
|
|
6952
|
+
return wire;
|
|
6953
|
+
}
|
|
6954
|
+
/**
|
|
6955
|
+
* `DELETE /api/v1/network/segments/{id}`
|
|
6956
|
+
*
|
|
6957
|
+
* Not retried on failure (§27.4 rule 8): every write on this surface is
|
|
6958
|
+
* issued exactly once, including the ones that look idempotent.
|
|
6959
|
+
*/
|
|
6960
|
+
async deleteSegment(id, version) {
|
|
6961
|
+
await sendManagement(this.#client, {
|
|
6962
|
+
operation: "network.delete_segment",
|
|
6963
|
+
method: "DELETE",
|
|
6964
|
+
pathTemplate: "/api/v1/network/segments/{id}",
|
|
6965
|
+
path: `/api/v1/network/segments/${encodeURIComponent(id)}`,
|
|
6966
|
+
query: { "version": String(version) }
|
|
6967
|
+
});
|
|
6968
|
+
}
|
|
6969
|
+
/** `GET /api/v1/network/profiles` */
|
|
6970
|
+
async listProfiles(page = {}) {
|
|
6971
|
+
const wire = await sendManagement(this.#client, {
|
|
6972
|
+
operation: "network.list_profiles",
|
|
6973
|
+
method: "GET",
|
|
6974
|
+
pathTemplate: "/api/v1/network/profiles",
|
|
6975
|
+
path: "/api/v1/network/profiles",
|
|
6976
|
+
query: { ...pageQuery(page) }
|
|
6977
|
+
});
|
|
6978
|
+
return wire;
|
|
6979
|
+
}
|
|
6980
|
+
/**
|
|
6981
|
+
* Walk `network.list_profiles` to exhaustion, concatenating every page.
|
|
6982
|
+
*
|
|
6983
|
+
* The auto-paging form §27.4 rule 4 requires. It stops on an empty page even
|
|
6984
|
+
* if `total` disagrees, so a misreporting server costs one wasted request
|
|
6985
|
+
* rather than an unbounded loop.
|
|
6986
|
+
*/
|
|
6987
|
+
listProfilesAll(start = {}) {
|
|
6988
|
+
return collectPages(start, (p) => this.listProfiles(p));
|
|
6989
|
+
}
|
|
6990
|
+
/**
|
|
6991
|
+
* `POST /api/v1/network/profiles`
|
|
6992
|
+
*
|
|
6993
|
+
* Not retried on failure (§27.4 rule 8): every write on this surface is
|
|
6994
|
+
* issued exactly once, including the ones that look idempotent.
|
|
6995
|
+
*/
|
|
6996
|
+
async createProfile(body) {
|
|
6997
|
+
const wire = await sendManagement(this.#client, {
|
|
6998
|
+
operation: "network.create_profile",
|
|
6999
|
+
method: "POST",
|
|
7000
|
+
pathTemplate: "/api/v1/network/profiles",
|
|
7001
|
+
path: "/api/v1/network/profiles",
|
|
7002
|
+
body
|
|
7003
|
+
});
|
|
7004
|
+
return wire;
|
|
7005
|
+
}
|
|
7006
|
+
/** `GET /api/v1/network/profiles/{segment_id}` */
|
|
7007
|
+
async getProfile(segmentId) {
|
|
7008
|
+
const wire = await sendManagement(this.#client, {
|
|
7009
|
+
operation: "network.get_profile",
|
|
7010
|
+
method: "GET",
|
|
7011
|
+
pathTemplate: "/api/v1/network/profiles/{segment_id}",
|
|
7012
|
+
path: `/api/v1/network/profiles/${encodeURIComponent(segmentId)}`
|
|
7013
|
+
});
|
|
7014
|
+
return wire;
|
|
7015
|
+
}
|
|
7016
|
+
/**
|
|
7017
|
+
* `PUT /api/v1/network/profiles/{segment_id}`
|
|
7018
|
+
*
|
|
7019
|
+
* **This is a replacement, not a patch** (§27.4 rule 5). Every field of the
|
|
7020
|
+
* body is required, and what you do not carry over from a prior read is not
|
|
7021
|
+
* preserved — it is overwritten. Read first, change the field you mean, send
|
|
7022
|
+
* the whole thing back.
|
|
7023
|
+
*
|
|
7024
|
+
* Not retried on failure (§27.4 rule 8): every write on this surface is
|
|
7025
|
+
* issued exactly once, including the ones that look idempotent.
|
|
7026
|
+
*/
|
|
7027
|
+
async replaceProfile(segmentId, body) {
|
|
7028
|
+
const wire = await sendManagement(this.#client, {
|
|
7029
|
+
operation: "network.replace_profile",
|
|
7030
|
+
method: "PUT",
|
|
7031
|
+
pathTemplate: "/api/v1/network/profiles/{segment_id}",
|
|
7032
|
+
path: `/api/v1/network/profiles/${encodeURIComponent(segmentId)}`,
|
|
7033
|
+
body
|
|
7034
|
+
});
|
|
7035
|
+
return wire;
|
|
7036
|
+
}
|
|
7037
|
+
/**
|
|
7038
|
+
* `DELETE /api/v1/network/profiles/{segment_id}`
|
|
7039
|
+
*
|
|
7040
|
+
* Not retried on failure (§27.4 rule 8): every write on this surface is
|
|
7041
|
+
* issued exactly once, including the ones that look idempotent.
|
|
7042
|
+
*/
|
|
7043
|
+
async deleteProfile(segmentId, version) {
|
|
7044
|
+
await sendManagement(this.#client, {
|
|
7045
|
+
operation: "network.delete_profile",
|
|
7046
|
+
method: "DELETE",
|
|
7047
|
+
pathTemplate: "/api/v1/network/profiles/{segment_id}",
|
|
7048
|
+
path: `/api/v1/network/profiles/${encodeURIComponent(segmentId)}`,
|
|
7049
|
+
query: { "version": String(version) }
|
|
7050
|
+
});
|
|
7051
|
+
}
|
|
7052
|
+
/** `GET /api/v1/network/policy` */
|
|
7053
|
+
async getPolicy() {
|
|
7054
|
+
const wire = await sendManagement(this.#client, {
|
|
7055
|
+
operation: "network.get_policy",
|
|
7056
|
+
method: "GET",
|
|
7057
|
+
pathTemplate: "/api/v1/network/policy",
|
|
7058
|
+
path: "/api/v1/network/policy"
|
|
7059
|
+
});
|
|
7060
|
+
return wire;
|
|
7061
|
+
}
|
|
7062
|
+
/**
|
|
7063
|
+
* `PUT /api/v1/network/policy`
|
|
7064
|
+
*
|
|
7065
|
+
* **This is a replacement, not a patch** (§27.4 rule 5). Every field of the
|
|
7066
|
+
* body is required, and what you do not carry over from a prior read is not
|
|
7067
|
+
* preserved — it is overwritten. Read first, change the field you mean, send
|
|
7068
|
+
* the whole thing back.
|
|
7069
|
+
*
|
|
7070
|
+
* Not retried on failure (§27.4 rule 8): every write on this surface is
|
|
7071
|
+
* issued exactly once, including the ones that look idempotent.
|
|
7072
|
+
*/
|
|
7073
|
+
async replacePolicy(body) {
|
|
7074
|
+
const wire = await sendManagement(this.#client, {
|
|
7075
|
+
operation: "network.replace_policy",
|
|
7076
|
+
method: "PUT",
|
|
7077
|
+
pathTemplate: "/api/v1/network/policy",
|
|
7078
|
+
path: "/api/v1/network/policy",
|
|
7079
|
+
body
|
|
7080
|
+
});
|
|
7081
|
+
return wire;
|
|
7082
|
+
}
|
|
7083
|
+
};
|
|
7084
|
+
|
|
6512
7085
|
// src/management/ops/settings.ts
|
|
6513
7086
|
var SettingsApi = class _SettingsApi {
|
|
6514
7087
|
#client;
|
|
@@ -7133,6 +7706,9 @@ function managementNamespaces(client) {
|
|
|
7133
7706
|
get scimTargets() {
|
|
7134
7707
|
return new ScimTargetsApi(client);
|
|
7135
7708
|
},
|
|
7709
|
+
get network() {
|
|
7710
|
+
return new NetworkApi(client);
|
|
7711
|
+
},
|
|
7136
7712
|
get settings() {
|
|
7137
7713
|
return new SettingsApi(client);
|
|
7138
7714
|
},
|
|
@@ -7854,6 +8430,7 @@ exports.MAX_ATTEMPTS = MAX_ATTEMPTS;
|
|
|
7854
8430
|
exports.MAX_DELAY_MS = MAX_DELAY_MS;
|
|
7855
8431
|
exports.MAX_TTL_MS = MAX_TTL_MS;
|
|
7856
8432
|
exports.ManifestApi = ManifestApi;
|
|
8433
|
+
exports.NetworkApi = NetworkApi;
|
|
7857
8434
|
exports.NetworkError = NetworkError;
|
|
7858
8435
|
exports.NotFoundError = NotFoundError;
|
|
7859
8436
|
exports.NotificationRulesApi = NotificationRulesApi;
|
|
@@ -7918,6 +8495,7 @@ exports.memoKey = memoKey;
|
|
|
7918
8495
|
exports.normalizeSearch = normalizeSearch;
|
|
7919
8496
|
exports.oAuth2ClientCreatedResponseFromWire = oAuth2ClientCreatedResponseFromWire;
|
|
7920
8497
|
exports.omitEmptyTenantScope = omitEmptyTenantScope;
|
|
8498
|
+
exports.omitNullMembers = omitNullMembers;
|
|
7921
8499
|
exports.opaqueAvailable = opaqueAvailable;
|
|
7922
8500
|
exports.opaqueEnrollment = opaqueEnrollment;
|
|
7923
8501
|
exports.opaqueEnrollmentForSelf = opaqueEnrollmentForSelf;
|
|
@@ -7948,6 +8526,7 @@ exports.setDirectoryConfigFrom = setDirectoryConfigFrom;
|
|
|
7948
8526
|
exports.setDirectoryConfigToWire = setDirectoryConfigToWire;
|
|
7949
8527
|
exports.ssfStreamInputFrom = ssfStreamInputFrom;
|
|
7950
8528
|
exports.ssfStreamInputToWire = ssfStreamInputToWire;
|
|
8529
|
+
exports.ssfStreamInputWith = ssfStreamInputWith;
|
|
7951
8530
|
exports.topologicalOrder = topologicalOrder;
|
|
7952
8531
|
exports.updateDirectoryConfigToWire = updateDirectoryConfigToWire;
|
|
7953
8532
|
exports.updateFederationConfigRequestToWire = updateFederationConfigRequestToWire;
|