@sealant/sdk-next 0.40.0-next.777 → 0.40.0-next.783
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/client.js +1 -1
- package/dist/effect/api-client.d.ts +606 -0
- package/dist/effect/operations.d.ts +274 -1
- package/dist/effect/operations.js +25 -0
- package/dist/index.d.ts +1 -0
- package/dist/scope-instances.d.ts +171 -0
- package/dist/scope-instances.js +153 -0
- package/dist/scopes.d.ts +13 -1
- package/dist/scopes.js +3 -1
- package/package.json +3 -3
package/dist/scopes.d.ts
CHANGED
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import { type ResourceDomainBudgetDimension } from "@sealant/api-contracts";
|
|
10
10
|
import type { SdkRuntime } from "./effect/runtime.js";
|
|
11
|
+
import type { SealantInternalConfig } from "./internal/config.js";
|
|
12
|
+
import { type ScopeArchivedVolume, type ScopeInstances, type ScopeWorkspaces } from "./scope-instances.js";
|
|
11
13
|
export interface ScopeInfo {
|
|
12
14
|
/** `rdm:<uuid>`. No person field of the API accepts it. */
|
|
13
15
|
readonly id: string;
|
|
@@ -105,6 +107,16 @@ export interface ScopeClient {
|
|
|
105
107
|
get(): Promise<ScopeInfo>;
|
|
106
108
|
readonly members: ScopeMembers;
|
|
107
109
|
readonly budget: ScopeBudgets;
|
|
110
|
+
/** The scope's long-running instances (Docker only). */
|
|
111
|
+
readonly instances: ScopeInstances;
|
|
112
|
+
readonly workspaces: ScopeWorkspaces;
|
|
113
|
+
/**
|
|
114
|
+
* Fence the scope, archive every instance (each volume kept, listed with its size) and unlink
|
|
115
|
+
* every workspace. A repeat answers no volume.
|
|
116
|
+
*/
|
|
117
|
+
archive(): Promise<{
|
|
118
|
+
readonly volumes: ReadonlyArray<ScopeArchivedVolume>;
|
|
119
|
+
}>;
|
|
108
120
|
}
|
|
109
121
|
export interface ScopesNamespace {
|
|
110
122
|
/**
|
|
@@ -120,4 +132,4 @@ export interface ScopesNamespace {
|
|
|
120
132
|
/** A client for this scope alone, and the only way to its members. Nothing is checked until its first call. */
|
|
121
133
|
actAs(scopeId: string): ScopeClient;
|
|
122
134
|
}
|
|
123
|
-
export declare const makeScopes: (runtime: SdkRuntime) => ScopesNamespace;
|
|
135
|
+
export declare const makeScopes: (runtime: SdkRuntime, config: SealantInternalConfig) => ScopesNamespace;
|
package/dist/scopes.js
CHANGED
|
@@ -9,12 +9,13 @@
|
|
|
9
9
|
import { RESOURCE_DOMAIN_BUDGET_DIMENSIONS, } from "@sealant/api-contracts";
|
|
10
10
|
import * as Rec from "effect/Record";
|
|
11
11
|
import { ensureResourceDomainOp, getResourceDomainBudgetOp, getResourceDomainMemberOp, getResourceDomainOp, grantResourceDomainMemberOp, listResourceDomainMembersOp, revokeResourceDomainMemberOp, setResourceDomainBudgetOp, } from "./effect/operations.js";
|
|
12
|
+
import { makeScopeInstances, } from "./scope-instances.js";
|
|
12
13
|
const toScope = (wire) => ({
|
|
13
14
|
id: wire.resourceDomainId,
|
|
14
15
|
key: wire.key,
|
|
15
16
|
createdAt: wire.createdAt,
|
|
16
17
|
});
|
|
17
|
-
export const makeScopes = (runtime) => {
|
|
18
|
+
export const makeScopes = (runtime, config) => {
|
|
18
19
|
const get = async (scopeId) => toScope(await runtime.run(getResourceDomainOp(scopeId)));
|
|
19
20
|
return {
|
|
20
21
|
ensure: async ({ key, budget }) => {
|
|
@@ -24,6 +25,7 @@ export const makeScopes = (runtime) => {
|
|
|
24
25
|
get,
|
|
25
26
|
actAs: (scopeId) => ({
|
|
26
27
|
id: scopeId,
|
|
28
|
+
...makeScopeInstances(runtime, config, scopeId),
|
|
27
29
|
get: () => get(scopeId),
|
|
28
30
|
members: {
|
|
29
31
|
grant: (userId, decision) => runtime.run(grantResourceDomainMemberOp(scopeId, userId, { version: decision.version })),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sealant/sdk-next",
|
|
3
|
-
"version": "0.40.0-next.
|
|
3
|
+
"version": "0.40.0-next.783",
|
|
4
4
|
"description": "The fluent public SDK for Sealant — create a workspace, run a harness, replay the record.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -26,12 +26,12 @@
|
|
|
26
26
|
"node": ">=20"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@sealant/api-contracts": "npm:@sealant/api-contracts-next@0.40.0-next.
|
|
29
|
+
"@sealant/api-contracts": "npm:@sealant/api-contracts-next@0.40.0-next.783"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
32
|
"effect": "^4.0.5"
|
|
33
33
|
},
|
|
34
|
-
"gitHead": "
|
|
34
|
+
"gitHead": "9d686294966f4b41d186efb8ee2ce27e34fdbe1b",
|
|
35
35
|
"publishConfig": {
|
|
36
36
|
"access": "public"
|
|
37
37
|
}
|