@stigmer/sdk 3.12.5 → 3.12.7
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__/update-input-roundtrip.test.d.ts +2 -0
- package/__tests__/update-input-roundtrip.test.d.ts.map +1 -0
- package/__tests__/update-input-roundtrip.test.js +795 -0
- package/__tests__/update-input-roundtrip.test.js.map +1 -0
- package/__tests__/update-input.test.js +22 -3
- package/__tests__/update-input.test.js.map +1 -1
- package/execution/__tests__/transcript.test.d.ts +2 -0
- package/execution/__tests__/transcript.test.d.ts.map +1 -0
- package/execution/__tests__/transcript.test.js +527 -0
- package/execution/__tests__/transcript.test.js.map +1 -0
- package/execution/conversation-rules.d.ts +64 -0
- package/execution/conversation-rules.d.ts.map +1 -0
- package/execution/conversation-rules.js +113 -0
- package/execution/conversation-rules.js.map +1 -0
- package/execution/transcript.d.ts +171 -0
- package/execution/transcript.d.ts.map +1 -0
- package/execution/transcript.js +484 -0
- package/execution/transcript.js.map +1 -0
- package/gen/agent.d.ts +21 -0
- package/gen/agent.d.ts.map +1 -1
- package/gen/agent.js +73 -1
- package/gen/agent.js.map +1 -1
- package/gen/agentchannel.d.ts +23 -1
- package/gen/agentchannel.d.ts.map +1 -1
- package/gen/agentchannel.js +55 -1
- package/gen/agentchannel.js.map +1 -1
- package/gen/agentexecution.d.ts +34 -1
- package/gen/agentexecution.d.ts.map +1 -1
- package/gen/agentexecution.js +176 -2
- package/gen/agentexecution.js.map +1 -1
- package/gen/agentinstance.d.ts +21 -0
- package/gen/agentinstance.d.ts.map +1 -1
- package/gen/agentinstance.js +32 -1
- package/gen/agentinstance.js.map +1 -1
- package/gen/agentshare.d.ts +23 -1
- package/gen/agentshare.d.ts.map +1 -1
- package/gen/agentshare.js +53 -1
- package/gen/agentshare.js.map +1 -1
- package/gen/apikey.d.ts +21 -0
- package/gen/apikey.d.ts.map +1 -1
- package/gen/apikey.js +33 -1
- package/gen/apikey.js.map +1 -1
- package/gen/artifact.d.ts +8 -0
- package/gen/artifact.d.ts.map +1 -1
- package/gen/artifact.js +1 -0
- package/gen/artifact.js.map +1 -1
- package/gen/channelapp.d.ts +21 -0
- package/gen/channelapp.d.ts.map +1 -1
- package/gen/channelapp.js +45 -0
- package/gen/channelapp.js.map +1 -1
- package/gen/client.d.ts +5 -1
- package/gen/client.d.ts.map +1 -1
- package/gen/client.js +4 -0
- package/gen/client.js.map +1 -1
- package/gen/environment.d.ts +21 -0
- package/gen/environment.d.ts.map +1 -1
- package/gen/environment.js +31 -1
- package/gen/environment.js.map +1 -1
- package/gen/executioncontext.d.ts +8 -0
- package/gen/executioncontext.d.ts.map +1 -1
- package/gen/executioncontext.js +1 -0
- package/gen/executioncontext.js.map +1 -1
- package/gen/iampolicy.d.ts +8 -0
- package/gen/iampolicy.d.ts.map +1 -1
- package/gen/iampolicy.js +1 -0
- package/gen/iampolicy.js.map +1 -1
- package/gen/identityaccount.d.ts +22 -0
- package/gen/identityaccount.d.ts.map +1 -1
- package/gen/identityaccount.js +48 -1
- package/gen/identityaccount.js.map +1 -1
- package/gen/identityprovider.d.ts +21 -0
- package/gen/identityprovider.d.ts.map +1 -1
- package/gen/identityprovider.js +40 -0
- package/gen/identityprovider.js.map +1 -1
- package/gen/invitation.d.ts +8 -0
- package/gen/invitation.d.ts.map +1 -1
- package/gen/invitation.js +1 -0
- package/gen/invitation.js.map +1 -1
- package/gen/mcpserver.d.ts +21 -0
- package/gen/mcpserver.d.ts.map +1 -1
- package/gen/mcpserver.js +79 -1
- package/gen/mcpserver.js.map +1 -1
- package/gen/memory.d.ts +58 -0
- package/gen/memory.d.ts.map +1 -0
- package/gen/memory.js +143 -0
- package/gen/memory.js.map +1 -0
- package/gen/oauthapp.d.ts +21 -0
- package/gen/oauthapp.d.ts.map +1 -1
- package/gen/oauthapp.js +39 -0
- package/gen/oauthapp.js.map +1 -1
- package/gen/organization.d.ts +22 -0
- package/gen/organization.d.ts.map +1 -1
- package/gen/organization.js +43 -1
- package/gen/organization.js.map +1 -1
- package/gen/platformclient.d.ts +21 -0
- package/gen/platformclient.d.ts.map +1 -1
- package/gen/platformclient.js +40 -1
- package/gen/platformclient.js.map +1 -1
- package/gen/project.d.ts +21 -0
- package/gen/project.d.ts.map +1 -1
- package/gen/project.js +32 -1
- package/gen/project.js.map +1 -1
- package/gen/proto-utils.d.ts +36 -0
- package/gen/proto-utils.d.ts.map +1 -1
- package/gen/proto-utils.js +58 -0
- package/gen/proto-utils.js.map +1 -1
- package/gen/schedule.d.ts +23 -1
- package/gen/schedule.d.ts.map +1 -1
- package/gen/schedule.js +79 -1
- package/gen/schedule.js.map +1 -1
- package/gen/session.d.ts +21 -0
- package/gen/session.d.ts.map +1 -1
- package/gen/session.js +80 -1
- package/gen/session.js.map +1 -1
- package/gen/skill.d.ts +8 -0
- package/gen/skill.d.ts.map +1 -1
- package/gen/skill.js +1 -0
- package/gen/skill.js.map +1 -1
- package/gen/workflow.d.ts +21 -0
- package/gen/workflow.d.ts.map +1 -1
- package/gen/workflow.js +79 -0
- package/gen/workflow.js.map +1 -1
- package/gen/workflowexecution.d.ts +21 -0
- package/gen/workflowexecution.d.ts.map +1 -1
- package/gen/workflowexecution.js +36 -1
- package/gen/workflowexecution.js.map +1 -1
- package/gen/workflowinstance.d.ts +21 -0
- package/gen/workflowinstance.d.ts.map +1 -1
- package/gen/workflowinstance.js +33 -1
- package/gen/workflowinstance.js.map +1 -1
- package/index.d.ts +23 -21
- package/index.d.ts.map +1 -1
- package/index.js +27 -23
- package/index.js.map +1 -1
- package/package.json +2 -2
- package/src/__tests__/update-input-roundtrip.test.ts +1035 -0
- package/src/__tests__/update-input.test.ts +34 -3
- package/src/execution/__tests__/transcript.golden.md +100 -0
- package/src/execution/__tests__/transcript.test.ts +627 -0
- package/src/execution/conversation-rules.ts +119 -0
- package/src/execution/transcript.ts +735 -0
- package/src/gen/agent.ts +89 -3
- package/src/gen/agentchannel.ts +72 -4
- package/src/gen/agentexecution.ts +216 -6
- package/src/gen/agentinstance.ts +41 -1
- package/src/gen/agentshare.ts +68 -4
- package/src/gen/apikey.ts +42 -1
- package/src/gen/artifact.ts +9 -0
- package/src/gen/channelapp.ts +57 -1
- package/src/gen/client.ts +6 -1
- package/src/gen/environment.ts +40 -1
- package/src/gen/executioncontext.ts +9 -0
- package/src/gen/iampolicy.ts +9 -0
- package/src/gen/identityaccount.ts +60 -2
- package/src/gen/identityprovider.ts +49 -0
- package/src/gen/invitation.ts +9 -0
- package/src/gen/mcpserver.ts +95 -3
- package/src/gen/memory.ts +164 -0
- package/src/gen/oauthapp.ts +48 -0
- package/src/gen/organization.ts +55 -2
- package/src/gen/platformclient.ts +49 -1
- package/src/gen/project.ts +41 -1
- package/src/gen/proto-utils.ts +64 -0
- package/src/gen/schedule.ts +98 -4
- package/src/gen/session.ts +97 -3
- package/src/gen/skill.ts +9 -0
- package/src/gen/workflow.ts +96 -2
- package/src/gen/workflowexecution.ts +45 -1
- package/src/gen/workflowinstance.ts +42 -1
- package/src/index.ts +52 -9
- package/src/update-input.ts +0 -168
- package/update-input.d.ts +0 -24
- package/update-input.d.ts.map +0 -1
- package/update-input.js +0 -126
- package/update-input.js.map +0 -1
package/src/gen/agentshare.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
// Code generated by stigmer-codegen. DO NOT EDIT.
|
|
2
2
|
|
|
3
3
|
import { wrapError } from "./errors.js";
|
|
4
|
-
import { stripUndefined } from "./proto-utils.js";
|
|
4
|
+
import { stripUndefined, toResourceRefInput, toResourceRefInputs } from "./proto-utils.js";
|
|
5
5
|
import { type ResourceRef } from "./types.js";
|
|
6
6
|
import { create } from "@bufbuild/protobuf";
|
|
7
7
|
import { createClient, type Client, type Transport } from "@connectrpc/connect";
|
|
8
|
-
import { ServiceTier } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/enum_pb";
|
|
9
|
-
import { RunConfigSchema } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/invocation_pb";
|
|
8
|
+
import { ServiceTier, ThinkingMode } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/enum_pb";
|
|
9
|
+
import { RunConfigSchema, type RunConfig } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/invocation_pb";
|
|
10
10
|
import { AgentShareSchema, type AgentShare } from "@stigmer/protos/ai/stigmer/agentic/agentshare/v1/api_pb";
|
|
11
11
|
import { AgentShareCommandController } from "@stigmer/protos/ai/stigmer/agentic/agentshare/v1/command_pb";
|
|
12
12
|
import { AgentShareIdSchema, RotateShareLinkInputSchema, GetAgentSharesByAgentRequestSchema, AgentShareListSchema, ListAgentSharesRequestSchema, GetSharedProfileRequestSchema, SharedAgentProfileSchema, type RotateShareLinkInput, type GetAgentSharesByAgentRequest, type AgentShareList, type ListAgentSharesRequest, type GetSharedProfileRequest, type SharedAgentProfile } from "@stigmer/protos/ai/stigmer/agentic/agentshare/v1/io_pb";
|
|
13
13
|
import { AgentShareQueryController } from "@stigmer/protos/ai/stigmer/agentic/agentshare/v1/query_pb";
|
|
14
|
-
import { AgentShareSpecSchema, AgentShareAudience, AgentShareMessagesSchema } from "@stigmer/protos/ai/stigmer/agentic/agentshare/v1/spec_pb";
|
|
14
|
+
import { AgentShareSpecSchema, AgentShareAudience, AgentShareMessagesSchema, type AgentShareMessages } from "@stigmer/protos/ai/stigmer/agentic/agentshare/v1/spec_pb";
|
|
15
15
|
import { ApiResourceKind } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
|
|
16
16
|
import { ApiResourceVisibility } from "@stigmer/protos/ai/stigmer/commons/apiresource/enum_pb";
|
|
17
17
|
import { ApiResourceReferenceSchema } from "@stigmer/protos/ai/stigmer/commons/apiresource/io_pb";
|
|
@@ -96,6 +96,14 @@ export class AgentShareClient {
|
|
|
96
96
|
|
|
97
97
|
/** Input for creating/updating a AgentShare. */
|
|
98
98
|
export interface AgentShareInput {
|
|
99
|
+
/**
|
|
100
|
+
* The resource's `metadata.id`, for exact update addressing when set
|
|
101
|
+
* from a loaded resource. Required for updates to platform-scoped
|
|
102
|
+
* (org-less) kinds, where the org+slug fallback cannot match. On
|
|
103
|
+
* create, the cloud server stamps its own id regardless; the OSS
|
|
104
|
+
* server honors a caller-supplied id (existing apply semantics).
|
|
105
|
+
*/
|
|
106
|
+
id?: string;
|
|
99
107
|
name: string;
|
|
100
108
|
slug?: string;
|
|
101
109
|
org: string;
|
|
@@ -123,6 +131,7 @@ export interface RunConfigInput {
|
|
|
123
131
|
maxCostUsd?: number;
|
|
124
132
|
maxToolRounds?: number;
|
|
125
133
|
serviceTier?: ServiceTier;
|
|
134
|
+
thinkingMode?: ThinkingMode;
|
|
126
135
|
}
|
|
127
136
|
|
|
128
137
|
function buildAgentShareMessagesProto(input: AgentShareMessagesInput) {
|
|
@@ -139,6 +148,7 @@ function buildRunConfigProto(input: RunConfigInput) {
|
|
|
139
148
|
maxCostUsd: input.maxCostUsd,
|
|
140
149
|
maxToolRounds: input.maxToolRounds,
|
|
141
150
|
serviceTier: input.serviceTier,
|
|
151
|
+
thinkingMode: input.thinkingMode,
|
|
142
152
|
}));
|
|
143
153
|
}
|
|
144
154
|
|
|
@@ -151,6 +161,7 @@ export function buildAgentShareProto(input: AgentShareInput): AgentShare {
|
|
|
151
161
|
apiVersion: "agentic.stigmer.ai/v1",
|
|
152
162
|
kind: "AgentShare",
|
|
153
163
|
metadata: Object.assign(create(ApiResourceMetadataSchema), {
|
|
164
|
+
...(input.id && { id: input.id }),
|
|
154
165
|
name: input.name,
|
|
155
166
|
org: input.org,
|
|
156
167
|
...(input.slug && { slug: input.slug }),
|
|
@@ -168,3 +179,56 @@ export function buildAgentShareProto(input: AgentShareInput): AgentShare {
|
|
|
168
179
|
})),
|
|
169
180
|
}) as AgentShare;
|
|
170
181
|
}
|
|
182
|
+
|
|
183
|
+
function toAgentShareMessagesInput(msg: AgentShareMessages): AgentShareMessagesInput {
|
|
184
|
+
return {
|
|
185
|
+
rateLimited: msg.rateLimited || undefined,
|
|
186
|
+
unavailable: msg.unavailable || undefined,
|
|
187
|
+
conversationEnded: msg.conversationEnded || undefined,
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
function toRunConfigInput(msg: RunConfig): RunConfigInput {
|
|
192
|
+
return {
|
|
193
|
+
modelName: msg.modelName || undefined,
|
|
194
|
+
maxCostUsd: msg.maxCostUsd || undefined,
|
|
195
|
+
maxToolRounds: msg.maxToolRounds || undefined,
|
|
196
|
+
serviceTier: msg.serviceTier || undefined,
|
|
197
|
+
thinkingMode: msg.thinkingMode || undefined,
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* Maps a fetched {@link AgentShare} to a complete {@link AgentShareInput} for `update()`.
|
|
203
|
+
*
|
|
204
|
+
* The update RPC replaces the ENTIRE spec — spread this mapper's output
|
|
205
|
+
* and override only the fields you edit (spread nested objects the same
|
|
206
|
+
* way):
|
|
207
|
+
*
|
|
208
|
+
* await client.update({ ...toAgentShareUpdateInput(res), description: next });
|
|
209
|
+
*
|
|
210
|
+
* Proto3 defaults normalize to `undefined`; resource references keep
|
|
211
|
+
* `version` (pinned refs) and `kind`.
|
|
212
|
+
*/
|
|
213
|
+
export function toAgentShareUpdateInput(resource: AgentShare): AgentShareInput {
|
|
214
|
+
const meta = resource.metadata;
|
|
215
|
+
const spec = resource.spec ?? create(AgentShareSpecSchema);
|
|
216
|
+
return {
|
|
217
|
+
// Exact update addressing (id-first in the update pipeline) — for
|
|
218
|
+
// platform-scoped (org-less) kinds the org+slug fallback cannot
|
|
219
|
+
// match, so the id is the ONLY working address.
|
|
220
|
+
id: meta?.id || undefined,
|
|
221
|
+
name: meta?.name ?? "",
|
|
222
|
+
slug: meta?.slug || undefined,
|
|
223
|
+
org: meta?.org ?? "",
|
|
224
|
+
labels: meta?.labels && Object.keys(meta.labels).length > 0 ? { ...meta.labels } : undefined,
|
|
225
|
+
visibility: meta?.visibility || undefined,
|
|
226
|
+
agentRef: toResourceRefInput(spec.agentRef) ?? { org: "", slug: "" },
|
|
227
|
+
enabled: spec.enabled || undefined,
|
|
228
|
+
audience: spec.audience || undefined,
|
|
229
|
+
allowedOrigins: spec.allowedOrigins?.length ? [...spec.allowedOrigins] : undefined,
|
|
230
|
+
messages: spec.messages ? toAgentShareMessagesInput(spec.messages) : undefined,
|
|
231
|
+
environmentRefs: toResourceRefInputs(spec.environmentRefs),
|
|
232
|
+
runConfig: spec.runConfig ? toRunConfigInput(spec.runConfig) : undefined,
|
|
233
|
+
};
|
|
234
|
+
}
|
package/src/gen/apikey.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { wrapError } from "./errors.js";
|
|
4
4
|
import { stripUndefined, toTimestamp } from "./proto-utils.js";
|
|
5
5
|
import { create } from "@bufbuild/protobuf";
|
|
6
|
-
import { EmptySchema } from "@bufbuild/protobuf/wkt";
|
|
6
|
+
import { EmptySchema, timestampDate } from "@bufbuild/protobuf/wkt";
|
|
7
7
|
import { createClient, type Client, type Transport } from "@connectrpc/connect";
|
|
8
8
|
import { ApiResourceVisibility } from "@stigmer/protos/ai/stigmer/commons/apiresource/enum_pb";
|
|
9
9
|
import { ApiResourceMetadataSchema } from "@stigmer/protos/ai/stigmer/commons/apiresource/metadata_pb";
|
|
@@ -62,6 +62,14 @@ export class ApiKeyClient {
|
|
|
62
62
|
|
|
63
63
|
/** Input for creating/updating a ApiKey. */
|
|
64
64
|
export interface ApiKeyInput {
|
|
65
|
+
/**
|
|
66
|
+
* The resource's `metadata.id`, for exact update addressing when set
|
|
67
|
+
* from a loaded resource. Required for updates to platform-scoped
|
|
68
|
+
* (org-less) kinds, where the org+slug fallback cannot match. On
|
|
69
|
+
* create, the cloud server stamps its own id regardless; the OSS
|
|
70
|
+
* server honors a caller-supplied id (existing apply semantics).
|
|
71
|
+
*/
|
|
72
|
+
id?: string;
|
|
65
73
|
name: string;
|
|
66
74
|
slug?: string;
|
|
67
75
|
org: string;
|
|
@@ -79,6 +87,7 @@ export function buildApiKeyProto(input: ApiKeyInput): ApiKey {
|
|
|
79
87
|
apiVersion: "iam.stigmer.ai/v1",
|
|
80
88
|
kind: "ApiKey",
|
|
81
89
|
metadata: Object.assign(create(ApiResourceMetadataSchema), {
|
|
90
|
+
...(input.id && { id: input.id }),
|
|
82
91
|
name: input.name,
|
|
83
92
|
org: input.org,
|
|
84
93
|
...(input.slug && { slug: input.slug }),
|
|
@@ -93,3 +102,35 @@ export function buildApiKeyProto(input: ApiKeyInput): ApiKey {
|
|
|
93
102
|
})),
|
|
94
103
|
}) as ApiKey;
|
|
95
104
|
}
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Maps a fetched {@link ApiKey} to a complete {@link ApiKeyInput} for `update()`.
|
|
108
|
+
*
|
|
109
|
+
* The update RPC replaces the ENTIRE spec — spread this mapper's output
|
|
110
|
+
* and override only the fields you edit (spread nested objects the same
|
|
111
|
+
* way):
|
|
112
|
+
*
|
|
113
|
+
* await client.update({ ...toApiKeyUpdateInput(res), description: next });
|
|
114
|
+
*
|
|
115
|
+
* Proto3 defaults normalize to `undefined`; resource references keep
|
|
116
|
+
* `version` (pinned refs) and `kind`.
|
|
117
|
+
*/
|
|
118
|
+
export function toApiKeyUpdateInput(resource: ApiKey): ApiKeyInput {
|
|
119
|
+
const meta = resource.metadata;
|
|
120
|
+
const spec = resource.spec ?? create(ApiKeySpecSchema);
|
|
121
|
+
return {
|
|
122
|
+
// Exact update addressing (id-first in the update pipeline) — for
|
|
123
|
+
// platform-scoped (org-less) kinds the org+slug fallback cannot
|
|
124
|
+
// match, so the id is the ONLY working address.
|
|
125
|
+
id: meta?.id || undefined,
|
|
126
|
+
name: meta?.name ?? "",
|
|
127
|
+
slug: meta?.slug || undefined,
|
|
128
|
+
org: meta?.org ?? "",
|
|
129
|
+
labels: meta?.labels && Object.keys(meta.labels).length > 0 ? { ...meta.labels } : undefined,
|
|
130
|
+
visibility: meta?.visibility || undefined,
|
|
131
|
+
keyHash: spec.keyHash || undefined,
|
|
132
|
+
fingerprint: spec.fingerprint || undefined,
|
|
133
|
+
expiresAt: spec.expiresAt ? timestampDate(spec.expiresAt) : undefined,
|
|
134
|
+
neverExpires: spec.neverExpires || undefined,
|
|
135
|
+
};
|
|
136
|
+
}
|
package/src/gen/artifact.ts
CHANGED
|
@@ -62,6 +62,14 @@ export class ArtifactClient {
|
|
|
62
62
|
|
|
63
63
|
/** Input for creating/updating a Artifact. */
|
|
64
64
|
export interface ArtifactInput {
|
|
65
|
+
/**
|
|
66
|
+
* The resource's `metadata.id`, for exact update addressing when set
|
|
67
|
+
* from a loaded resource. Required for updates to platform-scoped
|
|
68
|
+
* (org-less) kinds, where the org+slug fallback cannot match. On
|
|
69
|
+
* create, the cloud server stamps its own id regardless; the OSS
|
|
70
|
+
* server honors a caller-supplied id (existing apply semantics).
|
|
71
|
+
*/
|
|
72
|
+
id?: string;
|
|
65
73
|
name: string;
|
|
66
74
|
slug?: string;
|
|
67
75
|
org: string;
|
|
@@ -106,6 +114,7 @@ export function buildArtifactProto(input: ArtifactInput): Artifact {
|
|
|
106
114
|
apiVersion: "agentic.stigmer.ai/v1",
|
|
107
115
|
kind: "Artifact",
|
|
108
116
|
metadata: Object.assign(create(ApiResourceMetadataSchema), {
|
|
117
|
+
...(input.id && { id: input.id }),
|
|
109
118
|
name: input.name,
|
|
110
119
|
org: input.org,
|
|
111
120
|
...(input.slug && { slug: input.slug }),
|
package/src/gen/channelapp.ts
CHANGED
|
@@ -9,7 +9,7 @@ import { ChannelAppSchema, type ChannelApp } from "@stigmer/protos/ai/stigmer/ag
|
|
|
9
9
|
import { ChannelAppCommandController } from "@stigmer/protos/ai/stigmer/agentic/channelapp/v1/command_pb";
|
|
10
10
|
import { ListChannelAppsByOrgInputSchema, ChannelAppsSchema, type ListChannelAppsByOrgInput, type ChannelApps } from "@stigmer/protos/ai/stigmer/agentic/channelapp/v1/io_pb";
|
|
11
11
|
import { ChannelAppQueryController } from "@stigmer/protos/ai/stigmer/agentic/channelapp/v1/query_pb";
|
|
12
|
-
import { ChannelAppSpecSchema, SlackChannelAppConfigSchema, WhatsAppChannelAppConfigSchema } from "@stigmer/protos/ai/stigmer/agentic/channelapp/v1/spec_pb";
|
|
12
|
+
import { ChannelAppSpecSchema, SlackChannelAppConfigSchema, WhatsAppChannelAppConfigSchema, type SlackChannelAppConfig, type WhatsAppChannelAppConfig } from "@stigmer/protos/ai/stigmer/agentic/channelapp/v1/spec_pb";
|
|
13
13
|
import { ApiResourceKind } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
|
|
14
14
|
import { ApiResourceVisibility } from "@stigmer/protos/ai/stigmer/commons/apiresource/enum_pb";
|
|
15
15
|
import { ApiResourceIdSchema, ApiResourceReferenceSchema, ApiResourceDeleteInputSchema } from "@stigmer/protos/ai/stigmer/commons/apiresource/io_pb";
|
|
@@ -74,6 +74,14 @@ export class ChannelAppClient {
|
|
|
74
74
|
|
|
75
75
|
/** Input for creating/updating a ChannelApp. */
|
|
76
76
|
export interface ChannelAppInput {
|
|
77
|
+
/**
|
|
78
|
+
* The resource's `metadata.id`, for exact update addressing when set
|
|
79
|
+
* from a loaded resource. Required for updates to platform-scoped
|
|
80
|
+
* (org-less) kinds, where the org+slug fallback cannot match. On
|
|
81
|
+
* create, the cloud server stamps its own id regardless; the OSS
|
|
82
|
+
* server honors a caller-supplied id (existing apply semantics).
|
|
83
|
+
*/
|
|
84
|
+
id?: string;
|
|
77
85
|
name: string;
|
|
78
86
|
slug?: string;
|
|
79
87
|
org: string;
|
|
@@ -127,6 +135,7 @@ export function buildChannelAppProto(input: ChannelAppInput): ChannelApp {
|
|
|
127
135
|
apiVersion: "agentic.stigmer.ai/v1",
|
|
128
136
|
kind: "ChannelApp",
|
|
129
137
|
metadata: Object.assign(create(ApiResourceMetadataSchema), {
|
|
138
|
+
...(input.id && { id: input.id }),
|
|
130
139
|
name: input.name,
|
|
131
140
|
org: input.org,
|
|
132
141
|
...(input.slug && { slug: input.slug }),
|
|
@@ -136,3 +145,50 @@ export function buildChannelAppProto(input: ChannelAppInput): ChannelApp {
|
|
|
136
145
|
spec,
|
|
137
146
|
}) as ChannelApp;
|
|
138
147
|
}
|
|
148
|
+
|
|
149
|
+
function toSlackChannelAppConfigInput(msg: SlackChannelAppConfig): SlackChannelAppConfigInput {
|
|
150
|
+
return {
|
|
151
|
+
clientId: msg.clientId || undefined,
|
|
152
|
+
clientSecret: msg.clientSecret || undefined,
|
|
153
|
+
signingSecret: msg.signingSecret || undefined,
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
function toWhatsAppChannelAppConfigInput(msg: WhatsAppChannelAppConfig): WhatsAppChannelAppConfigInput {
|
|
158
|
+
return {
|
|
159
|
+
appId: msg.appId || undefined,
|
|
160
|
+
appSecret: msg.appSecret || undefined,
|
|
161
|
+
accessToken: msg.accessToken || undefined,
|
|
162
|
+
verifyToken: msg.verifyToken || undefined,
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Maps a fetched {@link ChannelApp} to a complete {@link ChannelAppInput} for `update()`.
|
|
168
|
+
*
|
|
169
|
+
* The update RPC replaces the ENTIRE spec — spread this mapper's output
|
|
170
|
+
* and override only the fields you edit (spread nested objects the same
|
|
171
|
+
* way):
|
|
172
|
+
*
|
|
173
|
+
* await client.update({ ...toChannelAppUpdateInput(res), description: next });
|
|
174
|
+
*
|
|
175
|
+
* Proto3 defaults normalize to `undefined`; resource references keep
|
|
176
|
+
* `version` (pinned refs) and `kind`.
|
|
177
|
+
*/
|
|
178
|
+
export function toChannelAppUpdateInput(resource: ChannelApp): ChannelAppInput {
|
|
179
|
+
const meta = resource.metadata;
|
|
180
|
+
const spec = resource.spec ?? create(ChannelAppSpecSchema);
|
|
181
|
+
return {
|
|
182
|
+
// Exact update addressing (id-first in the update pipeline) — for
|
|
183
|
+
// platform-scoped (org-less) kinds the org+slug fallback cannot
|
|
184
|
+
// match, so the id is the ONLY working address.
|
|
185
|
+
id: meta?.id || undefined,
|
|
186
|
+
name: meta?.name ?? "",
|
|
187
|
+
slug: meta?.slug || undefined,
|
|
188
|
+
org: meta?.org ?? "",
|
|
189
|
+
labels: meta?.labels && Object.keys(meta.labels).length > 0 ? { ...meta.labels } : undefined,
|
|
190
|
+
visibility: meta?.visibility || undefined,
|
|
191
|
+
slack: spec.providerConfig?.case === "slack" ? toSlackChannelAppConfigInput(spec.providerConfig.value) : undefined,
|
|
192
|
+
whatsapp: spec.providerConfig?.case === "whatsapp" ? toWhatsAppChannelAppConfigInput(spec.providerConfig.value) : undefined,
|
|
193
|
+
};
|
|
194
|
+
}
|
package/src/gen/client.ts
CHANGED
|
@@ -16,6 +16,7 @@ import { IdentityAccountClient } from "./identityaccount.js";
|
|
|
16
16
|
import { IdentityProviderClient } from "./identityprovider.js";
|
|
17
17
|
import { InvitationClient } from "./invitation.js";
|
|
18
18
|
import { McpServerClient } from "./mcpserver.js";
|
|
19
|
+
import { MemoryClient } from "./memory.js";
|
|
19
20
|
import { OAuthAppClient } from "./oauthapp.js";
|
|
20
21
|
import { OrganizationClient } from "./organization.js";
|
|
21
22
|
import { PlatformClientClient } from "./platformclient.js";
|
|
@@ -44,6 +45,7 @@ export class GeneratedClient {
|
|
|
44
45
|
readonly identityProvider: IdentityProviderClient;
|
|
45
46
|
readonly invitation: InvitationClient;
|
|
46
47
|
readonly mcpServer: McpServerClient;
|
|
48
|
+
readonly memory: MemoryClient;
|
|
47
49
|
readonly oauthapp: OAuthAppClient;
|
|
48
50
|
readonly organization: OrganizationClient;
|
|
49
51
|
readonly platformclient: PlatformClientClient;
|
|
@@ -71,6 +73,7 @@ export class GeneratedClient {
|
|
|
71
73
|
this.identityProvider = new IdentityProviderClient(transport);
|
|
72
74
|
this.invitation = new InvitationClient(transport);
|
|
73
75
|
this.mcpServer = new McpServerClient(transport);
|
|
76
|
+
this.memory = new MemoryClient(transport);
|
|
74
77
|
this.oauthapp = new OAuthAppClient(transport);
|
|
75
78
|
this.organization = new OrganizationClient(transport);
|
|
76
79
|
this.platformclient = new PlatformClientClient(transport);
|
|
@@ -90,7 +93,7 @@ export { type AgentInput, type McpServerUsageInput, type ToolApprovalOverrideInp
|
|
|
90
93
|
export { AgentChannelClient } from "./agentchannel.js";
|
|
91
94
|
export { type AgentChannelInput, type SlackChannelConfigInput, type WhatsAppChannelConfigInput, type RunConfigInput } from "./agentchannel.js";
|
|
92
95
|
export { AgentExecutionClient } from "./agentexecution.js";
|
|
93
|
-
export { type AgentExecutionInput, type SessionSpecInput, type WorkspaceEntryInput, type WorkspaceSourceInput, type GitRepoSourceInput, type LocalPathSourceInput, type ExecutionConfigInput, type ContextManagementConfigInput, type AttachmentInput, type ConversationCatchupInput, type DeclaredPreferencesInput } from "./agentexecution.js";
|
|
96
|
+
export { type AgentExecutionInput, type SessionSpecInput, type WorkspaceEntryInput, type WorkspaceSourceInput, type GitRepoSourceInput, type LocalPathSourceInput, type ExecutionConfigInput, type ContextManagementConfigInput, type AttachmentInput, type ConversationCatchupInput, type DeclaredPreferencesInput, type RecalledMemoriesInput, type RecalledMemoryFactInput } from "./agentexecution.js";
|
|
94
97
|
export { AgentInstanceClient } from "./agentinstance.js";
|
|
95
98
|
export { type AgentInstanceInput } from "./agentinstance.js";
|
|
96
99
|
export { AgentShareClient } from "./agentshare.js";
|
|
@@ -115,6 +118,8 @@ export { InvitationClient } from "./invitation.js";
|
|
|
115
118
|
export { type InvitationInput } from "./invitation.js";
|
|
116
119
|
export { McpServerClient } from "./mcpserver.js";
|
|
117
120
|
export { type McpServerInput, type StdioServerConfigInput, type HttpServerConfigInput, type ToolApprovalPolicyInput, type McpServerAuthInput } from "./mcpserver.js";
|
|
121
|
+
export { MemoryClient } from "./memory.js";
|
|
122
|
+
export { type MemoryInput, type MemoryProvenanceInput } from "./memory.js";
|
|
118
123
|
export { OAuthAppClient } from "./oauthapp.js";
|
|
119
124
|
export { type OAuthAppInput } from "./oauthapp.js";
|
|
120
125
|
export { OrganizationClient } from "./organization.js";
|
package/src/gen/environment.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Code generated by stigmer-codegen. DO NOT EDIT.
|
|
2
2
|
|
|
3
3
|
import { wrapError } from "./errors.js";
|
|
4
|
-
import { stripUndefined } from "./proto-utils.js";
|
|
4
|
+
import { stripUndefined, toEnvVarInputMap } from "./proto-utils.js";
|
|
5
5
|
import { type DeleteResourceInput, type ResourceRef, type EnvVarInput } from "./types.js";
|
|
6
6
|
import { create } from "@bufbuild/protobuf";
|
|
7
7
|
import { createClient, type Client, type Transport } from "@connectrpc/connect";
|
|
@@ -98,6 +98,14 @@ export class EnvironmentClient {
|
|
|
98
98
|
|
|
99
99
|
/** Input for creating/updating a Environment. */
|
|
100
100
|
export interface EnvironmentInput {
|
|
101
|
+
/**
|
|
102
|
+
* The resource's `metadata.id`, for exact update addressing when set
|
|
103
|
+
* from a loaded resource. Required for updates to platform-scoped
|
|
104
|
+
* (org-less) kinds, where the org+slug fallback cannot match. On
|
|
105
|
+
* create, the cloud server stamps its own id regardless; the OSS
|
|
106
|
+
* server honors a caller-supplied id (existing apply semantics).
|
|
107
|
+
*/
|
|
108
|
+
id?: string;
|
|
101
109
|
name: string;
|
|
102
110
|
slug?: string;
|
|
103
111
|
org: string;
|
|
@@ -117,6 +125,7 @@ export function buildEnvironmentProto(input: EnvironmentInput): Environment {
|
|
|
117
125
|
apiVersion: "agentic.stigmer.ai/v1",
|
|
118
126
|
kind: "Environment",
|
|
119
127
|
metadata: Object.assign(create(ApiResourceMetadataSchema), {
|
|
128
|
+
...(input.id && { id: input.id }),
|
|
120
129
|
name: input.name,
|
|
121
130
|
org: input.org,
|
|
122
131
|
...(input.slug && { slug: input.slug }),
|
|
@@ -129,3 +138,33 @@ export function buildEnvironmentProto(input: EnvironmentInput): Environment {
|
|
|
129
138
|
})),
|
|
130
139
|
}) as Environment;
|
|
131
140
|
}
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Maps a fetched {@link Environment} to a complete {@link EnvironmentInput} for `update()`.
|
|
144
|
+
*
|
|
145
|
+
* The update RPC replaces the ENTIRE spec — spread this mapper's output
|
|
146
|
+
* and override only the fields you edit (spread nested objects the same
|
|
147
|
+
* way):
|
|
148
|
+
*
|
|
149
|
+
* await client.update({ ...toEnvironmentUpdateInput(res), description: next });
|
|
150
|
+
*
|
|
151
|
+
* Proto3 defaults normalize to `undefined`; resource references keep
|
|
152
|
+
* `version` (pinned refs) and `kind`.
|
|
153
|
+
*/
|
|
154
|
+
export function toEnvironmentUpdateInput(resource: Environment): EnvironmentInput {
|
|
155
|
+
const meta = resource.metadata;
|
|
156
|
+
const spec = resource.spec ?? create(EnvironmentSpecSchema);
|
|
157
|
+
return {
|
|
158
|
+
// Exact update addressing (id-first in the update pipeline) — for
|
|
159
|
+
// platform-scoped (org-less) kinds the org+slug fallback cannot
|
|
160
|
+
// match, so the id is the ONLY working address.
|
|
161
|
+
id: meta?.id || undefined,
|
|
162
|
+
name: meta?.name ?? "",
|
|
163
|
+
slug: meta?.slug || undefined,
|
|
164
|
+
org: meta?.org ?? "",
|
|
165
|
+
labels: meta?.labels && Object.keys(meta.labels).length > 0 ? { ...meta.labels } : undefined,
|
|
166
|
+
visibility: meta?.visibility || undefined,
|
|
167
|
+
description: spec.description || undefined,
|
|
168
|
+
data: toEnvVarInputMap(spec.data),
|
|
169
|
+
};
|
|
170
|
+
}
|
|
@@ -68,6 +68,14 @@ export class ExecutionContextClient {
|
|
|
68
68
|
|
|
69
69
|
/** Input for creating/updating a ExecutionContext. */
|
|
70
70
|
export interface ExecutionContextInput {
|
|
71
|
+
/**
|
|
72
|
+
* The resource's `metadata.id`, for exact update addressing when set
|
|
73
|
+
* from a loaded resource. Required for updates to platform-scoped
|
|
74
|
+
* (org-less) kinds, where the org+slug fallback cannot match. On
|
|
75
|
+
* create, the cloud server stamps its own id regardless; the OSS
|
|
76
|
+
* server honors a caller-supplied id (existing apply semantics).
|
|
77
|
+
*/
|
|
78
|
+
id?: string;
|
|
71
79
|
name: string;
|
|
72
80
|
slug?: string;
|
|
73
81
|
org: string;
|
|
@@ -87,6 +95,7 @@ export function buildExecutionContextProto(input: ExecutionContextInput): Execut
|
|
|
87
95
|
apiVersion: "agentic.stigmer.ai/v1",
|
|
88
96
|
kind: "ExecutionContext",
|
|
89
97
|
metadata: Object.assign(create(ApiResourceMetadataSchema), {
|
|
98
|
+
...(input.id && { id: input.id }),
|
|
90
99
|
name: input.name,
|
|
91
100
|
org: input.org,
|
|
92
101
|
...(input.slug && { slug: input.slug }),
|
package/src/gen/iampolicy.ts
CHANGED
|
@@ -109,6 +109,14 @@ export class IamPolicyClient {
|
|
|
109
109
|
|
|
110
110
|
/** Input for creating/updating a IamPolicy. */
|
|
111
111
|
export interface IamPolicyInput {
|
|
112
|
+
/**
|
|
113
|
+
* The resource's `metadata.id`, for exact update addressing when set
|
|
114
|
+
* from a loaded resource. Required for updates to platform-scoped
|
|
115
|
+
* (org-less) kinds, where the org+slug fallback cannot match. On
|
|
116
|
+
* create, the cloud server stamps its own id regardless; the OSS
|
|
117
|
+
* server honors a caller-supplied id (existing apply semantics).
|
|
118
|
+
*/
|
|
119
|
+
id?: string;
|
|
112
120
|
name: string;
|
|
113
121
|
slug?: string;
|
|
114
122
|
org: string;
|
|
@@ -141,6 +149,7 @@ export function buildIamPolicyProto(input: IamPolicyInput): IamPolicy {
|
|
|
141
149
|
apiVersion: "iam.stigmer.ai/v1",
|
|
142
150
|
kind: "IamPolicy",
|
|
143
151
|
metadata: Object.assign(create(ApiResourceMetadataSchema), {
|
|
152
|
+
...(input.id && { id: input.id }),
|
|
144
153
|
name: input.name,
|
|
145
154
|
org: input.org,
|
|
146
155
|
...(input.slug && { slug: input.slug }),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Code generated by stigmer-codegen. DO NOT EDIT.
|
|
2
2
|
|
|
3
3
|
import { wrapError } from "./errors.js";
|
|
4
|
-
import { stripUndefined } from "./proto-utils.js";
|
|
4
|
+
import { stripUndefined, toResourceRefInput } from "./proto-utils.js";
|
|
5
5
|
import { type ResourceRef } from "./types.js";
|
|
6
6
|
import { create } from "@bufbuild/protobuf";
|
|
7
7
|
import { EmptySchema } from "@bufbuild/protobuf/wkt";
|
|
@@ -15,7 +15,7 @@ import { IdentityAccountCommandController } from "@stigmer/protos/ai/stigmer/iam
|
|
|
15
15
|
import { IdentityAccountProvisioningMode } from "@stigmer/protos/ai/stigmer/iam/identityaccount/v1/enum_pb";
|
|
16
16
|
import { IdentityAccountIdSchema, CreateFederatedAccountInputSchema, UpdateFederatedAccountInputSchema, DeprovisionFederatedAccountInputSchema, IdentityAccountEmailSchema, IdpIdSchema, ExternalSubLookupSchema, type CreateFederatedAccountInput, type UpdateFederatedAccountInput, type DeprovisionFederatedAccountInput, type IdentityAccountEmail, type ExternalSubLookup } from "@stigmer/protos/ai/stigmer/iam/identityaccount/v1/io_pb";
|
|
17
17
|
import { IdentityAccountQueryController } from "@stigmer/protos/ai/stigmer/iam/identityaccount/v1/query_pb";
|
|
18
|
-
import { IdentityAccountSpecSchema, IdentityAccountPreferencesSchema } from "@stigmer/protos/ai/stigmer/iam/identityaccount/v1/spec_pb";
|
|
18
|
+
import { IdentityAccountSpecSchema, IdentityAccountPreferencesSchema, type IdentityAccountPreferences } from "@stigmer/protos/ai/stigmer/iam/identityaccount/v1/spec_pb";
|
|
19
19
|
|
|
20
20
|
/** Provides operations on identityaccount resources. */
|
|
21
21
|
export class IdentityAccountClient {
|
|
@@ -108,6 +108,14 @@ export class IdentityAccountClient {
|
|
|
108
108
|
|
|
109
109
|
/** Input for creating/updating a IdentityAccount. */
|
|
110
110
|
export interface IdentityAccountInput {
|
|
111
|
+
/**
|
|
112
|
+
* The resource's `metadata.id`, for exact update addressing when set
|
|
113
|
+
* from a loaded resource. Required for updates to platform-scoped
|
|
114
|
+
* (org-less) kinds, where the org+slug fallback cannot match. On
|
|
115
|
+
* create, the cloud server stamps its own id regardless; the OSS
|
|
116
|
+
* server honors a caller-supplied id (existing apply semantics).
|
|
117
|
+
*/
|
|
118
|
+
id?: string;
|
|
111
119
|
name: string;
|
|
112
120
|
slug?: string;
|
|
113
121
|
org: string;
|
|
@@ -130,6 +138,7 @@ export interface IdentityAccountPreferencesInput {
|
|
|
130
138
|
defaultHarness?: string;
|
|
131
139
|
defaultNativeModel?: string;
|
|
132
140
|
defaultCursorModel?: string;
|
|
141
|
+
memoryEnabled?: boolean;
|
|
133
142
|
}
|
|
134
143
|
|
|
135
144
|
function buildIdentityAccountPreferencesProto(input: IdentityAccountPreferencesInput) {
|
|
@@ -138,6 +147,7 @@ function buildIdentityAccountPreferencesProto(input: IdentityAccountPreferencesI
|
|
|
138
147
|
defaultHarness: input.defaultHarness,
|
|
139
148
|
defaultNativeModel: input.defaultNativeModel,
|
|
140
149
|
defaultCursorModel: input.defaultCursorModel,
|
|
150
|
+
memoryEnabled: input.memoryEnabled,
|
|
141
151
|
}));
|
|
142
152
|
}
|
|
143
153
|
|
|
@@ -148,6 +158,7 @@ export function buildIdentityAccountProto(input: IdentityAccountInput): Identity
|
|
|
148
158
|
apiVersion: "iam.stigmer.ai/v1",
|
|
149
159
|
kind: "IdentityAccount",
|
|
150
160
|
metadata: Object.assign(create(ApiResourceMetadataSchema), {
|
|
161
|
+
...(input.id && { id: input.id }),
|
|
151
162
|
name: input.name,
|
|
152
163
|
org: input.org,
|
|
153
164
|
...(input.slug && { slug: input.slug }),
|
|
@@ -167,3 +178,50 @@ export function buildIdentityAccountProto(input: IdentityAccountInput): Identity
|
|
|
167
178
|
})),
|
|
168
179
|
}) as IdentityAccount;
|
|
169
180
|
}
|
|
181
|
+
|
|
182
|
+
function toIdentityAccountPreferencesInput(msg: IdentityAccountPreferences): IdentityAccountPreferencesInput {
|
|
183
|
+
return {
|
|
184
|
+
standingContext: msg.standingContext || undefined,
|
|
185
|
+
defaultHarness: msg.defaultHarness || undefined,
|
|
186
|
+
defaultNativeModel: msg.defaultNativeModel || undefined,
|
|
187
|
+
defaultCursorModel: msg.defaultCursorModel || undefined,
|
|
188
|
+
memoryEnabled: msg.memoryEnabled || undefined,
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* Maps a fetched {@link IdentityAccount} to a complete {@link IdentityAccountInput} for `update()`.
|
|
194
|
+
*
|
|
195
|
+
* The update RPC replaces the ENTIRE spec — spread this mapper's output
|
|
196
|
+
* and override only the fields you edit (spread nested objects the same
|
|
197
|
+
* way):
|
|
198
|
+
*
|
|
199
|
+
* await client.update({ ...toIdentityAccountUpdateInput(res), description: next });
|
|
200
|
+
*
|
|
201
|
+
* Proto3 defaults normalize to `undefined`; resource references keep
|
|
202
|
+
* `version` (pinned refs) and `kind`.
|
|
203
|
+
*/
|
|
204
|
+
export function toIdentityAccountUpdateInput(resource: IdentityAccount): IdentityAccountInput {
|
|
205
|
+
const meta = resource.metadata;
|
|
206
|
+
const spec = resource.spec ?? create(IdentityAccountSpecSchema);
|
|
207
|
+
return {
|
|
208
|
+
// Exact update addressing (id-first in the update pipeline) — for
|
|
209
|
+
// platform-scoped (org-less) kinds the org+slug fallback cannot
|
|
210
|
+
// match, so the id is the ONLY working address.
|
|
211
|
+
id: meta?.id || undefined,
|
|
212
|
+
name: meta?.name ?? "",
|
|
213
|
+
slug: meta?.slug || undefined,
|
|
214
|
+
org: meta?.org ?? "",
|
|
215
|
+
labels: meta?.labels && Object.keys(meta.labels).length > 0 ? { ...meta.labels } : undefined,
|
|
216
|
+
visibility: meta?.visibility || undefined,
|
|
217
|
+
idpId: spec.idpId ?? "",
|
|
218
|
+
email: spec.email || undefined,
|
|
219
|
+
firstName: spec.firstName || undefined,
|
|
220
|
+
lastName: spec.lastName || undefined,
|
|
221
|
+
pictureUrl: spec.pictureUrl || undefined,
|
|
222
|
+
isMachineAccount: spec.isMachineAccount || undefined,
|
|
223
|
+
provisioningMode: spec.provisioningMode || undefined,
|
|
224
|
+
identityProviderRef: toResourceRefInput(spec.identityProviderRef),
|
|
225
|
+
preferences: spec.preferences ? toIdentityAccountPreferencesInput(spec.preferences) : undefined,
|
|
226
|
+
};
|
|
227
|
+
}
|
|
@@ -81,6 +81,14 @@ export class IdentityProviderClient {
|
|
|
81
81
|
|
|
82
82
|
/** Input for creating/updating a IdentityProvider. */
|
|
83
83
|
export interface IdentityProviderInput {
|
|
84
|
+
/**
|
|
85
|
+
* The resource's `metadata.id`, for exact update addressing when set
|
|
86
|
+
* from a loaded resource. Required for updates to platform-scoped
|
|
87
|
+
* (org-less) kinds, where the org+slug fallback cannot match. On
|
|
88
|
+
* create, the cloud server stamps its own id regardless; the OSS
|
|
89
|
+
* server honors a caller-supplied id (existing apply semantics).
|
|
90
|
+
*/
|
|
91
|
+
id?: string;
|
|
84
92
|
name: string;
|
|
85
93
|
slug?: string;
|
|
86
94
|
org: string;
|
|
@@ -105,6 +113,7 @@ export function buildIdentityProviderProto(input: IdentityProviderInput): Identi
|
|
|
105
113
|
apiVersion: "iam.stigmer.ai/v1",
|
|
106
114
|
kind: "IdentityProvider",
|
|
107
115
|
metadata: Object.assign(create(ApiResourceMetadataSchema), {
|
|
116
|
+
...(input.id && { id: input.id }),
|
|
108
117
|
name: input.name,
|
|
109
118
|
org: input.org,
|
|
110
119
|
...(input.slug && { slug: input.slug }),
|
|
@@ -127,3 +136,43 @@ export function buildIdentityProviderProto(input: IdentityProviderInput): Identi
|
|
|
127
136
|
})),
|
|
128
137
|
}) as IdentityProvider;
|
|
129
138
|
}
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Maps a fetched {@link IdentityProvider} to a complete {@link IdentityProviderInput} for `update()`.
|
|
142
|
+
*
|
|
143
|
+
* The update RPC replaces the ENTIRE spec — spread this mapper's output
|
|
144
|
+
* and override only the fields you edit (spread nested objects the same
|
|
145
|
+
* way):
|
|
146
|
+
*
|
|
147
|
+
* await client.update({ ...toIdentityProviderUpdateInput(res), description: next });
|
|
148
|
+
*
|
|
149
|
+
* Proto3 defaults normalize to `undefined`; resource references keep
|
|
150
|
+
* `version` (pinned refs) and `kind`.
|
|
151
|
+
*/
|
|
152
|
+
export function toIdentityProviderUpdateInput(resource: IdentityProvider): IdentityProviderInput {
|
|
153
|
+
const meta = resource.metadata;
|
|
154
|
+
const spec = resource.spec ?? create(IdentityProviderSpecSchema);
|
|
155
|
+
return {
|
|
156
|
+
// Exact update addressing (id-first in the update pipeline) — for
|
|
157
|
+
// platform-scoped (org-less) kinds the org+slug fallback cannot
|
|
158
|
+
// match, so the id is the ONLY working address.
|
|
159
|
+
id: meta?.id || undefined,
|
|
160
|
+
name: meta?.name ?? "",
|
|
161
|
+
slug: meta?.slug || undefined,
|
|
162
|
+
org: meta?.org ?? "",
|
|
163
|
+
labels: meta?.labels && Object.keys(meta.labels).length > 0 ? { ...meta.labels } : undefined,
|
|
164
|
+
visibility: meta?.visibility || undefined,
|
|
165
|
+
displayName: spec.displayName || undefined,
|
|
166
|
+
jwksUri: spec.jwksUri || undefined,
|
|
167
|
+
allowedIssuers: spec.allowedIssuers?.length ? [...spec.allowedIssuers] : undefined,
|
|
168
|
+
expectedAudience: spec.expectedAudience || undefined,
|
|
169
|
+
rateLimitBudget: spec.rateLimitBudget || undefined,
|
|
170
|
+
userinfoEndpoint: spec.userinfoEndpoint || undefined,
|
|
171
|
+
isSsoProvider: spec.isSsoProvider || undefined,
|
|
172
|
+
oidcClientId: spec.oidcClientId || undefined,
|
|
173
|
+
autoProvisionAccounts: spec.autoProvisionAccounts || undefined,
|
|
174
|
+
autoGrantOnOrg: spec.autoGrantOnOrg || undefined,
|
|
175
|
+
autoGrantRole: spec.autoGrantRole || undefined,
|
|
176
|
+
tenantOrgClaim: spec.tenantOrgClaim || undefined,
|
|
177
|
+
};
|
|
178
|
+
}
|
package/src/gen/invitation.ts
CHANGED
|
@@ -62,6 +62,14 @@ export class InvitationClient {
|
|
|
62
62
|
|
|
63
63
|
/** Input for creating/updating a Invitation. */
|
|
64
64
|
export interface InvitationInput {
|
|
65
|
+
/**
|
|
66
|
+
* The resource's `metadata.id`, for exact update addressing when set
|
|
67
|
+
* from a loaded resource. Required for updates to platform-scoped
|
|
68
|
+
* (org-less) kinds, where the org+slug fallback cannot match. On
|
|
69
|
+
* create, the cloud server stamps its own id regardless; the OSS
|
|
70
|
+
* server honors a caller-supplied id (existing apply semantics).
|
|
71
|
+
*/
|
|
72
|
+
id?: string;
|
|
65
73
|
name: string;
|
|
66
74
|
slug?: string;
|
|
67
75
|
org: string;
|
|
@@ -79,6 +87,7 @@ export function buildInvitationProto(input: InvitationInput): Invitation {
|
|
|
79
87
|
apiVersion: "iam.stigmer.ai/v1",
|
|
80
88
|
kind: "Invitation",
|
|
81
89
|
metadata: Object.assign(create(ApiResourceMetadataSchema), {
|
|
90
|
+
...(input.id && { id: input.id }),
|
|
82
91
|
name: input.name,
|
|
83
92
|
org: input.org,
|
|
84
93
|
...(input.slug && { slug: input.slug }),
|