@forge/cli-shared 9.10.0-next.1-experimental-65945d2 → 9.10.0-next.3

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/CHANGELOG.md CHANGED
@@ -1,18 +1,18 @@
1
1
  # @forge/cli-shared
2
2
 
3
- ## 9.10.0-next.1-experimental-65945d2
3
+ ## 9.10.0-next.3
4
4
 
5
- ### Minor Changes
5
+ ### Patch Changes
6
6
 
7
- - e865360: Bump @forge/util with latest aris and dependencies
7
+ - Updated dependencies [9fba45e]
8
+ - @forge/manifest@13.9.0-next.2
9
+
10
+ ## 9.10.0-next.2
8
11
 
9
12
  ### Patch Changes
10
13
 
11
- - ffd952f: Add an experimental file-backed credential store with restricted macOS, Linux, and Windows permissions.
12
- - Updated dependencies [e865360]
13
- - Updated dependencies [5d8a857]
14
- - @forge/util@3.1.0-next.0-experimental-65945d2
15
- - @forge/manifest@13.8.1-next.0-experimental-65945d2
14
+ - Updated dependencies [7a4f919]
15
+ - @forge/manifest@13.8.1-next.1
16
16
 
17
17
  ## 9.10.0-next.1
18
18
 
@@ -1 +1 @@
1
- {"version":3,"file":"get-app-owner.d.ts","sourceRoot":"","sources":["../../src/apps/get-app-owner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAA4B,MAAM,YAAY,CAAC;AAErE,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAEjD,qBAAa,oBAAqB,SAAQ,KAAK;;CAI9C;AAED,eAAO,MAAM,aAAa;QAuC83n3G,8CAAc;GA9Bp6n3G,CAAC;AAEH,qBAAa,gBAAgB;IAEzB,OAAO,CAAC,QAAQ,CAAC,aAAa;IAC9B,OAAO,CAAC,QAAQ,CAAC,YAAY;gBADZ,aAAa,EAAE,aAAa,EAC5B,YAAY,EAAE,iBAAiB;IAGrC,OAAO;;;;;;;;;;;;;YAMN,WAAW;CAe1B"}
1
+ {"version":3,"file":"get-app-owner.d.ts","sourceRoot":"","sources":["../../src/apps/get-app-owner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAA4B,MAAM,YAAY,CAAC;AAErE,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAEjD,qBAAa,oBAAqB,SAAQ,KAAK;;CAI9C;AAED,eAAO,MAAM,aAAa;QAuCgpz3G,8CAAc;GA9Btrz3G,CAAC;AAEH,qBAAa,gBAAgB;IAEzB,OAAO,CAAC,QAAQ,CAAC,aAAa;IAC9B,OAAO,CAAC,QAAQ,CAAC,YAAY;gBADZ,aAAa,EAAE,aAAa,EAC5B,YAAY,EAAE,iBAAiB;IAGrC,OAAO;;;;;;;;;;;;;YAMN,WAAW;CAe1B"}
@@ -5,7 +5,6 @@ import { Logger } from '../../ui';
5
5
  import { UserRepository } from './user-repository';
6
6
  export declare const EMAIL_KEY = "FORGE_EMAIL";
7
7
  export declare const API_TOKEN_KEY = "FORGE_API_TOKEN";
8
- export declare const FILE_CREDENTIAL_STORE_FLAG = "FORGE_CLI_ENABLE_FILE_CREDENTIAL_STORE";
9
8
  export interface Keytar {
10
9
  getPassword(service: string, account: string): Promise<string | null>;
11
10
  setPassword(service: string, account: string, password: string): Promise<void>;
@@ -30,9 +29,6 @@ export declare class NoKeytarError extends UserError {
30
29
  }
31
30
  export declare class KeytarAccessError extends UserError {
32
31
  }
33
- export declare class CredentialStoreSecurityError extends UserError {
34
- constructor();
35
- }
36
32
  export interface CredentialGetter {
37
33
  getCredentials(): Promise<PersonalApiCredentialsValidated>;
38
34
  }
@@ -40,26 +36,6 @@ export interface CredentialStore extends CredentialGetter {
40
36
  setCredentials(credentials: PersonalApiCredentialsValidated): Promise<void>;
41
37
  deleteCredentials(): Promise<void>;
42
38
  }
43
- export type CredentialStoreCommandRunner = (command: string, args: readonly string[]) => Promise<string>;
44
- export declare function getCredentialsFilePath(currentPlatform?: NodeJS.Platform, environment?: NodeJS.ProcessEnv, userHome?: string): string;
45
- export declare class FileCredentialStore implements CredentialStore {
46
- private readonly userRepository;
47
- private readonly account;
48
- private readonly credentialsFilePath;
49
- private readonly currentPlatform;
50
- private readonly commandRunner;
51
- private windowsUserSid;
52
- constructor(userRepository: UserRepository, account: string, credentialsFilePath?: string, currentPlatform?: NodeJS.Platform, commandRunner?: CredentialStoreCommandRunner);
53
- private getWindowsUserSid;
54
- private applyWindowsAcl;
55
- private secureWindowsStorage;
56
- private securePosixStorage;
57
- private secureStorage;
58
- private readCredentialsFile;
59
- getCredentials(): Promise<PersonalApiCredentialsValidated>;
60
- setCredentials(credentials: PersonalApiCredentialsValidated): Promise<void>;
61
- deleteCredentials(): Promise<void>;
62
- }
63
39
  export declare class CredentialStoreImpl implements CredentialStore {
64
40
  private readonly logger;
65
41
  private readonly instructionsURL;
@@ -1 +1 @@
1
- {"version":3,"file":"credential-store.d.ts","sourceRoot":"","sources":["../../../src/auth/personal/credential-store.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,CAAC,MAAM,OAAO,CAAC;AAC3B,OAAO,EAAuB,UAAU,EAAE,MAAM,aAAa,CAAC;AAG9D,OAAO,EAAE,SAAS,EAAa,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,MAAM,EAAQ,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD,eAAO,MAAM,SAAS,gBAAgB,CAAC;AACvC,eAAO,MAAM,aAAa,oBAAoB,CAAC;AAC/C,eAAO,MAAM,0BAA0B,2CAA2C,CAAC;AAqBnF,MAAM,WAAW,MAAM;IACrB,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAEtE,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE/E,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,O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AI,OAAO,CAAC,+BAA+B,CAAC,CAAC;CAC5D;AAED,MAAM,WAAW,eAAgB,SAAQ,gBAAgB;IACvD,cAAc,CAAC,WAAW,EAAE,+BAA+B,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE5E,iBAAiB,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACpC;AAED,qBAAa,mBAAoB,YAAW,eAAe;IAIvD,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,eAAe;IAChC,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,YAAY;IAC7B,OAAO,CAAC,QAAQ,CAAC,cAAc;IAPjC,OAAO,CAAC,aAAa,CAAS;gBAGX,MAAM,EAAE,MAAM,EACd,eAAe,EAAE,MAAM,EACvB,MAAM,EAAE,MAAM,GAAG,IAAI,EACrB,YAAY,EAAE,UAAU,EACxB,cAAc,EAAE,cAAc;IAKjD,OAAO,CAAC,eAAe;IAoBvB,iBAAiB,CAAC,iBAAiB,EAAE,MAAM,GAAG,IAAI,GAAG,+BAA+B;IAoB9E,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,+BAA+B,GAAG,SAAS,CAAC;IAehG,+BAA+B,IAAI,+BAA+B,GAAG,SAAS;IAS9E,kCAAkC,IAAI,IAAI;IAIpC,cAAc,IAAI,OAAO,CAAC,+BAA+B,CAAC;IAgC1D,cAAc,CAAC,WAAW,EAAE,+BAA+B,GAAG,OAAO,CAAC,IAAI,CAAC;IAY3E,iBAAiB,IAAI,OAAO,CAAC,IAAI,CAAC;CAWzC;AAED,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,cAAc,GAAG,eAAe,CAKlG"}
@@ -1,14 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CredentialStoreImpl = exports.FileCredentialStore = exports.CredentialStoreSecurityError = exports.KeytarAccessError = exports.NoKeytarError = exports.NoTokenInStoreError = exports.personalApiCredentialsValidatedShape = exports.personalApiCredentialsShape = exports.FILE_CREDENTIAL_STORE_FLAG = exports.API_TOKEN_KEY = exports.EMAIL_KEY = void 0;
4
- exports.getCredentialsFilePath = getCredentialsFilePath;
3
+ exports.CredentialStoreImpl = exports.KeytarAccessError = exports.NoKeytarError = exports.NoTokenInStoreError = exports.personalApiCredentialsValidatedShape = exports.personalApiCredentialsShape = exports.API_TOKEN_KEY = exports.EMAIL_KEY = void 0;
5
4
  exports.getCredentialStore = getCredentialStore;
6
5
  const tslib_1 = require("tslib");
7
- const child_process_1 = require("child_process");
8
- const fs_1 = require("fs");
9
6
  const os_1 = require("os");
10
- const path_1 = tslib_1.__importDefault(require("path"));
11
- const util_1 = require("util");
12
7
  const Either_1 = require("fp-ts/lib/Either");
13
8
  const t = tslib_1.__importStar(require("io-ts"));
14
9
  const cache_1 = require("../../cache");
@@ -18,17 +13,8 @@ const shared_1 = require("../../shared");
18
13
  const ui_1 = require("../../ui");
19
14
  exports.EMAIL_KEY = 'FORGE_EMAIL';
20
15
  exports.API_TOKEN_KEY = 'FORGE_API_TOKEN';
21
- exports.FILE_CREDENTIAL_STORE_FLAG = 'FORGE_CLI_ENABLE_FILE_CREDENTIAL_STORE';
22
16
  const KEYTAR_SERVICE = 'Atlassian';
23
17
  const CACHE_CREDENTIALS_KEY = 'forge-credentials';
24
- const CREDENTIALS_FILE_NAME = 'credentials.json';
25
- const CONFIG_DIRECTORY_SUFFIX = 'nodejs';
26
- const CREDENTIALS_DIRECTORY_MODE = 0o700;
27
- const CREDENTIALS_FILE_MODE = 0o600;
28
- const PERMISSION_BITS_MASK = 0o777;
29
- const GROUP_OR_OTHER_WRITE_BITS_MASK = 0o022;
30
- const WINDOWS_SYSTEM_SID = 'S-1-5-18';
31
- const WINDOWS_ADMINISTRATORS_SID = 'S-1-5-32-544';
32
18
  var KeytarAccount;
33
19
  (function (KeytarAccount) {
34
20
  KeytarAccount["DEV"] = "Ecosystem-staging";
@@ -69,225 +55,6 @@ exports.NoKeytarError = NoKeytarError;
69
55
  class KeytarAccessError extends shared_1.UserError {
70
56
  }
71
57
  exports.KeytarAccessError = KeytarAccessError;
72
- class CredentialStoreSecurityError extends shared_1.UserError {
73
- constructor() {
74
- super(ui_1.Text.error.credentialsFilePermissions);
75
- }
76
- }
77
- exports.CredentialStoreSecurityError = CredentialStoreSecurityError;
78
- const execFileAsync = (0, util_1.promisify)(child_process_1.execFile);
79
- const runCredentialStoreCommand = async (command, args) => {
80
- const { stdout } = await execFileAsync(command, [...args], { encoding: 'utf8', windowsHide: true });
81
- return stdout;
82
- };
83
- const credentialsByAccountShape = t.record(t.string, exports.personalApiCredentialsValidatedShape);
84
- function isFileNotFoundError(error) {
85
- return typeof error === 'object' && error !== null && 'code' in error && error.code === 'ENOENT';
86
- }
87
- function getCredentialsFilePath(currentPlatform = (0, os_1.platform)(), environment = process.env, userHome = (0, os_1.homedir)()) {
88
- const platformPath = currentPlatform === 'win32' ? path_1.default.win32 : path_1.default.posix;
89
- let credentialsDirectory;
90
- switch (currentPlatform) {
91
- case 'darwin':
92
- credentialsDirectory = platformPath.join(userHome, 'Library', 'Preferences', `${cache_1.CONFIG_PROJECT_NAME}-${CONFIG_DIRECTORY_SUFFIX}`);
93
- break;
94
- case 'win32':
95
- credentialsDirectory = platformPath.join(environment.LOCALAPPDATA || platformPath.join(userHome, 'AppData', 'Local'), 'Atlassian', 'Forge');
96
- break;
97
- default:
98
- credentialsDirectory = platformPath.join(environment.XDG_CONFIG_HOME || platformPath.join(userHome, '.config'), `${cache_1.CONFIG_PROJECT_NAME}-${CONFIG_DIRECTORY_SUFFIX}`);
99
- }
100
- return platformPath.join(credentialsDirectory, CREDENTIALS_FILE_NAME);
101
- }
102
- class FileCredentialStore {
103
- userRepository;
104
- account;
105
- credentialsFilePath;
106
- currentPlatform;
107
- commandRunner;
108
- windowsUserSid;
109
- constructor(userRepository, account, credentialsFilePath = getCredentialsFilePath(), currentPlatform = (0, os_1.platform)(), commandRunner = runCredentialStoreCommand) {
110
- this.userRepository = userRepository;
111
- this.account = account;
112
- this.credentialsFilePath = credentialsFilePath;
113
- this.currentPlatform = currentPlatform;
114
- this.commandRunner = commandRunner;
115
- }
116
- async getWindowsUserSid() {
117
- this.windowsUserSid ??= this.commandRunner('whoami.exe', ['/user', '/fo', 'csv', '/nh']).then((output) => {
118
- const sid = output.trim().match(/"?(S-\d(?:-\d+)+)"?$/)?.[1];
119
- if (!sid) {
120
- throw new Error('Could not determine the current Windows user SID');
121
- }
122
- return sid;
123
- });
124
- return this.windowsUserSid;
125
- }
126
- async applyWindowsAcl(targetPath, directory) {
127
- const userSid = await this.getWindowsUserSid();
128
- const permission = directory ? '(OI)(CI)F' : 'F';
129
- await this.commandRunner('icacls.exe', [
130
- targetPath,
131
- '/inheritance:r',
132
- '/grant:r',
133
- `*${userSid}:${permission}`,
134
- `*${WINDOWS_SYSTEM_SID}:${permission}`,
135
- `*${WINDOWS_ADMINISTRATORS_SID}:${permission}`
136
- ]);
137
- }
138
- async secureWindowsStorage(createFile) {
139
- let fileExists = true;
140
- try {
141
- await fs_1.promises.access(this.credentialsFilePath);
142
- }
143
- catch (error) {
144
- if (!isFileNotFoundError(error)) {
145
- throw error;
146
- }
147
- fileExists = false;
148
- }
149
- if (!fileExists && !createFile) {
150
- return;
151
- }
152
- const credentialsDirectory = path_1.default.dirname(this.credentialsFilePath);
153
- await fs_1.promises.mkdir(credentialsDirectory, { recursive: true });
154
- await this.applyWindowsAcl(credentialsDirectory, true);
155
- if (!fileExists) {
156
- await fs_1.promises.writeFile(this.credentialsFilePath, '', { flag: 'wx' });
157
- }
158
- await this.applyWindowsAcl(this.credentialsFilePath, false);
159
- }
160
- async securePosixStorage(createFile) {
161
- let fileExists = true;
162
- try {
163
- await fs_1.promises.access(this.credentialsFilePath);
164
- }
165
- catch (error) {
166
- if (!isFileNotFoundError(error)) {
167
- throw error;
168
- }
169
- fileExists = false;
170
- }
171
- if (!fileExists && !createFile) {
172
- return;
173
- }
174
- const credentialsDirectory = path_1.default.dirname(this.credentialsFilePath);
175
- const createdDirectory = await fs_1.promises.mkdir(credentialsDirectory, {
176
- recursive: true,
177
- mode: CREDENTIALS_DIRECTORY_MODE
178
- });
179
- if (createdDirectory !== undefined) {
180
- await fs_1.promises.chmod(credentialsDirectory, CREDENTIALS_DIRECTORY_MODE);
181
- }
182
- const directoryStat = await fs_1.promises.stat(credentialsDirectory);
183
- const currentUserId = process.getuid?.();
184
- if (currentUserId === undefined ||
185
- !directoryStat.isDirectory() ||
186
- directoryStat.uid !== currentUserId ||
187
- (directoryStat.mode & GROUP_OR_OTHER_WRITE_BITS_MASK) !== 0) {
188
- throw new Error('The credentials directory is not owned exclusively by the current user');
189
- }
190
- if (!fileExists) {
191
- const file = await fs_1.promises.open(this.credentialsFilePath, 'wx', CREDENTIALS_FILE_MODE);
192
- await file.close();
193
- }
194
- await fs_1.promises.chmod(this.credentialsFilePath, CREDENTIALS_FILE_MODE);
195
- const fileStat = await fs_1.promises.stat(this.credentialsFilePath);
196
- if (!fileStat.isFile() ||
197
- fileStat.uid !== currentUserId ||
198
- (fileStat.mode & PERMISSION_BITS_MASK) !== CREDENTIALS_FILE_MODE) {
199
- throw new Error('Could not restrict access to the credentials file');
200
- }
201
- }
202
- async secureStorage(createFile) {
203
- try {
204
- if (this.currentPlatform === 'win32') {
205
- await this.secureWindowsStorage(createFile);
206
- }
207
- else {
208
- await this.securePosixStorage(createFile);
209
- }
210
- }
211
- catch {
212
- await fs_1.promises.rm(this.credentialsFilePath, { force: true }).catch(() => undefined);
213
- throw new CredentialStoreSecurityError();
214
- }
215
- }
216
- async readCredentialsFile() {
217
- let contents;
218
- try {
219
- await this.secureStorage(false);
220
- contents = await fs_1.promises.readFile(this.credentialsFilePath, 'utf8');
221
- }
222
- catch (error) {
223
- if (isFileNotFoundError(error)) {
224
- return {};
225
- }
226
- throw error;
227
- }
228
- let parsed;
229
- try {
230
- parsed = JSON.parse(contents);
231
- }
232
- catch {
233
- throw new NoTokenInStoreError();
234
- }
235
- const decodeResult = credentialsByAccountShape.decode(parsed);
236
- if ((0, Either_1.isLeft)(decodeResult)) {
237
- throw new NoTokenInStoreError();
238
- }
239
- return decodeResult.right;
240
- }
241
- async getCredentials() {
242
- if (process.env[exports.API_TOKEN_KEY] && process.env[exports.EMAIL_KEY]) {
243
- const credentials = {
244
- email: process.env[exports.EMAIL_KEY],
245
- token: process.env[exports.API_TOKEN_KEY]
246
- };
247
- const { accountId } = await this.userRepository.getUser(credentials);
248
- return { ...credentials, accountId };
249
- }
250
- const credentials = (await this.readCredentialsFile())[this.account];
251
- if (!credentials) {
252
- throw new NoTokenInStoreError();
253
- }
254
- return credentials;
255
- }
256
- async setCredentials(credentials) {
257
- let credentialsByAccount;
258
- try {
259
- credentialsByAccount = await this.readCredentialsFile();
260
- }
261
- catch (error) {
262
- if (!(error instanceof NoTokenInStoreError)) {
263
- throw error;
264
- }
265
- credentialsByAccount = {};
266
- }
267
- credentialsByAccount[this.account] = credentials;
268
- await this.secureStorage(true);
269
- await fs_1.promises.writeFile(this.credentialsFilePath, `${JSON.stringify(credentialsByAccount, null, 2)}\n`, 'utf8');
270
- await this.secureStorage(false);
271
- }
272
- async deleteCredentials() {
273
- const credentialsByAccount = await this.readCredentialsFile();
274
- delete credentialsByAccount[this.account];
275
- if (Object.keys(credentialsByAccount).length === 0) {
276
- try {
277
- await fs_1.promises.unlink(this.credentialsFilePath);
278
- }
279
- catch (error) {
280
- if (!isFileNotFoundError(error)) {
281
- throw error;
282
- }
283
- }
284
- return;
285
- }
286
- await fs_1.promises.writeFile(this.credentialsFilePath, `${JSON.stringify(credentialsByAccount, null, 2)}\n`, 'utf8');
287
- await this.secureStorage(false);
288
- }
289
- }
290
- exports.FileCredentialStore = FileCredentialStore;
291
58
  class CredentialStoreImpl {
292
59
  logger;
293
60
  instructionsURL;
@@ -417,10 +184,6 @@ class CredentialStoreImpl {
417
184
  }
418
185
  exports.CredentialStoreImpl = CredentialStoreImpl;
419
186
  function getCredentialStore(logger, userRepository) {
420
- const credentialAccount = (0, graphql_1.getEnvironmentConfig)(KeytarAccount);
421
- if (process.env[exports.FILE_CREDENTIAL_STORE_FLAG] === 'true') {
422
- return new FileCredentialStore(userRepository, credentialAccount);
423
- }
424
187
  const keytar = getKeytar();
425
188
  const cachedConfig = cache_1.CachedConf.getCache(cache_1.CONFIG_PROJECT_NAME);
426
189
  const instructionsUrl = (0, instruction_1.getInstructionsUrl)();
@@ -1129,6 +1129,11 @@ export type AvpUpdateChartInput = {
1129
1129
  chartAri: Scalars['ID']['input'];
1130
1130
  origin?: InputMaybe<AvpDashboardUpdateOrigin>;
1131
1131
  };
1132
+ export type AvpUpdateCommentInput = {
1133
+ commentAri: Scalars['ID']['input'];
1134
+ context?: InputMaybe<Scalars['JSON']['input']>;
1135
+ message: Scalars['JSON']['input'];
1136
+ };
1132
1137
  export type AvpUpdateCustomTemplateInput = {
1133
1138
  dashboardAri: Scalars['ID']['input'];
1134
1139
  description: Scalars['String']['input'];
@@ -3796,7 +3801,7 @@ export type AssetsVerticalAssetTypesTrackingSortInput = {
3796
3801
  };
3797
3802
  export type AssetsVerticalAsyncTaskQueryErrorCode = 'NOT_FOUND' | 'PERMISSION_DENIED' | 'VALIDATION_FAILED';
3798
3803
  export type AssetsVerticalAsyncTaskStatus = 'ARCHIVED' | 'FAILED' | 'IN_PROGRESS' | 'QUEUED' | 'SUCCEEDED';
3799
- export type AssetsVerticalAsyncTaskType = 'BUNDLE_INSTANTIATION' | 'VERTICAL_PROVISIONING';
3804
+ export type AssetsVerticalAsyncTaskType = 'BUNDLE_INSTANTIATION' | 'SAMPLE_DATA_CREATE' | 'SAMPLE_DATA_DELETE' | 'VERTICAL_PROVISIONING';
3800
3805
  export type AssetsVerticalBundleActionErrorCode = 'CONFLICT';
3801
3806
  export type AssetsVerticalBundleType = 'CDM' | 'HAM' | 'OSC' | 'SAM';
3802
3807
  export type AssetsVerticalCountByStatusInput = {
@@ -4032,6 +4037,7 @@ export type AssetsVerticalRoleAssignmentOperation = 'CREATE' | 'DELETE';
4032
4037
  export type AssetsVerticalRoleType = 'HAM_ADMIN' | 'HAM_USER' | 'SAM_ADMIN' | 'SAM_USER';
4033
4038
  export type AssetsVerticalRolesQueryErrorCode = 'NOT_FOUND' | 'PERMISSION_DENIED' | 'VALIDATION_FAILED';
4034
4039
  export type AssetsVerticalRovoCreditBlockReason = 'ORG' | 'RESTRICTED' | 'USER';
4040
+ export type AssetsVerticalRovoCreditRequestMode = 'EMAIL' | 'REDIRECT_URL';
4035
4041
  export type AssetsVerticalSoftwareEntitlementObjectsInput = {
4036
4042
  filters?: InputMaybe<Array<Array<AssetsVerticalObjectsFilterCondition>>>;
4037
4043
  limit?: InputMaybe<Scalars['Int']['input']>;
@@ -4782,6 +4788,7 @@ export type CloudifyRecommendationInput = {
4782
4788
  };
4783
4789
  export type CloudifyRecommendationResourceType = 'RAW_CUSTOMIZATION_RECOMMENDATION';
4784
4790
  export type CloudifyRecommendationStatus = 'FAILED' | 'NEW' | 'PREPARED' | 'PREPARING' | 'REJECTED';
4791
+ export type CloudifyRecommendationsChangesStatus = 'PENDING' | 'READY' | 'UNKNOWN';
4785
4792
  export type CloudifySiteTargetInput = {
4786
4793
  siteId: Scalars['ID']['input'];
4787
4794
  };
@@ -5095,6 +5102,7 @@ export type CommerceExpEntitlementStatus = 'ACTIVE' | 'INACTIVE';
5095
5102
  export type CommerceExpEntitlementTransitionResultForBac = 'ALLOWED' | 'NOT_ALLOWED' | 'NO_EFFECT';
5096
5103
  export type CommerceExpEntitlementType = 'ADD_ON' | 'APP' | 'COLLECTION' | 'COLLECTION_INSTANCE' | 'ENTERPRISE' | 'ENTERPRISE_INSTANCE' | 'FAMILY_CONTAINER' | 'MULTI_INSTANCE' | 'MULTI_INSTANCE_CHILD' | 'PRODUCT';
5097
5104
  export type CommerceExpEntitlementUpdateInput = {
5105
+ behaviourAtEndOfSubscription?: InputMaybe<CommerceExpBehaviourAtEndOfSubscription>;
5098
5106
  entitlementId: Scalars['String']['input'];
5099
5107
  promotionId?: InputMaybe<Scalars['String']['input']>;
5100
5108
  skipTrial?: InputMaybe<Scalars['Boolean']['input']>;
@@ -7782,7 +7790,13 @@ export type ConfluenceNbmRetryTransformationLongTaskInput = {
7782
7790
  export type ConfluenceNbmReviewTransformerImportInput = {
7783
7791
  storedTransformersJson: Scalars['String']['input'];
7784
7792
  };
7785
- export type ConfluenceNbmRunErrorCode = 'FEATURE_DISABLED' | 'INVALID_INPUT' | 'NOT_FOUND' | 'RUN_ALREADY_ACTIVE' | 'RUN_REFUSED';
7793
+ export type ConfluenceNbmRollbackClassification = 'ANOMALY' | 'CLEAN' | 'EDITED_AFTER' | 'PAGE_GONE';
7794
+ export type ConfluenceNbmRollbackRunInput = {
7795
+ force?: InputMaybe<Scalars['Boolean']['input']>;
7796
+ id: Scalars['ID']['input'];
7797
+ spaceKeys?: InputMaybe<Array<InputMaybe<Scalars['String']['input']>>>;
7798
+ };
7799
+ export type ConfluenceNbmRunErrorCode = 'INVALID_INPUT' | 'NOT_FOUND' | 'NOT_ROLLBACKABLE' | 'RUN_ALREADY_ACTIVE';
7786
7800
  export type ConfluenceNbmRunPageOutcome = 'CHANGED' | 'FAILED' | 'NO_TRANSFORMER' | 'TRUNCATED' | 'UNCHANGED';
7787
7801
  export type ConfluenceNbmRunStatus = 'COMPLETED' | 'FAILED' | 'RUNNING';
7788
7802
  export type ConfluenceNbmScanStatus = 'CANCELLED' | 'COMPLETED' | 'FAILED' | 'PENDING' | 'RUNNING';
@@ -7798,6 +7812,7 @@ export type ConfluenceNbmStartPerfScanLongTaskInput = {
7798
7812
  };
7799
7813
  export type ConfluenceNbmStartRunInput = {
7800
7814
  isDryRun?: InputMaybe<Scalars['Boolean']['input']>;
7815
+ isWholeSite?: InputMaybe<Scalars['Boolean']['input']>;
7801
7816
  nativeMacros?: InputMaybe<Array<InputMaybe<Scalars['String']['input']>>>;
7802
7817
  spaceKeys?: InputMaybe<Array<InputMaybe<Scalars['String']['input']>>>;
7803
7818
  transformers?: InputMaybe<Array<InputMaybe<Scalars['String']['input']>>>;
@@ -8854,7 +8869,7 @@ export type ConvertPageToLiveEditActionInput = {
8854
8869
  contentId: Scalars['ID']['input'];
8855
8870
  };
8856
8871
  export type ConvoAiActionStatus = 'CANCELLED' | 'ERRORED' | 'FINISHED' | 'PLANNED' | 'STARTED';
8857
- export type ConvoAiAgentSessionFailureReason = 'SYSTEM_RATE_LIMITED' | 'USER_RATE_LIMITED';
8872
+ export type ConvoAiAgentSessionFailureReason = 'A2A_IDLE_TIMEOUT' | 'A2A_POLL_TIMEOUT' | 'A2A_REMOTE_TASK_FAILED' | 'A2A_REMOTE_TASK_REJECTED' | 'A2A_SEND_FAILED' | 'A2A_STREAM_DISCONNECTED' | 'A2A_STREAM_ERROR' | 'A2A_TURN_UNWRITTEN' | 'SYSTEM_RATE_LIMITED' | 'USER_RATE_LIMITED';
8858
8873
  export type ConvoAiAgentSessionState = 'ARTEFACT_READY' | 'AUTH_REQUIRED' | 'COMPLETED' | 'FAILED' | 'INPUT_REQUIRED' | 'REJECTED' | 'UNKNOWN' | 'WORKING';
8859
8874
  export type ConvoAiAgentToUiFramework = 'A2UI';
8860
8875
  export type ConvoAiErrorMessageTemplate = 'A2A_ERROR' | 'ACCEPTABLE_USE_VIOLATIONS' | 'ERROR' | 'PRE_EXECUTION_ERROR';
@@ -8908,6 +8923,8 @@ export type ConvoAiSearchAgentInput = {
8908
8923
  export type ConvoAiSearchAgentPresentationMode = 'AMBIGUOUS_SCOPE' | 'EXPLAIN_CONFLICT' | 'NO_VERIFIED_EVIDENCE' | 'RESOLVE_SHARED' | 'RESOLVE_SINGLE';
8909
8924
  export type ConvoAiSearchAgentResponseMode = 'ANSWER_AND_SOURCES' | 'SOURCES_ONLY';
8910
8925
  export type ConvoAiSearchAgentSource = 'CONFLUENCE' | 'GOOGLE_DOCS' | 'SLACK' | 'THIRD_PARTY' | 'TOWNSQUARE';
8926
+ export type ConvoAiSkillDirectoryItemType = 'CUSTOM_SKILL' | 'FORGE_SKILL' | 'PLATFORM_SKILL';
8927
+ export type ConvoAiSkillDirectorySurface = 'ROVO' | 'STUDIO';
8911
8928
  export type ConvoAiSkillSource = 'ANTHROPIC' | 'STRATUS';
8912
8929
  export type CopyPolarisInsightsContainerInput = {
8913
8930
  container?: InputMaybe<Scalars['ID']['input']>;
@@ -12113,6 +12130,9 @@ export type GraphInferenceQualificationQualityThresholdsInput = {
12113
12130
  project: Scalars['Float']['input'];
12114
12131
  version: Scalars['String']['input'];
12115
12132
  };
12133
+ export type GraphInferenceRankingDecisionRelevance = 'IRRELEVANT' | 'RELEVANT';
12134
+ export type GraphInferenceRankingFeedbackUnavailableReason = 'BASELINE_UNAVAILABLE' | 'NO_GOLD';
12135
+ export type GraphInferenceRankingReportUnavailableReason = 'NO_SCORED_LISTS' | 'UNSUPPORTED_PACKET';
12116
12136
  export type GraphInferenceRequestDeletionJobInput = {
12117
12137
  appId: Scalars['ID']['input'];
12118
12138
  appVersion: Scalars['Int']['input'];
@@ -12137,6 +12157,7 @@ export type GraphInferenceSaveDecisionRankingInput = {
12137
12157
  irrelevantDecisionIds?: InputMaybe<Array<Scalars['ID']['input']>>;
12138
12158
  packetId: Scalars['ID']['input'];
12139
12159
  requestId: Scalars['String']['input'];
12160
+ shareRankingResponse?: InputMaybe<Scalars['Boolean']['input']>;
12140
12161
  snapshotId: Scalars['ID']['input'];
12141
12162
  };
12142
12163
  export type GraphInferenceSaveLinkRankingInput = {
@@ -29175,6 +29196,10 @@ export type KitsuneTagFeedbackSettingsInput = {
29175
29196
  preserveHumanValues?: InputMaybe<Scalars['Boolean']['input']>;
29176
29197
  skipLowConfidence?: InputMaybe<Scalars['Boolean']['input']>;
29177
29198
  };
29199
+ export type KitsuneUnlinkFeedbackToIdeaInput = {
29200
+ feedbackAri: Scalars['ID']['input'];
29201
+ ideaAri: Scalars['ID']['input'];
29202
+ };
29178
29203
  export type KitsuneUnlinkSpaceFromExternalInput = {
29179
29204
  id: Scalars['ID']['input'];
29180
29205
  spaceAri: Scalars['ID']['input'];
@@ -29271,7 +29296,7 @@ export type KitsuneViewConfigInput = {
29271
29296
  logicalOperator: KitsuneLogicalOperator;
29272
29297
  };
29273
29298
  export type KitsuneViewConfigStatus = 'DRAFT' | 'PUBLISHED' | 'SAVED';
29274
- export type KitsuneViewType = 'DASHBOARD' | 'LIST' | 'TABLE';
29299
+ export type KitsuneViewType = 'DASHBOARD' | 'FEED' | 'LIST' | 'LIST_NEW' | 'TABLE';
29275
29300
  export type KnowledgeBaseAiDraftArticleGenerationState = 'COMPLETED' | 'ERROR' | 'NOT_TRIGGERED' | 'SKIPPED' | 'TRIGGERED';
29276
29301
  export type KnowledgeBaseAgentArticleSearchInput = {
29277
29302
  cloudId: Scalars['ID']['input'];
@@ -30358,7 +30383,7 @@ export type MarketplaceConsoleWorkflowFrameworkAttributesInput = {
30358
30383
  export type MarketplaceEntityStatus = 'ACTIVE' | 'ARCHIVED';
30359
30384
  export type MarketplaceListingStatus = 'PRIVATE' | 'PUBLIC' | 'READY_TO_LAUNCH' | 'REJECTED' | 'SUBMITTED';
30360
30385
  export type MarketplaceLocation = 'IN_PRODUCT' | 'WEBSITE';
30361
- export type MarketplaceObjectType = 'AGENT' | 'APP' | 'MCP';
30386
+ export type MarketplaceObjectType = 'AGENT' | 'APP' | 'CONNECTOR' | 'MCP';
30362
30387
  export type MarketplacePartnerSupportHolidayFrequency = 'ANNUAL' | 'ONE_TIME';
30363
30388
  export type MarketplacePartnerTierType = 'GOLD' | 'PLATINUM' | 'SILVER';
30364
30389
  export type MarketplacePartnerType = 'ATLASSIAN_INTERNAL';
@@ -34529,8 +34554,14 @@ export type SearchThirdPartyRangeFilter = {
34529
34554
  lt?: InputMaybe<Scalars['String']['input']>;
34530
34555
  };
34531
34556
  export type SearchToolContext = {
34557
+ dataId?: InputMaybe<Scalars['String']['input']>;
34558
+ datasetName?: InputMaybe<Scalars['String']['input']>;
34559
+ evalJobId?: InputMaybe<Scalars['String']['input']>;
34560
+ evalOwnerAccountId?: InputMaybe<Scalars['String']['input']>;
34532
34561
  excludeSlack?: InputMaybe<Scalars['Boolean']['input']>;
34562
+ experimentArm?: InputMaybe<Scalars['String']['input']>;
34533
34563
  experimentId?: InputMaybe<Scalars['String']['input']>;
34564
+ isShadow?: InputMaybe<Scalars['Boolean']['input']>;
34534
34565
  isSynthetic?: InputMaybe<Scalars['Boolean']['input']>;
34535
34566
  };
34536
34567
  export type SearchTrelloFilter = {
@@ -35087,6 +35118,9 @@ export type SpaceViewsPersistence = {
35087
35118
  spaceKey: Scalars['String']['input'];
35088
35119
  };
35089
35120
  export type SpaceViewsPersistenceOption = 'POPULARITY' | 'RECENTLY_MODIFIED' | 'RECENTLY_VIEWED' | 'TITLE_AZ' | 'TREE';
35121
+ export type SpcsFullSiteScanEstimateInput = {
35122
+ workspaceAris: Array<Scalars['String']['input']>;
35123
+ };
35090
35124
  export type SpcsFullSiteScanStatus = 'CANCELLED' | 'DONE' | 'FAILED' | 'IN_PROGRESS' | 'PENDING';
35091
35125
  export type SpcsListFullSiteScansInput = {
35092
35126
  cursor?: InputMaybe<Scalars['String']['input']>;
@@ -35654,6 +35688,7 @@ export type StakeholderCommsMaintenanceUpdateRequest = {
35654
35688
  message: Scalars['String']['input'];
35655
35689
  name?: InputMaybe<Scalars['String']['input']>;
35656
35690
  pageId: Scalars['String']['input'];
35691
+ requestId?: InputMaybe<Scalars['String']['input']>;
35657
35692
  shouldSendNotifications: Scalars['Boolean']['input'];
35658
35693
  status: StakeholderCommsMaintenanceStatus;
35659
35694
  };
@@ -35907,10 +35942,12 @@ export type StalePagesSortingType = 'ASC' | 'DESC';
35907
35942
  export type StarlingAqlQueryInput = {
35908
35943
  aql: Scalars['String']['input'];
35909
35944
  deadlineMillis?: InputMaybe<Scalars['Int']['input']>;
35945
+ hydrateNodes?: Scalars['Boolean']['input'];
35910
35946
  };
35911
35947
  export type StarlingGraphqlCypherInput = {
35912
35948
  cypher: Scalars['String']['input'];
35913
35949
  deadlineMillis?: InputMaybe<Scalars['Int']['input']>;
35950
+ hydrateNodes?: Scalars['Boolean']['input'];
35914
35951
  parameters?: InputMaybe<Scalars['JSON']['input']>;
35915
35952
  };
35916
35953
  export type StartSprintInput = {
@@ -36821,6 +36858,9 @@ export type TownsquareGoalsRemoveWatchersInput = {
36821
36858
  goalId: Scalars['ID']['input'];
36822
36859
  watcherIds: Array<Scalars['ID']['input']>;
36823
36860
  };
36861
+ export type TownsquareGoalsRestoreGoalInput = {
36862
+ goalId: Scalars['ID']['input'];
36863
+ };
36824
36864
  export type TownsquareGoalsRestoreGoalsInput = {
36825
36865
  goalIds: Array<Scalars['ID']['input']>;
36826
36866
  };
@@ -36865,6 +36905,9 @@ export type TownsquareGoalsShareUpdateInput = {
36865
36905
  recipientEmailAddress?: InputMaybe<Scalars['String']['input']>;
36866
36906
  updateId: Scalars['ID']['input'];
36867
36907
  };
36908
+ export type TownsquareGoalsSoftDeleteGoalInput = {
36909
+ goalId: Scalars['ID']['input'];
36910
+ };
36868
36911
  export type TownsquareGoalsSoftDeleteGoalsInput = {
36869
36912
  goalIds: Array<Scalars['ID']['input']>;
36870
36913
  };