@gitkraken/core-gitlens 0.66.0 → 0.68.0

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.
Files changed (64) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/git-cli/providers/config.js +2 -2
  3. package/dist/git-cli/providers/pausedOperations.js +2 -2
  4. package/dist/git-cli/providers/pausedOperations.js.map +1 -1
  5. package/dist/git-cli/providers/staging.js +1 -1
  6. package/dist/ipc/discovery.js +1 -1
  7. package/dist/plus/agents/providers/claudeCodeTranscript.js +6 -6
  8. package/dist/plus/agents/providers/claudeCodeTranscript.js.map +1 -1
  9. package/dist/plus/ai/providers/openAICompatibleProviderBase.js +1 -1
  10. package/dist/plus/integrations/authentication/configuredIntegrationService.js +2 -2
  11. package/dist/plus/integrations/authentication/configuredIntegrationService.js.map +1 -1
  12. package/dist/plus/integrations/authentication/integrationAuthenticationService.d.ts +4 -2
  13. package/dist/plus/integrations/authentication/integrationAuthenticationService.js +5 -4
  14. package/dist/plus/integrations/authentication/integrationAuthenticationService.js.map +1 -1
  15. package/dist/plus/integrations/extensionManager.js.map +1 -1
  16. package/dist/plus/integrations/index.d.ts +3 -1
  17. package/dist/plus/integrations/index.js +21 -2
  18. package/dist/plus/integrations/index.js.map +1 -1
  19. package/dist/plus/integrations/integrationService.d.ts +34 -6
  20. package/dist/plus/integrations/integrationService.js +114 -7
  21. package/dist/plus/integrations/integrationService.js.map +1 -1
  22. package/dist/plus/integrations/manager.d.ts +12 -0
  23. package/dist/plus/integrations/models/linearIssueWrites.d.ts +101 -0
  24. package/dist/plus/integrations/models/linearIssueWrites.js +0 -0
  25. package/dist/plus/integrations/models/trelloCardWrites.d.ts +117 -0
  26. package/dist/plus/integrations/models/trelloCardWrites.js +0 -0
  27. package/dist/plus/integrations/providers/azure/azure.js +2 -2
  28. package/dist/plus/integrations/providers/github.js +1 -1
  29. package/dist/plus/integrations/providers/linear.d.ts +6 -6
  30. package/dist/plus/integrations/providers/linear.js +36 -14
  31. package/dist/plus/integrations/providers/linear.js.map +1 -1
  32. package/dist/plus/integrations/providers/linearIssueWriteTransport.d.ts +27 -0
  33. package/dist/plus/integrations/providers/linearIssueWriteTransport.js +110 -0
  34. package/dist/plus/integrations/providers/linearIssueWriteTransport.js.map +1 -0
  35. package/dist/plus/integrations/providers/linearIssueWrites.d.ts +27 -0
  36. package/dist/plus/integrations/providers/linearIssueWrites.js +310 -0
  37. package/dist/plus/integrations/providers/linearIssueWrites.js.map +1 -0
  38. package/dist/plus/integrations/providers/linearIssuesEtag.d.ts +2 -0
  39. package/dist/plus/integrations/providers/linearIssuesEtag.js +27 -1
  40. package/dist/plus/integrations/providers/linearIssuesEtag.js.map +1 -1
  41. package/dist/plus/integrations/providers/providerApiClient.d.ts +2 -2
  42. package/dist/plus/integrations/providers/providerApiClient.js +5 -5
  43. package/dist/plus/integrations/providers/providerApiClient.js.map +1 -1
  44. package/dist/plus/integrations/providers/providerErrors.d.ts +9 -0
  45. package/dist/plus/integrations/providers/providerErrors.js +1 -1
  46. package/dist/plus/integrations/providers/providerErrors.js.map +1 -1
  47. package/dist/plus/integrations/providers/providersApi.d.ts +1 -0
  48. package/dist/plus/integrations/providers/providersApi.js +9 -5
  49. package/dist/plus/integrations/providers/providersApi.js.map +1 -1
  50. package/dist/plus/integrations/providers/trello.d.ts +3 -1
  51. package/dist/plus/integrations/providers/trello.js +28 -0
  52. package/dist/plus/integrations/providers/trello.js.map +1 -1
  53. package/dist/plus/integrations/providers/trelloApi.d.ts +5 -0
  54. package/dist/plus/integrations/providers/trelloApi.js +9 -0
  55. package/dist/plus/integrations/providers/trelloApi.js.map +1 -0
  56. package/dist/plus/integrations/providers/trelloCardWriteTransport.d.ts +28 -0
  57. package/dist/plus/integrations/providers/trelloCardWriteTransport.js +94 -0
  58. package/dist/plus/integrations/providers/trelloCardWriteTransport.js.map +1 -0
  59. package/dist/plus/integrations/providers/trelloCardWrites.d.ts +26 -0
  60. package/dist/plus/integrations/providers/trelloCardWrites.js +342 -0
  61. package/dist/plus/integrations/providers/trelloCardWrites.js.map +1 -0
  62. package/dist/utils/env/node/exec.js +2 -2
  63. package/docs/integrations.md +84 -1
  64. package/package.json +1 -1
@@ -2,16 +2,18 @@ import { IssueResourceDescriptor, ResourceDescriptor } from "../../../git/models
2
2
  import { IssueOrPullRequest, IssueOrPullRequestType } from "../../../git/models/issueOrPullRequest.js";
3
3
  import { Issue, IssueShape } from "../../../git/models/issue.js";
4
4
  import { Account } from "../../../git/models/author.js";
5
- import { ProviderAuthenticationSession } from "../authentication/models.js";
5
+ import { ConfiguredIntegrationDescriptor, ProviderAuthenticationSession } from "../authentication/models.js";
6
6
  import { IssuesCloudHostIntegrationId } from "../constants.js";
7
7
  import { IntegrationAuthenticationProviderDescriptor } from "../authentication/integrationAuthenticationProvider.js";
8
8
  import { IssuesForProjectOptions, ProjectIssuesDrain } from "../models/issueReads.js";
9
9
  import { IssuesIntegration } from "../models/issuesIntegration.js";
10
+ import { TrelloCardWriteConnection } from "./trelloCardWriteTransport.js";
10
11
  //#region ../plus/integrations/src/providers/trello.d.ts
11
12
  /** A Trello board, surfaced as both a "resource" (org analogue) and a "project" for issue reads. */
12
13
  export interface TrelloBoardDescriptor extends IssueResourceDescriptor {}
13
14
  export declare class TrelloIntegration extends IssuesIntegration<IssuesCloudHostIntegrationId.Trello> {
14
15
  readonly authProvider: IntegrationAuthenticationProviderDescriptor;
16
+ getCardWriteConnection(connection: ConfiguredIntegrationDescriptor, isSelectionCurrent: () => boolean): Promise<TrelloCardWriteConnection | undefined>;
15
17
  get id(): IssuesCloudHostIntegrationId.Trello;
16
18
  protected get key(): 'trello';
17
19
  get name(): string;
@@ -4,6 +4,7 @@ import { IntegrationReadUnavailableError } from "../errors.js";
4
4
  import "../constants.js";
5
5
  import { providersMetadata } from "./metadata.js";
6
6
  import { toTokenWithInfo } from "../authentication/models.js";
7
+ import { ObservedAuthenticationProvider } from "../authentication/observedAuthenticationProvider.js";
7
8
  import { fromProviderIssue, toIssueShape } from "./models.js";
8
9
  import { IssuesIntegration } from "../models/issuesIntegration.js";
9
10
  //#region ../plus/integrations/src/providers/trello.ts
@@ -16,6 +17,33 @@ const authProvider = Object.freeze({
16
17
  const recentAccountTTL = 6e4;
17
18
  var TrelloIntegration = class extends IssuesIntegration {
18
19
  authProvider = authProvider;
20
+ async getCardWriteConnection(connection, isSelectionCurrent) {
21
+ if (!isSelectionCurrent()) return void 0;
22
+ const { id, cloud } = connection;
23
+ const provider = await this.authenticationService.get(this.id);
24
+ const capture = provider instanceof ObservedAuthenticationProvider ? provider.captureRelationshipSession({
25
+ ...this.authProviderDescriptor,
26
+ connectionId: id,
27
+ cloud
28
+ }) : void 0;
29
+ const session = await this.resolveReadSessionOrThrow(id, void 0, cloud);
30
+ if (session?.id !== id || session.cloud !== cloud || !session.accessToken) return void 0;
31
+ const appKey = this.appKeyFor(session);
32
+ if (!appKey) return void 0;
33
+ const tracked = this.trackWriteSession(session, {
34
+ cloud,
35
+ observeHostChanges: true
36
+ });
37
+ const currency = capture?.(session) ?? await this.authenticationService.trackStoredRelationshipSession(this.id, session, { throwOnLookupError: true });
38
+ if (currency == null) return void 0;
39
+ const isRetired = () => !isSelectionCurrent() || !this.isIntegrationAccessEnabled() || tracked.isRetired() || !currency.isCurrent();
40
+ return {
41
+ appKey,
42
+ accessToken: session.accessToken,
43
+ isCurrent: currency.verify,
44
+ isRetired
45
+ };
46
+ }
19
47
  get id() {
20
48
  return "trello";
21
49
  }
@@ -1 +1 @@
1
- {"version":3,"file":"trello.js","names":[],"sources":["../../../../../plus/integrations/src/providers/trello.ts"],"sourcesContent":["import type { Account } from '@gitlens/git/models/author.js';\nimport type { Issue, IssueShape } from '@gitlens/git/models/issue.js';\nimport type { IssueOrPullRequest, IssueOrPullRequestType } from '@gitlens/git/models/issueOrPullRequest.js';\nimport type { IssueResourceDescriptor, ResourceDescriptor } from '@gitlens/git/models/resourceDescriptor.js';\nimport { isIssueResourceDescriptor } from '@gitlens/git/utils/resourceDescriptor.utils.js';\nimport { PromiseCache } from '@gitlens/utils/promiseCache.js';\nimport type { IntegrationAuthenticationProviderDescriptor } from '../authentication/integrationAuthenticationProvider.js';\nimport type { ProviderAuthenticationSession } from '../authentication/models.js';\nimport { toTokenWithInfo } from '../authentication/models.js';\nimport { IssuesCloudHostIntegrationId } from '../constants.js';\nimport { IntegrationReadUnavailableError } from '../errors.js';\nimport type { IssuesForProjectOptions, ProjectIssuesDrain } from '../models/issueReads.js';\nimport { IssuesIntegration } from '../models/issuesIntegration.js';\nimport { providersMetadata } from './metadata.js';\nimport { fromProviderIssue, toIssueShape } from './models.js';\n\nconst metadata = providersMetadata[IssuesCloudHostIntegrationId.Trello];\nconst authProvider = Object.freeze({ id: metadata.id, scopes: metadata.scopes });\n/** Long enough to span one tracker read, short enough that a profile change shows on the next. */\nconst recentAccountTTL = 60 * 1000;\n\n/** A Trello board, surfaced as both a \"resource\" (org analogue) and a \"project\" for issue reads. */\nexport interface TrelloBoardDescriptor extends IssueResourceDescriptor {}\n\nexport class TrelloIntegration extends IssuesIntegration<IssuesCloudHostIntegrationId.Trello> {\n\treadonly authProvider: IntegrationAuthenticationProviderDescriptor = authProvider;\n\n\toverride get id(): IssuesCloudHostIntegrationId.Trello {\n\t\treturn IssuesCloudHostIntegrationId.Trello;\n\t}\n\tprotected override get key(): 'trello' {\n\t\treturn 'trello';\n\t}\n\toverride get name(): string {\n\t\treturn metadata.name;\n\t}\n\toverride get domain(): string {\n\t\treturn metadata.domain;\n\t}\n\n\t/** The Trello client requires the app key paired with the token; a session without one can't read. */\n\tprivate appKeyFor(session: ProviderAuthenticationSession): string | undefined {\n\t\treturn session.appKey;\n\t}\n\n\t/**\n\t * Resolves the app key or throws — a session that authenticated but carries no app key can't read Trello,\n\t * and must be surfaced as a broken read (warning + fetchFailed) rather than an empty account.\n\t */\n\tprivate requireAppKey(session: ProviderAuthenticationSession): string {\n\t\tconst appKey = this.appKeyFor(session);\n\t\tif (appKey == null) {\n\t\t\tthrow new IntegrationReadUnavailableError(metadata.name, 'missing app key (session has no appKey)');\n\t\t}\n\t\treturn appKey;\n\t}\n\n\t/**\n\t * Always asks Trello: the host's current-account cache decides when this runs. The member lookup is\n\t * account-wide, so the answer is lent briefly to the per-board lookup a tracker read makes right after it.\n\t */\n\tprotected override async getProviderCurrentAccount(\n\t\tsession: ProviderAuthenticationSession,\n\t): Promise<Account | undefined> {\n\t\tconst account = await this.fetchAccount(session);\n\t\tif (account != null) {\n\t\t\tthis._recentAccounts.set(session.accessToken, Promise.resolve(account));\n\t\t}\n\t\treturn account;\n\t}\n\n\tprotected override getProviderUncachedAccountForResource(\n\t\tsession: ProviderAuthenticationSession,\n\t\t_resource: ResourceDescriptor,\n\t): Promise<Account | undefined> {\n\t\treturn this.fetchAccount(session, this.requireAppKey(session));\n\t}\n\n\tprotected override async getProviderAccountForResource(\n\t\tsession: ProviderAuthenticationSession,\n\t\t_resource: ResourceDescriptor,\n\t): Promise<Account | undefined> {\n\t\tconst appKey = this.requireAppKey(session);\n\t\treturn this._recentAccounts.getOrCreate(session.accessToken, () => this.fetchAccount(session, appKey), {\n\t\t\tevictWhen: account => account == null,\n\t\t});\n\t}\n\n\tprotected override clearDiscoveryCaches(): void {\n\t\tthis._recentAccounts.clear();\n\t}\n\n\tprivate readonly _recentAccounts = new PromiseCache<string, Account | undefined>({\n\t\tcapacity: 10,\n\t\tcreateTTL: recentAccountTTL,\n\t});\n\n\tprivate async fetchAccount(\n\t\tsession: ProviderAuthenticationSession,\n\t\tappKey: string = this.requireAppKey(session),\n\t): Promise<Account | undefined> {\n\t\tconst api = await this.getProvidersApi();\n\t\tconst user = await api.getTrelloCurrentUser(toTokenWithInfo(this.id, session), appKey);\n\t\tif (user == null) return undefined;\n\n\t\treturn {\n\t\t\tprovider: this,\n\t\t\tid: user.id,\n\t\t\tname: user.name,\n\t\t\tusername: user.username,\n\t\t\temail: user.email,\n\t\t\tavatarUrl: user.avatarUrl ?? undefined,\n\t\t};\n\t}\n\n\tprotected override async getProviderResourcesForUser(\n\t\tsession: ProviderAuthenticationSession,\n\t): Promise<TrelloBoardDescriptor[] | undefined> {\n\t\tconst appKey = this.requireAppKey(session);\n\n\t\tconst api = await this.getProvidersApi();\n\t\tconst boards = await api.getTrelloBoardsForCurrentUser(toTokenWithInfo(this.id, session), appKey);\n\t\treturn boards?.map(b => ({ key: b.id, id: b.id, name: b.name }));\n\t}\n\n\tprotected override getProviderProjectsForResources(\n\t\t_session: ProviderAuthenticationSession,\n\t\tresources: ResourceDescriptor[],\n\t): Promise<TrelloBoardDescriptor[] | undefined> {\n\t\t// Trello boards are both the resource and the project scope, so projects are the boards themselves.\n\t\treturn Promise.resolve(\n\t\t\tresources.filter(isIssueResourceDescriptor).map(r => ({ key: r.key, id: r.id, name: r.name })),\n\t\t);\n\t}\n\n\tprotected override async getProviderIssuesForProject(\n\t\tsession: ProviderAuthenticationSession,\n\t\tproject: ResourceDescriptor,\n\t\toptions?: IssuesForProjectOptions,\n\t): Promise<IssueShape[] | undefined> {\n\t\treturn (await this.getProviderIssuesForProjectWithTruncation(session, project, options))?.values;\n\t}\n\n\tprotected override async getProviderIssuesForProjectWithTruncation(\n\t\tsession: ProviderAuthenticationSession,\n\t\tproject: ResourceDescriptor,\n\t\toptions?: IssuesForProjectOptions,\n\t): Promise<ProjectIssuesDrain | undefined> {\n\t\t// A non-issue descriptor genuinely has nothing to read (empty), but a missing app key is a broken read.\n\t\tif (!isIssueResourceDescriptor(project)) return undefined;\n\n\t\t// The board read always excludes archived cards, and a card has no other state, so only open cards can be\n\t\t// read. Refused rather than ignored: answering `closed` with the open cards would publish them as closed.\n\t\tif (options?.state != null && options.state !== 'open') {\n\t\t\tthrow new IntegrationReadUnavailableError(metadata.name, `issue state '${options.state}' is not supported`);\n\t\t}\n\n\t\tconst appKey = this.requireAppKey(session);\n\n\t\tconst api = await this.getProvidersApi();\n\t\tconst tokenWithInfo = toTokenWithInfo(this.id, session);\n\n\t\t// Enrich issues with their board list names (card status), mirroring gitkraken.dev's Trello reads.\n\t\tconst lists = await api.getTrelloListsForBoard(tokenWithInfo, appKey, project.id);\n\t\tconst trelloBoardListsById = lists?.reduce<Record<string, { name: string }>>((acc, list) => {\n\t\t\tacc[list.id] = { name: list.name };\n\t\t\treturn acc;\n\t\t}, {});\n\t\tconst boardProject = {\n\t\t\tid: project.id,\n\t\t\tname: project.name,\n\t\t\tresourceId: project.id,\n\t\t\tresourceName: project.name,\n\t\t};\n\n\t\tconst result = await api.getTrelloIssuesForBoard(tokenWithInfo, appKey, project.id, {\n\t\t\tassigneeLogins: options?.user != null ? [options.user] : undefined,\n\t\t\ttrelloBoardListsById: trelloBoardListsById,\n\t\t\tsort: options?.sort,\n\t\t});\n\n\t\tconst values = result.values.flatMap(issue => {\n\t\t\tconst mapped = toIssueShape(issue, this, { projection: 'project' });\n\t\t\treturn mapped == null ? [] : [{ ...mapped, project: boardProject } satisfies IssueShape];\n\t\t});\n\n\t\t// Trello's search caps results and reports the cap through `metadata.completeness` (partial/unknown),\n\t\t// never a cursor. Surface that as terminal truncation; there is no next page to fetch, so retrying the\n\t\t// same read cannot recover the omitted cards (D11).\n\t\tconst truncated = result.metadata != null && result.metadata.completeness !== 'complete';\n\t\treturn truncated\n\t\t\t? { values: values, truncated: true, recovery: 'none', metadata: result.metadata }\n\t\t\t: { values: values, truncated: false, metadata: result.metadata };\n\t}\n\n\tprotected override searchProviderMyIssues(\n\t\t_session: ProviderAuthenticationSession,\n\t\t_resources?: ResourceDescriptor[],\n\t\t_cancellation?: AbortSignal,\n\t): Promise<IssueShape[] | undefined> {\n\t\t// Trello has no cross-board \"issues assigned to me\" endpoint; issues are read per board via\n\t\t// getIssuesForProject. Callers that need them enumerate boards first.\n\t\treturn Promise.resolve(undefined);\n\t}\n\n\tprotected override getProviderLinkedIssueOrPullRequest(\n\t\t_session: ProviderAuthenticationSession,\n\t\t_resource: ResourceDescriptor,\n\t\t_id: { id: string; key: string },\n\t\t_type: undefined | IssueOrPullRequestType,\n\t): Promise<IssueOrPullRequest | undefined> {\n\t\treturn Promise.resolve(undefined);\n\t}\n\n\tprotected override async getProviderIssue(\n\t\tsession: ProviderAuthenticationSession,\n\t\tresource: ResourceDescriptor,\n\t\tid: string,\n\t): Promise<Issue | undefined> {\n\t\tif (!isIssueResourceDescriptor(resource)) return undefined;\n\n\t\tconst appKey = this.requireAppKey(session);\n\t\tconst api = await this.getProvidersApi();\n\t\tconst tokenWithInfo = toTokenWithInfo(this.id, session);\n\t\tconst lists = await api.getTrelloListsForBoard(tokenWithInfo, appKey, resource.id);\n\t\tconst trelloBoardListsById = lists?.reduce<Record<string, { name: string }>>((acc, list) => {\n\t\t\tacc[list.id] = { name: list.name };\n\t\t\treturn acc;\n\t\t}, {});\n\n\t\t// Branch-association round-trips use the encoded entity identifier's stable Trello card id. Resolve that\n\t\t// directly so large boards don't require a capped whole-board scan; keep a numeric idShort fallback so\n\t\t// legacy/manual callers that still pass the board-local display number continue to resolve.\n\t\tlet issue = await api.getTrelloCard(tokenWithInfo, appKey, id, {\n\t\t\ttrelloBoardListsById: trelloBoardListsById,\n\t\t});\n\t\tif (issue == null && /^[0-9]+$/.test(id)) {\n\t\t\tissue = (\n\t\t\t\tawait api.getTrelloIssuesForBoard(tokenWithInfo, appKey, resource.id, {\n\t\t\t\t\ttrelloBoardListsById: trelloBoardListsById,\n\t\t\t\t})\n\t\t\t).values.find(issue => issue.number === id);\n\t\t}\n\n\t\treturn issue != null\n\t\t\t? fromProviderIssue(issue, this, {\n\t\t\t\t\tprojection: 'point',\n\t\t\t\t\tproject: {\n\t\t\t\t\t\tid: resource.id,\n\t\t\t\t\t\tname: resource.name,\n\t\t\t\t\t\tresourceId: resource.id,\n\t\t\t\t\t\tresourceName: resource.name,\n\t\t\t\t\t},\n\t\t\t\t})\n\t\t\t: undefined;\n\t}\n}\n"],"mappings":";;;;;;;;;AAgBA,MAAM,WAAW,kBAAA;AACjB,MAAM,eAAe,OAAO,OAAO;CAA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AK,EAAE,GACtC,SACC,MAAM,IAAI,wBAAwB,eAAe,QAAQ,SAAS,IAAI,EAC/C,qBACvB,CAAC,EAAA,CACA,OAAO,MAAK,UAAS,MAAM,WAAW,EAAE;EAG3C,OAAO,SAAS,OACb,kBAAkB,OAAO,MAAM;GAC/B,YAAY;GACZ,SAAS;IACR,IAAI,SAAS;IACb,MAAM,SAAS;IACf,YAAY,SAAS;IACrB,cAAc,SAAS;GACxB;EACD,CAAC,IACA,KAAA;CACJ;AACD"}
1
+ {"version":3,"file":"trello.js","names":[],"sources":["../../../../../plus/integrations/src/providers/trello.ts"],"sourcesContent":["import type { Account } from '@gitlens/git/models/author.js';\nimport type { Issue, IssueShape } from '@gitlens/git/models/issue.js';\nimport type { IssueOrPullRequest, IssueOrPullRequestType } from '@gitlens/git/models/issueOrPullRequest.js';\nimport type { IssueResourceDescriptor, ResourceDescriptor } from '@gitlens/git/models/resourceDescriptor.js';\nimport { isIssueResourceDescriptor } from '@gitlens/git/utils/resourceDescriptor.utils.js';\nimport { PromiseCache } from '@gitlens/utils/promiseCache.js';\nimport type { IntegrationAuthenticationProviderDescriptor } from '../authentication/integrationAuthenticationProvider.js';\nimport type { ConfiguredIntegrationDescriptor, ProviderAuthenticationSession } from '../authentication/models.js';\nimport { toTokenWithInfo } from '../authentication/models.js';\nimport { ObservedAuthenticationProvider } from '../authentication/observedAuthenticationProvider.js';\nimport { IssuesCloudHostIntegrationId } from '../constants.js';\nimport { IntegrationReadUnavailableError } from '../errors.js';\nimport type { IssuesForProjectOptions, ProjectIssuesDrain } from '../models/issueReads.js';\nimport { IssuesIntegration } from '../models/issuesIntegration.js';\nimport { providersMetadata } from './metadata.js';\nimport { fromProviderIssue, toIssueShape } from './models.js';\nimport type { TrelloCardWriteConnection } from './trelloCardWriteTransport.js';\n\nconst metadata = providersMetadata[IssuesCloudHostIntegrationId.Trello];\nconst authProvider = Object.freeze({ id: metadata.id, scopes: metadata.scopes });\n/** Long enough to span one tracker read, short enough that a profile change shows on the next. */\nconst recentAccountTTL = 60 * 1000;\n\n/** A Trello board, surfaced as both a \"resource\" (org analogue) and a \"project\" for issue reads. */\nexport interface TrelloBoardDescriptor extends IssueResourceDescriptor {}\n\nexport class TrelloIntegration extends IssuesIntegration<IssuesCloudHostIntegrationId.Trello> {\n\treadonly authProvider: IntegrationAuthenticationProviderDescriptor = authProvider;\n\n\tasync getCardWriteConnection(\n\t\tconnection: ConfiguredIntegrationDescriptor,\n\t\tisSelectionCurrent: () => boolean,\n\t): Promise<TrelloCardWriteConnection | undefined> {\n\t\tif (!isSelectionCurrent()) return undefined;\n\n\t\tconst { id, cloud } = connection;\n\t\tconst provider = await this.authenticationService.get(this.id);\n\t\tconst capture =\n\t\t\tprovider instanceof ObservedAuthenticationProvider\n\t\t\t\t? provider.captureRelationshipSession({\n\t\t\t\t\t\t...this.authProviderDescriptor,\n\t\t\t\t\t\tconnectionId: id,\n\t\t\t\t\t\tcloud: cloud,\n\t\t\t\t\t})\n\t\t\t\t: undefined;\n\t\tconst session = await this.resolveReadSessionOrThrow(id, undefined, cloud);\n\t\tif (session?.id !== id || session.cloud !== cloud || !session.accessToken) return undefined;\n\n\t\tconst appKey = this.appKeyFor(session);\n\t\tif (!appKey) return undefined;\n\n\t\tconst tracked = this.trackWriteSession(session, { cloud: cloud, observeHostChanges: true });\n\t\tconst currency =\n\t\t\tcapture?.(session) ??\n\t\t\t(await this.authenticationService.trackStoredRelationshipSession(this.id, session, {\n\t\t\t\tthrowOnLookupError: true,\n\t\t\t}));\n\t\tif (currency == null) return undefined;\n\n\t\tconst isRetired = () =>\n\t\t\t!isSelectionCurrent() || !this.isIntegrationAccessEnabled() || tracked.isRetired() || !currency.isCurrent();\n\t\treturn { appKey: appKey, accessToken: session.accessToken, isCurrent: currency.verify, isRetired: isRetired };\n\t}\n\n\toverride get id(): IssuesCloudHostIntegrationId.Trello {\n\t\treturn IssuesCloudHostIntegrationId.Trello;\n\t}\n\tprotected override get key(): 'trello' {\n\t\treturn 'trello';\n\t}\n\toverride get name(): string {\n\t\treturn metadata.name;\n\t}\n\toverride get domain(): string {\n\t\treturn metadata.domain;\n\t}\n\n\t/** The Trello client requires the app key paired with the token; a session without one can't read. */\n\tprivate appKeyFor(session: ProviderAuthenticationSession): string | undefined {\n\t\treturn session.appKey;\n\t}\n\n\t/**\n\t * Resolves the app key or throws — a session that authenticated but carries no app key can't read Trello,\n\t * and must be surfaced as a broken read (warning + fetchFailed) rather than an empty account.\n\t */\n\tprivate requireAppKey(session: ProviderAuthenticationSession): string {\n\t\tconst appKey = this.appKeyFor(session);\n\t\tif (appKey == null) {\n\t\t\tthrow new IntegrationReadUnavailableError(metadata.name, 'missing app key (session has no appKey)');\n\t\t}\n\t\treturn appKey;\n\t}\n\n\t/**\n\t * Always asks Trello: the host's current-account cache decides when this runs. The member lookup is\n\t * account-wide, so the answer is lent briefly to the per-board lookup a tracker read makes right after it.\n\t */\n\tprotected override async getProviderCurrentAccount(\n\t\tsession: ProviderAuthenticationSession,\n\t): Promise<Account | undefined> {\n\t\tconst account = await this.fetchAccount(session);\n\t\tif (account != null) {\n\t\t\tthis._recentAccounts.set(session.accessToken, Promise.resolve(account));\n\t\t}\n\t\treturn account;\n\t}\n\n\tprotected override getProviderUncachedAccountForResource(\n\t\tsession: ProviderAuthenticationSession,\n\t\t_resource: ResourceDescriptor,\n\t): Promise<Account | undefined> {\n\t\treturn this.fetchAccount(session, this.requireAppKey(session));\n\t}\n\n\tprotected override async getProviderAccountForResource(\n\t\tsession: ProviderAuthenticationSession,\n\t\t_resource: ResourceDescriptor,\n\t): Promise<Account | undefined> {\n\t\tconst appKey = this.requireAppKey(session);\n\t\treturn this._recentAccounts.getOrCreate(session.accessToken, () => this.fetchAccount(session, appKey), {\n\t\t\tevictWhen: account => account == null,\n\t\t});\n\t}\n\n\tprotected override clearDiscoveryCaches(): void {\n\t\tthis._recentAccounts.clear();\n\t}\n\n\tprivate readonly _recentAccounts = new PromiseCache<string, Account | undefined>({\n\t\tcapacity: 10,\n\t\tcreateTTL: recentAccountTTL,\n\t});\n\n\tprivate async fetchAccount(\n\t\tsession: ProviderAuthenticationSession,\n\t\tappKey: string = this.requireAppKey(session),\n\t): Promise<Account | undefined> {\n\t\tconst api = await this.getProvidersApi();\n\t\tconst user = await api.getTrelloCurrentUser(toTokenWithInfo(this.id, session), appKey);\n\t\tif (user == null) return undefined;\n\n\t\treturn {\n\t\t\tprovider: this,\n\t\t\tid: user.id,\n\t\t\tname: user.name,\n\t\t\tusername: user.username,\n\t\t\temail: user.email,\n\t\t\tavatarUrl: user.avatarUrl ?? undefined,\n\t\t};\n\t}\n\n\tprotected override async getProviderResourcesForUser(\n\t\tsession: ProviderAuthenticationSession,\n\t): Promise<TrelloBoardDescriptor[] | undefined> {\n\t\tconst appKey = this.requireAppKey(session);\n\n\t\tconst api = await this.getProvidersApi();\n\t\tconst boards = await api.getTrelloBoardsForCurrentUser(toTokenWithInfo(this.id, session), appKey);\n\t\treturn boards?.map(b => ({ key: b.id, id: b.id, name: b.name }));\n\t}\n\n\tprotected override getProviderProjectsForResources(\n\t\t_session: ProviderAuthenticationSession,\n\t\tresources: ResourceDescriptor[],\n\t): Promise<TrelloBoardDescriptor[] | undefined> {\n\t\t// Trello boards are both the resource and the project scope, so projects are the boards themselves.\n\t\treturn Promise.resolve(\n\t\t\tresources.filter(isIssueResourceDescriptor).map(r => ({ key: r.key, id: r.id, name: r.name })),\n\t\t);\n\t}\n\n\tprotected override async getProviderIssuesForProject(\n\t\tsession: ProviderAuthenticationSession,\n\t\tproject: ResourceDescriptor,\n\t\toptions?: IssuesForProjectOptions,\n\t): Promise<IssueShape[] | undefined> {\n\t\treturn (await this.getProviderIssuesForProjectWithTruncation(session, project, options))?.values;\n\t}\n\n\tprotected override async getProviderIssuesForProjectWithTruncation(\n\t\tsession: ProviderAuthenticationSession,\n\t\tproject: ResourceDescriptor,\n\t\toptions?: IssuesForProjectOptions,\n\t): Promise<ProjectIssuesDrain | undefined> {\n\t\t// A non-issue descriptor genuinely has nothing to read (empty), but a missing app key is a broken read.\n\t\tif (!isIssueResourceDescriptor(project)) return undefined;\n\n\t\t// The board read always excludes archived cards, and a card has no other state, so only open cards can be\n\t\t// read. Refused rather than ignored: answering `closed` with the open cards would publish them as closed.\n\t\tif (options?.state != null && options.state !== 'open') {\n\t\t\tthrow new IntegrationReadUnavailableError(metadata.name, `issue state '${options.state}' is not supported`);\n\t\t}\n\n\t\tconst appKey = this.requireAppKey(session);\n\n\t\tconst api = await this.getProvidersApi();\n\t\tconst tokenWithInfo = toTokenWithInfo(this.id, session);\n\n\t\t// Enrich issues with their board list names (card status), mirroring gitkraken.dev's Trello reads.\n\t\tconst lists = await api.getTrelloListsForBoard(tokenWithInfo, appKey, project.id);\n\t\tconst trelloBoardListsById = lists?.reduce<Record<string, { name: string }>>((acc, list) => {\n\t\t\tacc[list.id] = { name: list.name };\n\t\t\treturn acc;\n\t\t}, {});\n\t\tconst boardProject = {\n\t\t\tid: project.id,\n\t\t\tname: project.name,\n\t\t\tresourceId: project.id,\n\t\t\tresourceName: project.name,\n\t\t};\n\n\t\tconst result = await api.getTrelloIssuesForBoard(tokenWithInfo, appKey, project.id, {\n\t\t\tassigneeLogins: options?.user != null ? [options.user] : undefined,\n\t\t\ttrelloBoardListsById: trelloBoardListsById,\n\t\t\tsort: options?.sort,\n\t\t});\n\n\t\tconst values = result.values.flatMap(issue => {\n\t\t\tconst mapped = toIssueShape(issue, this, { projection: 'project' });\n\t\t\treturn mapped == null ? [] : [{ ...mapped, project: boardProject } satisfies IssueShape];\n\t\t});\n\n\t\t// Trello's search caps results and reports the cap through `metadata.completeness` (partial/unknown),\n\t\t// never a cursor. Surface that as terminal truncation; there is no next page to fetch, so retrying the\n\t\t// same read cannot recover the omitted cards (D11).\n\t\tconst truncated = result.metadata != null && result.metadata.completeness !== 'complete';\n\t\treturn truncated\n\t\t\t? { values: values, truncated: true, recovery: 'none', metadata: result.metadata }\n\t\t\t: { values: values, truncated: false, metadata: result.metadata };\n\t}\n\n\tprotected override searchProviderMyIssues(\n\t\t_session: ProviderAuthenticationSession,\n\t\t_resources?: ResourceDescriptor[],\n\t\t_cancellation?: AbortSignal,\n\t): Promise<IssueShape[] | undefined> {\n\t\t// Trello has no cross-board \"issues assigned to me\" endpoint; issues are read per board via\n\t\t// getIssuesForProject. Callers that need them enumerate boards first.\n\t\treturn Promise.resolve(undefined);\n\t}\n\n\tprotected override getProviderLinkedIssueOrPullRequest(\n\t\t_session: ProviderAuthenticationSession,\n\t\t_resource: ResourceDescriptor,\n\t\t_id: { id: string; key: string },\n\t\t_type: undefined | IssueOrPullRequestType,\n\t): Promise<IssueOrPullRequest | undefined> {\n\t\treturn Promise.resolve(undefined);\n\t}\n\n\tprotected override async getProviderIssue(\n\t\tsession: ProviderAuthenticationSession,\n\t\tresource: ResourceDescriptor,\n\t\tid: string,\n\t): Promise<Issue | undefined> {\n\t\tif (!isIssueResourceDescriptor(resource)) return undefined;\n\n\t\tconst appKey = this.requireAppKey(session);\n\t\tconst api = await this.getProvidersApi();\n\t\tconst tokenWithInfo = toTokenWithInfo(this.id, session);\n\t\tconst lists = await api.getTrelloListsForBoard(tokenWithInfo, appKey, resource.id);\n\t\tconst trelloBoardListsById = lists?.reduce<Record<string, { name: string }>>((acc, list) => {\n\t\t\tacc[list.id] = { name: list.name };\n\t\t\treturn acc;\n\t\t}, {});\n\n\t\t// Branch-association round-trips use the encoded entity identifier's stable Trello card id. Resolve that\n\t\t// directly so large boards don't require a capped whole-board scan; keep a numeric idShort fallback so\n\t\t// legacy/manual callers that still pass the board-local display number continue to resolve.\n\t\tlet issue = await api.getTrelloCard(tokenWithInfo, appKey, id, {\n\t\t\ttrelloBoardListsById: trelloBoardListsById,\n\t\t});\n\t\tif (issue == null && /^[0-9]+$/.test(id)) {\n\t\t\tissue = (\n\t\t\t\tawait api.getTrelloIssuesForBoard(tokenWithInfo, appKey, resource.id, {\n\t\t\t\t\ttrelloBoardListsById: trelloBoardListsById,\n\t\t\t\t})\n\t\t\t).values.find(issue => issue.number === id);\n\t\t}\n\n\t\treturn issue != null\n\t\t\t? fromProviderIssue(issue, this, {\n\t\t\t\t\tprojection: 'point',\n\t\t\t\t\tproject: {\n\t\t\t\t\t\tid: resource.id,\n\t\t\t\t\t\tname: resource.name,\n\t\t\t\t\t\tresourceId: resource.id,\n\t\t\t\t\t\tresourceName: resource.name,\n\t\t\t\t\t},\n\t\t\t\t})\n\t\t\t: undefined;\n\t}\n}\n"],"mappings":";;;;;;;;;;AAkBA,MAAM,WAAW,kBAAA;AACjB,MAAM,eAAe,OAAO,OAAO;CAAE,IAAI,SAAS;CAAI,QAAQ,SAAS;AAAO,CAAC;;AAE/E,MAAM,mBAAmB;AAKzB,IAAa,oBAAb,cAAuC,kBAAuD;CAC7F,eAAqE;CAErE,MAAM,uBACL,YACA,oBACiD;EACjD,IAAI,CAAC,mBAAmB,GAAG,OAAO,KAAA;EAElC,MAAM,EAAE,IAAI,UAAU;EACtB,MAAM,WAAW,MAAM,KAAK,sBAAsB,IAAI,KAAK,EAAE;EAC7D,MAAM,UACL,oBAAoB,iCACjB,SAAS,2BAA2B;GACpC,GAAG,KAAK;GACR,cAAc;GACP;EACR,CAAC,IACA,KAAA;EACJ,MAAM,UAAU,MAAM,KAAK,0BAA0B,IAAI,KAAA,GAAW,KAAK;EACzE,IAAI,SAAS,OAAO,MAAM,QAAQ,UAAU,SAAS,CAAC,QAAQ,aAAa,OAAO,KAAA;EAElF,MAAM,SAAS,KAAK,UAAU,OAAO;EACrC,IAAI,CAAC,QAAQ,OAAO,KAAA;EAEpB,MAAM,UAAU,KAAK,kBAAkB,SAAS;GAAS;GAAO,oBAAoB;EAAK,CAAC;EAC1F,MAAM,WACL,UAAU,OAAO,KAChB,MAAM,KAAK,sBAAsB,+BAA+B,KAAK,IAAI,SAAS,EAClF,oBAAoB,KACrB,CAAC;EACF,IAAI,YAAY,MAAM,OAAO,KAAA;EAE7B,MAAM,kBACL,CAAC,mBAAmB,KAAK,CA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AAS,QAAQ,WAAW,KAAK,EAAE,GACtC,SACC,MAAM,IAAI,wBAAwB,eAAe,QAAQ,SAAS,IAAI,EAC/C,qBACvB,CAAC,EAAA,CACA,OAAO,MAAK,UAAS,MAAM,WAAW,EAAE;EAG3C,OAAO,SAAS,OACb,kBAAkB,OAAO,MAAM;GAC/B,YAAY;GACZ,SAAS;IACR,IAAI,SAAS;IACb,MAAM,SAAS;IACf,YAAY,SAAS;IACrB,cAAc,SAAS;GACxB;EACD,CAAC,IACA,KAAA;CACJ;AACD"}
@@ -0,0 +1,5 @@
1
+ //#region ../plus/integrations/src/providers/trelloApi.d.ts
2
+ export declare const trelloBaseUrl = "https://api.trello.com";
3
+ export declare function getTrelloAuthHeaders(appKey: string, token: string): Record<string, string>;
4
+ //#endregion
5
+ //# sourceMappingURL=trelloApi.d.ts.map
@@ -0,0 +1,9 @@
1
+ //#region ../plus/integrations/src/providers/trelloApi.ts
2
+ const trelloBaseUrl = "https://api.trello.com";
3
+ function getTrelloAuthHeaders(appKey, token) {
4
+ return { Authorization: `OAuth oauth_consumer_key="${appKey}", oauth_token="${token}"` };
5
+ }
6
+ //#endregion
7
+ export { getTrelloAuthHeaders, trelloBaseUrl };
8
+
9
+ //# sourceMappingURL=trelloApi.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trelloApi.js","names":[],"sources":["../../../../../plus/integrations/src/providers/trelloApi.ts"],"sourcesContent":["export const trelloBaseUrl = 'https://api.trello.com';\n\nexport function getTrelloAuthHeaders(appKey: string, token: string): Record<string, string> {\n\treturn {\n\t\tAuthorization: `OAuth oauth_consumer_key=\"${appKey}\", oauth_token=\"${token}\"`,\n\t};\n}\n"],"mappings":";AAAA,MAAa,gBAAgB;AAE7B,SAAgB,qBAAqB,QAAgB,OAAuC;CAC3F,OAAO,EACN,eAAe,6BAA6B,OAAO,kBAAkB,MAAM,GAC5E;AACD"}
@@ -0,0 +1,28 @@
1
+ import { TrelloCardWriteFailure } from "../models/trelloCardWrites.js";
2
+ import { ProviderRequestFunction } from "./models.js";
3
+ //#region ../plus/integrations/src/providers/trelloCardWriteTransport.d.ts
4
+ type FailureReason = TrelloCardWriteFailure['reason'];
5
+ export declare class TrelloCardWriteError extends Error {
6
+ readonly failure: TrelloCardWriteFailure;
7
+ static is(ex: unknown): ex is TrelloCardWriteError;
8
+ constructor(reason: FailureReason, dispatch?: 'none' | 'rejected' | 'uncertain');
9
+ }
10
+ export declare function toTrelloCardWriteFailure(ex: unknown): TrelloCardWriteFailure;
11
+ export type TrelloCardWriteConnection = {
12
+ appKey: string;
13
+ accessToken: string;
14
+ isCurrent: () => Promise<boolean>;
15
+ isRetired: () => boolean;
16
+ };
17
+ export declare class TrelloCardWriteTransport {
18
+ private readonly request;
19
+ private readonly connection;
20
+ private readonly headers;
21
+ constructor(request: ProviderRequestFunction, connection: TrelloCardWriteConnection);
22
+ verify(): Promise<void>;
23
+ read<T>(path: string): Promise<T>;
24
+ mutate<T>(method: 'POST' | 'PUT' | 'DELETE', path: string, data?: Record<string, string | boolean | undefined>): Promise<T>;
25
+ private send;
26
+ }
27
+ //#endregion
28
+ //# sourceMappingURL=trelloCardWriteTransport.d.ts.map
@@ -0,0 +1,94 @@
1
+ import { isCancellationError } from "../../../utils/cancellation.js";
2
+ import { RequestRateLimitError } from "../../../git/errors.js";
3
+ import { getProviderResponseBodyMessage } from "./providerErrors.js";
4
+ import { getTrelloAuthHeaders, trelloBaseUrl } from "./trelloApi.js";
5
+ //#region ../plus/integrations/src/providers/trelloCardWriteTransport.ts
6
+ var TrelloCardWriteError = class TrelloCardWriteError extends Error {
7
+ failure;
8
+ static is(ex) {
9
+ return ex instanceof TrelloCardWriteError;
10
+ }
11
+ constructor(reason, dispatch = "none") {
12
+ super(reason);
13
+ this.failure = {
14
+ ok: false,
15
+ reason,
16
+ ...dispatch === "none" && { mutationDispatched: false },
17
+ ...dispatch === "uncertain" && { applied: "maybe" }
18
+ };
19
+ }
20
+ };
21
+ function toTrelloCardWriteFailure(ex) {
22
+ if (TrelloCardWriteError.is(ex)) return ex.failure;
23
+ return new TrelloCardWriteError(isCancellationError(ex) ? "no-connection" : getFailureReason(ex)).failure;
24
+ }
25
+ var TrelloCardWriteTransport = class {
26
+ request;
27
+ connection;
28
+ headers;
29
+ constructor(request, connection) {
30
+ this.request = request;
31
+ this.connection = connection;
32
+ this.headers = getTrelloAuthHeaders(connection.appKey, connection.accessToken);
33
+ }
34
+ async verify() {
35
+ if (this.connection.isRetired() || !await this.connection.isCurrent() || this.connection.isRetired()) throw new TrelloCardWriteError("no-connection");
36
+ }
37
+ async read(path) {
38
+ return (await this.send("GET", path)).body;
39
+ }
40
+ async mutate(method, path, data) {
41
+ const response = await this.send(method, path, data == null ? void 0 : JSON.stringify(data));
42
+ if (response.status !== 200 && (method !== "DELETE" || response.status !== 204)) throw new TrelloCardWriteError("unknown", "uncertain");
43
+ try {
44
+ await this.verify();
45
+ } catch (ex) {
46
+ throw new TrelloCardWriteError(toTrelloCardWriteFailure(ex).reason, "uncertain");
47
+ }
48
+ return response.body;
49
+ }
50
+ async send(method, path, body) {
51
+ await this.verify();
52
+ if (this.connection.isRetired()) throw new TrelloCardWriteError("no-connection");
53
+ const mutation = method !== "GET";
54
+ try {
55
+ return await this.request({
56
+ url: `${trelloBaseUrl}/1/${path}`,
57
+ method,
58
+ redirect: "error",
59
+ credentials: "omit",
60
+ signal: AbortSignal.timeout(3e4),
61
+ headers: body == null ? this.headers : {
62
+ ...this.headers,
63
+ "Content-Type": "application/json"
64
+ },
65
+ body
66
+ });
67
+ } catch (ex) {
68
+ const reason = getFailureReason(ex);
69
+ throw new TrelloCardWriteError(reason, mutation ? reason === "unknown" ? "uncertain" : "rejected" : "none");
70
+ }
71
+ }
72
+ };
73
+ function getFailureReason(ex) {
74
+ if (RequestRateLimitError.is(ex)) return "rate-limit";
75
+ const error = ex;
76
+ const status = error?.response?.status ?? error?.statusCode;
77
+ if (status === 401 || status === 403) {
78
+ const reason = getProviderResponseBodyMessage(error?.response?.body) ?? "";
79
+ const challenge = error?.response?.headers?.["www-authenticate"] ?? "";
80
+ if (/\binsufficient[_ -]scope\b/i.test(challenge)) return "insufficient-scope";
81
+ if (status === 403 || /\bunauthorized (?:board |card |list )?permission requested\b/i.test(reason)) return "forbidden";
82
+ return "no-connection";
83
+ }
84
+ if (status === 404) return "not-found";
85
+ if (status === 400 || status === 413 || status === 414 || status === 415 || status === 422) return "invalid-input";
86
+ if (status === 405) return "unsupported";
87
+ if (status === 409) return "conflict";
88
+ if (status === 429) return "rate-limit";
89
+ return "unknown";
90
+ }
91
+ //#endregion
92
+ export { TrelloCardWriteError, TrelloCardWriteTransport, toTrelloCardWriteFailure };
93
+
94
+ //# sourceMappingURL=trelloCardWriteTransport.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trelloCardWriteTransport.js","names":[],"sources":["../../../../../plus/integrations/src/providers/trelloCardWriteTransport.ts"],"sourcesContent":["import { RequestRateLimitError } from '@gitlens/git/errors.js';\nimport { isCancellationError } from '@gitlens/utils/cancellation.js';\nimport type { TrelloCardWriteFailure } from '../models/trelloCardWrites.js';\nimport type { ProviderRequestFunction, ProviderRequestResponse } from './models.js';\nimport { getProviderResponseBodyMessage } from './providerErrors.js';\nimport { getTrelloAuthHeaders, trelloBaseUrl } from './trelloApi.js';\n\ntype FailureReason = TrelloCardWriteFailure['reason'];\n\nexport class TrelloCardWriteError extends Error {\n\treadonly failure: TrelloCardWriteFailure;\n\n\tstatic is(ex: unknown): ex is TrelloCardWriteError {\n\t\treturn ex instanceof TrelloCardWriteError;\n\t}\n\n\tconstructor(reason: FailureReason, dispatch: 'none' | 'rejected' | 'uncertain' = 'none') {\n\t\tsuper(reason);\n\t\tthis.failure = {\n\t\t\tok: false,\n\t\t\treason: reason,\n\t\t\t...(dispatch === 'none' && { mutationDispatched: false }),\n\t\t\t...(dispatch === 'uncertain' && { applied: 'maybe' }),\n\t\t};\n\t}\n}\n\nexport function toTrelloCardWriteFailure(ex: unknown): TrelloCardWriteFailure {\n\tif (TrelloCardWriteError.is(ex)) return ex.failure;\n\n\treturn new TrelloCardWriteError(isCancellationError(ex) ? 'no-connection' : getFailureReason(ex)).failure;\n}\n\nexport type TrelloCardWriteConnection = {\n\tappKey: string;\n\taccessToken: string;\n\tisCurrent: () => Promise<boolean>;\n\tisRetired: () => boolean;\n};\n\nexport class TrelloCardWriteTransport {\n\tprivate readonly headers: Record<string, string>;\n\n\tconstructor(\n\t\tprivate readonly request: ProviderRequestFunction,\n\t\tprivate readonly connection: TrelloCardWriteConnection,\n\t) {\n\t\tthis.headers = getTrelloAuthHeaders(connection.appKey, connection.accessToken);\n\t}\n\n\tasync verify(): Promise<void> {\n\t\tif (this.connection.isRetired() || !(await this.connection.isCurrent()) || this.connection.isRetired()) {\n\t\t\tthrow new TrelloCardWriteError('no-connection');\n\t\t}\n\t}\n\n\tasync read<T>(path: string): Promise<T> {\n\t\treturn (await this.send<T>('GET', path)).body;\n\t}\n\n\tasync mutate<T>(\n\t\tmethod: 'POST' | 'PUT' | 'DELETE',\n\t\tpath: string,\n\t\tdata?: Record<string, string | boolean | undefined>,\n\t): Promise<T> {\n\t\tconst response = await this.send<T>(method, path, data == null ? undefined : JSON.stringify(data));\n\t\tif (response.status !== 200 && (method !== 'DELETE' || response.status !== 204)) {\n\t\t\tthrow new TrelloCardWriteError('unknown', 'uncertain');\n\t\t}\n\n\t\ttry {\n\t\t\tawait this.verify();\n\t\t} catch (ex) {\n\t\t\tthrow new TrelloCardWriteError(toTrelloCardWriteFailure(ex).reason, 'uncertain');\n\t\t}\n\n\t\treturn response.body;\n\t}\n\n\tprivate async send<T>(\n\t\tmethod: 'GET' | 'POST' | 'PUT' | 'DELETE',\n\t\tpath: string,\n\t\tbody?: string,\n\t): Promise<ProviderRequestResponse<T>> {\n\t\tawait this.verify();\n\t\tif (this.connection.isRetired()) throw new TrelloCardWriteError('no-connection');\n\n\t\tconst mutation = method !== 'GET';\n\t\ttry {\n\t\t\treturn await this.request<T>({\n\t\t\t\turl: `${trelloBaseUrl}/1/${path}`,\n\t\t\t\tmethod: method,\n\t\t\t\tredirect: 'error',\n\t\t\t\tcredentials: 'omit',\n\t\t\t\tsignal: AbortSignal.timeout(30_000),\n\t\t\t\theaders: body == null ? this.headers : { ...this.headers, 'Content-Type': 'application/json' },\n\t\t\t\tbody: body,\n\t\t\t});\n\t\t} catch (ex) {\n\t\t\tconst reason = getFailureReason(ex);\n\t\t\tthrow new TrelloCardWriteError(\n\t\t\t\treason,\n\t\t\t\tmutation ? (reason === 'unknown' ? 'uncertain' : 'rejected') : 'none',\n\t\t\t);\n\t\t}\n\t}\n}\n\nfunction getFailureReason(ex: unknown): FailureReason {\n\tif (RequestRateLimitError.is(ex)) return 'rate-limit';\n\n\tconst error = ex as {\n\t\tstatusCode?: number;\n\t\tresponse?: { status?: number; body?: unknown; headers?: Record<string, string> };\n\t} | null;\n\tconst status = error?.response?.status ?? error?.statusCode;\n\tif (status === 401 || status === 403) {\n\t\tconst reason = getProviderResponseBodyMessage(error?.response?.body) ?? '';\n\t\tconst challenge = error?.response?.headers?.['www-authenticate'] ?? '';\n\t\tif (/\\binsufficient[_ -]scope\\b/i.test(challenge)) return 'insufficient-scope';\n\t\tif (status === 403 || /\\bunauthorized (?:board |card |list )?permission requested\\b/i.test(reason)) {\n\t\t\treturn 'forbidden';\n\t\t}\n\n\t\treturn 'no-connection';\n\t}\n\tif (status === 404) return 'not-found';\n\tif (status === 400 || status === 413 || status === 414 || status === 415 || status === 422) return 'invalid-input';\n\tif (status === 405) return 'unsupported';\n\tif (status === 409) return 'conflict';\n\tif (status === 429) return 'rate-limit';\n\n\treturn 'unknown';\n}\n"],"mappings":";;;;;AASA,IAAa,uBAAb,MAAa,6BAA6B,MAAM;CAC/C;CAEA,OAAO,GAAG,IAAyC;EAClD,OAAO,cAAc;CACtB;CAEA,YAAY,QAAuB,WAA8C,QAAQ;EACxF,MAAM,MAAM;EACZ,KAAK,UAAU;GACd,IAAI;GACI;GACR,GAAI,aA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B,KAAK,GAAG,cAAc,KAAK;IACnB;IACR,UAAU;IACV,aAAa;IACb,QAAQ,YAAY,QAAQ,GAAM;IAClC,SAAS,QAAQ,OAAO,KAAK,UAAU;KAAE,GAAG,KAAK;KAAS,gBAAgB;IAAmB;IACvF;GACP,CAAC;EACF,SAAS,IAAI;GACZ,MAAM,SAAS,iBAAiB,EAAE;GAClC,MAAM,IAAI,qBACT,QACA,WAAY,WAAW,YAAY,cAAc,aAAc,MAChE;EACD;CACD;AACD;AAEA,SAAS,iBAAiB,IAA4B;CACrD,IAAI,sBAAsB,GAAG,EAAE,GAAG,OAAO;CAEzC,MAAM,QAAQ;CAId,MAAM,SAAS,OAAO,UAAU,UAAU,OAAO;CACjD,IAAI,WAAW,OAAO,WAAW,KAAK;EACrC,MAAM,SAAS,+BAA+B,OAAO,UAAU,IAAI,KAAK;EACxE,MAAM,YAAY,OAAO,UAAU,UAAU,uBAAuB;EACpE,IAAI,8BAA8B,KAAK,SAAS,GAAG,OAAO;EAC1D,IAAI,WAAW,OAAO,gEAAgE,KAAK,MAAM,GAChG,OAAO;EAGR,OAAO;CACR;CACA,IAAI,WAAW,KAAK,OAAO;CAC3B,IAAI,WAAW,OAAO,WAAW,OAAO,WAAW,OAAO,WAAW,OAAO,WAAW,KAAK,OAAO;CACnG,IAAI,WAAW,KAAK,OAAO;CAC3B,IAAI,WAAW,KAAK,OAAO;CAC3B,IAAI,WAAW,KAAK,OAAO;CAE3B,OAAO;AACR"}
@@ -0,0 +1,26 @@
1
+ import { TrelloCardCreateOptions, TrelloCardCreateOptionsResult, TrelloCardDeleteOptions, TrelloCardDeleteResult, TrelloCardWriteOptions, TrelloCardWriteOptionsResult, TrelloCardWriteResult, TrelloCardWriteScope, TrelloCardWriteTargetOptions } from "../models/trelloCardWrites.js";
2
+ import { TrelloCardWriteTransport } from "./trelloCardWriteTransport.js";
3
+ //#region ../plus/integrations/src/providers/trelloCardWrites.d.ts
4
+ type ResolvedTarget = Extract<TrelloCardWriteOptionsResult, {
5
+ ok: true;
6
+ }>;
7
+ export declare function isTrelloCardWriteScope(scope: TrelloCardWriteScope, mutation: boolean): boolean;
8
+ export declare class TrelloCardWriter {
9
+ private readonly transport;
10
+ private readonly activeWrites;
11
+ constructor(transport: TrelloCardWriteTransport, activeWrites: Set<string>);
12
+ verify(): Promise<void>;
13
+ getCreateOptions(options: TrelloCardCreateOptions): Promise<TrelloCardCreateOptionsResult>;
14
+ resolveTarget(options: TrelloCardWriteTargetOptions): Promise<ResolvedTarget>;
15
+ write(options: TrelloCardWriteOptions): Promise<TrelloCardWriteResult>;
16
+ delete(options: TrelloCardDeleteOptions): Promise<TrelloCardDeleteResult>;
17
+ private create;
18
+ private getContext;
19
+ private getCard;
20
+ private getList;
21
+ private getBoard;
22
+ private getBoardOptions;
23
+ private withCardMutation;
24
+ }
25
+ //#endregion
26
+ //# sourceMappingURL=trelloCardWrites.d.ts.map