@stigmer/sdk 3.12.5 → 3.12.6
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 +791 -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/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 +23 -1
- package/gen/agentexecution.d.ts.map +1 -1
- package/gen/agentexecution.js +146 -1
- 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/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 +21 -0
- package/gen/identityaccount.d.ts.map +1 -1
- package/gen/identityaccount.js +46 -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/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 +21 -0
- package/gen/organization.d.ts.map +1 -1
- package/gen/organization.js +41 -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 +20 -21
- package/index.d.ts.map +1 -1
- package/index.js +24 -23
- package/index.js.map +1 -1
- package/package.json +2 -2
- package/src/__tests__/update-input-roundtrip.test.ts +1031 -0
- package/src/__tests__/update-input.test.ts +34 -3
- package/src/gen/agent.ts +89 -3
- package/src/gen/agentchannel.ts +72 -4
- package/src/gen/agentexecution.ts +172 -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/environment.ts +40 -1
- package/src/gen/executioncontext.ts +9 -0
- package/src/gen/iampolicy.ts +9 -0
- package/src/gen/identityaccount.ts +57 -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/oauthapp.ts +48 -0
- package/src/gen/organization.ts +52 -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 +24 -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/update-input.ts
DELETED
|
@@ -1,168 +0,0 @@
|
|
|
1
|
-
// Complete update-input mappers.
|
|
2
|
-
//
|
|
3
|
-
// The platform's update RPCs are FULL-SPEC REPLACEMENTS: the request spec
|
|
4
|
-
// wholesale overwrites the stored spec (both editions; only a small
|
|
5
|
-
// server-side preserve list of immutable identifiers survives). A client
|
|
6
|
-
// that sends only the fields it edits therefore silently WIPES every other
|
|
7
|
-
// mutable spec field — a data-loss bug class, not a single bug
|
|
8
|
-
// (stigmer/stigmer#293 Phase 1 surfaced it when `spec.preferences` set via
|
|
9
|
-
// CLI was dropped by a console profile save).
|
|
10
|
-
//
|
|
11
|
-
// These mappers are the structural fix: they convert a LOADED resource into
|
|
12
|
-
// a complete `*Input` for the generated update builders. Editors spread the
|
|
13
|
-
// mapper output and override only the fields they edit:
|
|
14
|
-
//
|
|
15
|
-
// await update({ ...toOrganizationUpdateInput(org), description: next });
|
|
16
|
-
//
|
|
17
|
-
// The `CompleteInput` mapped type removes optionality from every Input key,
|
|
18
|
-
// so when codegen adds a new Input field, compilation fails HERE — the one
|
|
19
|
-
// place a human must decide how the new field round-trips — instead of the
|
|
20
|
-
// field silently wiping in every subset-editing form.
|
|
21
|
-
//
|
|
22
|
-
// NESTED MESSAGE RULE: `CompleteInput` only sees TOP-LEVEL keys — a nested
|
|
23
|
-
// message (e.g. `preferences`) is one key whose object literal would keep
|
|
24
|
-
// compiling when codegen adds fields INSIDE it, recreating the wipe bug one
|
|
25
|
-
// level down. Every nested-message literal in this file must therefore be
|
|
26
|
-
// built by a dedicated `toXxxInput` helper whose return literal is itself
|
|
27
|
-
// typed `CompleteInput<XxxInput>`. Editors that override a nested message
|
|
28
|
-
// must spread the mapper's complete value and override only their fields:
|
|
29
|
-
//
|
|
30
|
-
// preferences: { ...mapped.preferences, standingContext: next }
|
|
31
|
-
|
|
32
|
-
import type { ApiResourceReference } from "@stigmer/protos/ai/stigmer/commons/apiresource/io_pb";
|
|
33
|
-
import type { IdentityAccount } from "@stigmer/protos/ai/stigmer/iam/identityaccount/v1/api_pb";
|
|
34
|
-
import type { IdentityAccountPreferences } from "@stigmer/protos/ai/stigmer/iam/identityaccount/v1/spec_pb";
|
|
35
|
-
import type { Organization } from "@stigmer/protos/ai/stigmer/tenancy/organization/v1/api_pb";
|
|
36
|
-
import type { OrganizationPreferences } from "@stigmer/protos/ai/stigmer/tenancy/organization/v1/spec_pb";
|
|
37
|
-
import type {
|
|
38
|
-
IdentityAccountInput,
|
|
39
|
-
IdentityAccountPreferencesInput,
|
|
40
|
-
} from "./gen/identityaccount.js";
|
|
41
|
-
import type {
|
|
42
|
-
OrganizationInput,
|
|
43
|
-
OrganizationPreferencesInput,
|
|
44
|
-
} from "./gen/organization.js";
|
|
45
|
-
import type { ResourceRef } from "./gen/types.js";
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* Every key of `T`, required to be present. Optional keys keep their
|
|
49
|
-
* `| undefined` value type (explicit `undefined` is stripped by the proto
|
|
50
|
-
* builders), so a mapper cannot compile while omitting an Input field.
|
|
51
|
-
*
|
|
52
|
-
* Mapping over `keyof Required<T>` (instead of a homomorphic `-?` map)
|
|
53
|
-
* is deliberate: `-?` would also strip `undefined` from optional value
|
|
54
|
-
* types, forcing fake values for genuinely absent fields.
|
|
55
|
-
*/
|
|
56
|
-
type CompleteInput<T> = { [K in keyof Required<T>]: T[K] };
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* Maps a loaded {@link Organization} to a complete {@link OrganizationInput}
|
|
60
|
-
* for `organization.update()`.
|
|
61
|
-
*
|
|
62
|
-
* Proto3 scalar defaults (empty string, `false`, enum `0`) are normalized to
|
|
63
|
-
* `undefined` — omitting them is wire-identical to sending the default, and
|
|
64
|
-
* it keeps the built proto in the builders' canonical shape.
|
|
65
|
-
*/
|
|
66
|
-
export function toOrganizationUpdateInput(
|
|
67
|
-
org: Organization,
|
|
68
|
-
): OrganizationInput {
|
|
69
|
-
const input: CompleteInput<OrganizationInput> = {
|
|
70
|
-
name: org.metadata?.name ?? "",
|
|
71
|
-
slug: org.metadata?.slug || undefined,
|
|
72
|
-
org: org.metadata?.org || org.metadata?.slug || "",
|
|
73
|
-
labels: nonEmptyLabels(org.metadata?.labels),
|
|
74
|
-
visibility: org.metadata?.visibility || undefined,
|
|
75
|
-
description: org.spec?.description || undefined,
|
|
76
|
-
logoUrl: org.spec?.logoUrl || undefined,
|
|
77
|
-
managementMode: org.spec?.managementMode || undefined,
|
|
78
|
-
identityProviderRef: toResourceRef(org.spec?.identityProviderRef),
|
|
79
|
-
externalOrgId: org.spec?.externalOrgId || undefined,
|
|
80
|
-
isPersonal: org.spec?.isPersonal || undefined,
|
|
81
|
-
preferences: org.spec?.preferences
|
|
82
|
-
? toOrganizationPreferencesInput(org.spec.preferences)
|
|
83
|
-
: undefined,
|
|
84
|
-
};
|
|
85
|
-
return input;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
/**
|
|
89
|
-
* Maps loaded {@link OrganizationPreferences} to a complete
|
|
90
|
-
* {@link OrganizationPreferencesInput} (nested-message rule above).
|
|
91
|
-
*/
|
|
92
|
-
function toOrganizationPreferencesInput(
|
|
93
|
-
preferences: OrganizationPreferences,
|
|
94
|
-
): OrganizationPreferencesInput {
|
|
95
|
-
const input: CompleteInput<OrganizationPreferencesInput> = {
|
|
96
|
-
standingContext: preferences.standingContext || undefined,
|
|
97
|
-
};
|
|
98
|
-
return input;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
/**
|
|
102
|
-
* Maps a loaded {@link IdentityAccount} to a complete
|
|
103
|
-
* {@link IdentityAccountInput} for `identityAccount.update()`.
|
|
104
|
-
*
|
|
105
|
-
* The generated builder never sets `metadata.id`; the update pipeline
|
|
106
|
-
* locates the resource by org + slug instead (and authorizes against the
|
|
107
|
-
* loaded resource's id), so carrying `org` and `slug` here is what makes
|
|
108
|
-
* the update addressable.
|
|
109
|
-
*/
|
|
110
|
-
export function toIdentityAccountUpdateInput(
|
|
111
|
-
account: IdentityAccount,
|
|
112
|
-
): IdentityAccountInput {
|
|
113
|
-
const input: CompleteInput<IdentityAccountInput> = {
|
|
114
|
-
name: account.metadata?.name ?? "",
|
|
115
|
-
slug: account.metadata?.slug || undefined,
|
|
116
|
-
org: account.metadata?.org ?? "",
|
|
117
|
-
labels: nonEmptyLabels(account.metadata?.labels),
|
|
118
|
-
visibility: account.metadata?.visibility || undefined,
|
|
119
|
-
idpId: account.spec?.idpId ?? "",
|
|
120
|
-
email: account.spec?.email || undefined,
|
|
121
|
-
firstName: account.spec?.firstName || undefined,
|
|
122
|
-
lastName: account.spec?.lastName || undefined,
|
|
123
|
-
pictureUrl: account.spec?.pictureUrl || undefined,
|
|
124
|
-
isMachineAccount: account.spec?.isMachineAccount || undefined,
|
|
125
|
-
provisioningMode: account.spec?.provisioningMode || undefined,
|
|
126
|
-
identityProviderRef: toResourceRef(account.spec?.identityProviderRef),
|
|
127
|
-
preferences: account.spec?.preferences
|
|
128
|
-
? toIdentityAccountPreferencesInput(account.spec.preferences)
|
|
129
|
-
: undefined,
|
|
130
|
-
};
|
|
131
|
-
return input;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
/**
|
|
135
|
-
* Maps loaded {@link IdentityAccountPreferences} to a complete
|
|
136
|
-
* {@link IdentityAccountPreferencesInput} (nested-message rule above).
|
|
137
|
-
*/
|
|
138
|
-
function toIdentityAccountPreferencesInput(
|
|
139
|
-
preferences: IdentityAccountPreferences,
|
|
140
|
-
): IdentityAccountPreferencesInput {
|
|
141
|
-
const input: CompleteInput<IdentityAccountPreferencesInput> = {
|
|
142
|
-
standingContext: preferences.standingContext || undefined,
|
|
143
|
-
defaultHarness: preferences.defaultHarness || undefined,
|
|
144
|
-
defaultNativeModel: preferences.defaultNativeModel || undefined,
|
|
145
|
-
defaultCursorModel: preferences.defaultCursorModel || undefined,
|
|
146
|
-
};
|
|
147
|
-
return input;
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
function nonEmptyLabels(
|
|
151
|
-
labels: Record<string, string> | undefined,
|
|
152
|
-
): Record<string, string> | undefined {
|
|
153
|
-
return labels && Object.keys(labels).length > 0 ? labels : undefined;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
function toResourceRef(
|
|
157
|
-
ref: ApiResourceReference | undefined,
|
|
158
|
-
): ResourceRef | undefined {
|
|
159
|
-
// The builders treat a ref without org and slug as absent; mirror that so
|
|
160
|
-
// an empty message round-trips to "no reference".
|
|
161
|
-
if (!ref || (!ref.org && !ref.slug)) return undefined;
|
|
162
|
-
return {
|
|
163
|
-
org: ref.org,
|
|
164
|
-
slug: ref.slug,
|
|
165
|
-
...(ref.version && { version: ref.version }),
|
|
166
|
-
...(ref.kind && { kind: ref.kind }),
|
|
167
|
-
};
|
|
168
|
-
}
|
package/update-input.d.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { IdentityAccount } from "@stigmer/protos/ai/stigmer/iam/identityaccount/v1/api_pb";
|
|
2
|
-
import type { Organization } from "@stigmer/protos/ai/stigmer/tenancy/organization/v1/api_pb";
|
|
3
|
-
import type { IdentityAccountInput } from "./gen/identityaccount.js";
|
|
4
|
-
import type { OrganizationInput } from "./gen/organization.js";
|
|
5
|
-
/**
|
|
6
|
-
* Maps a loaded {@link Organization} to a complete {@link OrganizationInput}
|
|
7
|
-
* for `organization.update()`.
|
|
8
|
-
*
|
|
9
|
-
* Proto3 scalar defaults (empty string, `false`, enum `0`) are normalized to
|
|
10
|
-
* `undefined` — omitting them is wire-identical to sending the default, and
|
|
11
|
-
* it keeps the built proto in the builders' canonical shape.
|
|
12
|
-
*/
|
|
13
|
-
export declare function toOrganizationUpdateInput(org: Organization): OrganizationInput;
|
|
14
|
-
/**
|
|
15
|
-
* Maps a loaded {@link IdentityAccount} to a complete
|
|
16
|
-
* {@link IdentityAccountInput} for `identityAccount.update()`.
|
|
17
|
-
*
|
|
18
|
-
* The generated builder never sets `metadata.id`; the update pipeline
|
|
19
|
-
* locates the resource by org + slug instead (and authorizes against the
|
|
20
|
-
* loaded resource's id), so carrying `org` and `slug` here is what makes
|
|
21
|
-
* the update addressable.
|
|
22
|
-
*/
|
|
23
|
-
export declare function toIdentityAccountUpdateInput(account: IdentityAccount): IdentityAccountInput;
|
|
24
|
-
//# sourceMappingURL=update-input.d.ts.map
|
package/update-input.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"update-input.d.ts","sourceRoot":"","sources":["../src/update-input.ts"],"names":[],"mappings":"AAgCA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0DAA0D,CAAC;AAEhG,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2DAA2D,CAAC;AAE9F,OAAO,KAAK,EACV,oBAAoB,EAErB,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EACV,iBAAiB,EAElB,MAAM,uBAAuB,CAAC;AAc/B;;;;;;;GAOG;AACH,wBAAgB,yBAAyB,CACvC,GAAG,EAAE,YAAY,GAChB,iBAAiB,CAkBnB;AAeD;;;;;;;;GAQG;AACH,wBAAgB,4BAA4B,CAC1C,OAAO,EAAE,eAAe,GACvB,oBAAoB,CAoBtB"}
|
package/update-input.js
DELETED
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
// Complete update-input mappers.
|
|
2
|
-
//
|
|
3
|
-
// The platform's update RPCs are FULL-SPEC REPLACEMENTS: the request spec
|
|
4
|
-
// wholesale overwrites the stored spec (both editions; only a small
|
|
5
|
-
// server-side preserve list of immutable identifiers survives). A client
|
|
6
|
-
// that sends only the fields it edits therefore silently WIPES every other
|
|
7
|
-
// mutable spec field — a data-loss bug class, not a single bug
|
|
8
|
-
// (stigmer/stigmer#293 Phase 1 surfaced it when `spec.preferences` set via
|
|
9
|
-
// CLI was dropped by a console profile save).
|
|
10
|
-
//
|
|
11
|
-
// These mappers are the structural fix: they convert a LOADED resource into
|
|
12
|
-
// a complete `*Input` for the generated update builders. Editors spread the
|
|
13
|
-
// mapper output and override only the fields they edit:
|
|
14
|
-
//
|
|
15
|
-
// await update({ ...toOrganizationUpdateInput(org), description: next });
|
|
16
|
-
//
|
|
17
|
-
// The `CompleteInput` mapped type removes optionality from every Input key,
|
|
18
|
-
// so when codegen adds a new Input field, compilation fails HERE — the one
|
|
19
|
-
// place a human must decide how the new field round-trips — instead of the
|
|
20
|
-
// field silently wiping in every subset-editing form.
|
|
21
|
-
//
|
|
22
|
-
// NESTED MESSAGE RULE: `CompleteInput` only sees TOP-LEVEL keys — a nested
|
|
23
|
-
// message (e.g. `preferences`) is one key whose object literal would keep
|
|
24
|
-
// compiling when codegen adds fields INSIDE it, recreating the wipe bug one
|
|
25
|
-
// level down. Every nested-message literal in this file must therefore be
|
|
26
|
-
// built by a dedicated `toXxxInput` helper whose return literal is itself
|
|
27
|
-
// typed `CompleteInput<XxxInput>`. Editors that override a nested message
|
|
28
|
-
// must spread the mapper's complete value and override only their fields:
|
|
29
|
-
//
|
|
30
|
-
// preferences: { ...mapped.preferences, standingContext: next }
|
|
31
|
-
/**
|
|
32
|
-
* Maps a loaded {@link Organization} to a complete {@link OrganizationInput}
|
|
33
|
-
* for `organization.update()`.
|
|
34
|
-
*
|
|
35
|
-
* Proto3 scalar defaults (empty string, `false`, enum `0`) are normalized to
|
|
36
|
-
* `undefined` — omitting them is wire-identical to sending the default, and
|
|
37
|
-
* it keeps the built proto in the builders' canonical shape.
|
|
38
|
-
*/
|
|
39
|
-
export function toOrganizationUpdateInput(org) {
|
|
40
|
-
const input = {
|
|
41
|
-
name: org.metadata?.name ?? "",
|
|
42
|
-
slug: org.metadata?.slug || undefined,
|
|
43
|
-
org: org.metadata?.org || org.metadata?.slug || "",
|
|
44
|
-
labels: nonEmptyLabels(org.metadata?.labels),
|
|
45
|
-
visibility: org.metadata?.visibility || undefined,
|
|
46
|
-
description: org.spec?.description || undefined,
|
|
47
|
-
logoUrl: org.spec?.logoUrl || undefined,
|
|
48
|
-
managementMode: org.spec?.managementMode || undefined,
|
|
49
|
-
identityProviderRef: toResourceRef(org.spec?.identityProviderRef),
|
|
50
|
-
externalOrgId: org.spec?.externalOrgId || undefined,
|
|
51
|
-
isPersonal: org.spec?.isPersonal || undefined,
|
|
52
|
-
preferences: org.spec?.preferences
|
|
53
|
-
? toOrganizationPreferencesInput(org.spec.preferences)
|
|
54
|
-
: undefined,
|
|
55
|
-
};
|
|
56
|
-
return input;
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* Maps loaded {@link OrganizationPreferences} to a complete
|
|
60
|
-
* {@link OrganizationPreferencesInput} (nested-message rule above).
|
|
61
|
-
*/
|
|
62
|
-
function toOrganizationPreferencesInput(preferences) {
|
|
63
|
-
const input = {
|
|
64
|
-
standingContext: preferences.standingContext || undefined,
|
|
65
|
-
};
|
|
66
|
-
return input;
|
|
67
|
-
}
|
|
68
|
-
/**
|
|
69
|
-
* Maps a loaded {@link IdentityAccount} to a complete
|
|
70
|
-
* {@link IdentityAccountInput} for `identityAccount.update()`.
|
|
71
|
-
*
|
|
72
|
-
* The generated builder never sets `metadata.id`; the update pipeline
|
|
73
|
-
* locates the resource by org + slug instead (and authorizes against the
|
|
74
|
-
* loaded resource's id), so carrying `org` and `slug` here is what makes
|
|
75
|
-
* the update addressable.
|
|
76
|
-
*/
|
|
77
|
-
export function toIdentityAccountUpdateInput(account) {
|
|
78
|
-
const input = {
|
|
79
|
-
name: account.metadata?.name ?? "",
|
|
80
|
-
slug: account.metadata?.slug || undefined,
|
|
81
|
-
org: account.metadata?.org ?? "",
|
|
82
|
-
labels: nonEmptyLabels(account.metadata?.labels),
|
|
83
|
-
visibility: account.metadata?.visibility || undefined,
|
|
84
|
-
idpId: account.spec?.idpId ?? "",
|
|
85
|
-
email: account.spec?.email || undefined,
|
|
86
|
-
firstName: account.spec?.firstName || undefined,
|
|
87
|
-
lastName: account.spec?.lastName || undefined,
|
|
88
|
-
pictureUrl: account.spec?.pictureUrl || undefined,
|
|
89
|
-
isMachineAccount: account.spec?.isMachineAccount || undefined,
|
|
90
|
-
provisioningMode: account.spec?.provisioningMode || undefined,
|
|
91
|
-
identityProviderRef: toResourceRef(account.spec?.identityProviderRef),
|
|
92
|
-
preferences: account.spec?.preferences
|
|
93
|
-
? toIdentityAccountPreferencesInput(account.spec.preferences)
|
|
94
|
-
: undefined,
|
|
95
|
-
};
|
|
96
|
-
return input;
|
|
97
|
-
}
|
|
98
|
-
/**
|
|
99
|
-
* Maps loaded {@link IdentityAccountPreferences} to a complete
|
|
100
|
-
* {@link IdentityAccountPreferencesInput} (nested-message rule above).
|
|
101
|
-
*/
|
|
102
|
-
function toIdentityAccountPreferencesInput(preferences) {
|
|
103
|
-
const input = {
|
|
104
|
-
standingContext: preferences.standingContext || undefined,
|
|
105
|
-
defaultHarness: preferences.defaultHarness || undefined,
|
|
106
|
-
defaultNativeModel: preferences.defaultNativeModel || undefined,
|
|
107
|
-
defaultCursorModel: preferences.defaultCursorModel || undefined,
|
|
108
|
-
};
|
|
109
|
-
return input;
|
|
110
|
-
}
|
|
111
|
-
function nonEmptyLabels(labels) {
|
|
112
|
-
return labels && Object.keys(labels).length > 0 ? labels : undefined;
|
|
113
|
-
}
|
|
114
|
-
function toResourceRef(ref) {
|
|
115
|
-
// The builders treat a ref without org and slug as absent; mirror that so
|
|
116
|
-
// an empty message round-trips to "no reference".
|
|
117
|
-
if (!ref || (!ref.org && !ref.slug))
|
|
118
|
-
return undefined;
|
|
119
|
-
return {
|
|
120
|
-
org: ref.org,
|
|
121
|
-
slug: ref.slug,
|
|
122
|
-
...(ref.version && { version: ref.version }),
|
|
123
|
-
...(ref.kind && { kind: ref.kind }),
|
|
124
|
-
};
|
|
125
|
-
}
|
|
126
|
-
//# sourceMappingURL=update-input.js.map
|
package/update-input.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"update-input.js","sourceRoot":"","sources":["../src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