@stigmer/sdk 0.0.36 → 0.0.40
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/__tests__/config.test.d.ts +2 -0
- package/__tests__/config.test.d.ts.map +1 -0
- package/__tests__/config.test.js +35 -0
- package/__tests__/config.test.js.map +1 -0
- package/__tests__/errors.test.d.ts +2 -0
- package/__tests__/errors.test.d.ts.map +1 -0
- package/__tests__/errors.test.js +125 -0
- package/__tests__/errors.test.js.map +1 -0
- package/__tests__/gen/errors.test.d.ts +2 -0
- package/__tests__/gen/errors.test.d.ts.map +1 -0
- package/__tests__/gen/errors.test.js +97 -0
- package/__tests__/gen/errors.test.js.map +1 -0
- package/__tests__/gen/proto-utils.test.d.ts +2 -0
- package/__tests__/gen/proto-utils.test.d.ts.map +1 -0
- package/__tests__/gen/proto-utils.test.js +45 -0
- package/__tests__/gen/proto-utils.test.js.map +1 -0
- package/__tests__/gen/session-client.test.d.ts +2 -0
- package/__tests__/gen/session-client.test.d.ts.map +1 -0
- package/__tests__/gen/session-client.test.js +148 -0
- package/__tests__/gen/session-client.test.js.map +1 -0
- package/gen/agent.d.ts +6 -0
- package/gen/agent.d.ts.map +1 -1
- package/gen/agent.js +78 -8
- package/gen/agent.js.map +1 -1
- package/gen/agentexecution.d.ts +4 -1
- package/gen/agentexecution.d.ts.map +1 -1
- package/gen/agentexecution.js +55 -6
- package/gen/agentexecution.js.map +1 -1
- package/gen/agentinstance.d.ts +4 -1
- package/gen/agentinstance.d.ts.map +1 -1
- package/gen/agentinstance.js +17 -4
- package/gen/agentinstance.js.map +1 -1
- package/gen/apikey.d.ts +2 -0
- package/gen/apikey.d.ts.map +1 -1
- package/gen/apikey.js +5 -2
- package/gen/apikey.js.map +1 -1
- package/gen/environment.d.ts +8 -0
- package/gen/environment.d.ts.map +1 -1
- package/gen/environment.js +45 -5
- package/gen/environment.js.map +1 -1
- package/gen/executioncontext.d.ts +2 -0
- package/gen/executioncontext.d.ts.map +1 -1
- package/gen/executioncontext.js +13 -5
- package/gen/executioncontext.js.map +1 -1
- package/gen/iampolicy.d.ts +2 -1
- package/gen/iampolicy.d.ts.map +1 -1
- package/gen/iampolicy.js +17 -13
- package/gen/iampolicy.js.map +1 -1
- package/gen/identityaccount.d.ts +2 -0
- package/gen/identityaccount.d.ts.map +1 -1
- package/gen/identityaccount.js +8 -3
- package/gen/identityaccount.js.map +1 -1
- package/gen/identityprovider.d.ts +2 -0
- package/gen/identityprovider.d.ts.map +1 -1
- package/gen/identityprovider.js +7 -3
- package/gen/identityprovider.js.map +1 -1
- package/gen/mcpserver.d.ts +4 -0
- package/gen/mcpserver.d.ts.map +1 -1
- package/gen/mcpserver.js +58 -11
- package/gen/mcpserver.js.map +1 -1
- package/gen/organization.d.ts +3 -0
- package/gen/organization.d.ts.map +1 -1
- package/gen/organization.js +9 -3
- package/gen/organization.js.map +1 -1
- package/gen/project.d.ts +2 -0
- package/gen/project.d.ts.map +1 -1
- package/gen/project.js +9 -4
- package/gen/project.js.map +1 -1
- package/gen/proto-utils.d.ts +6 -0
- package/gen/proto-utils.d.ts.map +1 -0
- package/gen/proto-utils.js +15 -0
- package/gen/proto-utils.js.map +1 -0
- package/gen/session.d.ts +18 -1
- package/gen/session.d.ts.map +1 -1
- package/gen/session.js +62 -3
- package/gen/session.js.map +1 -1
- package/gen/skill.d.ts +6 -1
- package/gen/skill.d.ts.map +1 -1
- package/gen/skill.js +22 -3
- package/gen/skill.js.map +1 -1
- package/gen/workflow.d.ts +2 -0
- package/gen/workflow.d.ts.map +1 -1
- package/gen/workflow.js +55 -7
- package/gen/workflow.js.map +1 -1
- package/gen/workflowexecution.d.ts +2 -0
- package/gen/workflowexecution.d.ts.map +1 -1
- package/gen/workflowexecution.js +11 -3
- package/gen/workflowexecution.js.map +1 -1
- package/gen/workflowinstance.d.ts +3 -1
- package/gen/workflowinstance.d.ts.map +1 -1
- package/gen/workflowinstance.js +9 -4
- package/gen/workflowinstance.js.map +1 -1
- package/github.d.ts +38 -0
- package/github.d.ts.map +1 -0
- package/github.js +51 -0
- package/github.js.map +1 -0
- package/index.d.ts +2 -0
- package/index.d.ts.map +1 -1
- package/index.js +4 -0
- package/index.js.map +1 -1
- package/package.json +2 -2
- package/session.d.ts +31 -0
- package/session.d.ts.map +1 -0
- package/session.js +36 -0
- package/session.js.map +1 -0
- package/src/__tests__/config.test.ts +52 -0
- package/src/__tests__/errors.test.ts +188 -0
- package/src/__tests__/gen/errors.test.ts +138 -0
- package/src/__tests__/gen/proto-utils.test.ts +53 -0
- package/src/__tests__/gen/session-client.test.ts +202 -0
- package/src/gen/agent.ts +73 -10
- package/src/gen/agentexecution.ts +55 -7
- package/src/gen/agentinstance.ts +18 -5
- package/src/gen/apikey.ts +7 -2
- package/src/gen/environment.ts +41 -5
- package/src/gen/executioncontext.ts +16 -5
- package/src/gen/iampolicy.ts +19 -10
- package/src/gen/identityaccount.ts +10 -3
- package/src/gen/identityprovider.ts +9 -3
- package/src/gen/mcpserver.ts +61 -12
- package/src/gen/organization.ts +12 -4
- package/src/gen/project.ts +11 -4
- package/src/gen/proto-utils.ts +15 -0
- package/src/gen/session.ts +82 -4
- package/src/gen/skill.ts +22 -5
- package/src/gen/workflow.ts +56 -7
- package/src/gen/workflowexecution.ts +14 -3
- package/src/gen/workflowinstance.ts +12 -5
- package/src/github.ts +89 -0
- package/src/index.ts +12 -0
- package/src/session.ts +37 -0
- package/src/stigmer.ts +3 -0
- package/stigmer.d.ts +2 -0
- package/stigmer.d.ts.map +1 -1
- package/stigmer.js +3 -0
- package/stigmer.js.map +1 -1
package/src/gen/agent.ts
CHANGED
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
// Code generated by stigmer-codegen. DO NOT EDIT.
|
|
2
2
|
|
|
3
3
|
import { wrapError } from "./errors";
|
|
4
|
+
import { stripUndefined } from "./proto-utils";
|
|
4
5
|
import { type ListParams, type ListResult, type EnvSpecInput, type ResourceRef } from "./types";
|
|
5
6
|
import { create } from "@bufbuild/protobuf";
|
|
6
7
|
import { createClient, type Client, type Transport } from "@connectrpc/connect";
|
|
7
8
|
import { AgentSchema, type Agent } from "@stigmer/protos/ai/stigmer/agentic/agent/v1/api_pb";
|
|
8
9
|
import { AgentCommandController } from "@stigmer/protos/ai/stigmer/agentic/agent/v1/command_pb";
|
|
9
|
-
import { AgentIdSchema } from "@stigmer/protos/ai/stigmer/agentic/agent/v1/io_pb";
|
|
10
|
+
import { AgentIdSchema, GetDefaultAgentRequestSchema, type GetDefaultAgentRequest } from "@stigmer/protos/ai/stigmer/agentic/agent/v1/io_pb";
|
|
10
11
|
import { AgentQueryController } from "@stigmer/protos/ai/stigmer/agentic/agent/v1/query_pb";
|
|
11
|
-
import { AgentSpecSchema } from "@stigmer/protos/ai/stigmer/agentic/agent/v1/spec_pb";
|
|
12
|
+
import { AgentSpecSchema, ToolApprovalOverrideSchema, McpServerUsageSchema, McpAccessSchema, SubAgentSchema } from "@stigmer/protos/ai/stigmer/agentic/agent/v1/spec_pb";
|
|
13
|
+
import { EnvironmentSpecSchema, EnvironmentValueSchema } from "@stigmer/protos/ai/stigmer/agentic/environment/v1/spec_pb";
|
|
12
14
|
import { ApiResourceKind } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
|
|
13
|
-
import { ApiResourceReferenceSchema } from "@stigmer/protos/ai/stigmer/commons/apiresource/io_pb";
|
|
15
|
+
import { ApiResourceReferenceSchema, type UpdateVisibilityInput } from "@stigmer/protos/ai/stigmer/commons/apiresource/io_pb";
|
|
14
16
|
import { ApiResourceMetadataSchema } from "@stigmer/protos/ai/stigmer/commons/apiresource/metadata_pb";
|
|
15
17
|
import { PageInfoSchema } from "@stigmer/protos/ai/stigmer/commons/rpc/pagination_pb";
|
|
16
18
|
import { SearchRequestSchema } from "@stigmer/protos/ai/stigmer/search/v1/io_pb";
|
|
@@ -46,6 +48,12 @@ export class AgentClient {
|
|
|
46
48
|
} catch (e) { throw wrapError(e); }
|
|
47
49
|
}
|
|
48
50
|
|
|
51
|
+
async updateVisibility(input: UpdateVisibilityInput): Promise<Agent> {
|
|
52
|
+
try {
|
|
53
|
+
return await this.command.updateVisibility(input);
|
|
54
|
+
} catch (e) { throw wrapError(e); }
|
|
55
|
+
}
|
|
56
|
+
|
|
49
57
|
async delete(id: string): Promise<Agent> {
|
|
50
58
|
try {
|
|
51
59
|
return await this.command.delete(create(AgentIdSchema, { value: id }));
|
|
@@ -60,7 +68,13 @@ export class AgentClient {
|
|
|
60
68
|
|
|
61
69
|
async getByReference(ref: ResourceRef): Promise<Agent> {
|
|
62
70
|
try {
|
|
63
|
-
return await this.query.getByReference(create(ApiResourceReferenceSchema, ref));
|
|
71
|
+
return await this.query.getByReference(create(ApiResourceReferenceSchema, { ...ref, kind: ApiResourceKind.agent }));
|
|
72
|
+
} catch (e) { throw wrapError(e); }
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
async getDefault(input: GetDefaultAgentRequest): Promise<Agent> {
|
|
76
|
+
try {
|
|
77
|
+
return await this.query.getDefault(input);
|
|
64
78
|
} catch (e) { throw wrapError(e); }
|
|
65
79
|
}
|
|
66
80
|
|
|
@@ -85,7 +99,9 @@ export class AgentClient {
|
|
|
85
99
|
/** Input for creating/updating a Agent. */
|
|
86
100
|
export interface AgentInput {
|
|
87
101
|
name: string;
|
|
102
|
+
slug?: string;
|
|
88
103
|
org: string;
|
|
104
|
+
labels?: Record<string, string>;
|
|
89
105
|
description?: string;
|
|
90
106
|
iconUrl?: string;
|
|
91
107
|
instructions?: string;
|
|
@@ -125,22 +141,69 @@ export interface McpAccessInput {
|
|
|
125
141
|
enabledTools?: string[];
|
|
126
142
|
}
|
|
127
143
|
|
|
144
|
+
function buildToolApprovalOverrideProto(input: ToolApprovalOverrideInput) {
|
|
145
|
+
return Object.assign(create(ToolApprovalOverrideSchema), stripUndefined({
|
|
146
|
+
toolName: input.toolName,
|
|
147
|
+
requiresApproval: input.requiresApproval,
|
|
148
|
+
message: input.message,
|
|
149
|
+
}));
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
function buildMcpServerUsageProto(input: McpServerUsageInput) {
|
|
153
|
+
const msg = create(McpServerUsageSchema);
|
|
154
|
+
if (input.mcpServerRef) msg.mcpServerRef = create(ApiResourceReferenceSchema, input.mcpServerRef);
|
|
155
|
+
if (input.enabledTools) msg.enabledTools = input.enabledTools;
|
|
156
|
+
if (input.toolApprovalOverrides) msg.toolApprovalOverrides = input.toolApprovalOverrides.map(buildToolApprovalOverrideProto);
|
|
157
|
+
return msg;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
function buildMcpAccessProto(input: McpAccessInput) {
|
|
161
|
+
return Object.assign(create(McpAccessSchema), stripUndefined({
|
|
162
|
+
mcpServer: input.mcpServer,
|
|
163
|
+
enabledTools: input.enabledTools,
|
|
164
|
+
}));
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
function buildSubAgentProto(input: SubAgentInput) {
|
|
168
|
+
const msg = create(SubAgentSchema);
|
|
169
|
+
if (input.name !== undefined) msg.name = input.name;
|
|
170
|
+
if (input.description !== undefined) msg.description = input.description;
|
|
171
|
+
if (input.instructions !== undefined) msg.instructions = input.instructions;
|
|
172
|
+
if (input.mcpAccess) msg.mcpAccess = input.mcpAccess.map(buildMcpAccessProto);
|
|
173
|
+
if (input.skillRefs) msg.skillRefs = input.skillRefs.map(r => create(ApiResourceReferenceSchema, r));
|
|
174
|
+
if (input.modelOverride !== undefined) msg.modelOverride = input.modelOverride;
|
|
175
|
+
return msg;
|
|
176
|
+
}
|
|
177
|
+
|
|
128
178
|
function buildAgentProto(input: AgentInput): Agent {
|
|
179
|
+
const mcpServerUsages = input.mcpServerUsages?.map(buildMcpServerUsageProto);
|
|
180
|
+
const skillRefs = input.skillRefs?.map(r => create(ApiResourceReferenceSchema, r));
|
|
181
|
+
const subAgents = input.subAgents?.map(buildSubAgentProto);
|
|
182
|
+
let envSpec;
|
|
183
|
+
if (input.envSpec) {
|
|
184
|
+
const es = create(EnvironmentSpecSchema);
|
|
185
|
+
for (const [k, v] of Object.entries(input.envSpec.variables)) {
|
|
186
|
+
es.data[k] = create(EnvironmentValueSchema, { value: v.value, isSecret: v.isSecret, description: v.description });
|
|
187
|
+
}
|
|
188
|
+
envSpec = es;
|
|
189
|
+
}
|
|
129
190
|
return Object.assign(create(AgentSchema), {
|
|
130
191
|
apiVersion: "agentic.stigmer.ai/v1",
|
|
131
192
|
kind: "Agent",
|
|
132
193
|
metadata: Object.assign(create(ApiResourceMetadataSchema), {
|
|
133
194
|
name: input.name,
|
|
134
195
|
org: input.org,
|
|
196
|
+
...(input.slug && { slug: input.slug }),
|
|
197
|
+
...(input.labels && { labels: input.labels }),
|
|
135
198
|
}),
|
|
136
|
-
spec: Object.assign(create(AgentSpecSchema), {
|
|
199
|
+
spec: Object.assign(create(AgentSpecSchema), stripUndefined({
|
|
137
200
|
description: input.description,
|
|
138
201
|
iconUrl: input.iconUrl,
|
|
139
202
|
instructions: input.instructions,
|
|
140
|
-
mcpServerUsages
|
|
141
|
-
skillRefs
|
|
142
|
-
subAgents
|
|
143
|
-
envSpec
|
|
144
|
-
}),
|
|
203
|
+
mcpServerUsages,
|
|
204
|
+
skillRefs,
|
|
205
|
+
subAgents,
|
|
206
|
+
envSpec,
|
|
207
|
+
})),
|
|
145
208
|
}) as Agent;
|
|
146
209
|
}
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
// Code generated by stigmer-codegen. DO NOT EDIT.
|
|
2
2
|
|
|
3
3
|
import { wrapError } from "./errors";
|
|
4
|
+
import { stripUndefined } from "./proto-utils";
|
|
4
5
|
import { type EnvVarInput } from "./types";
|
|
5
6
|
import { create } from "@bufbuild/protobuf";
|
|
6
7
|
import { createClient, type Client, type Transport } from "@connectrpc/connect";
|
|
7
8
|
import { AgentExecutionSchema, type AgentExecution } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/api_pb";
|
|
8
9
|
import { AgentExecutionCommandController } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/command_pb";
|
|
9
|
-
import { AgentExecutionIdSchema, AgentExecutionUpdateStatusInputSchema, SubmitApprovalInputSchema, CancelAgentExecutionInputSchema, TerminateAgentExecutionInputSchema, RecoverAgentExecutionInputSchema, PauseAgentExecutionInputSchema, ResumeAgentExecutionInputSchema, UploadAttachmentRequestSchema, UploadAttachmentResponseSchema, ListAgentExecutionsRequestSchema, AgentExecutionListSchema, ListAgentExecutionsBySessionRequestSchema, GetArtifactDownloadUrlRequestSchema, GetArtifactDownloadUrlResponseSchema, GetSessionUsageReportInputSchema, GetSessionUsageReportOutputSchema, GetAgentUsageReportInputSchema, GetAgentUsageReportOutputSchema, GetOrgUsageReportInputSchema, GetOrgUsageReportOutputSchema, type AgentExecutionUpdateStatusInput, type SubmitApprovalInput, type CancelAgentExecutionInput, type TerminateAgentExecutionInput, type RecoverAgentExecutionInput, type PauseAgentExecutionInput, type ResumeAgentExecutionInput, type UploadAttachmentRequest, type UploadAttachmentResponse, type ListAgentExecutionsRequest, type AgentExecutionList, type ListAgentExecutionsBySessionRequest, type GetArtifactDownloadUrlRequest, type GetArtifactDownloadUrlResponse, type GetSessionUsageReportInput, type GetSessionUsageReportOutput, type GetAgentUsageReportInput, type GetAgentUsageReportOutput, type GetOrgUsageReportInput, type GetOrgUsageReportOutput } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/io_pb";
|
|
10
|
+
import { AgentExecutionIdSchema, AgentExecutionUpdateStatusInputSchema, SubmitApprovalInputSchema, CancelAgentExecutionInputSchema, TerminateAgentExecutionInputSchema, RecoverAgentExecutionInputSchema, PauseAgentExecutionInputSchema, ResumeAgentExecutionInputSchema, UploadAttachmentRequestSchema, UploadAttachmentResponseSchema, ListAgentExecutionsRequestSchema, AgentExecutionListSchema, ListAgentExecutionsBySessionRequestSchema, GetArtifactDownloadUrlRequestSchema, GetArtifactDownloadUrlResponseSchema, GetArtifactContentRequestSchema, GetArtifactContentResponseSchema, GetSessionUsageReportInputSchema, GetSessionUsageReportOutputSchema, GetAgentUsageReportInputSchema, GetAgentUsageReportOutputSchema, GetOrgUsageReportInputSchema, GetOrgUsageReportOutputSchema, type AgentExecutionUpdateStatusInput, type SubmitApprovalInput, type CancelAgentExecutionInput, type TerminateAgentExecutionInput, type RecoverAgentExecutionInput, type PauseAgentExecutionInput, type ResumeAgentExecutionInput, type UploadAttachmentRequest, type UploadAttachmentResponse, type ListAgentExecutionsRequest, type AgentExecutionList, type ListAgentExecutionsBySessionRequest, type GetArtifactDownloadUrlRequest, type GetArtifactDownloadUrlResponse, type GetArtifactContentRequest, type GetArtifactContentResponse, type GetSessionUsageReportInput, type GetSessionUsageReportOutput, type GetAgentUsageReportInput, type GetAgentUsageReportOutput, type GetOrgUsageReportInput, type GetOrgUsageReportOutput } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/io_pb";
|
|
10
11
|
import { AgentExecutionQueryController } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/query_pb";
|
|
11
|
-
import { AgentExecutionSpecSchema } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/spec_pb";
|
|
12
|
+
import { AgentExecutionSpecSchema, ContextManagementConfigSchema, ExecutionConfigSchema, AttachmentSchema } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/spec_pb";
|
|
13
|
+
import { ExecutionValueSchema } from "@stigmer/protos/ai/stigmer/agentic/executioncontext/v1/spec_pb";
|
|
12
14
|
import { ApiResourceIdSchema } from "@stigmer/protos/ai/stigmer/commons/apiresource/io_pb";
|
|
13
15
|
import { ApiResourceMetadataSchema } from "@stigmer/protos/ai/stigmer/commons/apiresource/metadata_pb";
|
|
14
16
|
|
|
@@ -120,6 +122,12 @@ export class AgentExecutionClient {
|
|
|
120
122
|
} catch (e) { throw wrapError(e); }
|
|
121
123
|
}
|
|
122
124
|
|
|
125
|
+
async getArtifactContent(input: GetArtifactContentRequest): Promise<GetArtifactContentResponse> {
|
|
126
|
+
try {
|
|
127
|
+
return await this.query.getArtifactContent(input);
|
|
128
|
+
} catch (e) { throw wrapError(e); }
|
|
129
|
+
}
|
|
130
|
+
|
|
123
131
|
async getSessionUsageReport(input: GetSessionUsageReportInput): Promise<GetSessionUsageReportOutput> {
|
|
124
132
|
try {
|
|
125
133
|
return await this.query.getSessionUsageReport(input);
|
|
@@ -142,7 +150,9 @@ export class AgentExecutionClient {
|
|
|
142
150
|
/** Input for creating/updating a AgentExecution. */
|
|
143
151
|
export interface AgentExecutionInput {
|
|
144
152
|
name: string;
|
|
153
|
+
slug?: string;
|
|
145
154
|
org: string;
|
|
155
|
+
labels?: Record<string, string>;
|
|
146
156
|
sessionId?: string;
|
|
147
157
|
agentId?: string;
|
|
148
158
|
message?: string;
|
|
@@ -181,25 +191,63 @@ export interface AttachmentInput {
|
|
|
181
191
|
localPath?: string;
|
|
182
192
|
}
|
|
183
193
|
|
|
194
|
+
function buildContextManagementConfigProto(input: ContextManagementConfigInput) {
|
|
195
|
+
return Object.assign(create(ContextManagementConfigSchema), stripUndefined({
|
|
196
|
+
disableSummarization: input.disableSummarization,
|
|
197
|
+
customTriggerThreshold: input.customTriggerThreshold,
|
|
198
|
+
customTargetTokens: input.customTargetTokens,
|
|
199
|
+
}));
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
function buildExecutionConfigProto(input: ExecutionConfigInput) {
|
|
203
|
+
const msg = create(ExecutionConfigSchema);
|
|
204
|
+
if (input.modelName !== undefined) msg.modelName = input.modelName;
|
|
205
|
+
if (input.contextManagement) msg.contextManagement = buildContextManagementConfigProto(input.contextManagement);
|
|
206
|
+
if (input.maxToolRounds !== undefined) msg.maxToolRounds = input.maxToolRounds;
|
|
207
|
+
if (input.maxToolResultChars !== undefined) msg.maxToolResultChars = input.maxToolResultChars;
|
|
208
|
+
if (input.maxCostUsd !== undefined) msg.maxCostUsd = input.maxCostUsd;
|
|
209
|
+
return msg;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
function buildAttachmentProto(input: AttachmentInput) {
|
|
213
|
+
return Object.assign(create(AttachmentSchema), stripUndefined({
|
|
214
|
+
filename: input.filename,
|
|
215
|
+
storageKey: input.storageKey,
|
|
216
|
+
mountPath: input.mountPath,
|
|
217
|
+
contentType: input.contentType,
|
|
218
|
+
extract: input.extract,
|
|
219
|
+
localPath: input.localPath,
|
|
220
|
+
}));
|
|
221
|
+
}
|
|
222
|
+
|
|
184
223
|
function buildAgentExecutionProto(input: AgentExecutionInput): AgentExecution {
|
|
224
|
+
const executionConfig = input.executionConfig ? buildExecutionConfigProto(input.executionConfig) : undefined;
|
|
225
|
+
let runtimeEnv;
|
|
226
|
+
if (input.runtimeEnv) {
|
|
227
|
+
runtimeEnv = Object.fromEntries(Object.entries(input.runtimeEnv).map(([k, v]) =>
|
|
228
|
+
[k, create(ExecutionValueSchema, { value: v.value, isSecret: v.isSecret })]));
|
|
229
|
+
}
|
|
230
|
+
const attachments = input.attachments?.map(buildAttachmentProto);
|
|
185
231
|
return Object.assign(create(AgentExecutionSchema), {
|
|
186
232
|
apiVersion: "agentic.stigmer.ai/v1",
|
|
187
233
|
kind: "AgentExecution",
|
|
188
234
|
metadata: Object.assign(create(ApiResourceMetadataSchema), {
|
|
189
235
|
name: input.name,
|
|
190
236
|
org: input.org,
|
|
237
|
+
...(input.slug && { slug: input.slug }),
|
|
238
|
+
...(input.labels && { labels: input.labels }),
|
|
191
239
|
}),
|
|
192
|
-
spec: Object.assign(create(AgentExecutionSpecSchema), {
|
|
240
|
+
spec: Object.assign(create(AgentExecutionSpecSchema), stripUndefined({
|
|
193
241
|
sessionId: input.sessionId,
|
|
194
242
|
agentId: input.agentId,
|
|
195
243
|
message: input.message,
|
|
196
|
-
executionConfig
|
|
197
|
-
runtimeEnv
|
|
244
|
+
executionConfig,
|
|
245
|
+
runtimeEnv,
|
|
198
246
|
callbackToken: input.callbackToken,
|
|
199
247
|
autoApproveAll: input.autoApproveAll,
|
|
200
248
|
parentWorkflowId: input.parentWorkflowId,
|
|
201
|
-
attachments
|
|
249
|
+
attachments,
|
|
202
250
|
workspaceFileRefs: input.workspaceFileRefs,
|
|
203
|
-
}),
|
|
251
|
+
})),
|
|
204
252
|
}) as AgentExecution;
|
|
205
253
|
}
|
package/src/gen/agentinstance.ts
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
// Code generated by stigmer-codegen. DO NOT EDIT.
|
|
2
2
|
|
|
3
3
|
import { wrapError } from "./errors";
|
|
4
|
+
import { stripUndefined } from "./proto-utils";
|
|
4
5
|
import { type ResourceRef } from "./types";
|
|
5
6
|
import { create } from "@bufbuild/protobuf";
|
|
6
7
|
import { createClient, type Client, type Transport } from "@connectrpc/connect";
|
|
7
8
|
import { AgentInstanceSchema, type AgentInstance } from "@stigmer/protos/ai/stigmer/agentic/agentinstance/v1/api_pb";
|
|
8
9
|
import { AgentInstanceCommandController } from "@stigmer/protos/ai/stigmer/agentic/agentinstance/v1/command_pb";
|
|
9
|
-
import { AgentInstanceIdSchema, GetAgentInstancesByAgentRequestSchema, AgentInstanceListSchema, type GetAgentInstancesByAgentRequest, type AgentInstanceList } from "@stigmer/protos/ai/stigmer/agentic/agentinstance/v1/io_pb";
|
|
10
|
+
import { AgentInstanceIdSchema, GetAgentInstancesByAgentRequestSchema, AgentInstanceListSchema, ListAgentInstancesRequestSchema, type GetAgentInstancesByAgentRequest, type AgentInstanceList, type ListAgentInstancesRequest } from "@stigmer/protos/ai/stigmer/agentic/agentinstance/v1/io_pb";
|
|
10
11
|
import { AgentInstanceQueryController } from "@stigmer/protos/ai/stigmer/agentic/agentinstance/v1/query_pb";
|
|
11
12
|
import { AgentInstanceSpecSchema } from "@stigmer/protos/ai/stigmer/agentic/agentinstance/v1/spec_pb";
|
|
13
|
+
import { ApiResourceKind } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
|
|
12
14
|
import { ApiResourceReferenceSchema } from "@stigmer/protos/ai/stigmer/commons/apiresource/io_pb";
|
|
13
15
|
import { ApiResourceMetadataSchema } from "@stigmer/protos/ai/stigmer/commons/apiresource/metadata_pb";
|
|
14
16
|
|
|
@@ -60,7 +62,13 @@ export class AgentInstanceClient {
|
|
|
60
62
|
|
|
61
63
|
async getByReference(ref: ResourceRef): Promise<AgentInstance> {
|
|
62
64
|
try {
|
|
63
|
-
return await this.query.getByReference(create(ApiResourceReferenceSchema, ref));
|
|
65
|
+
return await this.query.getByReference(create(ApiResourceReferenceSchema, { ...ref, kind: ApiResourceKind.agent_instance }));
|
|
66
|
+
} catch (e) { throw wrapError(e); }
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
async list(input: ListAgentInstancesRequest): Promise<AgentInstanceList> {
|
|
70
|
+
try {
|
|
71
|
+
return await this.query.list(input);
|
|
64
72
|
} catch (e) { throw wrapError(e); }
|
|
65
73
|
}
|
|
66
74
|
}
|
|
@@ -68,24 +76,29 @@ export class AgentInstanceClient {
|
|
|
68
76
|
/** Input for creating/updating a AgentInstance. */
|
|
69
77
|
export interface AgentInstanceInput {
|
|
70
78
|
name: string;
|
|
79
|
+
slug?: string;
|
|
71
80
|
org: string;
|
|
81
|
+
labels?: Record<string, string>;
|
|
72
82
|
agentId?: string;
|
|
73
83
|
description?: string;
|
|
74
84
|
environmentRefs?: ResourceRef[];
|
|
75
85
|
}
|
|
76
86
|
|
|
77
87
|
function buildAgentInstanceProto(input: AgentInstanceInput): AgentInstance {
|
|
88
|
+
const environmentRefs = input.environmentRefs?.map(r => create(ApiResourceReferenceSchema, r));
|
|
78
89
|
return Object.assign(create(AgentInstanceSchema), {
|
|
79
90
|
apiVersion: "agentic.stigmer.ai/v1",
|
|
80
91
|
kind: "AgentInstance",
|
|
81
92
|
metadata: Object.assign(create(ApiResourceMetadataSchema), {
|
|
82
93
|
name: input.name,
|
|
83
94
|
org: input.org,
|
|
95
|
+
...(input.slug && { slug: input.slug }),
|
|
96
|
+
...(input.labels && { labels: input.labels }),
|
|
84
97
|
}),
|
|
85
|
-
spec: Object.assign(create(AgentInstanceSpecSchema), {
|
|
98
|
+
spec: Object.assign(create(AgentInstanceSpecSchema), stripUndefined({
|
|
86
99
|
agentId: input.agentId,
|
|
87
100
|
description: input.description,
|
|
88
|
-
environmentRefs
|
|
89
|
-
}),
|
|
101
|
+
environmentRefs,
|
|
102
|
+
})),
|
|
90
103
|
}) as AgentInstance;
|
|
91
104
|
}
|
package/src/gen/apikey.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// Code generated by stigmer-codegen. DO NOT EDIT.
|
|
2
2
|
|
|
3
3
|
import { wrapError } from "./errors";
|
|
4
|
+
import { stripUndefined } from "./proto-utils";
|
|
4
5
|
import { create } from "@bufbuild/protobuf";
|
|
5
6
|
import { EmptySchema } from "@bufbuild/protobuf/wkt";
|
|
6
7
|
import { createClient, type Client, type Transport } from "@connectrpc/connect";
|
|
@@ -61,7 +62,9 @@ export class ApiKeyClient {
|
|
|
61
62
|
/** Input for creating/updating a ApiKey. */
|
|
62
63
|
export interface ApiKeyInput {
|
|
63
64
|
name: string;
|
|
65
|
+
slug?: string;
|
|
64
66
|
org: string;
|
|
67
|
+
labels?: Record<string, string>;
|
|
65
68
|
keyHash?: string;
|
|
66
69
|
fingerprint?: string;
|
|
67
70
|
expiresAt?: Date | string;
|
|
@@ -75,12 +78,14 @@ function buildApiKeyProto(input: ApiKeyInput): ApiKey {
|
|
|
75
78
|
metadata: Object.assign(create(ApiResourceMetadataSchema), {
|
|
76
79
|
name: input.name,
|
|
77
80
|
org: input.org,
|
|
81
|
+
...(input.slug && { slug: input.slug }),
|
|
82
|
+
...(input.labels && { labels: input.labels }),
|
|
78
83
|
}),
|
|
79
|
-
spec: Object.assign(create(ApiKeySpecSchema), {
|
|
84
|
+
spec: Object.assign(create(ApiKeySpecSchema), stripUndefined({
|
|
80
85
|
keyHash: input.keyHash,
|
|
81
86
|
fingerprint: input.fingerprint,
|
|
82
87
|
expiresAt: input.expiresAt,
|
|
83
88
|
neverExpires: input.neverExpires,
|
|
84
|
-
}),
|
|
89
|
+
})),
|
|
85
90
|
}) as ApiKey;
|
|
86
91
|
}
|
package/src/gen/environment.ts
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
// Code generated by stigmer-codegen. DO NOT EDIT.
|
|
2
2
|
|
|
3
3
|
import { wrapError } from "./errors";
|
|
4
|
+
import { stripUndefined } from "./proto-utils";
|
|
4
5
|
import { type DeleteResourceInput, type ResourceRef, type EnvVarInput } from "./types";
|
|
5
6
|
import { create } from "@bufbuild/protobuf";
|
|
6
7
|
import { createClient, type Client, type Transport } from "@connectrpc/connect";
|
|
7
8
|
import { EnvironmentSchema, type Environment } from "@stigmer/protos/ai/stigmer/agentic/environment/v1/api_pb";
|
|
8
9
|
import { EnvironmentCommandController } from "@stigmer/protos/ai/stigmer/agentic/environment/v1/command_pb";
|
|
10
|
+
import { UpdateEnvironmentVariablesRequestSchema, RemoveEnvironmentVariablesRequestSchema, EnvironmentSecretValueInputSchema, ListEnvironmentsRequestSchema, EnvironmentListSchema, type UpdateEnvironmentVariablesRequest, type RemoveEnvironmentVariablesRequest, type EnvironmentSecretValueInput, type ListEnvironmentsRequest, type EnvironmentList } from "@stigmer/protos/ai/stigmer/agentic/environment/v1/io_pb";
|
|
9
11
|
import { EnvironmentQueryController } from "@stigmer/protos/ai/stigmer/agentic/environment/v1/query_pb";
|
|
10
|
-
import { EnvironmentSpecSchema } from "@stigmer/protos/ai/stigmer/agentic/environment/v1/spec_pb";
|
|
12
|
+
import { EnvironmentValueSchema, EnvironmentSpecSchema, type EnvironmentValue } from "@stigmer/protos/ai/stigmer/agentic/environment/v1/spec_pb";
|
|
13
|
+
import { ApiResourceKind } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
|
|
11
14
|
import { ApiResourceIdSchema, ApiResourceReferenceSchema, ApiResourceDeleteInputSchema } from "@stigmer/protos/ai/stigmer/commons/apiresource/io_pb";
|
|
12
15
|
import { ApiResourceMetadataSchema } from "@stigmer/protos/ai/stigmer/commons/apiresource/metadata_pb";
|
|
13
16
|
|
|
@@ -49,6 +52,18 @@ export class EnvironmentClient {
|
|
|
49
52
|
} catch (e) { throw wrapError(e); }
|
|
50
53
|
}
|
|
51
54
|
|
|
55
|
+
async updateVariables(input: UpdateEnvironmentVariablesRequest): Promise<Environment> {
|
|
56
|
+
try {
|
|
57
|
+
return await this.command.updateVariables(input);
|
|
58
|
+
} catch (e) { throw wrapError(e); }
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
async removeVariables(input: RemoveEnvironmentVariablesRequest): Promise<Environment> {
|
|
62
|
+
try {
|
|
63
|
+
return await this.command.removeVariables(input);
|
|
64
|
+
} catch (e) { throw wrapError(e); }
|
|
65
|
+
}
|
|
66
|
+
|
|
52
67
|
async get(id: string): Promise<Environment> {
|
|
53
68
|
try {
|
|
54
69
|
return await this.query.get(create(ApiResourceIdSchema, { value: id }));
|
|
@@ -57,7 +72,19 @@ export class EnvironmentClient {
|
|
|
57
72
|
|
|
58
73
|
async getByReference(ref: ResourceRef): Promise<Environment> {
|
|
59
74
|
try {
|
|
60
|
-
return await this.query.getByReference(create(ApiResourceReferenceSchema, ref));
|
|
75
|
+
return await this.query.getByReference(create(ApiResourceReferenceSchema, { ...ref, kind: ApiResourceKind.environment }));
|
|
76
|
+
} catch (e) { throw wrapError(e); }
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
async getSecretValue(input: EnvironmentSecretValueInput): Promise<EnvironmentValue> {
|
|
80
|
+
try {
|
|
81
|
+
return await this.query.getSecretValue(input);
|
|
82
|
+
} catch (e) { throw wrapError(e); }
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
async list(input: ListEnvironmentsRequest): Promise<EnvironmentList> {
|
|
86
|
+
try {
|
|
87
|
+
return await this.query.list(input);
|
|
61
88
|
} catch (e) { throw wrapError(e); }
|
|
62
89
|
}
|
|
63
90
|
}
|
|
@@ -65,22 +92,31 @@ export class EnvironmentClient {
|
|
|
65
92
|
/** Input for creating/updating a Environment. */
|
|
66
93
|
export interface EnvironmentInput {
|
|
67
94
|
name: string;
|
|
95
|
+
slug?: string;
|
|
68
96
|
org: string;
|
|
97
|
+
labels?: Record<string, string>;
|
|
69
98
|
description?: string;
|
|
70
99
|
data?: Record<string, EnvVarInput>;
|
|
71
100
|
}
|
|
72
101
|
|
|
73
102
|
function buildEnvironmentProto(input: EnvironmentInput): Environment {
|
|
103
|
+
let data;
|
|
104
|
+
if (input.data) {
|
|
105
|
+
data = Object.fromEntries(Object.entries(input.data).map(([k, v]) =>
|
|
106
|
+
[k, create(EnvironmentValueSchema, { value: v.value, isSecret: v.isSecret, description: v.description })]));
|
|
107
|
+
}
|
|
74
108
|
return Object.assign(create(EnvironmentSchema), {
|
|
75
109
|
apiVersion: "agentic.stigmer.ai/v1",
|
|
76
110
|
kind: "Environment",
|
|
77
111
|
metadata: Object.assign(create(ApiResourceMetadataSchema), {
|
|
78
112
|
name: input.name,
|
|
79
113
|
org: input.org,
|
|
114
|
+
...(input.slug && { slug: input.slug }),
|
|
115
|
+
...(input.labels && { labels: input.labels }),
|
|
80
116
|
}),
|
|
81
|
-
spec: Object.assign(create(EnvironmentSpecSchema), {
|
|
117
|
+
spec: Object.assign(create(EnvironmentSpecSchema), stripUndefined({
|
|
82
118
|
description: input.description,
|
|
83
|
-
data
|
|
84
|
-
}),
|
|
119
|
+
data,
|
|
120
|
+
})),
|
|
85
121
|
}) as Environment;
|
|
86
122
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// Code generated by stigmer-codegen. DO NOT EDIT.
|
|
2
2
|
|
|
3
3
|
import { wrapError } from "./errors";
|
|
4
|
+
import { stripUndefined } from "./proto-utils";
|
|
4
5
|
import { type DeleteResourceInput, type ResourceRef, type EnvVarInput } from "./types";
|
|
5
6
|
import { create } from "@bufbuild/protobuf";
|
|
6
7
|
import { createClient, type Client, type Transport } from "@connectrpc/connect";
|
|
@@ -8,7 +9,8 @@ import { ExecutionContextSchema, type ExecutionContext } from "@stigmer/protos/a
|
|
|
8
9
|
import { ExecutionContextCommandController } from "@stigmer/protos/ai/stigmer/agentic/executioncontext/v1/command_pb";
|
|
9
10
|
import { ExecutionContextIdSchema, ExecutionContextExecutionIdInputSchema, type ExecutionContextExecutionIdInput } from "@stigmer/protos/ai/stigmer/agentic/executioncontext/v1/io_pb";
|
|
10
11
|
import { ExecutionContextQueryController } from "@stigmer/protos/ai/stigmer/agentic/executioncontext/v1/query_pb";
|
|
11
|
-
import { ExecutionContextSpecSchema } from "@stigmer/protos/ai/stigmer/agentic/executioncontext/v1/spec_pb";
|
|
12
|
+
import { ExecutionContextSpecSchema, ExecutionValueSchema } from "@stigmer/protos/ai/stigmer/agentic/executioncontext/v1/spec_pb";
|
|
13
|
+
import { ApiResourceKind } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
|
|
12
14
|
import { ApiResourceReferenceSchema, ApiResourceDeleteInputSchema } from "@stigmer/protos/ai/stigmer/commons/apiresource/io_pb";
|
|
13
15
|
import { ApiResourceMetadataSchema } from "@stigmer/protos/ai/stigmer/commons/apiresource/metadata_pb";
|
|
14
16
|
|
|
@@ -52,7 +54,7 @@ export class ExecutionContextClient {
|
|
|
52
54
|
|
|
53
55
|
async getByReference(ref: ResourceRef): Promise<ExecutionContext> {
|
|
54
56
|
try {
|
|
55
|
-
return await this.query.getByReference(create(ApiResourceReferenceSchema, ref));
|
|
57
|
+
return await this.query.getByReference(create(ApiResourceReferenceSchema, { ...ref, kind: ApiResourceKind.execution_context }));
|
|
56
58
|
} catch (e) { throw wrapError(e); }
|
|
57
59
|
}
|
|
58
60
|
|
|
@@ -66,22 +68,31 @@ export class ExecutionContextClient {
|
|
|
66
68
|
/** Input for creating/updating a ExecutionContext. */
|
|
67
69
|
export interface ExecutionContextInput {
|
|
68
70
|
name: string;
|
|
71
|
+
slug?: string;
|
|
69
72
|
org: string;
|
|
73
|
+
labels?: Record<string, string>;
|
|
70
74
|
executionId?: string;
|
|
71
75
|
data?: Record<string, EnvVarInput>;
|
|
72
76
|
}
|
|
73
77
|
|
|
74
78
|
function buildExecutionContextProto(input: ExecutionContextInput): ExecutionContext {
|
|
79
|
+
let data;
|
|
80
|
+
if (input.data) {
|
|
81
|
+
data = Object.fromEntries(Object.entries(input.data).map(([k, v]) =>
|
|
82
|
+
[k, create(ExecutionValueSchema, { value: v.value, isSecret: v.isSecret })]));
|
|
83
|
+
}
|
|
75
84
|
return Object.assign(create(ExecutionContextSchema), {
|
|
76
85
|
apiVersion: "agentic.stigmer.ai/v1",
|
|
77
86
|
kind: "ExecutionContext",
|
|
78
87
|
metadata: Object.assign(create(ApiResourceMetadataSchema), {
|
|
79
88
|
name: input.name,
|
|
80
89
|
org: input.org,
|
|
90
|
+
...(input.slug && { slug: input.slug }),
|
|
91
|
+
...(input.labels && { labels: input.labels }),
|
|
81
92
|
}),
|
|
82
|
-
spec: Object.assign(create(ExecutionContextSpecSchema), {
|
|
93
|
+
spec: Object.assign(create(ExecutionContextSpecSchema), stripUndefined({
|
|
83
94
|
executionId: input.executionId,
|
|
84
|
-
data
|
|
85
|
-
}),
|
|
95
|
+
data,
|
|
96
|
+
})),
|
|
86
97
|
}) as ExecutionContext;
|
|
87
98
|
}
|
package/src/gen/iampolicy.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// Code generated by stigmer-codegen. DO NOT EDIT.
|
|
2
2
|
|
|
3
3
|
import { wrapError } from "./errors";
|
|
4
|
+
import { stripUndefined } from "./proto-utils";
|
|
4
5
|
import { create } from "@bufbuild/protobuf";
|
|
5
6
|
import { createClient, type Client, type Transport } from "@connectrpc/connect";
|
|
6
7
|
import { ApiResourceMetadataSchema } from "@stigmer/protos/ai/stigmer/commons/apiresource/metadata_pb";
|
|
@@ -32,12 +33,6 @@ export class IamPolicyClient {
|
|
|
32
33
|
} catch (e) { throw wrapError(e); }
|
|
33
34
|
}
|
|
34
35
|
|
|
35
|
-
async createPlatformLink(input: IamPolicySpec): Promise<IamPolicy> {
|
|
36
|
-
try {
|
|
37
|
-
return await this.command.createPlatformLink(input);
|
|
38
|
-
} catch (e) { throw wrapError(e); }
|
|
39
|
-
}
|
|
40
|
-
|
|
41
36
|
async bootstrapPolicy(input: IamPolicySpec): Promise<IamPolicy> {
|
|
42
37
|
try {
|
|
43
38
|
return await this.command.bootstrapPolicy(input);
|
|
@@ -78,7 +73,9 @@ export class IamPolicyClient {
|
|
|
78
73
|
/** Input for creating/updating a IamPolicy. */
|
|
79
74
|
export interface IamPolicyInput {
|
|
80
75
|
name: string;
|
|
76
|
+
slug?: string;
|
|
81
77
|
org: string;
|
|
78
|
+
labels?: Record<string, string>;
|
|
82
79
|
principal: ApiResourceRefInput;
|
|
83
80
|
resource: ApiResourceRefInput;
|
|
84
81
|
relation: string;
|
|
@@ -91,18 +88,30 @@ export interface ApiResourceRefInput {
|
|
|
91
88
|
relation?: string;
|
|
92
89
|
}
|
|
93
90
|
|
|
91
|
+
function buildApiResourceRefProto(input: ApiResourceRefInput) {
|
|
92
|
+
return Object.assign(create(ApiResourceRefSchema), stripUndefined({
|
|
93
|
+
kind: input.kind,
|
|
94
|
+
id: input.id,
|
|
95
|
+
relation: input.relation,
|
|
96
|
+
}));
|
|
97
|
+
}
|
|
98
|
+
|
|
94
99
|
function buildIamPolicyProto(input: IamPolicyInput): IamPolicy {
|
|
100
|
+
const principal = input.principal ? buildApiResourceRefProto(input.principal) : undefined;
|
|
101
|
+
const resource = input.resource ? buildApiResourceRefProto(input.resource) : undefined;
|
|
95
102
|
return Object.assign(create(IamPolicySchema), {
|
|
96
103
|
apiVersion: "iam.stigmer.ai/v1",
|
|
97
104
|
kind: "IamPolicy",
|
|
98
105
|
metadata: Object.assign(create(ApiResourceMetadataSchema), {
|
|
99
106
|
name: input.name,
|
|
100
107
|
org: input.org,
|
|
108
|
+
...(input.slug && { slug: input.slug }),
|
|
109
|
+
...(input.labels && { labels: input.labels }),
|
|
101
110
|
}),
|
|
102
|
-
spec: Object.assign(create(IamPolicySpecSchema), {
|
|
103
|
-
principal
|
|
104
|
-
resource
|
|
111
|
+
spec: Object.assign(create(IamPolicySpecSchema), stripUndefined({
|
|
112
|
+
principal,
|
|
113
|
+
resource,
|
|
105
114
|
relation: input.relation,
|
|
106
|
-
}),
|
|
115
|
+
})),
|
|
107
116
|
}) as IamPolicy;
|
|
108
117
|
}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
// Code generated by stigmer-codegen. DO NOT EDIT.
|
|
2
2
|
|
|
3
3
|
import { wrapError } from "./errors";
|
|
4
|
+
import { stripUndefined } from "./proto-utils";
|
|
4
5
|
import { type ResourceRef } from "./types";
|
|
5
6
|
import { create } from "@bufbuild/protobuf";
|
|
6
7
|
import { EmptySchema } from "@bufbuild/protobuf/wkt";
|
|
7
8
|
import { createClient, type Client, type Transport } from "@connectrpc/connect";
|
|
9
|
+
import { ApiResourceReferenceSchema } from "@stigmer/protos/ai/stigmer/commons/apiresource/io_pb";
|
|
8
10
|
import { ApiResourceMetadataSchema } from "@stigmer/protos/ai/stigmer/commons/apiresource/metadata_pb";
|
|
9
11
|
import { type ApiResourceAuditActor } from "@stigmer/protos/ai/stigmer/commons/apiresource/status_pb";
|
|
10
12
|
import { IdentityAccountSchema, type IdentityAccount } from "@stigmer/protos/ai/stigmer/iam/identityaccount/v1/api_pb";
|
|
@@ -82,7 +84,9 @@ export class IdentityAccountClient {
|
|
|
82
84
|
/** Input for creating/updating a IdentityAccount. */
|
|
83
85
|
export interface IdentityAccountInput {
|
|
84
86
|
name: string;
|
|
87
|
+
slug?: string;
|
|
85
88
|
org: string;
|
|
89
|
+
labels?: Record<string, string>;
|
|
86
90
|
idpId: string;
|
|
87
91
|
email?: string;
|
|
88
92
|
firstName?: string;
|
|
@@ -94,14 +98,17 @@ export interface IdentityAccountInput {
|
|
|
94
98
|
}
|
|
95
99
|
|
|
96
100
|
function buildIdentityAccountProto(input: IdentityAccountInput): IdentityAccount {
|
|
101
|
+
const identityProviderRef = input.identityProviderRef ? create(ApiResourceReferenceSchema, input.identityProviderRef) : undefined;
|
|
97
102
|
return Object.assign(create(IdentityAccountSchema), {
|
|
98
103
|
apiVersion: "iam.stigmer.ai/v1",
|
|
99
104
|
kind: "IdentityAccount",
|
|
100
105
|
metadata: Object.assign(create(ApiResourceMetadataSchema), {
|
|
101
106
|
name: input.name,
|
|
102
107
|
org: input.org,
|
|
108
|
+
...(input.slug && { slug: input.slug }),
|
|
109
|
+
...(input.labels && { labels: input.labels }),
|
|
103
110
|
}),
|
|
104
|
-
spec: Object.assign(create(IdentityAccountSpecSchema), {
|
|
111
|
+
spec: Object.assign(create(IdentityAccountSpecSchema), stripUndefined({
|
|
105
112
|
idpId: input.idpId,
|
|
106
113
|
email: input.email,
|
|
107
114
|
firstName: input.firstName,
|
|
@@ -109,7 +116,7 @@ function buildIdentityAccountProto(input: IdentityAccountInput): IdentityAccount
|
|
|
109
116
|
pictureUrl: input.pictureUrl,
|
|
110
117
|
isMachineAccount: input.isMachineAccount,
|
|
111
118
|
provisioningMode: input.provisioningMode,
|
|
112
|
-
identityProviderRef
|
|
113
|
-
}),
|
|
119
|
+
identityProviderRef,
|
|
120
|
+
})),
|
|
114
121
|
}) as IdentityAccount;
|
|
115
122
|
}
|