@xemahq/authorization-internal-api-client 0.5.3 → 0.6.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.
Files changed (141) hide show
  1. package/dist/endpoints/authorization/authorization.d.ts +1 -19
  2. package/dist/endpoints/authorization/authorization.js +1 -52
  3. package/dist/endpoints/authorization-policy-sets/authorization-policy-sets.d.ts +27 -0
  4. package/dist/endpoints/authorization-policy-sets/authorization-policy-sets.js +65 -0
  5. package/dist/index.d.ts +1 -1
  6. package/dist/index.js +1 -1
  7. package/dist/models/adoptOrgPolicySetDto.d.ts +21 -0
  8. package/dist/models/dataClassification.d.ts +3 -0
  9. package/dist/models/executionEnvironmentKind.d.ts +1 -1
  10. package/dist/models/index.d.ts +15 -56
  11. package/dist/models/index.js +15 -56
  12. package/dist/models/orgPolicySetDto.d.ts +18 -0
  13. package/dist/models/orgPolicySetDtoDataEnvelope.d.ts +9 -0
  14. package/dist/models/{policyRouteHintDtoRequiredRunnerLabels.d.ts → orgPolicySetDtoModel.d.ts} +5 -2
  15. package/dist/models/orgPolicySetDtoModules.d.ts +11 -0
  16. package/dist/models/policySetTestFileDto.d.ts +22 -0
  17. package/dist/models/policySetTestFileResultDto.d.ts +11 -0
  18. package/dist/models/policySetTestResultsDto.d.ts +9 -0
  19. package/dist/models/policySetTestResultsDtoDataEnvelope.d.ts +9 -0
  20. package/dist/models/retiredNamespaceDto.d.ts +9 -0
  21. package/dist/models/retiredNamespaceDtoDataEnvelope.d.ts +9 -0
  22. package/dist/models/runPolicySetTestsDto.d.ts +12 -0
  23. package/dist/models/runPolicySetTestsDtoModel.d.ts +11 -0
  24. package/dist/models/runtimeModuleContributionDto.d.ts +20 -0
  25. package/dist/models/runtimeModuleContributionDtoManifest.d.ts +11 -0
  26. package/dist/models/runtimeModuleContributionDtoManifest.js +7 -0
  27. package/dist/models/spaceKind.d.ts +3 -0
  28. package/package.json +1 -1
  29. package/dist/endpoints/resources/resources.d.ts +0 -59
  30. package/dist/endpoints/resources/resources.js +0 -141
  31. package/dist/models/addResourceShareDto.d.ts +0 -12
  32. package/dist/models/authorizationCheckRequestDto.d.ts +0 -39
  33. package/dist/models/authorizationCheckResponseDto.d.ts +0 -14
  34. package/dist/models/authorizationCheckResponseDtoDataEnvelope.d.ts +0 -9
  35. package/dist/models/authorizationDecisionCode.d.ts +0 -18
  36. package/dist/models/authorizationDecisionCode.js +0 -20
  37. package/dist/models/authorizationReasonDto.d.ts +0 -11
  38. package/dist/models/authorizationSuggestionDto.d.ts +0 -25
  39. package/dist/models/authorizationSuggestionKind.d.ts +0 -11
  40. package/dist/models/authorizationSuggestionKind.js +0 -13
  41. package/dist/models/biomeExecutionTrustTier.d.ts +0 -10
  42. package/dist/models/biomeExecutionTrustTier.js +0 -12
  43. package/dist/models/callerKind.d.ts +0 -14
  44. package/dist/models/callerKind.js +0 -16
  45. package/dist/models/credentialPrecedenceSource.d.ts +0 -17
  46. package/dist/models/credentialPrecedenceSource.js +0 -16
  47. package/dist/models/dataResidency.d.ts +0 -9
  48. package/dist/models/dataResidency.js +0 -11
  49. package/dist/models/listRegisteredResourcesDto.d.ts +0 -12
  50. package/dist/models/listVisibleResourcesDto.d.ts +0 -20
  51. package/dist/models/policyActingAgentDto.d.ts +0 -14
  52. package/dist/models/policyActingAgentDtoKind.d.ts +0 -9
  53. package/dist/models/policyActingAgentDtoKind.js +0 -11
  54. package/dist/models/policyActingForDto.d.ts +0 -29
  55. package/dist/models/policyActingForDto.js +0 -2
  56. package/dist/models/policyBiomeDto.d.ts +0 -14
  57. package/dist/models/policyBiomeDto.js +0 -2
  58. package/dist/models/policyCallerDto.d.ts +0 -17
  59. package/dist/models/policyCallerDto.js +0 -2
  60. package/dist/models/policyCapabilityDto.d.ts +0 -14
  61. package/dist/models/policyCheckBatchRequestDto.d.ts +0 -13
  62. package/dist/models/policyCheckBatchRequestDto.js +0 -2
  63. package/dist/models/policyCheckBatchResponseDto.d.ts +0 -10
  64. package/dist/models/policyCheckBatchResponseDto.js +0 -2
  65. package/dist/models/policyCheckBatchResponseDtoDataEnvelope.d.ts +0 -9
  66. package/dist/models/policyCheckBatchResponseDtoDataEnvelope.js +0 -2
  67. package/dist/models/policyCheckRequestDto.d.ts +0 -96
  68. package/dist/models/policyCheckRequestDto.js +0 -2
  69. package/dist/models/policyCheckRequestDtoAperture.d.ts +0 -11
  70. package/dist/models/policyConstraintsDto.d.ts +0 -12
  71. package/dist/models/policyDecisionDto.d.ts +0 -26
  72. package/dist/models/policyDecisionDto.js +0 -2
  73. package/dist/models/policyDecisionDtoDataEnvelope.d.ts +0 -9
  74. package/dist/models/policyDecisionDtoDataEnvelope.js +0 -2
  75. package/dist/models/policyDecisionKind.d.ts +0 -11
  76. package/dist/models/policyDecisionKind.js +0 -13
  77. package/dist/models/policyDelegatedAuthorityDto.d.ts +0 -25
  78. package/dist/models/policyDelegatedAuthorityDto.js +0 -2
  79. package/dist/models/policyEnvironmentDto.d.ts +0 -15
  80. package/dist/models/policyEnvironmentDto.js +0 -2
  81. package/dist/models/policyObligationDto.d.ts +0 -29
  82. package/dist/models/policyObligationDto.js +0 -2
  83. package/dist/models/policyObligationKind.d.ts +0 -17
  84. package/dist/models/policyObligationKind.js +0 -19
  85. package/dist/models/policyResourceDto.d.ts +0 -15
  86. package/dist/models/policyResourceDto.js +0 -2
  87. package/dist/models/policyRouteHintDto.d.ts +0 -14
  88. package/dist/models/policyRouteHintDto.js +0 -2
  89. package/dist/models/policySpaceRefDto.d.ts +0 -23
  90. package/dist/models/policySpaceRefDto.js +0 -2
  91. package/dist/models/policySubjectRefDto.d.ts +0 -14
  92. package/dist/models/policySubjectRefDto.js +0 -2
  93. package/dist/models/registerResourceOwnershipDto.d.ts +0 -34
  94. package/dist/models/registerResourceOwnershipDto.js +0 -2
  95. package/dist/models/registeredResourceDto.d.ts +0 -12
  96. package/dist/models/registeredResourceDto.js +0 -2
  97. package/dist/models/registeredResourcesDto.d.ts +0 -10
  98. package/dist/models/registeredResourcesDto.js +0 -2
  99. package/dist/models/registeredResourcesDtoDataEnvelope.d.ts +0 -9
  100. package/dist/models/registeredResourcesDtoDataEnvelope.js +0 -2
  101. package/dist/models/removeResourceShareDto.d.ts +0 -10
  102. package/dist/models/removeResourceShareDto.js +0 -2
  103. package/dist/models/replaceResourceOwnershipDto.d.ts +0 -34
  104. package/dist/models/replaceResourceOwnershipDto.js +0 -2
  105. package/dist/models/resourceOwnershipDto.d.ts +0 -15
  106. package/dist/models/resourceOwnershipDto.js +0 -2
  107. package/dist/models/resourceOwnershipDtoDataEnvelope.d.ts +0 -9
  108. package/dist/models/resourceOwnershipDtoDataEnvelope.js +0 -2
  109. package/dist/models/resourceOwnershipEntryDto.d.ts +0 -17
  110. package/dist/models/resourceOwnershipEntryDto.js +0 -2
  111. package/dist/models/resourceOwnershipReadDto.d.ts +0 -16
  112. package/dist/models/resourceOwnershipReadDto.js +0 -2
  113. package/dist/models/resourceOwnershipReadDtoDataEnvelope.d.ts +0 -9
  114. package/dist/models/resourceOwnershipReadDtoDataEnvelope.js +0 -2
  115. package/dist/models/resourceShareRefDto.d.ts +0 -21
  116. package/dist/models/resourceShareRefDto.js +0 -2
  117. package/dist/models/resourceVisibilityPattern.d.ts +0 -11
  118. package/dist/models/resourceVisibilityPattern.js +0 -13
  119. package/dist/models/runnerKind.d.ts +0 -15
  120. package/dist/models/runnerKind.js +0 -17
  121. package/dist/models/sessionParticipantRole.d.ts +0 -14
  122. package/dist/models/sessionParticipantRole.js +0 -13
  123. package/dist/models/subjectRefDto.d.ts +0 -15
  124. package/dist/models/subjectRefDto.js +0 -2
  125. package/dist/models/visibleResourcesDto.d.ts +0 -9
  126. package/dist/models/visibleResourcesDtoDataEnvelope.d.ts +0 -9
  127. package/dist/models/visibleResourcesDtoDataEnvelope.js +0 -2
  128. /package/dist/models/{addResourceShareDto.js → adoptOrgPolicySetDto.js} +0 -0
  129. /package/dist/models/{authorizationCheckRequestDto.js → orgPolicySetDto.js} +0 -0
  130. /package/dist/models/{authorizationCheckResponseDto.js → orgPolicySetDtoDataEnvelope.js} +0 -0
  131. /package/dist/models/{listRegisteredResourcesDto.js → orgPolicySetDtoModel.js} +0 -0
  132. /package/dist/models/{policyCapabilityDto.js → orgPolicySetDtoModules.js} +0 -0
  133. /package/dist/models/{policyCheckRequestDtoAperture.js → policySetTestFileDto.js} +0 -0
  134. /package/dist/models/{policyConstraintsDto.js → policySetTestFileResultDto.js} +0 -0
  135. /package/dist/models/{authorizationCheckResponseDtoDataEnvelope.js → policySetTestResultsDto.js} +0 -0
  136. /package/dist/models/{authorizationReasonDto.js → policySetTestResultsDtoDataEnvelope.js} +0 -0
  137. /package/dist/models/{policyRouteHintDtoRequiredRunnerLabels.js → retiredNamespaceDto.js} +0 -0
  138. /package/dist/models/{authorizationSuggestionDto.js → retiredNamespaceDtoDataEnvelope.js} +0 -0
  139. /package/dist/models/{listVisibleResourcesDto.js → runPolicySetTestsDto.js} +0 -0
  140. /package/dist/models/{visibleResourcesDto.js → runPolicySetTestsDtoModel.js} +0 -0
  141. /package/dist/models/{policyActingAgentDto.js → runtimeModuleContributionDto.js} +0 -0
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Generated by @xemahq/api-client-generator — do not edit manually.
3
+ * Authorization API
4
+ * OpenAPI spec version: 0.1.1
5
+ */
6
+ export interface PolicySetTestFileDto {
7
+ /**
8
+ * The module the file belongs to (`xema_core`, a biome id).
9
+ * @minLength 1
10
+ */
11
+ owner: string;
12
+ /**
13
+ * The file name, e.g. `pai-core.fga.yaml`.
14
+ * @minLength 1
15
+ */
16
+ name: string;
17
+ /**
18
+ * The standard OpenFGA test file (`fga model test`) as YAML.
19
+ * @minLength 1
20
+ */
21
+ contents: string;
22
+ }
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Generated by @xemahq/api-client-generator — do not edit manually.
3
+ * Authorization API
4
+ * OpenAPI spec version: 0.1.1
5
+ */
6
+ export interface PolicySetTestFileResultDto {
7
+ owner: string;
8
+ name: string;
9
+ passed: boolean;
10
+ output: string;
11
+ }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Generated by @xemahq/api-client-generator — do not edit manually.
3
+ * Authorization API
4
+ * OpenAPI spec version: 0.1.1
5
+ */
6
+ import type { PolicySetTestFileResultDto } from './policySetTestFileResultDto.js';
7
+ export interface PolicySetTestResultsDto {
8
+ results: PolicySetTestFileResultDto[];
9
+ }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Generated by @xemahq/api-client-generator — do not edit manually.
3
+ * Authorization API
4
+ * OpenAPI spec version: 0.1.1
5
+ */
6
+ import type { PolicySetTestResultsDto } from './policySetTestResultsDto.js';
7
+ export interface PolicySetTestResultsDtoDataEnvelope {
8
+ data: PolicySetTestResultsDto;
9
+ }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Generated by @xemahq/api-client-generator — do not edit manually.
3
+ * Authorization API
4
+ * OpenAPI spec version: 0.1.1
5
+ */
6
+ export interface RetiredNamespaceDto {
7
+ /** Tuples deleted by the teardown. */
8
+ tuplesDeleted: number;
9
+ }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Generated by @xemahq/api-client-generator — do not edit manually.
3
+ * Authorization API
4
+ * OpenAPI spec version: 0.1.1
5
+ */
6
+ import type { RetiredNamespaceDto } from './retiredNamespaceDto.js';
7
+ export interface RetiredNamespaceDtoDataEnvelope {
8
+ data: RetiredNamespaceDto;
9
+ }
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Generated by @xemahq/api-client-generator — do not edit manually.
3
+ * Authorization API
4
+ * OpenAPI spec version: 0.1.1
5
+ */
6
+ import type { PolicySetTestFileDto } from './policySetTestFileDto.js';
7
+ import type { RunPolicySetTestsDtoModel } from './runPolicySetTestsDtoModel.js';
8
+ export interface RunPolicySetTestsDto {
9
+ /** The composed OpenFGA JSON model. */
10
+ model: RunPolicySetTestsDtoModel;
11
+ testFiles: PolicySetTestFileDto[];
12
+ }
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Generated by @xemahq/api-client-generator — do not edit manually.
3
+ * Authorization API
4
+ * OpenAPI spec version: 0.1.1
5
+ */
6
+ /**
7
+ * The composed OpenFGA JSON model.
8
+ */
9
+ export type RunPolicySetTestsDtoModel = {
10
+ [key: string]: unknown;
11
+ };
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Generated by @xemahq/api-client-generator — do not edit manually.
3
+ * Authorization API
4
+ * OpenAPI spec version: 0.1.1
5
+ */
6
+ import type { RuntimeModuleContributionDtoManifest } from './runtimeModuleContributionDtoManifest.js';
7
+ export interface RuntimeModuleContributionDto {
8
+ /**
9
+ * The signed biome id (the derived namespace).
10
+ * @minLength 1
11
+ */
12
+ biomeId: string;
13
+ /**
14
+ * The signed biome version the module was read from.
15
+ * @minLength 1
16
+ */
17
+ biomeVersion: string;
18
+ /** The stamped authorization-module contribution manifest (envelope, files, tests, signedBiome). */
19
+ manifest: RuntimeModuleContributionDtoManifest;
20
+ }
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Generated by @xemahq/api-client-generator — do not edit manually.
3
+ * Authorization API
4
+ * OpenAPI spec version: 0.1.1
5
+ */
6
+ /**
7
+ * The stamped authorization-module contribution manifest (envelope, files, tests, signedBiome).
8
+ */
9
+ export type RuntimeModuleContributionDtoManifest = {
10
+ [key: string]: unknown;
11
+ };
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ /**
3
+ * Generated by @xemahq/api-client-generator — do not edit manually.
4
+ * Authorization API
5
+ * OpenAPI spec version: 0.1.1
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -3,6 +3,9 @@
3
3
  * Authorization API
4
4
  * OpenAPI spec version: 0.1.1
5
5
  */
6
+ /**
7
+ * The ref's tier — what an admin sees this as (a project, an app, the org).
8
+ */
6
9
  export type SpaceKind = typeof SpaceKind[keyof typeof SpaceKind];
7
10
  export declare const SpaceKind: {
8
11
  readonly system: "system";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xemahq/authorization-internal-api-client",
3
- "version": "0.5.3",
3
+ "version": "0.6.0",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "files": [
@@ -1,59 +0,0 @@
1
- /**
2
- * Generated by @xemahq/api-client-generator — do not edit manually.
3
- * Authorization API
4
- * OpenAPI spec version: 0.1.1
5
- */
6
- import type { AddResourceShareDto, ListRegisteredResourcesDto, ListVisibleResourcesDto, RegisterResourceOwnershipDto, RegisteredResourcesDtoDataEnvelope, RemoveResourceShareDto, ReplaceResourceOwnershipDto, ResourceOwnershipDtoDataEnvelope, ResourceOwnershipReadDtoDataEnvelope, VisibleResourcesDtoDataEnvelope } from '../../models';
7
- export declare const getResourcesControllerRegisterUrl: () => string;
8
- /**
9
- * Writes the ownership rows + OpenFGA tuples so the PDP ANDs the verb verdict with instance ownership. Idempotent (upsert + ignore-duplicate tuples). Org scope is forced from the caller context.
10
- * @summary Register ownership/visibility of a resource instance
11
- */
12
- export declare const resourcesControllerRegister: (registerResourceOwnershipDto: RegisterResourceOwnershipDto, options?: RequestInit) => Promise<ResourceOwnershipDtoDataEnvelope>;
13
- export declare const getResourcesControllerListVisibleUrl: () => string;
14
- /**
15
- * Unions OpenFGA owner/shared-with visibility (usersets expanded transitively) with org-shared instances. Org scope is forced from the caller context. Used by platform BFFs to visibility-filter a list on behalf of the end user they serve.
16
- *
17
- * Supplying `minLevel` narrows the question from "may this subject SEE it" to "does this subject hold at least this LEVEL on it": the answer becomes owner ∪ shared at or above that rung, and org-shared instances drop out because org-shared is a visibility pattern rather than a rung. That is the question a BFF asks to decide who may MANAGE an instance, and answering it here is what keeps the caller from having to expand identity groups itself — OpenFGA expands `team#member` and `role#assignee` usersets transitively.
18
- * @summary List the instances of a resource type a subject may see
19
- */
20
- export declare const resourcesControllerListVisible: (listVisibleResourcesDto: ListVisibleResourcesDto, options?: RequestInit) => Promise<VisibleResourcesDtoDataEnvelope>;
21
- export declare const getResourcesControllerListRegisteredUrl: () => string;
22
- /**
23
- * Every registered instance of `resourceType` in the caller org, with the subjects that OWN it. Org scope is forced from the caller context.
24
- *
25
- * This is NOT `resource.listVisible` with a privileged subject, and the difference is the reason it exists. `listVisible` answers "what may THIS SUBJECT see"; a service needing "what has this org registered" used to ask it about a subject it had made the owner of everything — which works only for as long as that fixed owner exists, and turns any later ownership change into a silent, total loss of the enumeration. A convergence pass built on the substitute does not just stop registering: it reads every live instance as registered-but-not-live and DEREGISTERS it.
26
- *
27
- * A POST rather than a GET because `resource.getOwnership` is mounted at `GET /resources/:type/:id`, which would shadow any `GET /resources/registered/...` shape; the body carries the one input.
28
- * @summary List the instances of a resource type this ORG has registered
29
- */
30
- export declare const resourcesControllerListRegistered: (listRegisteredResourcesDto: ListRegisteredResourcesDto, options?: RequestInit) => Promise<RegisteredResourcesDtoDataEnvelope>;
31
- export declare const getResourcesControllerGetOwnershipUrl: (type: string, id: string) => string;
32
- /**
33
- * Returns the instance visibility and the combined set of registered subjects (owners + shares; the SQL authority does not split them). 404 when the instance was never registered.
34
- * @summary Read a resource instance’s current visibility + subjects
35
- */
36
- export declare const resourcesControllerGetOwnership: (type: string, id: string, options?: RequestInit) => Promise<ResourceOwnershipReadDtoDataEnvelope>;
37
- export declare const getResourcesControllerReplaceOwnershipUrl: (type: string, id: string) => string;
38
- /**
39
- * The whole post-state: after this call the instance’s registered subjects are EXACTLY `owners` ∪ `explicitShares`, and a subject named by neither loses its authority row AND its `shared_with` tuple. This is the ONLY surface that can express a revocation as part of a set write — `resource.register` upserts what it is handed and never touches a subject outside that list, so re-registering with a subject removed reports 200 and leaves both its row and its tuple live. Removals delete the tuple BEFORE the row (a crash between them leaves the subject WITHOUT access); additions write the row before the tuple. Serialised per instance by an advisory lock, so two concurrent replaces cannot interleave into a mixed set. Idempotent. Refuses (409 `RESOURCE_SUBJECT_IS_OWNER`) when a currently-registered OWNER is absent from the new `owners` list — dropping or demoting an owner is `resource.deregister`. Org scope is forced from the caller context. A body naming a `grantor` has every share judged against the level that subject actually holds (read from the tuple store, never from the body); omitting it means the calling service asserts owner authority.
40
- * @summary REPLACE a resource instance’s ownership set
41
- */
42
- export declare const resourcesControllerReplaceOwnership: (type: string, id: string, replaceResourceOwnershipDto: ReplaceResourceOwnershipDto, options?: RequestInit) => Promise<ResourceOwnershipDtoDataEnvelope>;
43
- export declare const getResourcesControllerDeregisterUrl: (type: string, id: string) => string;
44
- /**
45
- * Idempotent — a no-op when the instance was never registered.
46
- * @summary Deregister a resource instance (drop ownership rows + tuples)
47
- */
48
- export declare const resourcesControllerDeregister: (type: string, id: string, options?: RequestInit) => Promise<void>;
49
- export declare const getResourcesControllerAddShareUrl: (type: string, id: string) => string;
50
- /**
51
- * @summary Add an explicit share to a registered resource instance
52
- */
53
- export declare const resourcesControllerAddShare: (type: string, id: string, addResourceShareDto: AddResourceShareDto, options?: RequestInit) => Promise<void>;
54
- export declare const getResourcesControllerRemoveShareUrl: (type: string, id: string) => string;
55
- /**
56
- * The inverse of `resource.addShare`, and the ONLY way to unshare without the deregister-then-register window (during which the instance is UNREGISTERED and the PDP resolves it as a verb-only ALLOW for everyone). Drops the `shared_with` tuple FIRST and the authority row second, so a crash between them leaves the subject WITHOUT access, never with it. Idempotent: removing a share that does not exist is a no-op success. Refuses a subject that holds an `owned_by` tuple (409 `RESOURCE_SUBJECT_IS_OWNER`) — owner removal is `resource.deregister`. Does NOT change the instance visibility, even when this removes the last share: `explicit-share` with zero shares means "shared with nobody".
57
- * @summary Remove an explicit share from a registered resource instance
58
- */
59
- export declare const resourcesControllerRemoveShare: (type: string, id: string, removeResourceShareDto: RemoveResourceShareDto, options?: RequestInit) => Promise<void>;
@@ -1,141 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.resourcesControllerRemoveShare = exports.getResourcesControllerRemoveShareUrl = exports.resourcesControllerAddShare = exports.getResourcesControllerAddShareUrl = exports.resourcesControllerDeregister = exports.getResourcesControllerDeregisterUrl = exports.resourcesControllerReplaceOwnership = exports.getResourcesControllerReplaceOwnershipUrl = exports.resourcesControllerGetOwnership = exports.getResourcesControllerGetOwnershipUrl = exports.resourcesControllerListRegistered = exports.getResourcesControllerListRegisteredUrl = exports.resourcesControllerListVisible = exports.getResourcesControllerListVisibleUrl = exports.resourcesControllerRegister = exports.getResourcesControllerRegisterUrl = void 0;
4
- const custom_fetch_1 = require("../../custom-fetch");
5
- const getResourcesControllerRegisterUrl = () => {
6
- return `/resources`;
7
- };
8
- exports.getResourcesControllerRegisterUrl = getResourcesControllerRegisterUrl;
9
- /**
10
- * Writes the ownership rows + OpenFGA tuples so the PDP ANDs the verb verdict with instance ownership. Idempotent (upsert + ignore-duplicate tuples). Org scope is forced from the caller context.
11
- * @summary Register ownership/visibility of a resource instance
12
- */
13
- const resourcesControllerRegister = async (registerResourceOwnershipDto, options) => {
14
- return (0, custom_fetch_1.customFetch)((0, exports.getResourcesControllerRegisterUrl)(), {
15
- ...options,
16
- method: 'POST',
17
- headers: { 'Content-Type': 'application/json', ...options?.headers },
18
- body: JSON.stringify(registerResourceOwnershipDto)
19
- });
20
- };
21
- exports.resourcesControllerRegister = resourcesControllerRegister;
22
- const getResourcesControllerListVisibleUrl = () => {
23
- return `/resources/visible`;
24
- };
25
- exports.getResourcesControllerListVisibleUrl = getResourcesControllerListVisibleUrl;
26
- /**
27
- * Unions OpenFGA owner/shared-with visibility (usersets expanded transitively) with org-shared instances. Org scope is forced from the caller context. Used by platform BFFs to visibility-filter a list on behalf of the end user they serve.
28
- *
29
- * Supplying `minLevel` narrows the question from "may this subject SEE it" to "does this subject hold at least this LEVEL on it": the answer becomes owner ∪ shared at or above that rung, and org-shared instances drop out because org-shared is a visibility pattern rather than a rung. That is the question a BFF asks to decide who may MANAGE an instance, and answering it here is what keeps the caller from having to expand identity groups itself — OpenFGA expands `team#member` and `role#assignee` usersets transitively.
30
- * @summary List the instances of a resource type a subject may see
31
- */
32
- const resourcesControllerListVisible = async (listVisibleResourcesDto, options) => {
33
- return (0, custom_fetch_1.customFetch)((0, exports.getResourcesControllerListVisibleUrl)(), {
34
- ...options,
35
- method: 'POST',
36
- headers: { 'Content-Type': 'application/json', ...options?.headers },
37
- body: JSON.stringify(listVisibleResourcesDto)
38
- });
39
- };
40
- exports.resourcesControllerListVisible = resourcesControllerListVisible;
41
- const getResourcesControllerListRegisteredUrl = () => {
42
- return `/resources/registered`;
43
- };
44
- exports.getResourcesControllerListRegisteredUrl = getResourcesControllerListRegisteredUrl;
45
- /**
46
- * Every registered instance of `resourceType` in the caller org, with the subjects that OWN it. Org scope is forced from the caller context.
47
- *
48
- * This is NOT `resource.listVisible` with a privileged subject, and the difference is the reason it exists. `listVisible` answers "what may THIS SUBJECT see"; a service needing "what has this org registered" used to ask it about a subject it had made the owner of everything — which works only for as long as that fixed owner exists, and turns any later ownership change into a silent, total loss of the enumeration. A convergence pass built on the substitute does not just stop registering: it reads every live instance as registered-but-not-live and DEREGISTERS it.
49
- *
50
- * A POST rather than a GET because `resource.getOwnership` is mounted at `GET /resources/:type/:id`, which would shadow any `GET /resources/registered/...` shape; the body carries the one input.
51
- * @summary List the instances of a resource type this ORG has registered
52
- */
53
- const resourcesControllerListRegistered = async (listRegisteredResourcesDto, options) => {
54
- return (0, custom_fetch_1.customFetch)((0, exports.getResourcesControllerListRegisteredUrl)(), {
55
- ...options,
56
- method: 'POST',
57
- headers: { 'Content-Type': 'application/json', ...options?.headers },
58
- body: JSON.stringify(listRegisteredResourcesDto)
59
- });
60
- };
61
- exports.resourcesControllerListRegistered = resourcesControllerListRegistered;
62
- const getResourcesControllerGetOwnershipUrl = (type, id) => {
63
- return `/resources/${type}/${id}`;
64
- };
65
- exports.getResourcesControllerGetOwnershipUrl = getResourcesControllerGetOwnershipUrl;
66
- /**
67
- * Returns the instance visibility and the combined set of registered subjects (owners + shares; the SQL authority does not split them). 404 when the instance was never registered.
68
- * @summary Read a resource instance’s current visibility + subjects
69
- */
70
- const resourcesControllerGetOwnership = async (type, id, options) => {
71
- return (0, custom_fetch_1.customFetch)((0, exports.getResourcesControllerGetOwnershipUrl)(type, id), {
72
- ...options,
73
- method: 'GET'
74
- });
75
- };
76
- exports.resourcesControllerGetOwnership = resourcesControllerGetOwnership;
77
- const getResourcesControllerReplaceOwnershipUrl = (type, id) => {
78
- return `/resources/${type}/${id}`;
79
- };
80
- exports.getResourcesControllerReplaceOwnershipUrl = getResourcesControllerReplaceOwnershipUrl;
81
- /**
82
- * The whole post-state: after this call the instance’s registered subjects are EXACTLY `owners` ∪ `explicitShares`, and a subject named by neither loses its authority row AND its `shared_with` tuple. This is the ONLY surface that can express a revocation as part of a set write — `resource.register` upserts what it is handed and never touches a subject outside that list, so re-registering with a subject removed reports 200 and leaves both its row and its tuple live. Removals delete the tuple BEFORE the row (a crash between them leaves the subject WITHOUT access); additions write the row before the tuple. Serialised per instance by an advisory lock, so two concurrent replaces cannot interleave into a mixed set. Idempotent. Refuses (409 `RESOURCE_SUBJECT_IS_OWNER`) when a currently-registered OWNER is absent from the new `owners` list — dropping or demoting an owner is `resource.deregister`. Org scope is forced from the caller context. A body naming a `grantor` has every share judged against the level that subject actually holds (read from the tuple store, never from the body); omitting it means the calling service asserts owner authority.
83
- * @summary REPLACE a resource instance’s ownership set
84
- */
85
- const resourcesControllerReplaceOwnership = async (type, id, replaceResourceOwnershipDto, options) => {
86
- return (0, custom_fetch_1.customFetch)((0, exports.getResourcesControllerReplaceOwnershipUrl)(type, id), {
87
- ...options,
88
- method: 'PUT',
89
- headers: { 'Content-Type': 'application/json', ...options?.headers },
90
- body: JSON.stringify(replaceResourceOwnershipDto)
91
- });
92
- };
93
- exports.resourcesControllerReplaceOwnership = resourcesControllerReplaceOwnership;
94
- const getResourcesControllerDeregisterUrl = (type, id) => {
95
- return `/resources/${type}/${id}`;
96
- };
97
- exports.getResourcesControllerDeregisterUrl = getResourcesControllerDeregisterUrl;
98
- /**
99
- * Idempotent — a no-op when the instance was never registered.
100
- * @summary Deregister a resource instance (drop ownership rows + tuples)
101
- */
102
- const resourcesControllerDeregister = async (type, id, options) => {
103
- return (0, custom_fetch_1.customFetch)((0, exports.getResourcesControllerDeregisterUrl)(type, id), {
104
- ...options,
105
- method: 'DELETE'
106
- });
107
- };
108
- exports.resourcesControllerDeregister = resourcesControllerDeregister;
109
- const getResourcesControllerAddShareUrl = (type, id) => {
110
- return `/resources/${type}/${id}/relationships`;
111
- };
112
- exports.getResourcesControllerAddShareUrl = getResourcesControllerAddShareUrl;
113
- /**
114
- * @summary Add an explicit share to a registered resource instance
115
- */
116
- const resourcesControllerAddShare = async (type, id, addResourceShareDto, options) => {
117
- return (0, custom_fetch_1.customFetch)((0, exports.getResourcesControllerAddShareUrl)(type, id), {
118
- ...options,
119
- method: 'POST',
120
- headers: { 'Content-Type': 'application/json', ...options?.headers },
121
- body: JSON.stringify(addResourceShareDto)
122
- });
123
- };
124
- exports.resourcesControllerAddShare = resourcesControllerAddShare;
125
- const getResourcesControllerRemoveShareUrl = (type, id) => {
126
- return `/resources/${type}/${id}/relationships`;
127
- };
128
- exports.getResourcesControllerRemoveShareUrl = getResourcesControllerRemoveShareUrl;
129
- /**
130
- * The inverse of `resource.addShare`, and the ONLY way to unshare without the deregister-then-register window (during which the instance is UNREGISTERED and the PDP resolves it as a verb-only ALLOW for everyone). Drops the `shared_with` tuple FIRST and the authority row second, so a crash between them leaves the subject WITHOUT access, never with it. Idempotent: removing a share that does not exist is a no-op success. Refuses a subject that holds an `owned_by` tuple (409 `RESOURCE_SUBJECT_IS_OWNER`) — owner removal is `resource.deregister`. Does NOT change the instance visibility, even when this removes the last share: `explicit-share` with zero shares means "shared with nobody".
131
- * @summary Remove an explicit share from a registered resource instance
132
- */
133
- const resourcesControllerRemoveShare = async (type, id, removeResourceShareDto, options) => {
134
- return (0, custom_fetch_1.customFetch)((0, exports.getResourcesControllerRemoveShareUrl)(type, id), {
135
- ...options,
136
- method: 'DELETE',
137
- headers: { 'Content-Type': 'application/json', ...options?.headers },
138
- body: JSON.stringify(removeResourceShareDto)
139
- });
140
- };
141
- exports.resourcesControllerRemoveShare = resourcesControllerRemoveShare;
@@ -1,12 +0,0 @@
1
- /**
2
- * Generated by @xemahq/api-client-generator — do not edit manually.
3
- * Authorization API
4
- * OpenAPI spec version: 0.1.1
5
- */
6
- import type { ResourceShareRefDto } from './resourceShareRefDto.js';
7
- import type { ResourceSubjectRefDto } from './resourceSubjectRefDto.js';
8
- export interface AddResourceShareDto {
9
- share: ResourceShareRefDto;
10
- /** The subject GRANTING this share, when it is not the instance owner. Used to apply the two delegation rules: a grantor may never confer more than they hold, and re-sharing is itself a level. Omitted means the caller asserts owner authority, which this service verifies against the tuple store — it is never taken on the caller's word. */
11
- grantor?: ResourceSubjectRefDto;
12
- }
@@ -1,39 +0,0 @@
1
- /**
2
- * Generated by @xemahq/api-client-generator — do not edit manually.
3
- * Authorization API
4
- * OpenAPI spec version: 0.1.1
5
- */
6
- import type { SubjectRefDto } from './subjectRefDto.js';
7
- export interface AuthorizationCheckRequestDto {
8
- /**
9
- * Organization identifier. Scopes the grant lookup to the tenant.
10
- * @minLength 1
11
- */
12
- orgId: string;
13
- /**
14
- * Canonical CapabilityRef `<domain>:<resource>.<verb>@<major>` from `@xemahq/kernel-contracts/capability`.
15
- * @minLength 1
16
- */
17
- capability: string;
18
- subject: SubjectRefDto;
19
- /**
20
- * ExecutionEnvironmentRef in `environment:<slug>` format (e.g. `"environment:project"`). The service parses the prefix and checks the slug against the ExecutionEnvironmentKind enum.
21
- * @minLength 1
22
- */
23
- environment: string;
24
- /**
25
- * Canonical `xema://<Space>/resource/<type>/<id>[@version]` address naming the instance the capability targets. Optional — omit it for a verb-only check; do not send a placeholder. The legacy `resource:<type>:<id>` form is still accepted, but it cannot express the org scope the canonical form carries. Any other shape is refused at the edge with `400 RESOURCE_REF_MALFORMED`.
26
- * @minLength 1
27
- */
28
- resource?: string;
29
- /**
30
- * Audience policy slug; Phase 3 ignores this dimension.
31
- * @minLength 1
32
- */
33
- audience?: string;
34
- /**
35
- * Caller-supplied correlation id surfaced in audit logs.
36
- * @minLength 1
37
- */
38
- correlationId?: string;
39
- }
@@ -1,14 +0,0 @@
1
- /**
2
- * Generated by @xemahq/api-client-generator — do not edit manually.
3
- * Authorization API
4
- * OpenAPI spec version: 0.1.1
5
- */
6
- import type { AuthorizationReasonDto } from './authorizationReasonDto.js';
7
- import type { AuthorizationSuggestionDto } from './authorizationSuggestionDto.js';
8
- export interface AuthorizationCheckResponseDto {
9
- allowed: boolean;
10
- /** Identifier of the `CapabilityGrant` row that matched (allow only). */
11
- grantId?: string;
12
- reasons: AuthorizationReasonDto[];
13
- suggestions: AuthorizationSuggestionDto[];
14
- }
@@ -1,9 +0,0 @@
1
- /**
2
- * Generated by @xemahq/api-client-generator — do not edit manually.
3
- * Authorization API
4
- * OpenAPI spec version: 0.1.1
5
- */
6
- import type { AuthorizationCheckResponseDto } from './authorizationCheckResponseDto.js';
7
- export interface AuthorizationCheckResponseDtoDataEnvelope {
8
- data: AuthorizationCheckResponseDto;
9
- }
@@ -1,18 +0,0 @@
1
- /**
2
- * Generated by @xemahq/api-client-generator — do not edit manually.
3
- * Authorization API
4
- * OpenAPI spec version: 0.1.1
5
- */
6
- export type AuthorizationDecisionCode = typeof AuthorizationDecisionCode[keyof typeof AuthorizationDecisionCode];
7
- export declare const AuthorizationDecisionCode: {
8
- readonly MATCHED_GRANT: "MATCHED_GRANT";
9
- readonly NO_GRANT_FOUND: "NO_GRANT_FOUND";
10
- readonly GRANT_REVOKED: "GRANT_REVOKED";
11
- readonly CAPABILITY_DENIED_BY_ENVIRONMENT: "CAPABILITY_DENIED_BY_ENVIRONMENT";
12
- readonly CAPABILITY_REQUIRES_APPROVAL: "CAPABILITY_REQUIRES_APPROVAL";
13
- readonly DELEGATION_GRANT_INSUFFICIENT: "DELEGATION_GRANT_INSUFFICIENT";
14
- readonly RESOURCE_NOT_OWNED: "RESOURCE_NOT_OWNED";
15
- readonly RESOURCE_SHARE_LEVEL_INSUFFICIENT: "RESOURCE_SHARE_LEVEL_INSUFFICIENT";
16
- readonly RESOURCE_UNREGISTERED: "RESOURCE_UNREGISTERED";
17
- readonly REACH_TIER_DENIED: "REACH_TIER_DENIED";
18
- };
@@ -1,20 +0,0 @@
1
- "use strict";
2
- /**
3
- * Generated by @xemahq/api-client-generator — do not edit manually.
4
- * Authorization API
5
- * OpenAPI spec version: 0.1.1
6
- */
7
- Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.AuthorizationDecisionCode = void 0;
9
- exports.AuthorizationDecisionCode = {
10
- MATCHED_GRANT: 'MATCHED_GRANT',
11
- NO_GRANT_FOUND: 'NO_GRANT_FOUND',
12
- GRANT_REVOKED: 'GRANT_REVOKED',
13
- CAPABILITY_DENIED_BY_ENVIRONMENT: 'CAPABILITY_DENIED_BY_ENVIRONMENT',
14
- CAPABILITY_REQUIRES_APPROVAL: 'CAPABILITY_REQUIRES_APPROVAL',
15
- DELEGATION_GRANT_INSUFFICIENT: 'DELEGATION_GRANT_INSUFFICIENT',
16
- RESOURCE_NOT_OWNED: 'RESOURCE_NOT_OWNED',
17
- RESOURCE_SHARE_LEVEL_INSUFFICIENT: 'RESOURCE_SHARE_LEVEL_INSUFFICIENT',
18
- RESOURCE_UNREGISTERED: 'RESOURCE_UNREGISTERED',
19
- REACH_TIER_DENIED: 'REACH_TIER_DENIED',
20
- };
@@ -1,11 +0,0 @@
1
- /**
2
- * Generated by @xemahq/api-client-generator — do not edit manually.
3
- * Authorization API
4
- * OpenAPI spec version: 0.1.1
5
- */
6
- import type { AuthorizationDecisionCode } from './authorizationDecisionCode.js';
7
- export interface AuthorizationReasonDto {
8
- code: AuthorizationDecisionCode;
9
- /** @minLength 1 */
10
- detail: string;
11
- }
@@ -1,25 +0,0 @@
1
- /**
2
- * Generated by @xemahq/api-client-generator — do not edit manually.
3
- * Authorization API
4
- * OpenAPI spec version: 0.1.1
5
- */
6
- import type { AuthorizationSuggestionKind } from './authorizationSuggestionKind.js';
7
- export interface AuthorizationSuggestionDto {
8
- kind: AuthorizationSuggestionKind;
9
- /** @minLength 1 */
10
- capability?: string;
11
- /** @minLength 1 */
12
- environment?: string;
13
- /** @minLength 1 */
14
- resource?: string;
15
- /**
16
- * For `switch-environment`: the environment the request was sent with (denied). For other kinds, undefined.
17
- * @minLength 1
18
- */
19
- from?: string;
20
- /**
21
- * For `switch-environment`: a environment the caller already holds a matching grant in. For other kinds, undefined.
22
- * @minLength 1
23
- */
24
- to?: string;
25
- }
@@ -1,11 +0,0 @@
1
- /**
2
- * Generated by @xemahq/api-client-generator — do not edit manually.
3
- * Authorization API
4
- * OpenAPI spec version: 0.1.1
5
- */
6
- export type AuthorizationSuggestionKind = typeof AuthorizationSuggestionKind[keyof typeof AuthorizationSuggestionKind];
7
- export declare const AuthorizationSuggestionKind: {
8
- readonly 'request-grant': "request-grant";
9
- readonly 'switch-environment': "switch-environment";
10
- readonly 'request-approval': "request-approval";
11
- };
@@ -1,13 +0,0 @@
1
- "use strict";
2
- /**
3
- * Generated by @xemahq/api-client-generator — do not edit manually.
4
- * Authorization API
5
- * OpenAPI spec version: 0.1.1
6
- */
7
- Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.AuthorizationSuggestionKind = void 0;
9
- exports.AuthorizationSuggestionKind = {
10
- 'request-grant': 'request-grant',
11
- 'switch-environment': 'switch-environment',
12
- 'request-approval': 'request-approval',
13
- };
@@ -1,10 +0,0 @@
1
- /**
2
- * Generated by @xemahq/api-client-generator — do not edit manually.
3
- * Authorization API
4
- * OpenAPI spec version: 0.1.1
5
- */
6
- export type BiomeExecutionTrustTier = typeof BiomeExecutionTrustTier[keyof typeof BiomeExecutionTrustTier];
7
- export declare const BiomeExecutionTrustTier: {
8
- readonly official: "official";
9
- readonly verified: "verified";
10
- };
@@ -1,12 +0,0 @@
1
- "use strict";
2
- /**
3
- * Generated by @xemahq/api-client-generator — do not edit manually.
4
- * Authorization API
5
- * OpenAPI spec version: 0.1.1
6
- */
7
- Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.BiomeExecutionTrustTier = void 0;
9
- exports.BiomeExecutionTrustTier = {
10
- official: 'official',
11
- verified: 'verified',
12
- };
@@ -1,14 +0,0 @@
1
- /**
2
- * Generated by @xemahq/api-client-generator — do not edit manually.
3
- * Authorization API
4
- * OpenAPI spec version: 0.1.1
5
- */
6
- export type CallerKind = typeof CallerKind[keyof typeof CallerKind];
7
- export declare const CallerKind: {
8
- readonly web: "web";
9
- readonly api: "api";
10
- readonly agent: "agent";
11
- readonly workflow: "workflow";
12
- readonly shell: "shell";
13
- readonly scheduler: "scheduler";
14
- };
@@ -1,16 +0,0 @@
1
- "use strict";
2
- /**
3
- * Generated by @xemahq/api-client-generator — do not edit manually.
4
- * Authorization API
5
- * OpenAPI spec version: 0.1.1
6
- */
7
- Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.CallerKind = void 0;
9
- exports.CallerKind = {
10
- web: 'web',
11
- api: 'api',
12
- agent: 'agent',
13
- workflow: 'workflow',
14
- shell: 'shell',
15
- scheduler: 'scheduler',
16
- };
@@ -1,17 +0,0 @@
1
- /**
2
- * Generated by @xemahq/api-client-generator — do not edit manually.
3
- * Authorization API
4
- * OpenAPI spec version: 0.1.1
5
- */
6
- /**
7
- * Which precedence tier supplied `credentialBindingId` (explicit grant > capability default > project default > org default). Populated iff `credentialBindingId` is present.
8
- */
9
- export type CredentialPrecedenceSource = typeof CredentialPrecedenceSource[keyof typeof CredentialPrecedenceSource];
10
- export declare const CredentialPrecedenceSource: {
11
- readonly explicit: "explicit";
12
- readonly capability_default: "capability_default";
13
- readonly user_default: "user_default";
14
- readonly project_default: "project_default";
15
- readonly org_default: "org_default";
16
- readonly platform_default: "platform_default";
17
- };