@opengeni/sdk 0.29.0 → 0.33.1
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 +47 -4
- package/dist/artifact-client.d.ts +11 -0
- package/dist/chunk-YROWFD7R.js +2971 -0
- package/dist/chunk-YROWFD7R.js.map +1 -0
- package/dist/client.d.ts +643 -0
- package/dist/core.d.ts +5 -0
- package/dist/core.js +23 -0
- package/dist/core.js.map +1 -0
- package/dist/desktop.d.ts +71 -0
- package/dist/errors.d.ts +39 -0
- package/dist/index.d.ts +26 -4211
- package/dist/index.js +50 -2729
- package/dist/index.js.map +1 -1
- package/dist/mcp-output.d.ts +15 -0
- package/dist/preference-registry.d.ts +169 -0
- package/dist/proxy.d.ts +64 -0
- package/dist/sse.d.ts +14 -0
- package/dist/stream.d.ts +48 -0
- package/dist/terminal.d.ts +49 -0
- package/dist/transcription.d.ts +189 -0
- package/dist/types.d.ts +3221 -0
- package/dist/workspace-artifacts.d.ts +94 -0
- package/dist/workspace-control-stream.d.ts +12 -0
- package/dist/workspace-instruction-policies.d.ts +98 -0
- package/dist/workspace-state.d.ts +122 -0
- package/package.json +7 -3
- package/src/artifact-client.ts +85 -0
- package/src/client.ts +280 -3
- package/src/core.ts +19 -0
- package/src/index.ts +79 -1
- package/src/preference-registry.ts +210 -0
- package/src/transcription.ts +16 -0
- package/src/types.ts +262 -2
- package/src/workspace-artifacts.ts +94 -0
- package/src/workspace-state.ts +134 -0
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
export type WorkspaceArtifactVersion = {
|
|
2
|
+
id: string;
|
|
3
|
+
accountId: string;
|
|
4
|
+
workspaceId: string;
|
|
5
|
+
artifactId: string;
|
|
6
|
+
revision: number;
|
|
7
|
+
contentType: "text/html";
|
|
8
|
+
contentSha256: string;
|
|
9
|
+
sizeBytes: number;
|
|
10
|
+
sourceSessionId: string | null;
|
|
11
|
+
sourceTurnId: string | null;
|
|
12
|
+
sourceAttemptId: string | null;
|
|
13
|
+
sourceExecutionGeneration: number | null;
|
|
14
|
+
createdBySubjectId: string;
|
|
15
|
+
createdAt: string;
|
|
16
|
+
};
|
|
17
|
+
export type WorkspaceArtifact = {
|
|
18
|
+
id: string;
|
|
19
|
+
accountId: string;
|
|
20
|
+
workspaceId: string;
|
|
21
|
+
slug: string;
|
|
22
|
+
title: string;
|
|
23
|
+
description: string | null;
|
|
24
|
+
status: "active" | "archived";
|
|
25
|
+
currentVersion: WorkspaceArtifactVersion | null;
|
|
26
|
+
createdBySubjectId: string;
|
|
27
|
+
createdAt: string;
|
|
28
|
+
updatedAt: string;
|
|
29
|
+
};
|
|
30
|
+
export type WorkspaceArtifactEvent = {
|
|
31
|
+
id: string;
|
|
32
|
+
accountId: string;
|
|
33
|
+
workspaceId: string;
|
|
34
|
+
artifactId: string;
|
|
35
|
+
type: "published" | "rolled_back";
|
|
36
|
+
fromVersionId: string | null;
|
|
37
|
+
toVersionId: string;
|
|
38
|
+
sourceSessionId: string | null;
|
|
39
|
+
sourceTurnId: string | null;
|
|
40
|
+
sourceAttemptId: string | null;
|
|
41
|
+
sourceExecutionGeneration: number | null;
|
|
42
|
+
actorSubjectId: string;
|
|
43
|
+
reason: string;
|
|
44
|
+
createdAt: string;
|
|
45
|
+
};
|
|
46
|
+
export type WorkspaceArtifactListOptions = {
|
|
47
|
+
limit?: number;
|
|
48
|
+
cursor?: string;
|
|
49
|
+
};
|
|
50
|
+
export type WorkspaceArtifactListResponse = {
|
|
51
|
+
artifacts: WorkspaceArtifact[];
|
|
52
|
+
nextCursor: string | null;
|
|
53
|
+
truncated: boolean;
|
|
54
|
+
};
|
|
55
|
+
export type WorkspaceArtifactDetailResponse = {
|
|
56
|
+
artifact: WorkspaceArtifact;
|
|
57
|
+
versions: WorkspaceArtifactVersion[];
|
|
58
|
+
events: WorkspaceArtifactEvent[];
|
|
59
|
+
versionsTruncated: boolean;
|
|
60
|
+
eventsTruncated: boolean;
|
|
61
|
+
};
|
|
62
|
+
export type WorkspaceArtifactContentResponse = {
|
|
63
|
+
artifactId: string;
|
|
64
|
+
versionId: string;
|
|
65
|
+
contentType: "text/html";
|
|
66
|
+
contentSha256: string;
|
|
67
|
+
html: string;
|
|
68
|
+
};
|
|
69
|
+
export type WorkspaceArtifactMutationResponse = {
|
|
70
|
+
artifact: WorkspaceArtifact;
|
|
71
|
+
version: WorkspaceArtifactVersion;
|
|
72
|
+
event: WorkspaceArtifactEvent;
|
|
73
|
+
replayed: boolean;
|
|
74
|
+
};
|
|
75
|
+
export type CreateWorkspaceArtifactRequest = {
|
|
76
|
+
slug?: string;
|
|
77
|
+
title: string;
|
|
78
|
+
description?: string | null;
|
|
79
|
+
html: string;
|
|
80
|
+
idempotencyKey: string;
|
|
81
|
+
};
|
|
82
|
+
export type PublishWorkspaceArtifactVersionRequest = {
|
|
83
|
+
title?: string;
|
|
84
|
+
description?: string | null;
|
|
85
|
+
html: string;
|
|
86
|
+
expectedCurrentVersionId: string;
|
|
87
|
+
idempotencyKey: string;
|
|
88
|
+
};
|
|
89
|
+
export type RollbackWorkspaceArtifactRequest = {
|
|
90
|
+
versionId: string;
|
|
91
|
+
expectedCurrentVersionId: string;
|
|
92
|
+
reason: string;
|
|
93
|
+
idempotencyKey: string;
|
|
94
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { StreamSessionEventsOptions } from "./stream";
|
|
2
|
+
import type { WorkspaceControlEvent } from "./types";
|
|
3
|
+
export type WorkspaceControlStreamTransport = {
|
|
4
|
+
/** The server replays every durable event after the cursor before going live. */
|
|
5
|
+
openStream: (after: number, signal: AbortSignal | undefined) => Promise<ReadableStream<Uint8Array>>;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Reconnecting workspace invalidation stream. Control revisions are monotonic
|
|
9
|
+
* but can begin above one after the one-way migration, so unlike conversation
|
|
10
|
+
* events this stream intentionally permits sparse sequence values.
|
|
11
|
+
*/
|
|
12
|
+
export declare function streamWorkspaceControlEvents(transport: WorkspaceControlStreamTransport, options?: StreamSessionEventsOptions): AsyncGenerator<WorkspaceControlEvent, void, void>;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
export type WorkspaceInstructionPolicyKind = "charter" | "policy";
|
|
2
|
+
export type WorkspaceInstructionPolicyScope = "global" | "role";
|
|
3
|
+
export type WorkspaceInstructionPolicyProvenanceSource = "human" | "onboarding" | "knowledge_proposal" | "legacy_import";
|
|
4
|
+
export type WorkspaceInstructionPolicyDraftProvenanceSource = Exclude<WorkspaceInstructionPolicyProvenanceSource, "legacy_import">;
|
|
5
|
+
export type WorkspaceInstructionPolicyActivationType = "activate" | "rollback";
|
|
6
|
+
export declare function normalizeWorkspaceInstructionPolicyRoleKey(value: string): string;
|
|
7
|
+
export type WorkspaceInstructionPolicyTarget = {
|
|
8
|
+
kind: WorkspaceInstructionPolicyKind;
|
|
9
|
+
scope: WorkspaceInstructionPolicyScope;
|
|
10
|
+
roleKey: string | null;
|
|
11
|
+
};
|
|
12
|
+
export type WorkspaceInstructionPolicyRevisionIdentity = {
|
|
13
|
+
id: string;
|
|
14
|
+
revision: number;
|
|
15
|
+
contentHash: string;
|
|
16
|
+
};
|
|
17
|
+
export type WorkspaceInstructionPolicyRevision = WorkspaceInstructionPolicyRevisionIdentity & WorkspaceInstructionPolicyTarget & {
|
|
18
|
+
accountId: string;
|
|
19
|
+
workspaceId: string;
|
|
20
|
+
content: string;
|
|
21
|
+
provenance: {
|
|
22
|
+
source: WorkspaceInstructionPolicyProvenanceSource;
|
|
23
|
+
sourceId: string | null;
|
|
24
|
+
};
|
|
25
|
+
supersedesRevisionId: string | null;
|
|
26
|
+
createdBySubjectId: string;
|
|
27
|
+
createdAt: string;
|
|
28
|
+
};
|
|
29
|
+
export type WorkspaceInstructionPolicyHead = WorkspaceInstructionPolicyTarget & {
|
|
30
|
+
workspaceId: string;
|
|
31
|
+
revisionId: string;
|
|
32
|
+
revision: number;
|
|
33
|
+
contentHash: string;
|
|
34
|
+
activationVersion: number;
|
|
35
|
+
activatedAt: string;
|
|
36
|
+
};
|
|
37
|
+
export type WorkspaceInstructionPolicyActivationEvent = WorkspaceInstructionPolicyTarget & {
|
|
38
|
+
id: string;
|
|
39
|
+
accountId: string;
|
|
40
|
+
workspaceId: string;
|
|
41
|
+
type: WorkspaceInstructionPolicyActivationType;
|
|
42
|
+
activationVersion: number;
|
|
43
|
+
oldRevision: WorkspaceInstructionPolicyRevisionIdentity | null;
|
|
44
|
+
newRevision: WorkspaceInstructionPolicyRevisionIdentity;
|
|
45
|
+
actorSubjectId: string;
|
|
46
|
+
reason: string;
|
|
47
|
+
createdAt: string;
|
|
48
|
+
};
|
|
49
|
+
export type CreateWorkspaceInstructionPolicyDraftRequest = WorkspaceInstructionPolicyTarget & {
|
|
50
|
+
content: string;
|
|
51
|
+
provenanceSource?: WorkspaceInstructionPolicyDraftProvenanceSource;
|
|
52
|
+
provenanceSourceId?: string | null;
|
|
53
|
+
supersedesRevisionId?: string | null;
|
|
54
|
+
};
|
|
55
|
+
export type ImportLegacyWorkspaceInstructionPolicyDraftRequest = {
|
|
56
|
+
supersedesRevisionId?: string | null;
|
|
57
|
+
};
|
|
58
|
+
export type WorkspaceInstructionPolicyListOptions = {
|
|
59
|
+
kind?: WorkspaceInstructionPolicyKind;
|
|
60
|
+
scope?: WorkspaceInstructionPolicyScope;
|
|
61
|
+
roleKey?: string;
|
|
62
|
+
afterRevision?: number;
|
|
63
|
+
limit?: number;
|
|
64
|
+
};
|
|
65
|
+
export type WorkspaceInstructionPolicyListResponse = {
|
|
66
|
+
revisions: WorkspaceInstructionPolicyRevision[];
|
|
67
|
+
activeHeads: WorkspaceInstructionPolicyHead[];
|
|
68
|
+
activationEvents: WorkspaceInstructionPolicyActivationEvent[];
|
|
69
|
+
nextAfterRevision: number | null;
|
|
70
|
+
};
|
|
71
|
+
export type WorkspaceInstructionPolicyDiffRequest = {
|
|
72
|
+
fromRevisionId: string;
|
|
73
|
+
toRevisionId: string;
|
|
74
|
+
};
|
|
75
|
+
export type WorkspaceInstructionPolicyDiffResponse = {
|
|
76
|
+
from: WorkspaceInstructionPolicyRevision;
|
|
77
|
+
to: WorkspaceInstructionPolicyRevision;
|
|
78
|
+
format: "unified";
|
|
79
|
+
diff: string;
|
|
80
|
+
};
|
|
81
|
+
export type ActivateWorkspaceInstructionPolicyRequest = {
|
|
82
|
+
expectedCurrentRevisionId: string | null;
|
|
83
|
+
reason: string;
|
|
84
|
+
};
|
|
85
|
+
export type RollbackWorkspaceInstructionPolicyRequest = {
|
|
86
|
+
targetRevisionId: string;
|
|
87
|
+
expectedCurrentRevisionId: string;
|
|
88
|
+
reason: string;
|
|
89
|
+
};
|
|
90
|
+
export type WorkspaceInstructionPolicyActivationResponse = {
|
|
91
|
+
head: WorkspaceInstructionPolicyHead;
|
|
92
|
+
event: WorkspaceInstructionPolicyActivationEvent;
|
|
93
|
+
};
|
|
94
|
+
export type WorkspaceInstructionPolicyConflictResponse = {
|
|
95
|
+
code: "WORKSPACE_INSTRUCTION_POLICY_CONFLICT";
|
|
96
|
+
message: string;
|
|
97
|
+
currentHead: WorkspaceInstructionPolicyHead | null;
|
|
98
|
+
};
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import type { WorkspaceInstructionPolicyKind, WorkspaceInstructionPolicyProvenanceSource, WorkspaceInstructionPolicyScope } from "./workspace-instruction-policies";
|
|
2
|
+
export type WorkspaceStateDocumentStatusCounts = {
|
|
3
|
+
queued: number;
|
|
4
|
+
indexing: number;
|
|
5
|
+
ready: number;
|
|
6
|
+
failed: number;
|
|
7
|
+
};
|
|
8
|
+
export type WorkspaceStateSourceKindCounts = {
|
|
9
|
+
manual_upload: number;
|
|
10
|
+
meeting_transcript: number;
|
|
11
|
+
repository: number;
|
|
12
|
+
email: number;
|
|
13
|
+
chat: number;
|
|
14
|
+
document: number;
|
|
15
|
+
web: number;
|
|
16
|
+
other: number;
|
|
17
|
+
};
|
|
18
|
+
export type WorkspaceStateMemoryStatusCounts = {
|
|
19
|
+
proposed: number;
|
|
20
|
+
approved: number;
|
|
21
|
+
rejected: number;
|
|
22
|
+
active: number;
|
|
23
|
+
superseded: number;
|
|
24
|
+
archived: number;
|
|
25
|
+
};
|
|
26
|
+
export type WorkspaceStateMemoryKindCounts = {
|
|
27
|
+
semantic: number;
|
|
28
|
+
episodic: number;
|
|
29
|
+
procedural: number;
|
|
30
|
+
decision: number;
|
|
31
|
+
preference: number;
|
|
32
|
+
};
|
|
33
|
+
export type WorkspaceStateGapCode = "no_document_bases" | "no_visible_documents" | "failed_documents" | "processing_documents" | "missing_topic_coverage" | "no_memory_records" | "pending_memory_review" | "partial_inventory";
|
|
34
|
+
export type WorkspaceStateResponse = {
|
|
35
|
+
workspaceId: string;
|
|
36
|
+
generatedAt: string;
|
|
37
|
+
truth: {
|
|
38
|
+
current: {
|
|
39
|
+
source: "read_time_projection";
|
|
40
|
+
capturedAt: string;
|
|
41
|
+
};
|
|
42
|
+
policySnapshot: {
|
|
43
|
+
status: "not_captured";
|
|
44
|
+
reason: "workspace_instruction_policy_snapshot_not_implemented";
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
policy: {
|
|
48
|
+
authority: "workspace_instruction_policy_heads";
|
|
49
|
+
activeHeads: Array<{
|
|
50
|
+
kind: WorkspaceInstructionPolicyKind;
|
|
51
|
+
scope: WorkspaceInstructionPolicyScope;
|
|
52
|
+
roleKey: string | null;
|
|
53
|
+
revisionId: string;
|
|
54
|
+
revision: number;
|
|
55
|
+
contentHash: string;
|
|
56
|
+
activationVersion: number;
|
|
57
|
+
activatedAt: string;
|
|
58
|
+
}>;
|
|
59
|
+
activeHeadsTruncated: boolean;
|
|
60
|
+
latestRevision: {
|
|
61
|
+
kind: WorkspaceInstructionPolicyKind;
|
|
62
|
+
scope: WorkspaceInstructionPolicyScope;
|
|
63
|
+
roleKey: string | null;
|
|
64
|
+
revisionId: string;
|
|
65
|
+
revision: number;
|
|
66
|
+
contentHash: string;
|
|
67
|
+
provenanceSource: WorkspaceInstructionPolicyProvenanceSource;
|
|
68
|
+
state: "active" | "inactive";
|
|
69
|
+
createdAt: string;
|
|
70
|
+
} | null;
|
|
71
|
+
legacyRuntime: {
|
|
72
|
+
source: "workspace_override" | "deployment_default";
|
|
73
|
+
workspaceOverrideConfigured: boolean;
|
|
74
|
+
};
|
|
75
|
+
runtimeComposition: {
|
|
76
|
+
status: "not_implemented";
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
knowledge: {
|
|
80
|
+
availability: "unavailable";
|
|
81
|
+
reason: "missing_permission";
|
|
82
|
+
requiredPermission: "documents:search";
|
|
83
|
+
} | {
|
|
84
|
+
availability: "available";
|
|
85
|
+
coverage: "complete" | "partial";
|
|
86
|
+
baseCount: number;
|
|
87
|
+
bases: Array<{
|
|
88
|
+
id: string;
|
|
89
|
+
name: string;
|
|
90
|
+
visibleDocumentCount: number;
|
|
91
|
+
statusCounts: WorkspaceStateDocumentStatusCounts;
|
|
92
|
+
latestUpdatedAt: string | null;
|
|
93
|
+
}>;
|
|
94
|
+
basesTruncated: boolean;
|
|
95
|
+
inspectedVisibleDocumentCount: number;
|
|
96
|
+
documentStatusCounts: WorkspaceStateDocumentStatusCounts;
|
|
97
|
+
sourceKindCounts: WorkspaceStateSourceKindCounts;
|
|
98
|
+
topics: Array<{
|
|
99
|
+
name: string;
|
|
100
|
+
documentCount: number;
|
|
101
|
+
}>;
|
|
102
|
+
topicsTruncated: boolean;
|
|
103
|
+
latestDocumentUpdatedAt: string | null;
|
|
104
|
+
memorySample: {
|
|
105
|
+
recordCount: number;
|
|
106
|
+
sampleLimit: 100;
|
|
107
|
+
limitReached: boolean;
|
|
108
|
+
statusCounts: WorkspaceStateMemoryStatusCounts;
|
|
109
|
+
kindCounts: WorkspaceStateMemoryKindCounts;
|
|
110
|
+
preferenceAuthority: {
|
|
111
|
+
kindCountSource: "knowledge_memories_legacy_observations";
|
|
112
|
+
activeAuthority: "structured_preference_registry";
|
|
113
|
+
};
|
|
114
|
+
latestUpdatedAt: string | null;
|
|
115
|
+
};
|
|
116
|
+
gaps: Array<{
|
|
117
|
+
code: WorkspaceStateGapCode;
|
|
118
|
+
severity: "info" | "warning";
|
|
119
|
+
relatedCount: number | null;
|
|
120
|
+
}>;
|
|
121
|
+
};
|
|
122
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengeni/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.33.1",
|
|
4
4
|
"description": "Framework-agnostic TypeScript SDK for the OpenGeni API: typed client, session lifecycle, SSE event streaming with reconnect + replay-by-sequence, and proxy re-streaming helpers.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -21,6 +21,10 @@
|
|
|
21
21
|
".": {
|
|
22
22
|
"types": "./dist/index.d.ts",
|
|
23
23
|
"import": "./dist/index.js"
|
|
24
|
+
},
|
|
25
|
+
"./core": {
|
|
26
|
+
"types": "./dist/core.d.ts",
|
|
27
|
+
"import": "./dist/core.js"
|
|
24
28
|
}
|
|
25
29
|
},
|
|
26
30
|
"publishConfig": {
|
|
@@ -28,8 +32,8 @@
|
|
|
28
32
|
"provenance": true
|
|
29
33
|
},
|
|
30
34
|
"scripts": {
|
|
31
|
-
"typecheck": "
|
|
32
|
-
"build": "
|
|
35
|
+
"typecheck": "tsc --noEmit",
|
|
36
|
+
"build": "bun ../../scripts/build-typescript-package.ts",
|
|
33
37
|
"prepublishOnly": "bash ../../scripts/prepublish-guard"
|
|
34
38
|
},
|
|
35
39
|
"engines": {
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { OpenGeniClient as OpenGeniCoreClient } from "./client";
|
|
2
|
+
import type {
|
|
3
|
+
CreateWorkspaceArtifactRequest,
|
|
4
|
+
PublishWorkspaceArtifactVersionRequest,
|
|
5
|
+
RollbackWorkspaceArtifactRequest,
|
|
6
|
+
WorkspaceArtifactContentResponse,
|
|
7
|
+
WorkspaceArtifactDetailResponse,
|
|
8
|
+
WorkspaceArtifactListOptions,
|
|
9
|
+
WorkspaceArtifactListResponse,
|
|
10
|
+
WorkspaceArtifactMutationResponse,
|
|
11
|
+
} from "./workspace-artifacts";
|
|
12
|
+
|
|
13
|
+
/** Public SDK client. Artifact operations stay out of the console's eager core graph. */
|
|
14
|
+
export class OpenGeniClient extends OpenGeniCoreClient {
|
|
15
|
+
async listWorkspaceArtifacts(
|
|
16
|
+
workspaceId: string,
|
|
17
|
+
options: WorkspaceArtifactListOptions = {},
|
|
18
|
+
): Promise<WorkspaceArtifactListResponse> {
|
|
19
|
+
const query = new URLSearchParams();
|
|
20
|
+
if (options.limit !== undefined) query.set("limit", String(options.limit));
|
|
21
|
+
if (options.cursor) query.set("cursor", options.cursor);
|
|
22
|
+
const suffix = query.size > 0 ? `?${query.toString()}` : "";
|
|
23
|
+
return await this.requestJson<WorkspaceArtifactListResponse>(
|
|
24
|
+
"GET",
|
|
25
|
+
`/v1/workspaces/${workspaceId}/published-artifacts${suffix}`,
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
async getWorkspaceArtifact(
|
|
30
|
+
workspaceId: string,
|
|
31
|
+
artifactId: string,
|
|
32
|
+
): Promise<WorkspaceArtifactDetailResponse> {
|
|
33
|
+
return await this.requestJson<WorkspaceArtifactDetailResponse>(
|
|
34
|
+
"GET",
|
|
35
|
+
`/v1/workspaces/${workspaceId}/published-artifacts/${encodeURIComponent(artifactId)}`,
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
async getWorkspaceArtifactContent(
|
|
40
|
+
workspaceId: string,
|
|
41
|
+
artifactId: string,
|
|
42
|
+
versionId?: string,
|
|
43
|
+
): Promise<WorkspaceArtifactContentResponse> {
|
|
44
|
+
const query = versionId ? `?versionId=${encodeURIComponent(versionId)}` : "";
|
|
45
|
+
return await this.requestJson<WorkspaceArtifactContentResponse>(
|
|
46
|
+
"GET",
|
|
47
|
+
`/v1/workspaces/${workspaceId}/published-artifacts/${encodeURIComponent(artifactId)}/content${query}`,
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
async createWorkspaceArtifact(
|
|
52
|
+
workspaceId: string,
|
|
53
|
+
request: CreateWorkspaceArtifactRequest,
|
|
54
|
+
): Promise<WorkspaceArtifactMutationResponse> {
|
|
55
|
+
return await this.requestJson<WorkspaceArtifactMutationResponse>(
|
|
56
|
+
"POST",
|
|
57
|
+
`/v1/workspaces/${workspaceId}/published-artifacts`,
|
|
58
|
+
request,
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
async publishWorkspaceArtifactVersion(
|
|
63
|
+
workspaceId: string,
|
|
64
|
+
artifactId: string,
|
|
65
|
+
request: PublishWorkspaceArtifactVersionRequest,
|
|
66
|
+
): Promise<WorkspaceArtifactMutationResponse> {
|
|
67
|
+
return await this.requestJson<WorkspaceArtifactMutationResponse>(
|
|
68
|
+
"POST",
|
|
69
|
+
`/v1/workspaces/${workspaceId}/published-artifacts/${encodeURIComponent(artifactId)}/versions`,
|
|
70
|
+
request,
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
async rollbackWorkspaceArtifact(
|
|
75
|
+
workspaceId: string,
|
|
76
|
+
artifactId: string,
|
|
77
|
+
request: RollbackWorkspaceArtifactRequest,
|
|
78
|
+
): Promise<WorkspaceArtifactMutationResponse> {
|
|
79
|
+
return await this.requestJson<WorkspaceArtifactMutationResponse>(
|
|
80
|
+
"POST",
|
|
81
|
+
`/v1/workspaces/${workspaceId}/published-artifacts/${encodeURIComponent(artifactId)}/rollback`,
|
|
82
|
+
request,
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
}
|