@forge/cli-shared 5.0.2-next.0-experimental-a92f9f3 → 5.1.0-next.2

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,11 +1,16 @@
1
1
  # @forge/cli-shared
2
2
 
3
- ## 5.0.2-next.0-experimental-a92f9f3
3
+ ## 5.1.0-next.2
4
4
 
5
5
  ### Patch Changes
6
6
 
7
- - Updated dependencies [19b82e5]
8
- - @forge/manifest@7.4.1-next.0-experimental-a92f9f3
7
+ - 7bf2dda: Get AAID from AGG when credentials are supplied via environment
8
+
9
+ ## 5.1.0-next.1
10
+
11
+ ### Minor Changes
12
+
13
+ - fbc037b: Specify Tunnel flow (Ngrok/Cloudflare) when starting forge tunnel
9
14
 
10
15
  ## 5.0.2-next.0
11
16
 
@@ -1,7 +1,8 @@
1
1
  import * as t from 'io-ts';
2
- import { Logger } from '../../ui';
3
2
  import { CachedConf } from '../../cache';
4
3
  import { UserError } from '../../shared';
4
+ import { Logger } from '../../ui';
5
+ import { UserRepository } from './user-repository';
5
6
  export declare const EMAIL_KEY = "FORGE_EMAIL";
6
7
  export declare const API_TOKEN_KEY = "FORGE_API_TOKEN";
7
8
  export interface Keytar {
@@ -30,7 +31,6 @@ export declare class KeytarAccessError extends UserError {
30
31
  }
31
32
  export interface CredentialGetter {
32
33
  getCredentials(): Promise<PersonalApiCredentialsValidated>;
33
- getInstructionsWhenInvalid(): string;
34
34
  }
35
35
  export interface CredentialStore extends CredentialGetter {
36
36
  setCredentials(credentials: PersonalApiCredentialsValidated): Promise<void>;
@@ -41,8 +41,9 @@ export declare class CredentialStoreImpl implements CredentialStore {
41
41
  private readonly instructionsURL;
42
42
  private readonly keytar;
43
43
  private readonly cachedConfig;
44
+ private readonly userRepository;
44
45
  private keytarAccount;
45
- constructor(logger: Logger, instructionsURL: string, keytar: Keytar | null, cachedConfig: CachedConf);
46
+ constructor(logger: Logger, instructionsURL: string, keytar: Keytar | null, cachedConfig: CachedConf, userRepository: UserRepository);
46
47
  private wrapKeytarError;
47
48
  decodeCredentials(credentialsString: string | null): PersonalApiCredentialsValidated;
48
49
  getCredentialsKeytar(keytar: Keytar): Promise<PersonalApiCredentialsValidated | undefined>;
@@ -51,7 +52,6 @@ export declare class CredentialStoreImpl implements CredentialStore {
51
52
  getCredentials(): Promise<PersonalApiCredentialsValidated>;
52
53
  setCredentials(credentials: PersonalApiCredentialsValidated): Promise<void>;
53
54
  deleteCredentials(): Promise<void>;
54
- getInstructionsWhenInvalid(): string;
55
55
  }
56
- export declare function getCredentialStore(logger: Logger): CredentialStore;
56
+ export declare function getCredentialStore(logger: Logger, userRepository: UserRepository): CredentialStore;
57
57
  //# sourceMappingURL=credential-store.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"credential-store.d.ts","sourceRoot":"","sources":["../../../src/auth/personal/credential-store.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,CAAC,MAAM,OAAO,CAAC;AAC3B,OAAO,EAAE,MAAM,EAAQ,MAAM,UAAU,CAAC;AACxC,OAAO,EAAuB,UAAU,EAAE,MAAM,aAAa,CAAC;AAG9D,OAAO,EAAE,SAAS,EAAa,MAAM,cAAc,CAAC;AAEpD,eAAO,MAAM,SAAS,gBAAgB,CAAC;AACvC,eAAO,MAAM,aAAa,oBAAoB,CAAC;AAc/C,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,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACjE;AAUD,eAAO,MAAM,2BAA2B;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MAAM,EAAE,cAAc,EAAE,cAAc,GAAG,eAAe,CAKlG"}
@@ -5,14 +5,13 @@ const tslib_1 = require("tslib");
5
5
  const os_1 = require("os");
6
6
  const Either_1 = require("fp-ts/lib/Either");
7
7
  const t = tslib_1.__importStar(require("io-ts"));
8
- const ui_1 = require("../../ui");
9
8
  const cache_1 = require("../../cache");
10
9
  const instruction_1 = require("../instruction");
11
10
  const graphql_1 = require("../../graphql");
12
11
  const shared_1 = require("../../shared");
12
+ const ui_1 = require("../../ui");
13
13
  exports.EMAIL_KEY = 'FORGE_EMAIL';
14
14
  exports.API_TOKEN_KEY = 'FORGE_API_TOKEN';
15
- const AAID_KEY = 'FORGE_AAID';
16
15
  const KEYTAR_SERVICE = 'Atlassian';
17
16
  const CACHE_CREDENTIALS_KEY = 'forge-credentials';
18
17
  var KeytarAccount;
@@ -60,12 +59,14 @@ class CredentialStoreImpl {
60
59
  instructionsURL;
61
60
  keytar;
62
61
  cachedConfig;
62
+ userRepository;
63
63
  keytarAccount;
64
- constructor(logger, instructionsURL, keytar, cachedConfig) {
64
+ constructor(logger, instructionsURL, keytar, cachedConfig, userRepository) {
65
65
  this.logger = logger;
66
66
  this.instructionsURL = instructionsURL;
67
67
  this.keytar = keytar;
68
68
  this.cachedConfig = cachedConfig;
69
+ this.userRepository = userRepository;
69
70
  this.keytarAccount = (0, graphql_1.getEnvironment)(KeytarAccount);
70
71
  }
71
72
  wrapKeytarError(e) {
@@ -140,11 +141,12 @@ class CredentialStoreImpl {
140
141
  }
141
142
  }
142
143
  if (process.env[exports.API_TOKEN_KEY] && process.env[exports.EMAIL_KEY]) {
143
- return {
144
+ const credentials = {
144
145
  email: process.env[exports.EMAIL_KEY],
145
- token: process.env[exports.API_TOKEN_KEY],
146
- accountId: process.env[AAID_KEY] || ''
146
+ token: process.env[exports.API_TOKEN_KEY]
147
147
  };
148
+ const { accountId } = await this.userRepository.getUser(credentials);
149
+ return { ...credentials, accountId };
148
150
  }
149
151
  if (this.keytar) {
150
152
  const result = await this.getCredentialsKeytar(this.keytar);
@@ -177,18 +179,12 @@ class CredentialStoreImpl {
177
179
  }
178
180
  this.deleteInsecurePlaintextCredentials();
179
181
  }
180
- getInstructionsWhenInvalid() {
181
- if (process.env[exports.API_TOKEN_KEY] && process.env[exports.EMAIL_KEY]) {
182
- return ui_1.Text.error.invalidTokenInEnv(this.instructionsURL, exports.EMAIL_KEY, exports.API_TOKEN_KEY);
183
- }
184
- return ui_1.Text.error.invalidTokenInKeytar;
185
- }
186
182
  }
187
183
  exports.CredentialStoreImpl = CredentialStoreImpl;
188
- function getCredentialStore(logger) {
184
+ function getCredentialStore(logger, userRepository) {
189
185
  const keytar = getKeytar();
190
186
  const cachedConfig = cache_1.CachedConf.getCache(cache_1.CONFIG_PROJECT_NAME);
191
187
  const instructionsUrl = (0, instruction_1.getInstructionsUrl)();
192
- return new CredentialStoreImpl(logger, instructionsUrl, keytar, cachedConfig);
188
+ return new CredentialStoreImpl(logger, instructionsUrl, keytar, cachedConfig, userRepository);
193
189
  }
194
190
  exports.getCredentialStore = getCredentialStore;
@@ -3,4 +3,5 @@ export * from './login';
3
3
  export * from './logout';
4
4
  export * from './me-graphql-client';
5
5
  export * from './token-authenticator';
6
+ export * from './user-repository';
6
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/auth/personal/index.ts"],"names":[],"mappings":"AAEA,cAAc,oBAAoB,CAAC;AACnC,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/auth/personal/index.ts"],"names":[],"mappings":"AAEA,cAAc,oBAAoB,CAAC;AACnC,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC"}
@@ -6,3 +6,4 @@ tslib_1.__exportStar(require("./login"), exports);
6
6
  tslib_1.__exportStar(require("./logout"), exports);
7
7
  tslib_1.__exportStar(require("./me-graphql-client"), exports);
8
8
  tslib_1.__exportStar(require("./token-authenticator"), exports);
9
+ tslib_1.__exportStar(require("./user-repository"), exports);
@@ -1,19 +1,10 @@
1
- import { GraphQLClient, User } from '../../graphql';
2
- import { Logger } from '../../ui';
3
- import { Authenticator } from '../../auth';
4
- import { CredentialStore, PersonalApiCredentials, PersonalApiCredentialsValidated } from './credential-store';
1
+ import { User } from '../../graphql';
2
+ import { UserRepository } from '../../auth';
3
+ import { CredentialStore, PersonalApiCredentials } from './credential-store';
5
4
  export declare class LoginCommand {
6
- private readonly createGraphQLClient;
5
+ private readonly userRepository;
7
6
  private readonly store;
8
- private readonly logger;
9
- constructor(createGraphQLClient: (authenticator: Authenticator) => GraphQLClient, store: CredentialStore, logger: Logger);
10
- execute(credentials: PersonalApiCredentials): Promise<{
11
- user: User;
12
- creds: PersonalApiCredentialsValidated;
13
- analytics: {
14
- userId: string;
15
- };
16
- }>;
17
- getUser(credentials: PersonalApiCredentials): Promise<User>;
7
+ constructor(userRepository: UserRepository, store: CredentialStore);
8
+ execute(credentials: PersonalApiCredentials): Promise<User>;
18
9
  }
19
10
  //# sourceMappingURL=login.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"login.d.ts","sourceRoot":"","sources":["../../../src/auth/personal/login.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAI3C,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,+BAA+B,EAAE,MAAM,oBAAoB,CAAC;AAE9G,qBAAa,YAAY;IAErB,OAAO,CAAC,QAAQ,CAAC,mBAAmB;IACpC,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAFN,mBAAmB,EAAE,CAAC,aAAa,EAAE,aAAa,KAAK,aAAa,EACpE,KAAK,EAAE,eAAe,EACtB,MAAM,EAAE,MAAM;IAGpB,OAAO,CAAC,WAAW,EAAE,sBAAsB,GAAG,OAAO,CAAC;QACjE,IAAI,EAAE,IAAI,CAAC;QACX,KAAK,EAAE,+BAA+B,CAAC;QACvC,SAAS,EAAE;YAAE,MAAM,EAAE,MAAM,CAAA;SAAE,CAAC;KAC/B,CAAC;IAmBW,OAAO,CAAC,WAAW,EAAE,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC;CAUzE"}
1
+ {"version":3,"file":"login.d.ts","sourceRoot":"","sources":["../../../src/auth/personal/login.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAErC,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAE7E,qBAAa,YAAY;IAErB,OAAO,CAAC,QAAQ,CAAC,cAAc;IAC/B,OAAO,CAAC,QAAQ,CAAC,KAAK;gBADL,cAAc,EAAE,cAAc,EAC9B,KAAK,EAAE,eAAe;IAG5B,OAAO,CAAC,WAAW,EAAE,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC;CAOzE"}
@@ -1,40 +1,17 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.LoginCommand = void 0;
4
- const me_graphql_client_1 = require("./me-graphql-client");
5
- const token_authenticator_1 = require("./token-authenticator");
6
4
  class LoginCommand {
7
- createGraphQLClient;
5
+ userRepository;
8
6
  store;
9
- logger;
10
- constructor(createGraphQLClient, store, logger) {
11
- this.createGraphQLClient = createGraphQLClient;
7
+ constructor(userRepository, store) {
8
+ this.userRepository = userRepository;
12
9
  this.store = store;
13
- this.logger = logger;
14
10
  }
15
11
  async execute(credentials) {
16
- const user = await this.getUser(credentials);
17
- const creds = {
18
- ...credentials,
19
- accountId: user.accountId
20
- };
21
- await this.store.setCredentials(creds);
22
- return {
23
- user,
24
- creds,
25
- analytics: {
26
- userId: creds.accountId
27
- }
28
- };
29
- }
30
- async getUser(credentials) {
31
- const authenticator = new token_authenticator_1.PersonalTokenAuthenticator({
32
- getCredentials: async () => ({ ...credentials, accountId: '' }),
33
- getInstructionsWhenInvalid: this.store.getInstructionsWhenInvalid
34
- });
35
- const graphqlClient = this.createGraphQLClient(authenticator);
36
- const meClient = new me_graphql_client_1.MeGraphqlClient(graphqlClient, this.logger);
37
- return await meClient.getUser();
12
+ const user = await this.userRepository.getUser(credentials);
13
+ await this.store.setCredentials({ ...credentials, accountId: user.accountId });
14
+ return user;
38
15
  }
39
16
  }
40
17
  exports.LoginCommand = LoginCommand;
@@ -1 +1 @@
1
- {"version":3,"file":"token-authenticator.d.ts","sourceRoot":"","sources":["../../../src/auth/personal/token-authenticator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,qBAAa,0BAA2B,YAAW,aAAa;IAClD,OAAO,CAAC,QAAQ,CAAC,eAAe;gBAAf,eAAe,EAAE,gBAAgB;IAEjD,sBAAsB;IAO5B,0BAA0B,IAAI,MAAM;CAG5C"}
1
+ {"version":3,"file":"token-authenticator.d.ts","sourceRoot":"","sources":["../../../src/auth/personal/token-authenticator.ts"],"names":[],"mappings":"AACA,OAAO,EAA+B,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAE9E,OAAO,EAAiB,gBAAgB,EAAa,MAAM,oBAAoB,CAAC;AAEhF,qBAAa,0BAA2B,YAAW,aAAa;IAClD,OAAO,CAAC,QAAQ,CAAC,eAAe;gBAAf,eAAe,EAAE,gBAAgB;IAEjD,sBAAsB;IAO5B,0BAA0B,IAAI,MAAM;CAO5C"}
@@ -1,7 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PersonalTokenAuthenticator = void 0;
4
+ const ui_1 = require("../../ui");
4
5
  const authenticator_1 = require("../authenticator");
6
+ const instruction_1 = require("../instruction");
7
+ const credential_store_1 = require("./credential-store");
5
8
  class PersonalTokenAuthenticator {
6
9
  credentialStore;
7
10
  constructor(credentialStore) {
@@ -12,7 +15,11 @@ class PersonalTokenAuthenticator {
12
15
  return (0, authenticator_1.getBasicAuthorizationHeader)(email, token);
13
16
  }
14
17
  getInstructionsWhenInvalid() {
15
- return this.credentialStore.getInstructionsWhenInvalid();
18
+ const instructionsUrl = (0, instruction_1.getInstructionsUrl)();
19
+ if (process.env[credential_store_1.API_TOKEN_KEY] && process.env[credential_store_1.EMAIL_KEY]) {
20
+ return ui_1.Text.error.invalidTokenInEnv(instructionsUrl, credential_store_1.EMAIL_KEY, credential_store_1.API_TOKEN_KEY);
21
+ }
22
+ return ui_1.Text.error.invalidTokenInKeytar;
16
23
  }
17
24
  }
18
25
  exports.PersonalTokenAuthenticator = PersonalTokenAuthenticator;
@@ -0,0 +1,14 @@
1
+ import { GraphQLClient, User } from '../../graphql';
2
+ import { Logger } from '../../ui';
3
+ import { Authenticator } from '..';
4
+ import { PersonalApiCredentials } from './credential-store';
5
+ export interface UserRepository {
6
+ getUser(credentials: PersonalApiCredentials): Promise<User>;
7
+ }
8
+ export declare class UserRepositoryImpl {
9
+ private readonly createGraphQLClient;
10
+ private readonly logger;
11
+ constructor(createGraphQLClient: (authenticator: Authenticator) => GraphQLClient, logger: Logger);
12
+ getUser(credentials: PersonalApiCredentials): Promise<User>;
13
+ }
14
+ //# sourceMappingURL=user-repository.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"user-repository.d.ts","sourceRoot":"","sources":["../../../src/auth/personal/user-repository.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,OAAO,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC;AAInC,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAE5D,MAAM,WAAW,cAAc;IAC7B,OAAO,CAAC,WAAW,EAAE,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC7D;AAED,qBAAa,kBAAkB;IAE3B,OAAO,CAAC,QAAQ,CAAC,mBAAmB;IACpC,OAAO,CAAC,QAAQ,CAAC,MAAM;gBADN,mBAAmB,EAAE,CAAC,aAAa,EAAE,aAAa,KAAK,aAAa,EACpE,MAAM,EAAE,MAAM;IAGpB,OAAO,CAAC,WAAW,EAAE,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC;CASzE"}
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UserRepositoryImpl = void 0;
4
+ const me_graphql_client_1 = require("./me-graphql-client");
5
+ const token_authenticator_1 = require("./token-authenticator");
6
+ class UserRepositoryImpl {
7
+ createGraphQLClient;
8
+ logger;
9
+ constructor(createGraphQLClient, logger) {
10
+ this.createGraphQLClient = createGraphQLClient;
11
+ this.logger = logger;
12
+ }
13
+ async getUser(credentials) {
14
+ const authenticator = new token_authenticator_1.PersonalTokenAuthenticator({
15
+ getCredentials: async () => ({ ...credentials, accountId: '' })
16
+ });
17
+ const graphqlClient = this.createGraphQLClient(authenticator);
18
+ const meClient = new me_graphql_client_1.MeGraphqlClient(graphqlClient, this.logger);
19
+ return await meClient.getUser();
20
+ }
21
+ }
22
+ exports.UserRepositoryImpl = UserRepositoryImpl;
@@ -29869,6 +29869,7 @@ export declare type JiraArchivedIssueEdge = {
29869
29869
  node?: Maybe<JiraArchivedIssue>;
29870
29870
  };
29871
29871
  export declare type JiraArchivedIssuesFilterInput = {
29872
+ byArchivalDateRange?: InputMaybe<JiraArchivedOnDateRange>;
29872
29873
  byArchivedBy?: InputMaybe<Array<InputMaybe<Scalars['ID']['input']>>>;
29873
29874
  byAssignee?: InputMaybe<Array<InputMaybe<Scalars['ID']['input']>>>;
29874
29875
  byCreatedOn?: InputMaybe<Scalars['Date']['input']>;
@@ -29876,6 +29877,22 @@ export declare type JiraArchivedIssuesFilterInput = {
29876
29877
  byProject?: InputMaybe<Scalars['String']['input']>;
29877
29878
  byReporter?: InputMaybe<Array<InputMaybe<Scalars['ID']['input']>>>;
29878
29879
  };
29880
+ export declare type JiraArchivedIssuesFilterOptions = {
29881
+ __typename?: 'JiraArchivedIssuesFilterOptions';
29882
+ projectId: Scalars['ID']['output'];
29883
+ reporters: JiraUserConnection;
29884
+ };
29885
+ export declare type JiraArchivedIssuesFilterOptionsReportersArgs = {
29886
+ after?: InputMaybe<Scalars['String']['input']>;
29887
+ before?: InputMaybe<Scalars['String']['input']>;
29888
+ first?: InputMaybe<Scalars['Int']['input']>;
29889
+ last?: InputMaybe<Scalars['Int']['input']>;
29890
+ searchBy?: InputMaybe<Scalars['String']['input']>;
29891
+ };
29892
+ export declare type JiraArchivedOnDateRange = {
29893
+ from?: InputMaybe<Scalars['Date']['input']>;
29894
+ to?: InputMaybe<Scalars['Date']['input']>;
29895
+ };
29879
29896
  export declare type JiraAsset = {
29880
29897
  __typename?: 'JiraAsset';
29881
29898
  appKey?: Maybe<Scalars['String']['output']>;
@@ -35224,6 +35241,7 @@ export declare type JiraMutation = {
35224
35241
  updateProjectShortcut?: Maybe<JiraProjectShortcutPayload>;
35225
35242
  updateRadioSelectField?: Maybe<JiraRadioSelectFieldPayload>;
35226
35243
  updateReleaseNotesConfiguration?: Maybe<JiraUpdateReleaseNotesConfigurationPayload>;
35244
+ updateRemainingTimeEstimateField?: Maybe<JiraRemainingTimeEstimateFieldPayload>;
35227
35245
  updateResolutionField?: Maybe<JiraResolutionFieldPayload>;
35228
35246
  updateRichTextField?: Maybe<JiraRichTextFieldPayload>;
35229
35247
  updateSecurityLevelField?: Maybe<JiraSecurityLevelFieldPayload>;
@@ -35620,6 +35638,9 @@ export declare type JiraMutationUpdateRadioSelectFieldArgs = {
35620
35638
  export declare type JiraMutationUpdateReleaseNotesConfigurationArgs = {
35621
35639
  input: JiraUpdateReleaseNotesConfigurationInput;
35622
35640
  };
35641
+ export declare type JiraMutationUpdateRemainingTimeEstimateFieldArgs = {
35642
+ input: JiraRemainingTimeEstimateFieldInput;
35643
+ };
35623
35644
  export declare type JiraMutationUpdateResolutionFieldArgs = {
35624
35645
  input: JiraUpdateResolutionFieldInput;
35625
35646
  };
@@ -37352,6 +37373,7 @@ export declare type JiraQuery = {
37352
37373
  filters?: Maybe<Array<Maybe<JiraFilter>>>;
37353
37374
  first100JsmWorkflowTemplates?: Maybe<Array<JiraServiceManagementWorkflowTemplateMetadata>>;
37354
37375
  getArchivedIssues?: Maybe<JiraArchivedIssueConnection>;
37376
+ getArchivedIssuesFilterOptions?: Maybe<JiraArchivedIssuesFilterOptions>;
37355
37377
  getGlobalPermissionsAndGrants?: Maybe<JiraGlobalPermissionGrantsResult>;
37356
37378
  getIssueTransitionByIssueId?: Maybe<JiraIssueTransitionModal>;
37357
37379
  getIssueTransitionByIssueKey?: Maybe<JiraIssueTransitionModal>;
@@ -37657,6 +37679,9 @@ export declare type JiraQueryGetArchivedIssuesArgs = {
37657
37679
  last?: InputMaybe<Scalars['Int']['input']>;
37658
37680
  searchBy?: InputMaybe<Scalars['String']['input']>;
37659
37681
  };
37682
+ export declare type JiraQueryGetArchivedIssuesFilterOptionsArgs = {
37683
+ projectId: Scalars['ID']['input'];
37684
+ };
37660
37685
  export declare type JiraQueryGetGlobalPermissionsAndGrantsArgs = {
37661
37686
  cloudId: Scalars['ID']['input'];
37662
37687
  };
@@ -38432,6 +38457,29 @@ export declare type JiraReleasesTimeWindowInput = {
38432
38457
  after: Scalars['DateTime']['input'];
38433
38458
  before: Scalars['DateTime']['input'];
38434
38459
  };
38460
+ export declare type JiraRemainingTimeEstimateField = JiraIssueField & JiraIssueFieldConfiguration & JiraUserIssueFieldConfiguration & Node & {
38461
+ __typename?: 'JiraRemainingTimeEstimateField';
38462
+ aliasFieldId?: Maybe<Scalars['ID']['output']>;
38463
+ description?: Maybe<Scalars['String']['output']>;
38464
+ fieldConfig?: Maybe<JiraFieldConfig>;
38465
+ fieldId: Scalars['String']['output'];
38466
+ id: Scalars['ID']['output'];
38467
+ isEditableInIssueView?: Maybe<Scalars['Boolean']['output']>;
38468
+ name: Scalars['String']['output'];
38469
+ remainingEstimate?: Maybe<JiraEstimate>;
38470
+ type: Scalars['String']['output'];
38471
+ userFieldConfig?: Maybe<JiraUserFieldConfig>;
38472
+ };
38473
+ export declare type JiraRemainingTimeEstimateFieldInput = {
38474
+ id: Scalars['ID']['input'];
38475
+ remainingEstimate: JiraEstimateInput;
38476
+ };
38477
+ export declare type JiraRemainingTimeEstimateFieldPayload = Payload & {
38478
+ __typename?: 'JiraRemainingTimeEstimateFieldPayload';
38479
+ errors?: Maybe<Array<MutationError>>;
38480
+ field?: Maybe<JiraRemainingTimeEstimateField>;
38481
+ success: Scalars['Boolean']['output'];
38482
+ };
38435
38483
  export declare type JiraRemoteIssueLink = JiraConfluenceRemoteIssueLink | JiraCustomRemoteIssueLink | JiraIssueRemoteIssueLink | JiraWebRemoteIssueLink;
38436
38484
  export declare type JiraRemoveActiveBackgroundInput = {
38437
38485
  entityId: Scalars['ID']['input'];
@@ -51302,6 +51350,7 @@ export declare enum ShepherdClassificationLevelColor {
51302
51350
  BlueBold = "BLUE_BOLD",
51303
51351
  Green = "GREEN",
51304
51352
  Grey = "GREY",
51353
+ Lime = "LIME",
51305
51354
  Navy = "NAVY",
51306
51355
  None = "NONE",
51307
51356
  Orange = "ORANGE",
@@ -53570,6 +53619,16 @@ export declare type ToolchainDisassociateContainersPayload = Payload & {
53570
53619
  errors?: Maybe<Array<MutationError>>;
53571
53620
  success: Scalars['Boolean']['output'];
53572
53621
  };
53622
+ export declare enum ToolchainDisassociateEntitiesErrorCode {
53623
+ UnknownAssociation = "UNKNOWN_ASSOCIATION"
53624
+ }
53625
+ export declare type ToolchainDisassociateEntitiesErrorExtension = MutationErrorExtension & {
53626
+ __typename?: 'ToolchainDisassociateEntitiesErrorExtension';
53627
+ entityId?: Maybe<Scalars['ID']['output']>;
53628
+ errorCode?: Maybe<ToolchainDisassociateEntitiesErrorCode>;
53629
+ errorType?: Maybe<Scalars['String']['output']>;
53630
+ statusCode?: Maybe<Scalars['Int']['output']>;
53631
+ };
53573
53632
  export declare type ToolchainDisassociateEntitiesInput = {
53574
53633
  cloudId: Scalars['ID']['input'];
53575
53634
  disassociations: Array<ToolchainDisassociateEntityInput>;