@rastrokit/sdk 0.0.0-stage → 0.15.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.
- package/README.md +32 -2
- package/dist/cli.cjs +53806 -0
- package/dist/cli.cjs.map +1 -0
- package/dist/cli.js +53815 -0
- package/dist/cli.js.map +1 -0
- package/dist/index.cjs +5120 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +2616 -0
- package/dist/index.d.ts +2616 -0
- package/dist/index.js +5059 -0
- package/dist/index.js.map +1 -0
- package/package.json +51 -4
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,2616 @@
|
|
|
1
|
+
type AddonCapability = 'auth' | 'dataSource' | 'analytics' | 'watcher' | 'calendar' | 'punch' | 'theme';
|
|
2
|
+
declare const VALID_ADDON_CAPABILITIES: readonly AddonCapability[];
|
|
3
|
+
declare function isAddonCapability(value: string): value is AddonCapability;
|
|
4
|
+
declare function hasCapability(capabilities: readonly AddonCapability[] | undefined | null, capability: AddonCapability): boolean;
|
|
5
|
+
declare function isDataSource(capabilities: readonly AddonCapability[] | undefined | null): boolean;
|
|
6
|
+
declare function isWatcher(capabilities: readonly AddonCapability[] | undefined | null): boolean;
|
|
7
|
+
declare function isTheme(capabilities: readonly AddonCapability[] | undefined | null): boolean;
|
|
8
|
+
declare function isAnalytics(capabilities: readonly AddonCapability[] | undefined | null): boolean;
|
|
9
|
+
|
|
10
|
+
interface ViewModel<Data = void> {
|
|
11
|
+
isSuccess: boolean;
|
|
12
|
+
statusCode: number;
|
|
13
|
+
data?: Data;
|
|
14
|
+
error?: string;
|
|
15
|
+
/** Erros por campo (id do campo -> mensagens), quando a falha é de validação de formulário. */
|
|
16
|
+
details?: Record<string, string[]>;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
interface PaginatedViewModel<Data> extends ViewModel<Data> {
|
|
20
|
+
totalItems: number;
|
|
21
|
+
totalPages: number;
|
|
22
|
+
currentPage: number;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
type AppErrorType = 'danger' | 'warning';
|
|
26
|
+
type FieldErrors = Record<string, string[]>;
|
|
27
|
+
declare abstract class AppError {
|
|
28
|
+
readonly messageKey: string;
|
|
29
|
+
readonly details?: FieldErrors;
|
|
30
|
+
readonly statusCode: number;
|
|
31
|
+
readonly type: AppErrorType;
|
|
32
|
+
protected constructor(messageKey: string, statusCode: number, details?: FieldErrors, type?: AppErrorType);
|
|
33
|
+
static ValidationError(messageKey: string, details?: FieldErrors, type?: AppErrorType): ValidationError;
|
|
34
|
+
static NotFound(messageKey: string, details?: FieldErrors, type?: AppErrorType): NotFoundError;
|
|
35
|
+
static Unauthorized(messageKey: string, details?: FieldErrors, type?: AppErrorType): UnauthorizedError;
|
|
36
|
+
static Internal(messageKey: string, details?: FieldErrors, type?: AppErrorType): InternalServerError;
|
|
37
|
+
static Http(statusCode: number, messageKey: string, details?: FieldErrors): AppError;
|
|
38
|
+
getFieldErrors(field: string): string[];
|
|
39
|
+
hasErrors(): boolean;
|
|
40
|
+
}
|
|
41
|
+
declare class ValidationError extends AppError {
|
|
42
|
+
constructor(messageKey: string, details?: FieldErrors, type?: AppErrorType);
|
|
43
|
+
}
|
|
44
|
+
declare class NotFoundError extends AppError {
|
|
45
|
+
constructor(messageKey: string, details?: FieldErrors, type?: AppErrorType);
|
|
46
|
+
}
|
|
47
|
+
declare class UnauthorizedError extends AppError {
|
|
48
|
+
constructor(messageKey: string, details?: FieldErrors, type?: AppErrorType);
|
|
49
|
+
}
|
|
50
|
+
declare class InternalServerError extends AppError {
|
|
51
|
+
constructor(messageKey: string, details?: FieldErrors, type?: AppErrorType);
|
|
52
|
+
}
|
|
53
|
+
interface TokenRefreshErrorOptions {
|
|
54
|
+
readonly reauthRequired?: boolean;
|
|
55
|
+
readonly remoteOutcomeUncertain?: boolean;
|
|
56
|
+
readonly details?: FieldErrors;
|
|
57
|
+
}
|
|
58
|
+
declare class TokenRefreshError extends AppError {
|
|
59
|
+
readonly reauthRequired: boolean;
|
|
60
|
+
readonly remoteOutcomeUncertain: boolean;
|
|
61
|
+
constructor(messageKey: string, statusCode: number, options?: TokenRefreshErrorOptions);
|
|
62
|
+
static reauthRequired(messageKey: string, statusCode?: number, details?: FieldErrors): TokenRefreshError;
|
|
63
|
+
static remoteOutcomeUncertain(messageKey: string, statusCode?: number, details?: FieldErrors): TokenRefreshError;
|
|
64
|
+
static transient(messageKey: string, statusCode?: number, details?: FieldErrors): TokenRefreshError;
|
|
65
|
+
static clientError(messageKey: string, statusCode?: number, details?: FieldErrors): TokenRefreshError;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
declare function success(): Either<never, void>;
|
|
69
|
+
declare function success<Success, Failure = never>(value: Success): Either<Failure, Success>;
|
|
70
|
+
declare function failure<Failure, Success = never>(value: Failure): Either<Failure, Success>;
|
|
71
|
+
interface Either<Failure, Success> {
|
|
72
|
+
forwardFailure<NextSuccess>(): Either<Failure, NextSuccess>;
|
|
73
|
+
isFailure(): boolean;
|
|
74
|
+
isSuccess(): boolean;
|
|
75
|
+
readonly failure: Failure;
|
|
76
|
+
readonly success: Success;
|
|
77
|
+
map<NextSuccess>(transform: (value: Success) => NextSuccess): Either<Failure, NextSuccess>;
|
|
78
|
+
flatMap<NextSuccess>(transform: (value: Success) => Either<Failure, NextSuccess>): Either<Failure, NextSuccess>;
|
|
79
|
+
getOrElse(defaultValue: Success): Success;
|
|
80
|
+
unwrap(): Failure | Success;
|
|
81
|
+
}
|
|
82
|
+
declare const Either: {
|
|
83
|
+
success: typeof success;
|
|
84
|
+
failure: typeof failure;
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Canonical runtime type guards.
|
|
89
|
+
* Centralizes runtime checks on untrusted or external boundaries,
|
|
90
|
+
* preventing ad-hoc `typeof === 'object'` antipatterns across the codebase.
|
|
91
|
+
*/
|
|
92
|
+
declare function isRecord(value: unknown): value is Record<string, unknown>;
|
|
93
|
+
declare function isString(value: unknown): value is string;
|
|
94
|
+
declare function isNonEmptyString(value: unknown): value is string;
|
|
95
|
+
declare function isNumber(value: unknown): value is number;
|
|
96
|
+
declare function isBoolean(value: unknown): value is boolean;
|
|
97
|
+
declare function isArray(value: unknown): value is unknown[];
|
|
98
|
+
declare function isFunction(value: unknown): value is (...args: unknown[]) => unknown;
|
|
99
|
+
declare function hasProperty<K extends string>(target: unknown, key: K): target is Record<K, unknown>;
|
|
100
|
+
declare function isWorkspaceScoped(value: unknown): value is {
|
|
101
|
+
workspaceId: string;
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
type AddonTier = 'free' | 'plus';
|
|
105
|
+
declare const VALID_ADDON_TIERS: AddonTier[];
|
|
106
|
+
interface AddonScreenshot {
|
|
107
|
+
url: string;
|
|
108
|
+
caption?: string;
|
|
109
|
+
}
|
|
110
|
+
interface AddonPackage {
|
|
111
|
+
version: string;
|
|
112
|
+
requiredApiVersion?: string;
|
|
113
|
+
releaseDate?: string;
|
|
114
|
+
downloadUrl: string;
|
|
115
|
+
sha256?: string;
|
|
116
|
+
size?: number;
|
|
117
|
+
changelog?: string[];
|
|
118
|
+
}
|
|
119
|
+
interface IAddonManifest {
|
|
120
|
+
id: string;
|
|
121
|
+
name: string;
|
|
122
|
+
version: string;
|
|
123
|
+
tier?: AddonTier;
|
|
124
|
+
capabilities: readonly AddonCapability[];
|
|
125
|
+
author: string;
|
|
126
|
+
shortDescription: string;
|
|
127
|
+
description: string;
|
|
128
|
+
iconUrl?: string;
|
|
129
|
+
sourceUrl?: string;
|
|
130
|
+
homepage?: string;
|
|
131
|
+
tags?: string[];
|
|
132
|
+
screenshots?: AddonScreenshot[];
|
|
133
|
+
downloadUrl?: string;
|
|
134
|
+
sha256?: string;
|
|
135
|
+
size?: number;
|
|
136
|
+
requiredApiVersion?: string;
|
|
137
|
+
releaseDate?: string;
|
|
138
|
+
changelog?: string[];
|
|
139
|
+
packages?: AddonPackage[];
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
interface AddonCatalogFileEntry {
|
|
143
|
+
readonly path: string;
|
|
144
|
+
readonly sha256: string;
|
|
145
|
+
}
|
|
146
|
+
interface AddonCatalogManifestContent {
|
|
147
|
+
readonly keyId: string;
|
|
148
|
+
readonly addonId: string;
|
|
149
|
+
readonly version: string;
|
|
150
|
+
readonly sdkVersionRange: string;
|
|
151
|
+
readonly classification: 'free' | 'plus';
|
|
152
|
+
readonly files: readonly AddonCatalogFileEntry[];
|
|
153
|
+
readonly publishedAt: number;
|
|
154
|
+
}
|
|
155
|
+
/** Embedded inventory excludes its own envelope and the circular ZIP hash. */
|
|
156
|
+
interface AddonCatalogManifestV2 extends AddonCatalogManifestContent {
|
|
157
|
+
readonly formatVersion: 2;
|
|
158
|
+
}
|
|
159
|
+
/** Detached catalog receipt binds the completed archive to its inventory. */
|
|
160
|
+
interface AddonCatalogManifestV1 extends AddonCatalogManifestContent {
|
|
161
|
+
readonly formatVersion: 1;
|
|
162
|
+
readonly packageSha256: string;
|
|
163
|
+
}
|
|
164
|
+
interface SignedAddonCatalogManifestV2 {
|
|
165
|
+
readonly manifestBase64Url: string;
|
|
166
|
+
readonly signatureBase64Url: string;
|
|
167
|
+
readonly signedToken: string;
|
|
168
|
+
}
|
|
169
|
+
interface SignedAddonCatalogManifestV1 extends SignedAddonCatalogManifestV2 {
|
|
170
|
+
readonly manifest: AddonCatalogManifestV1;
|
|
171
|
+
}
|
|
172
|
+
declare const ADDON_CATALOG_RECEIPT_FILE = "catalog-version.json";
|
|
173
|
+
|
|
174
|
+
type AddonConfig = {
|
|
175
|
+
id?: string;
|
|
176
|
+
name?: string;
|
|
177
|
+
main?: string;
|
|
178
|
+
version?: string;
|
|
179
|
+
tier?: AddonTier;
|
|
180
|
+
author?: string;
|
|
181
|
+
shortDescription?: string;
|
|
182
|
+
description?: string;
|
|
183
|
+
capabilities?: AddonCapability[];
|
|
184
|
+
tags?: string[];
|
|
185
|
+
iconUrl?: string;
|
|
186
|
+
sourceUrl?: string;
|
|
187
|
+
homepage?: string;
|
|
188
|
+
screenshots?: AddonScreenshot[];
|
|
189
|
+
downloadUrl?: string;
|
|
190
|
+
sha256?: string;
|
|
191
|
+
size?: number;
|
|
192
|
+
requiredApiVersion?: string;
|
|
193
|
+
releaseDate?: string;
|
|
194
|
+
changelog?: string[];
|
|
195
|
+
packages?: AddonPackage[];
|
|
196
|
+
};
|
|
197
|
+
|
|
198
|
+
type ConnectionCardinality = 'single' | 'multi';
|
|
199
|
+
interface AuthorizationRoleRequirement {
|
|
200
|
+
readonly authorizationRole: string;
|
|
201
|
+
readonly allowedAuthProfileIds: readonly string[];
|
|
202
|
+
readonly defaultAuthProfileId: string | null;
|
|
203
|
+
readonly required?: boolean;
|
|
204
|
+
readonly label?: string;
|
|
205
|
+
}
|
|
206
|
+
type ConnectionProfileDescriptor = Readonly<{
|
|
207
|
+
connectionProfileId: string;
|
|
208
|
+
cardinality: ConnectionCardinality;
|
|
209
|
+
default: boolean;
|
|
210
|
+
allowedAuthProfileIds?: readonly string[];
|
|
211
|
+
defaultAuthProfileId?: string | null;
|
|
212
|
+
roles?: readonly AuthorizationRoleRequirement[];
|
|
213
|
+
capability?: string;
|
|
214
|
+
}>;
|
|
215
|
+
|
|
216
|
+
type ConnectionIdentity = {
|
|
217
|
+
kind: 'human';
|
|
218
|
+
providerId: string;
|
|
219
|
+
tenantId: string;
|
|
220
|
+
providerSubjectId: string;
|
|
221
|
+
displayName: string;
|
|
222
|
+
avatarUrl?: string;
|
|
223
|
+
} | {
|
|
224
|
+
kind: 'bot';
|
|
225
|
+
providerId: string;
|
|
226
|
+
tenantId: string;
|
|
227
|
+
providerSubjectId: string;
|
|
228
|
+
displayName: string;
|
|
229
|
+
avatarUrl?: string;
|
|
230
|
+
} | {
|
|
231
|
+
kind: 'installation';
|
|
232
|
+
providerId: string;
|
|
233
|
+
tenantId: string;
|
|
234
|
+
providerSubjectId: string;
|
|
235
|
+
displayName: string;
|
|
236
|
+
};
|
|
237
|
+
|
|
238
|
+
interface AddonInstallerViewModel {
|
|
239
|
+
id: string;
|
|
240
|
+
packages: {
|
|
241
|
+
version: string;
|
|
242
|
+
requiredApiVersion: string;
|
|
243
|
+
releaseDate: string;
|
|
244
|
+
downloadUrl: string;
|
|
245
|
+
sha256?: string;
|
|
246
|
+
size?: number;
|
|
247
|
+
changelog: string[];
|
|
248
|
+
}[];
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
type AddonLoadFailureStage = 'authorize' | 'apiVersion' | 'entry' | 'manifest' | 'contract' | 'import' | 'instantiate' | 'activate';
|
|
252
|
+
type AddonLoadFailureReason = 'AUTHORIZATION_FAILED' | 'API_VERSION_INCOMPATIBLE' | 'ENTRY_NOT_FOUND' | 'MANIFEST_INVALID' | 'CONTRACT_VIOLATION' | 'IMPORT_FAILED' | 'INVALID_DEFAULT_EXPORT' | 'INSTANTIATION_FAILED' | 'INITIALIZATION_FAILED' | 'UNEXPECTED_ERROR';
|
|
253
|
+
interface AddonLoadFailureViewModel {
|
|
254
|
+
addonId: string;
|
|
255
|
+
addonName?: string;
|
|
256
|
+
iconUrl?: string;
|
|
257
|
+
folderPath: string;
|
|
258
|
+
entryPath?: string;
|
|
259
|
+
stage: AddonLoadFailureStage;
|
|
260
|
+
reason: AddonLoadFailureReason;
|
|
261
|
+
technicalMessage: string;
|
|
262
|
+
timestamp: number;
|
|
263
|
+
}
|
|
264
|
+
interface AddonLoadFailuresSnapshot {
|
|
265
|
+
revision: number;
|
|
266
|
+
failures: AddonLoadFailureViewModel[];
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
type AddonTierViewModel = 'free' | 'plus';
|
|
270
|
+
interface AddonScreenshotViewModel {
|
|
271
|
+
url: string;
|
|
272
|
+
caption?: string;
|
|
273
|
+
}
|
|
274
|
+
interface AddonPackageViewModel {
|
|
275
|
+
version: string;
|
|
276
|
+
requiredApiVersion?: string;
|
|
277
|
+
releaseDate?: string;
|
|
278
|
+
downloadUrl: string;
|
|
279
|
+
sha256?: string;
|
|
280
|
+
size?: number;
|
|
281
|
+
changelog?: string[];
|
|
282
|
+
}
|
|
283
|
+
interface AddonManifestViewModel {
|
|
284
|
+
id: string;
|
|
285
|
+
version: string;
|
|
286
|
+
name: string;
|
|
287
|
+
creator: string;
|
|
288
|
+
description: string;
|
|
289
|
+
path: string;
|
|
290
|
+
logo: string;
|
|
291
|
+
downloads: number;
|
|
292
|
+
stars: number;
|
|
293
|
+
installed: boolean;
|
|
294
|
+
capabilities: readonly AddonCapability[];
|
|
295
|
+
tier?: AddonTierViewModel;
|
|
296
|
+
sha256?: string;
|
|
297
|
+
size?: number;
|
|
298
|
+
installerManifestUrl?: string;
|
|
299
|
+
sourceUrl?: string;
|
|
300
|
+
homepage?: string;
|
|
301
|
+
tags?: string[];
|
|
302
|
+
screenshots?: AddonScreenshotViewModel[];
|
|
303
|
+
downloadUrl?: string;
|
|
304
|
+
requiredApiVersion?: string;
|
|
305
|
+
releaseDate?: string;
|
|
306
|
+
changelog?: string[];
|
|
307
|
+
packages?: AddonPackageViewModel[];
|
|
308
|
+
updateAvailable?: boolean;
|
|
309
|
+
latestVersion?: string;
|
|
310
|
+
latestDownloadUrl?: string;
|
|
311
|
+
latestSha256?: string;
|
|
312
|
+
latestSize?: number;
|
|
313
|
+
incompatibleUpdate?: boolean;
|
|
314
|
+
incompatibleReason?: string;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
interface AddonThemeViewModel {
|
|
318
|
+
id: string;
|
|
319
|
+
name: string;
|
|
320
|
+
description?: string;
|
|
321
|
+
css: string;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
interface MemberViewModel {
|
|
325
|
+
id: number;
|
|
326
|
+
login: string;
|
|
327
|
+
firstname: string;
|
|
328
|
+
lastname: string;
|
|
329
|
+
admin: boolean;
|
|
330
|
+
createdOn: string;
|
|
331
|
+
lastLoginOn: string;
|
|
332
|
+
avatarUrl?: string;
|
|
333
|
+
customFields: {
|
|
334
|
+
id: number;
|
|
335
|
+
name: string;
|
|
336
|
+
value: string;
|
|
337
|
+
}[];
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
interface AuthenticationViewModel {
|
|
341
|
+
member: MemberViewModel;
|
|
342
|
+
token: string;
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
interface ConnectionResultViewModel {
|
|
346
|
+
member?: MemberViewModel;
|
|
347
|
+
identity?: {
|
|
348
|
+
kind: string;
|
|
349
|
+
providerId: string;
|
|
350
|
+
tenantId?: string;
|
|
351
|
+
providerSubjectId: string;
|
|
352
|
+
displayName?: string;
|
|
353
|
+
};
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
type LicensingStatusStateViewModel = 'inactive' | 'active' | 'past_due_grace' | 'expired' | 'revoked';
|
|
357
|
+
interface LicensingStatusViewModel {
|
|
358
|
+
state: LicensingStatusStateViewModel;
|
|
359
|
+
tier: 'free' | 'plus';
|
|
360
|
+
isPlusActive: boolean;
|
|
361
|
+
licenseKeyMasked?: string;
|
|
362
|
+
activationId?: string;
|
|
363
|
+
subscriptionStatus?: string;
|
|
364
|
+
currentPeriodEnd?: string;
|
|
365
|
+
graceUntil?: string;
|
|
366
|
+
offlineVerifyUntil?: string;
|
|
367
|
+
lastVerifiedAt?: string;
|
|
368
|
+
entitlements: string[];
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
interface MetadataViewModel {
|
|
372
|
+
taskStatuses: MetadataItem$1[];
|
|
373
|
+
taskPriorities: MetadataItem$1[];
|
|
374
|
+
activities: MetadataItem$1[];
|
|
375
|
+
trackStatuses: MetadataItem$1[];
|
|
376
|
+
participantRoles: MetadataItem$1[];
|
|
377
|
+
estimationTypes: MetadataItem$1[];
|
|
378
|
+
}
|
|
379
|
+
interface MetadataItem$1 {
|
|
380
|
+
id: string;
|
|
381
|
+
name: string;
|
|
382
|
+
icon: string;
|
|
383
|
+
colors: {
|
|
384
|
+
badge: string;
|
|
385
|
+
background: string;
|
|
386
|
+
text: string;
|
|
387
|
+
border?: string;
|
|
388
|
+
};
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
interface SyncFailureViewModel {
|
|
392
|
+
messageKey: string;
|
|
393
|
+
details?: Record<string, string[]>;
|
|
394
|
+
statusCode: number;
|
|
395
|
+
}
|
|
396
|
+
type SyncDocumentViewModel<T> = T & {
|
|
397
|
+
originalId?: string;
|
|
398
|
+
remoteId?: string | null;
|
|
399
|
+
creationAttempted?: boolean;
|
|
400
|
+
_deleted?: boolean;
|
|
401
|
+
conflicted?: boolean;
|
|
402
|
+
creationAmbiguous?: boolean;
|
|
403
|
+
creationPending?: boolean;
|
|
404
|
+
confirmationPending?: boolean;
|
|
405
|
+
syncRetryable?: boolean;
|
|
406
|
+
conflictData?: {
|
|
407
|
+
server?: T;
|
|
408
|
+
local: T;
|
|
409
|
+
};
|
|
410
|
+
validationError?: SyncFailureViewModel;
|
|
411
|
+
syncedAt?: Date;
|
|
412
|
+
assumedMasterState?: T;
|
|
413
|
+
};
|
|
414
|
+
|
|
415
|
+
interface TaskViewModel {
|
|
416
|
+
id: string;
|
|
417
|
+
title: string;
|
|
418
|
+
description?: string;
|
|
419
|
+
url?: string;
|
|
420
|
+
projectName?: string;
|
|
421
|
+
status: {
|
|
422
|
+
id: string;
|
|
423
|
+
name: string;
|
|
424
|
+
};
|
|
425
|
+
priority?: {
|
|
426
|
+
id: string;
|
|
427
|
+
name: string;
|
|
428
|
+
};
|
|
429
|
+
assignedTo?: {
|
|
430
|
+
id?: string;
|
|
431
|
+
name: string;
|
|
432
|
+
};
|
|
433
|
+
author?: {
|
|
434
|
+
id?: string;
|
|
435
|
+
name: string;
|
|
436
|
+
};
|
|
437
|
+
tracker?: {
|
|
438
|
+
id: string;
|
|
439
|
+
};
|
|
440
|
+
createdAt: Date;
|
|
441
|
+
updatedAt: Date;
|
|
442
|
+
startDate?: Date;
|
|
443
|
+
dueDate?: Date;
|
|
444
|
+
doneRatio?: number;
|
|
445
|
+
estimatedTimes?: EstimatedTime$1[];
|
|
446
|
+
spentHours?: number;
|
|
447
|
+
statusChanges?: StatusChange[];
|
|
448
|
+
participants?: Participants$1[];
|
|
449
|
+
}
|
|
450
|
+
interface Participants$1 {
|
|
451
|
+
id: string;
|
|
452
|
+
name: string;
|
|
453
|
+
role: {
|
|
454
|
+
id: string;
|
|
455
|
+
};
|
|
456
|
+
}
|
|
457
|
+
interface EstimatedTime$1 {
|
|
458
|
+
id: string;
|
|
459
|
+
name: string;
|
|
460
|
+
activities: {
|
|
461
|
+
id: string;
|
|
462
|
+
name: string;
|
|
463
|
+
}[];
|
|
464
|
+
hours: number;
|
|
465
|
+
}
|
|
466
|
+
interface StatusChange {
|
|
467
|
+
fromStatus: string;
|
|
468
|
+
toStatus: string;
|
|
469
|
+
description?: string;
|
|
470
|
+
changedBy: {
|
|
471
|
+
id: string;
|
|
472
|
+
name: string;
|
|
473
|
+
};
|
|
474
|
+
changedAt: Date;
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
interface TimeEntryViewModel {
|
|
478
|
+
id?: string;
|
|
479
|
+
correlationId?: string;
|
|
480
|
+
task: {
|
|
481
|
+
id: string;
|
|
482
|
+
};
|
|
483
|
+
activity: {
|
|
484
|
+
id: string;
|
|
485
|
+
name?: string;
|
|
486
|
+
};
|
|
487
|
+
user: {
|
|
488
|
+
id: string;
|
|
489
|
+
name?: string;
|
|
490
|
+
};
|
|
491
|
+
startDate?: Date;
|
|
492
|
+
endDate?: Date;
|
|
493
|
+
timeSpent: number;
|
|
494
|
+
comments?: string;
|
|
495
|
+
createdAt: Date;
|
|
496
|
+
updatedAt: Date;
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
type WorkspaceStatus$1 = 'draft' | 'configured';
|
|
500
|
+
interface WorkspaceConnectionIdentityViewModel {
|
|
501
|
+
kind: 'human' | 'bot' | 'installation';
|
|
502
|
+
providerId: string;
|
|
503
|
+
tenantId: string;
|
|
504
|
+
providerSubjectId: string;
|
|
505
|
+
displayName: string;
|
|
506
|
+
avatarUrl?: string;
|
|
507
|
+
}
|
|
508
|
+
interface WorkspaceConnectionMemberViewModel {
|
|
509
|
+
id: string;
|
|
510
|
+
name: string;
|
|
511
|
+
login: string;
|
|
512
|
+
avatarUrl?: string;
|
|
513
|
+
}
|
|
514
|
+
interface WorkspaceConnectionViewModel {
|
|
515
|
+
id: string;
|
|
516
|
+
addonId: string;
|
|
517
|
+
connectionProfileId: string;
|
|
518
|
+
cardinality: 'single' | 'multi';
|
|
519
|
+
status: 'connected' | 'disabled' | 'disconnected' | 'archived';
|
|
520
|
+
identity?: WorkspaceConnectionIdentityViewModel;
|
|
521
|
+
member?: WorkspaceConnectionMemberViewModel;
|
|
522
|
+
config?: Record<string, unknown>;
|
|
523
|
+
lastAuthenticatedAt?: string;
|
|
524
|
+
}
|
|
525
|
+
interface WorkspaceViewModel {
|
|
526
|
+
id: string;
|
|
527
|
+
name: string;
|
|
528
|
+
status: WorkspaceStatus$1;
|
|
529
|
+
description?: string;
|
|
530
|
+
avatarUrl?: string;
|
|
531
|
+
connections: WorkspaceConnectionViewModel[];
|
|
532
|
+
createdAt: Date;
|
|
533
|
+
updatedAt: Date;
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
interface CreateTimeEntryDTO {
|
|
537
|
+
taskId: string;
|
|
538
|
+
timeSpentSeconds: number;
|
|
539
|
+
comments?: string;
|
|
540
|
+
activityId?: string;
|
|
541
|
+
dataSourceId?: string;
|
|
542
|
+
connectionInstanceId?: string;
|
|
543
|
+
startDate?: string;
|
|
544
|
+
endDate?: string;
|
|
545
|
+
pauseSeconds?: number;
|
|
546
|
+
status?: 'finished' | 'suggestion';
|
|
547
|
+
source?: 'manual' | 'timer' | 'ai_suggestion' | 'addon';
|
|
548
|
+
addonSource?: {
|
|
549
|
+
id: string;
|
|
550
|
+
name: string;
|
|
551
|
+
imageUrl?: string;
|
|
552
|
+
metadata?: Readonly<Record<string, string | number | boolean>>;
|
|
553
|
+
};
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
interface TimeEntryRecordDTO {
|
|
557
|
+
id: string;
|
|
558
|
+
taskId?: string;
|
|
559
|
+
comments?: string;
|
|
560
|
+
activityId?: string;
|
|
561
|
+
dataSourceId?: string;
|
|
562
|
+
connectionInstanceId?: string;
|
|
563
|
+
startDate?: string;
|
|
564
|
+
endDate?: string;
|
|
565
|
+
timeSpentSeconds: number;
|
|
566
|
+
pauseSeconds: number;
|
|
567
|
+
status?: 'running' | 'paused' | 'finished' | 'suggestion';
|
|
568
|
+
source?: 'manual' | 'timer' | 'ai_suggestion' | 'addon';
|
|
569
|
+
addonSource?: {
|
|
570
|
+
id: string;
|
|
571
|
+
name: string;
|
|
572
|
+
imageUrl?: string;
|
|
573
|
+
metadata?: Readonly<Record<string, string | number | boolean>>;
|
|
574
|
+
};
|
|
575
|
+
createdAt: string;
|
|
576
|
+
updatedAt?: string;
|
|
577
|
+
}
|
|
578
|
+
interface TimerStateDTO {
|
|
579
|
+
status: 'running' | 'paused' | 'idle';
|
|
580
|
+
currentSeconds: number;
|
|
581
|
+
baseSeconds: number;
|
|
582
|
+
elapsedSeconds: number;
|
|
583
|
+
mode: 'countup' | 'countdown';
|
|
584
|
+
taskId?: string;
|
|
585
|
+
activityId?: string;
|
|
586
|
+
comments?: string;
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
interface TimeInterval {
|
|
590
|
+
readonly start: string;
|
|
591
|
+
readonly end: string;
|
|
592
|
+
}
|
|
593
|
+
interface ConflictingTimeEntry {
|
|
594
|
+
readonly id: string;
|
|
595
|
+
readonly title?: string;
|
|
596
|
+
readonly timeStatus: 'running' | 'paused' | 'finished';
|
|
597
|
+
readonly startDate: string;
|
|
598
|
+
readonly endDate?: string;
|
|
599
|
+
readonly runningSince?: string;
|
|
600
|
+
readonly effectiveIntervals: readonly TimeInterval[];
|
|
601
|
+
}
|
|
602
|
+
interface TimeOverlapDetectionResult {
|
|
603
|
+
readonly hasOverlap: boolean;
|
|
604
|
+
readonly conflicts: readonly ConflictingTimeEntry[];
|
|
605
|
+
readonly conflictToken?: string;
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
/** Keep this identity unchanged when retrying an interrupted operation. */
|
|
609
|
+
interface LocalOperationIdentity {
|
|
610
|
+
commandId: string;
|
|
611
|
+
entryId: string;
|
|
612
|
+
}
|
|
613
|
+
interface LocalTimerStateDTO extends TimerStateDTO {
|
|
614
|
+
entryId: string;
|
|
615
|
+
workspaceId: string;
|
|
616
|
+
}
|
|
617
|
+
interface ILocalTimeEntriesCapability {
|
|
618
|
+
list(workspaceId: string, filter?: LocalEntryFilter): Promise<Either<AppError, TimeEntryRecordDTO[]>>;
|
|
619
|
+
getById(workspaceId: string, id: string): Promise<Either<AppError, TimeEntryRecordDTO | null>>;
|
|
620
|
+
create(workspaceId: string, payload: LocalEntryInput, operation: LocalOperationIdentity): Promise<Either<AppError, TimeEntryRecordDTO>>;
|
|
621
|
+
createSuggestion(workspaceId: string, payload: LocalEntryInput, operation: LocalOperationIdentity): Promise<Either<AppError, TimeEntryRecordDTO>>;
|
|
622
|
+
acceptSuggestion(workspaceId: string, operation: LocalOperationIdentity): Promise<Either<AppError, TimeEntryRecordDTO>>;
|
|
623
|
+
dismissSuggestion(workspaceId: string, operation: LocalOperationIdentity): Promise<Either<AppError, boolean>>;
|
|
624
|
+
update(workspaceId: string, payload: LocalEntryChanges, operation: LocalOperationIdentity): Promise<Either<AppError, TimeEntryRecordDTO>>;
|
|
625
|
+
delete(workspaceId: string, operation: LocalOperationIdentity): Promise<Either<AppError, boolean>>;
|
|
626
|
+
}
|
|
627
|
+
interface ILocalTimerCapability {
|
|
628
|
+
getActiveEntry(workspaceId: string): Promise<Either<AppError, LocalTimerStateDTO | null>>;
|
|
629
|
+
requestControlLock(): Promise<Either<AppError, boolean>>;
|
|
630
|
+
releaseControlLock(): Promise<Either<AppError, void>>;
|
|
631
|
+
isControlLockHeld(): Promise<Either<AppError, boolean>>;
|
|
632
|
+
start(workspaceId: string, payload: LocalTimerInput, operation: LocalOperationIdentity): Promise<Either<AppError, void>>;
|
|
633
|
+
pause(workspaceId: string, operation: LocalOperationIdentity): Promise<Either<AppError, void>>;
|
|
634
|
+
resume(workspaceId: string, operation: LocalOperationIdentity): Promise<Either<AppError, void>>;
|
|
635
|
+
stop(workspaceId: string, operation: LocalOperationIdentity): Promise<Either<AppError, void>>;
|
|
636
|
+
logTime(workspaceId: string, payload: LocalEntryInput, operation: LocalOperationIdentity): Promise<Either<AppError, void>>;
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
interface LocalEntryInput extends CreateTimeEntryDTO {
|
|
640
|
+
activityName?: string;
|
|
641
|
+
userId?: string;
|
|
642
|
+
userName?: string;
|
|
643
|
+
}
|
|
644
|
+
interface LocalEntryChanges {
|
|
645
|
+
taskId?: string;
|
|
646
|
+
activityId?: string;
|
|
647
|
+
activityName?: string;
|
|
648
|
+
userId?: string;
|
|
649
|
+
userName?: string;
|
|
650
|
+
connectionInstanceId?: string;
|
|
651
|
+
dataSourceId?: string;
|
|
652
|
+
comments?: string;
|
|
653
|
+
timeSpentSeconds?: number;
|
|
654
|
+
pauseSeconds?: number;
|
|
655
|
+
startDate?: string;
|
|
656
|
+
endDate?: string;
|
|
657
|
+
timeStatus?: 'finished' | 'suggestion' | 'running';
|
|
658
|
+
}
|
|
659
|
+
interface LocalTimerInput extends LocalEntryInput {
|
|
660
|
+
mode: 'countup' | 'countdown';
|
|
661
|
+
}
|
|
662
|
+
interface LocalCommandIdentity {
|
|
663
|
+
commandId: string;
|
|
664
|
+
workspaceId: string;
|
|
665
|
+
entryId: string;
|
|
666
|
+
}
|
|
667
|
+
type LocalRuntimeCommand = (LocalCommandIdentity & {
|
|
668
|
+
action: 'create' | 'suggest';
|
|
669
|
+
payload: LocalEntryInput;
|
|
670
|
+
}) | (LocalCommandIdentity & {
|
|
671
|
+
action: 'update';
|
|
672
|
+
payload: LocalEntryChanges;
|
|
673
|
+
}) | (LocalCommandIdentity & {
|
|
674
|
+
action: 'timerStart';
|
|
675
|
+
payload: LocalTimerInput;
|
|
676
|
+
}) | (LocalCommandIdentity & {
|
|
677
|
+
action: 'acceptSuggestion';
|
|
678
|
+
confirmation?: {
|
|
679
|
+
conflictToken: string;
|
|
680
|
+
};
|
|
681
|
+
}) | (LocalCommandIdentity & {
|
|
682
|
+
action: 'delete' | 'dismissSuggestion' | 'timerPause' | 'timerResume' | 'timerStop';
|
|
683
|
+
});
|
|
684
|
+
interface LocalEntryFilter {
|
|
685
|
+
connectionInstanceId?: string;
|
|
686
|
+
taskId?: string;
|
|
687
|
+
startDate?: string;
|
|
688
|
+
endDate?: string;
|
|
689
|
+
source?: 'manual' | 'timer' | 'addon';
|
|
690
|
+
}
|
|
691
|
+
type LocalRuntimeQuery = {
|
|
692
|
+
action: 'list';
|
|
693
|
+
workspaceId: string;
|
|
694
|
+
filter: LocalEntryFilter;
|
|
695
|
+
} | {
|
|
696
|
+
action: 'get';
|
|
697
|
+
workspaceId: string;
|
|
698
|
+
entryId: string;
|
|
699
|
+
} | {
|
|
700
|
+
action: 'timerState';
|
|
701
|
+
workspaceId: string;
|
|
702
|
+
} | {
|
|
703
|
+
action: 'detectOverlaps';
|
|
704
|
+
workspaceId: string;
|
|
705
|
+
start: string;
|
|
706
|
+
end: string;
|
|
707
|
+
excludeEntryId?: string;
|
|
708
|
+
};
|
|
709
|
+
type LocalRuntimeRequest = LocalRuntimeCommand | LocalRuntimeQuery;
|
|
710
|
+
interface LocalRuntimeResult {
|
|
711
|
+
/** A durable replay does not emit a second notification or addon event. */
|
|
712
|
+
replayed?: boolean;
|
|
713
|
+
entry: TimeEntryRecordDTO | null;
|
|
714
|
+
entries: TimeEntryRecordDTO[];
|
|
715
|
+
timer: TimerStateDTO | null;
|
|
716
|
+
deleted: boolean;
|
|
717
|
+
pendingWrites: boolean;
|
|
718
|
+
overlap?: TimeOverlapDetectionResult;
|
|
719
|
+
}
|
|
720
|
+
interface LocalRuntimeFailure {
|
|
721
|
+
messageKey: string;
|
|
722
|
+
statusCode: number;
|
|
723
|
+
details?: FieldErrors;
|
|
724
|
+
}
|
|
725
|
+
type LocalRuntimeResponse = {
|
|
726
|
+
ok: true;
|
|
727
|
+
value: LocalRuntimeResult;
|
|
728
|
+
} | {
|
|
729
|
+
ok: false;
|
|
730
|
+
error: LocalRuntimeFailure;
|
|
731
|
+
};
|
|
732
|
+
interface ILocalRuntimeAPI {
|
|
733
|
+
request(input: LocalRuntimeRequest): Promise<LocalRuntimeResponse>;
|
|
734
|
+
}
|
|
735
|
+
|
|
736
|
+
interface TimerEventPayload {
|
|
737
|
+
workspaceId?: string;
|
|
738
|
+
taskId?: string;
|
|
739
|
+
taskName?: string;
|
|
740
|
+
comments?: string;
|
|
741
|
+
}
|
|
742
|
+
interface TimerStartPayload extends TimerEventPayload {
|
|
743
|
+
mode: 'countup' | 'countdown';
|
|
744
|
+
baseSeconds: number;
|
|
745
|
+
}
|
|
746
|
+
interface TimerPausePayload extends TimerEventPayload {
|
|
747
|
+
currentSeconds: number;
|
|
748
|
+
}
|
|
749
|
+
interface SystemIdlePayload {
|
|
750
|
+
idleMinutes: number;
|
|
751
|
+
}
|
|
752
|
+
interface ConnectionEventPayload {
|
|
753
|
+
workspaceId: string;
|
|
754
|
+
connectionInstanceId: string;
|
|
755
|
+
}
|
|
756
|
+
interface AddonSettingsSavedEventPayload {
|
|
757
|
+
addonId: string;
|
|
758
|
+
scope: {
|
|
759
|
+
kind: 'addon';
|
|
760
|
+
} | {
|
|
761
|
+
kind: 'workspace';
|
|
762
|
+
workspaceId: string;
|
|
763
|
+
} | {
|
|
764
|
+
kind: 'connection';
|
|
765
|
+
workspaceId: string;
|
|
766
|
+
connectionInstanceId: string;
|
|
767
|
+
} | {
|
|
768
|
+
kind: 'capability';
|
|
769
|
+
workspaceId: string;
|
|
770
|
+
connectionInstanceId: string;
|
|
771
|
+
capabilityId: string;
|
|
772
|
+
};
|
|
773
|
+
revision: number;
|
|
774
|
+
values: Record<string, string | number | boolean | null>;
|
|
775
|
+
}
|
|
776
|
+
interface AnalyticsLoadProgressEvent {
|
|
777
|
+
workspaceId: string;
|
|
778
|
+
connectionInstanceId: string;
|
|
779
|
+
selectionKey: string;
|
|
780
|
+
datasetId: string;
|
|
781
|
+
mode: 'full' | 'changes' | 'window_rescan';
|
|
782
|
+
phase: 'extracting' | 'publishing' | 'completed' | 'failed';
|
|
783
|
+
batchIndex: number;
|
|
784
|
+
fetchedRows: number;
|
|
785
|
+
totalRows?: number;
|
|
786
|
+
coverage?: 'complete' | 'unverified';
|
|
787
|
+
}
|
|
788
|
+
interface AnalyticsStorageErrorEvent {
|
|
789
|
+
workspaceId: string;
|
|
790
|
+
operation: 'hydrate' | 'load' | 'query' | 'saveWorkspaceState' | 'resetStorage';
|
|
791
|
+
messageKey: string;
|
|
792
|
+
details?: Record<string, string[]>;
|
|
793
|
+
}
|
|
794
|
+
interface AnalyticsStorageResetEvent {
|
|
795
|
+
workspaceId: string;
|
|
796
|
+
removed: boolean;
|
|
797
|
+
}
|
|
798
|
+
interface ISystemEvents {
|
|
799
|
+
'timer:start': TimerStartPayload;
|
|
800
|
+
'timer:pause': TimerPausePayload;
|
|
801
|
+
'timer:resume': TimerEventPayload & {
|
|
802
|
+
currentSeconds: number;
|
|
803
|
+
};
|
|
804
|
+
'timer:stop': TimerPausePayload;
|
|
805
|
+
'timer:update': TimerEventPayload;
|
|
806
|
+
'system:idle': SystemIdlePayload;
|
|
807
|
+
'system:active': {
|
|
808
|
+
idleMinutes: number;
|
|
809
|
+
};
|
|
810
|
+
'timeEntry:created': {
|
|
811
|
+
workspaceId?: string;
|
|
812
|
+
id: string;
|
|
813
|
+
timeSpentSeconds: number;
|
|
814
|
+
};
|
|
815
|
+
'timeEntry:updated': {
|
|
816
|
+
workspaceId?: string;
|
|
817
|
+
id: string;
|
|
818
|
+
timeSpentSeconds: number;
|
|
819
|
+
};
|
|
820
|
+
'workspace:changed': {
|
|
821
|
+
previousWorkspaceId?: string;
|
|
822
|
+
currentWorkspaceId: string;
|
|
823
|
+
};
|
|
824
|
+
'timeEntry:deleted': {
|
|
825
|
+
workspaceId?: string;
|
|
826
|
+
id: string;
|
|
827
|
+
};
|
|
828
|
+
'connection:disconnected': ConnectionEventPayload;
|
|
829
|
+
'connection:archived': ConnectionEventPayload;
|
|
830
|
+
'connection:removed': ConnectionEventPayload;
|
|
831
|
+
'addon:settings:saved': AddonSettingsSavedEventPayload;
|
|
832
|
+
'analytics:load-progress': AnalyticsLoadProgressEvent;
|
|
833
|
+
'analytics:storage-error': AnalyticsStorageErrorEvent;
|
|
834
|
+
'analytics:storage-reset': AnalyticsStorageResetEvent;
|
|
835
|
+
}
|
|
836
|
+
|
|
837
|
+
type IHeaders = {
|
|
838
|
+
authorization?: string;
|
|
839
|
+
};
|
|
840
|
+
|
|
841
|
+
interface IRequest<TBody = void> {
|
|
842
|
+
headers?: IHeaders;
|
|
843
|
+
body: TBody;
|
|
844
|
+
}
|
|
845
|
+
|
|
846
|
+
type AddonSettingsSnapshot = {
|
|
847
|
+
schemaVersion: 1;
|
|
848
|
+
revision: number;
|
|
849
|
+
values: AddonSettingsValues;
|
|
850
|
+
};
|
|
851
|
+
|
|
852
|
+
type AddonVaultScope = {
|
|
853
|
+
kind: 'addon';
|
|
854
|
+
} | {
|
|
855
|
+
kind: 'workspace';
|
|
856
|
+
workspaceId: string;
|
|
857
|
+
} | {
|
|
858
|
+
kind: 'connection';
|
|
859
|
+
workspaceId: string;
|
|
860
|
+
connectionInstanceId: string;
|
|
861
|
+
} | {
|
|
862
|
+
kind: 'capability';
|
|
863
|
+
workspaceId: string;
|
|
864
|
+
connectionInstanceId: string;
|
|
865
|
+
capabilityId: string;
|
|
866
|
+
};
|
|
867
|
+
type AddonSettingScalarValue = string | number | boolean | null;
|
|
868
|
+
type AddonSettingValue = AddonSettingScalarValue | AddonSettingObjectValue | AddonSettingArrayValue;
|
|
869
|
+
interface AddonSettingObjectValue {
|
|
870
|
+
readonly [key: string]: AddonSettingValue | undefined;
|
|
871
|
+
}
|
|
872
|
+
type AddonSettingArrayValue = readonly AddonSettingValue[];
|
|
873
|
+
type AddonSettingsValues = Record<string, AddonSettingValue>;
|
|
874
|
+
type AddonCollectionItemRecord = {
|
|
875
|
+
readonly itemId: string;
|
|
876
|
+
readonly values: AddonSettingsValues;
|
|
877
|
+
};
|
|
878
|
+
type AddonCollectionItemEnvelope = AddonCollectionItemRecord;
|
|
879
|
+
type AddonTaskReferenceValue = {
|
|
880
|
+
readonly workspaceId: string;
|
|
881
|
+
readonly connectionInstanceId: string;
|
|
882
|
+
readonly taskId: string;
|
|
883
|
+
readonly titleSnapshot?: string;
|
|
884
|
+
readonly projectNameSnapshot?: string;
|
|
885
|
+
readonly metadataValues?: Readonly<Record<string, string | number | boolean>>;
|
|
886
|
+
};
|
|
887
|
+
interface IAddonVaultAPI {
|
|
888
|
+
get(scope: AddonVaultScope, key: string): Promise<Either<AppError, string | null>>;
|
|
889
|
+
set(scope: AddonVaultScope, key: string, value: string): Promise<Either<AppError, void>>;
|
|
890
|
+
delete(scope: AddonVaultScope, key: string): Promise<Either<AppError, void>>;
|
|
891
|
+
getSettings(scope: AddonVaultScope): Promise<Either<AppError, AddonSettingsSnapshot>>;
|
|
892
|
+
}
|
|
893
|
+
|
|
894
|
+
type AddonSettingsFieldScope = 'credential' | 'configuration';
|
|
895
|
+
interface AddonSettingsOptionGroup {
|
|
896
|
+
readonly id: string;
|
|
897
|
+
readonly label: string;
|
|
898
|
+
}
|
|
899
|
+
interface AddonSettingsOptionPresentation {
|
|
900
|
+
readonly group?: AddonSettingsOptionGroup;
|
|
901
|
+
readonly imageUrl?: string;
|
|
902
|
+
}
|
|
903
|
+
interface AddonSettingsOption extends AddonSettingsOptionPresentation {
|
|
904
|
+
readonly label: string;
|
|
905
|
+
readonly value: string | number | boolean;
|
|
906
|
+
readonly description?: string;
|
|
907
|
+
readonly disabled?: boolean;
|
|
908
|
+
}
|
|
909
|
+
interface AddonSettingsMultiSelectOption extends AddonSettingsOptionPresentation {
|
|
910
|
+
readonly label: string;
|
|
911
|
+
readonly value: string | number;
|
|
912
|
+
readonly description?: string;
|
|
913
|
+
readonly disabled?: boolean;
|
|
914
|
+
}
|
|
915
|
+
type ConfiguredFieldMapping = {
|
|
916
|
+
readonly icon: string;
|
|
917
|
+
readonly color: string;
|
|
918
|
+
readonly customValue?: string;
|
|
919
|
+
};
|
|
920
|
+
type AddonMappingPreset = Record<string, ConfiguredFieldMapping>;
|
|
921
|
+
interface DataSourceConfigPreset {
|
|
922
|
+
readonly pluginId?: string;
|
|
923
|
+
readonly version?: string;
|
|
924
|
+
readonly name?: string;
|
|
925
|
+
readonly configuration: Record<string, string | number | boolean>;
|
|
926
|
+
readonly mapping?: AddonMappingPreset;
|
|
927
|
+
}
|
|
928
|
+
type AddonFieldAddressStep = {
|
|
929
|
+
readonly kind: 'field';
|
|
930
|
+
readonly fieldId: string;
|
|
931
|
+
} | {
|
|
932
|
+
readonly kind: 'item';
|
|
933
|
+
readonly itemId: string;
|
|
934
|
+
};
|
|
935
|
+
interface AddonFieldAddress {
|
|
936
|
+
readonly path: readonly AddonFieldAddressStep[];
|
|
937
|
+
}
|
|
938
|
+
interface AddonBaseSettingsField {
|
|
939
|
+
readonly id: string;
|
|
940
|
+
readonly label: string;
|
|
941
|
+
readonly description?: string;
|
|
942
|
+
readonly required?: boolean;
|
|
943
|
+
readonly scope?: AddonSettingsFieldScope;
|
|
944
|
+
}
|
|
945
|
+
interface AddonSettingsTextField extends AddonBaseSettingsField {
|
|
946
|
+
readonly type: 'text';
|
|
947
|
+
readonly defaultValue?: string;
|
|
948
|
+
readonly placeholder?: string;
|
|
949
|
+
}
|
|
950
|
+
interface AddonSettingsTextareaField extends AddonBaseSettingsField {
|
|
951
|
+
readonly type: 'textarea';
|
|
952
|
+
readonly defaultValue?: string;
|
|
953
|
+
readonly placeholder?: string;
|
|
954
|
+
readonly rows?: number;
|
|
955
|
+
}
|
|
956
|
+
interface AddonSettingsNumberField extends AddonBaseSettingsField {
|
|
957
|
+
readonly type: 'number';
|
|
958
|
+
readonly defaultValue?: number;
|
|
959
|
+
readonly min?: number;
|
|
960
|
+
readonly max?: number;
|
|
961
|
+
readonly step?: number;
|
|
962
|
+
readonly placeholder?: string;
|
|
963
|
+
}
|
|
964
|
+
interface AddonSettingsBooleanField extends AddonBaseSettingsField {
|
|
965
|
+
readonly type: 'boolean';
|
|
966
|
+
readonly defaultValue?: boolean;
|
|
967
|
+
}
|
|
968
|
+
interface AddonSettingsDateField extends AddonBaseSettingsField {
|
|
969
|
+
readonly type: 'date';
|
|
970
|
+
readonly defaultValue?: string;
|
|
971
|
+
readonly placeholder?: string;
|
|
972
|
+
}
|
|
973
|
+
interface AddonSettingsTimeField extends AddonBaseSettingsField {
|
|
974
|
+
readonly type: 'time';
|
|
975
|
+
readonly defaultValue?: string;
|
|
976
|
+
readonly placeholder?: string;
|
|
977
|
+
}
|
|
978
|
+
interface AddonSettingsTimezoneField extends AddonBaseSettingsField {
|
|
979
|
+
readonly type: 'timezone';
|
|
980
|
+
readonly defaultValue?: string;
|
|
981
|
+
readonly placeholder?: string;
|
|
982
|
+
}
|
|
983
|
+
interface AddonSettingsFieldDependency {
|
|
984
|
+
readonly base: 'root' | 'parent';
|
|
985
|
+
readonly address: AddonFieldAddress;
|
|
986
|
+
}
|
|
987
|
+
type AddonSettingsSelectSource = {
|
|
988
|
+
readonly kind: 'static';
|
|
989
|
+
readonly options: readonly AddonSettingsOption[];
|
|
990
|
+
} | {
|
|
991
|
+
readonly kind: 'dynamic';
|
|
992
|
+
readonly providerId: string;
|
|
993
|
+
readonly dependsOn?: readonly AddonSettingsFieldDependency[];
|
|
994
|
+
};
|
|
995
|
+
type AddonSettingsMultiSelectSource = {
|
|
996
|
+
readonly kind: 'static';
|
|
997
|
+
readonly options: readonly AddonSettingsMultiSelectOption[];
|
|
998
|
+
} | {
|
|
999
|
+
readonly kind: 'dynamic';
|
|
1000
|
+
readonly providerId: string;
|
|
1001
|
+
readonly dependsOn?: readonly AddonSettingsFieldDependency[];
|
|
1002
|
+
};
|
|
1003
|
+
interface AddonSettingsSelectField extends AddonBaseSettingsField {
|
|
1004
|
+
readonly type: 'select';
|
|
1005
|
+
readonly source?: AddonSettingsSelectSource;
|
|
1006
|
+
readonly options?: readonly AddonSettingsOption[];
|
|
1007
|
+
readonly defaultValue?: string | number | boolean;
|
|
1008
|
+
readonly placeholder?: string;
|
|
1009
|
+
}
|
|
1010
|
+
interface AddonSettingsMultiSelectField extends AddonBaseSettingsField {
|
|
1011
|
+
readonly type: 'multiselect';
|
|
1012
|
+
readonly source?: AddonSettingsMultiSelectSource;
|
|
1013
|
+
readonly options?: readonly AddonSettingsMultiSelectOption[];
|
|
1014
|
+
readonly defaultValue?: readonly (string | number)[];
|
|
1015
|
+
readonly placeholder?: string;
|
|
1016
|
+
}
|
|
1017
|
+
interface AddonSettingsTaskReferenceField extends AddonBaseSettingsField {
|
|
1018
|
+
readonly type: 'task-reference';
|
|
1019
|
+
readonly includeMetadata?: boolean;
|
|
1020
|
+
}
|
|
1021
|
+
interface AddonSettingsGroupField {
|
|
1022
|
+
readonly id: string;
|
|
1023
|
+
readonly type: 'group';
|
|
1024
|
+
readonly label: string;
|
|
1025
|
+
readonly description?: string;
|
|
1026
|
+
readonly scope?: AddonSettingsFieldScope;
|
|
1027
|
+
readonly fields: readonly AddonSettingsField[];
|
|
1028
|
+
}
|
|
1029
|
+
interface AddonSettingsCollectionField {
|
|
1030
|
+
readonly id: string;
|
|
1031
|
+
readonly type: 'collection';
|
|
1032
|
+
readonly label: string;
|
|
1033
|
+
readonly description?: string;
|
|
1034
|
+
readonly itemLabel?: string;
|
|
1035
|
+
readonly scope?: AddonSettingsFieldScope;
|
|
1036
|
+
readonly enabledFieldId?: string;
|
|
1037
|
+
readonly allowReorder?: boolean;
|
|
1038
|
+
readonly allowDuplicate?: boolean;
|
|
1039
|
+
readonly fields: readonly AddonSettingsField[];
|
|
1040
|
+
}
|
|
1041
|
+
interface AddonOperationalActionDefinition {
|
|
1042
|
+
readonly id: string;
|
|
1043
|
+
readonly label: string;
|
|
1044
|
+
readonly variant?: 'default' | 'destructive' | 'outline' | 'secondary' | 'ghost' | 'link';
|
|
1045
|
+
readonly fields?: readonly AddonSettingsField[];
|
|
1046
|
+
}
|
|
1047
|
+
interface AddonSettingsOperationalListField {
|
|
1048
|
+
readonly id: string;
|
|
1049
|
+
readonly type: 'operational-list';
|
|
1050
|
+
readonly label: string;
|
|
1051
|
+
readonly description?: string;
|
|
1052
|
+
readonly scope?: AddonSettingsFieldScope;
|
|
1053
|
+
readonly providerId: string;
|
|
1054
|
+
readonly actions: readonly AddonOperationalActionDefinition[];
|
|
1055
|
+
}
|
|
1056
|
+
interface AddonSettingsPasswordField extends AddonBaseSettingsField {
|
|
1057
|
+
readonly type: 'password';
|
|
1058
|
+
readonly scope: 'credential';
|
|
1059
|
+
readonly placeholder?: string;
|
|
1060
|
+
}
|
|
1061
|
+
interface AddonSettingsJsonField extends AddonBaseSettingsField {
|
|
1062
|
+
readonly type: 'json';
|
|
1063
|
+
readonly defaultValue?: string;
|
|
1064
|
+
readonly placeholder?: string;
|
|
1065
|
+
}
|
|
1066
|
+
interface AddonSettingsMappingField extends AddonBaseSettingsField {
|
|
1067
|
+
readonly type: 'mapping';
|
|
1068
|
+
readonly defaultValue?: AddonMappingPreset;
|
|
1069
|
+
}
|
|
1070
|
+
interface AddonSettingsButtonField {
|
|
1071
|
+
readonly id: string;
|
|
1072
|
+
readonly type: 'button';
|
|
1073
|
+
readonly label: string;
|
|
1074
|
+
readonly actionId: string;
|
|
1075
|
+
readonly scope?: AddonSettingsFieldScope;
|
|
1076
|
+
readonly variant?: 'default' | 'destructive' | 'outline' | 'secondary' | 'ghost' | 'link';
|
|
1077
|
+
readonly description?: string;
|
|
1078
|
+
}
|
|
1079
|
+
interface AddonSettingsInfoCardField {
|
|
1080
|
+
readonly id: string;
|
|
1081
|
+
readonly type: 'info-card';
|
|
1082
|
+
readonly label: string;
|
|
1083
|
+
readonly description?: string;
|
|
1084
|
+
readonly scope?: AddonSettingsFieldScope;
|
|
1085
|
+
readonly display?: {
|
|
1086
|
+
readonly title?: string;
|
|
1087
|
+
readonly message?: string;
|
|
1088
|
+
readonly avatarUrl?: string;
|
|
1089
|
+
readonly data?: Record<string, string>;
|
|
1090
|
+
};
|
|
1091
|
+
}
|
|
1092
|
+
interface AddonSettingsDataSourceInstancesField {
|
|
1093
|
+
readonly id: string;
|
|
1094
|
+
readonly type: 'datasource-instances';
|
|
1095
|
+
readonly label: string;
|
|
1096
|
+
readonly scope?: AddonSettingsFieldScope;
|
|
1097
|
+
readonly description?: string;
|
|
1098
|
+
}
|
|
1099
|
+
interface AddonSettingsFileField extends AddonBaseSettingsField {
|
|
1100
|
+
readonly type: 'file';
|
|
1101
|
+
readonly defaultValue?: string;
|
|
1102
|
+
readonly placeholder?: string;
|
|
1103
|
+
readonly extensions?: readonly string[];
|
|
1104
|
+
}
|
|
1105
|
+
interface AddonSettingsDirectoryField extends AddonBaseSettingsField {
|
|
1106
|
+
readonly type: 'directory';
|
|
1107
|
+
readonly defaultValue?: string;
|
|
1108
|
+
readonly placeholder?: string;
|
|
1109
|
+
}
|
|
1110
|
+
type AddonCollectionItemField = AddonSettingsField;
|
|
1111
|
+
type AddonSettingsField = AddonSettingsTextField | AddonSettingsTextareaField | AddonSettingsNumberField | AddonSettingsBooleanField | AddonSettingsDateField | AddonSettingsTimeField | AddonSettingsTimezoneField | AddonSettingsSelectField | AddonSettingsMultiSelectField | AddonSettingsTaskReferenceField | AddonSettingsGroupField | AddonSettingsCollectionField | AddonSettingsOperationalListField | AddonSettingsPasswordField | AddonSettingsJsonField | AddonSettingsMappingField | AddonSettingsButtonField | AddonSettingsInfoCardField | AddonSettingsDataSourceInstancesField | AddonSettingsFileField | AddonSettingsDirectoryField;
|
|
1112
|
+
type AddonSettingsFieldType = AddonSettingsField['type'];
|
|
1113
|
+
type AddonSettingsTabKind = 'auth' | 'capability';
|
|
1114
|
+
type AddonSettingsAuthType = 'credentials' | 'oauth2';
|
|
1115
|
+
interface AddonSettingsGroup {
|
|
1116
|
+
readonly id: string;
|
|
1117
|
+
readonly label: string;
|
|
1118
|
+
readonly description?: string;
|
|
1119
|
+
readonly authType?: AddonSettingsAuthType;
|
|
1120
|
+
readonly fields: readonly AddonSettingsField[];
|
|
1121
|
+
}
|
|
1122
|
+
interface AddonSettingsTab {
|
|
1123
|
+
readonly id: string;
|
|
1124
|
+
readonly label: string;
|
|
1125
|
+
readonly description?: string;
|
|
1126
|
+
readonly kind?: AddonSettingsTabKind;
|
|
1127
|
+
readonly requiresAuth?: boolean;
|
|
1128
|
+
readonly isAuthenticated?: boolean;
|
|
1129
|
+
readonly authType?: AddonSettingsAuthType;
|
|
1130
|
+
readonly evaluatorId?: string;
|
|
1131
|
+
readonly groups?: readonly AddonSettingsGroup[];
|
|
1132
|
+
readonly fields?: readonly AddonSettingsField[];
|
|
1133
|
+
}
|
|
1134
|
+
type AddonSettingsSchema = readonly AddonSettingsTab[] | readonly AddonSettingsField[];
|
|
1135
|
+
|
|
1136
|
+
interface AddonSettingsContext {
|
|
1137
|
+
readonly scope?: AddonVaultScope;
|
|
1138
|
+
readonly workspaceId?: string;
|
|
1139
|
+
}
|
|
1140
|
+
type AddonSettingsApplyStatus = 'applied' | 'pending' | 'failed';
|
|
1141
|
+
interface AddonSettingsApplyState {
|
|
1142
|
+
readonly revision: number;
|
|
1143
|
+
readonly status: AddonSettingsApplyStatus;
|
|
1144
|
+
readonly error?: {
|
|
1145
|
+
readonly messageKey: string;
|
|
1146
|
+
readonly statusCode: number;
|
|
1147
|
+
readonly details?: FieldErrors;
|
|
1148
|
+
};
|
|
1149
|
+
}
|
|
1150
|
+
interface AddonValidateSettingsRequest {
|
|
1151
|
+
readonly scope: AddonVaultScope;
|
|
1152
|
+
readonly values: AddonSettingsValues;
|
|
1153
|
+
}
|
|
1154
|
+
type AddonSettingsValidateHandler = (request: AddonValidateSettingsRequest) => Promise<Either<AppError, void>> | Either<AppError, void>;
|
|
1155
|
+
interface AddonResolvedDependencyEntry {
|
|
1156
|
+
readonly address: AddonFieldAddress;
|
|
1157
|
+
readonly value: AddonSettingValue;
|
|
1158
|
+
}
|
|
1159
|
+
interface AddonResolveOptionsRequest {
|
|
1160
|
+
readonly scope: AddonVaultScope;
|
|
1161
|
+
readonly providerId: string;
|
|
1162
|
+
readonly fieldAddress: AddonFieldAddress;
|
|
1163
|
+
readonly dependencies: readonly AddonResolvedDependencyEntry[];
|
|
1164
|
+
readonly draftValues: AddonSettingsValues;
|
|
1165
|
+
readonly search?: string;
|
|
1166
|
+
readonly cursor?: string;
|
|
1167
|
+
readonly limit?: number;
|
|
1168
|
+
}
|
|
1169
|
+
type AddonResolveOptionsPagination = {
|
|
1170
|
+
readonly hasMore: true;
|
|
1171
|
+
readonly nextCursor: string;
|
|
1172
|
+
} | {
|
|
1173
|
+
readonly hasMore: false;
|
|
1174
|
+
};
|
|
1175
|
+
type AddonResolveOptionsResponse = {
|
|
1176
|
+
readonly availability: 'available' | 'empty' | 'no-permission' | 'disconnected' | 'error';
|
|
1177
|
+
readonly options: readonly AddonSettingsOption[];
|
|
1178
|
+
readonly reason?: string;
|
|
1179
|
+
readonly error?: {
|
|
1180
|
+
readonly messageKey: string;
|
|
1181
|
+
readonly statusCode: number;
|
|
1182
|
+
readonly details?: FieldErrors;
|
|
1183
|
+
};
|
|
1184
|
+
} & AddonResolveOptionsPagination;
|
|
1185
|
+
type AddonSettingsOptionsProviderHandler = (request: AddonResolveOptionsRequest) => Promise<Either<AppError, AddonResolveOptionsResponse>> | Either<AppError, AddonResolveOptionsResponse>;
|
|
1186
|
+
interface AddonOperationalItem {
|
|
1187
|
+
readonly itemId: string;
|
|
1188
|
+
readonly title: string;
|
|
1189
|
+
readonly subtitle?: string;
|
|
1190
|
+
readonly status: 'pending' | 'resolved' | 'interrupted' | 'error';
|
|
1191
|
+
readonly reason?: string;
|
|
1192
|
+
readonly timestamp: string;
|
|
1193
|
+
readonly durationSeconds?: number;
|
|
1194
|
+
readonly data: Record<string, AddonSettingScalarValue>;
|
|
1195
|
+
readonly availableActions: readonly AddonOperationalActionDefinition[];
|
|
1196
|
+
}
|
|
1197
|
+
interface AddonOperationalListRequest {
|
|
1198
|
+
readonly scope: AddonVaultScope;
|
|
1199
|
+
readonly providerId: string;
|
|
1200
|
+
readonly cursor?: string;
|
|
1201
|
+
readonly limit?: number;
|
|
1202
|
+
}
|
|
1203
|
+
type AddonOperationalListPagination = {
|
|
1204
|
+
readonly hasMore: true;
|
|
1205
|
+
readonly nextCursor: string;
|
|
1206
|
+
} | {
|
|
1207
|
+
readonly hasMore: false;
|
|
1208
|
+
};
|
|
1209
|
+
type AddonOperationalListResponse = {
|
|
1210
|
+
readonly items: readonly AddonOperationalItem[];
|
|
1211
|
+
} & AddonOperationalListPagination;
|
|
1212
|
+
type AddonSettingsOperationalListProviderHandler = (request: AddonOperationalListRequest) => Promise<Either<AppError, AddonOperationalListResponse>> | Either<AppError, AddonOperationalListResponse>;
|
|
1213
|
+
interface AddonExecuteOperationalActionRequest {
|
|
1214
|
+
readonly scope: AddonVaultScope;
|
|
1215
|
+
readonly providerId: string;
|
|
1216
|
+
readonly itemId: string;
|
|
1217
|
+
readonly actionId: string;
|
|
1218
|
+
readonly payload?: Record<string, AddonSettingValue>;
|
|
1219
|
+
}
|
|
1220
|
+
type AddonSettingsOperationalActionHandler = (request: AddonExecuteOperationalActionRequest) => Promise<Either<AppError, void>> | Either<AppError, void>;
|
|
1221
|
+
interface AddonFieldMessageEntry {
|
|
1222
|
+
readonly address: AddonFieldAddress;
|
|
1223
|
+
readonly messages: readonly string[];
|
|
1224
|
+
}
|
|
1225
|
+
interface AddonFieldVisibilityEntry {
|
|
1226
|
+
readonly address: AddonFieldAddress;
|
|
1227
|
+
readonly visible: boolean;
|
|
1228
|
+
}
|
|
1229
|
+
interface AddonFieldDisabledEntry {
|
|
1230
|
+
readonly address: AddonFieldAddress;
|
|
1231
|
+
readonly disabled: boolean;
|
|
1232
|
+
}
|
|
1233
|
+
interface AddonEvaluateFormRequest {
|
|
1234
|
+
readonly scope: AddonVaultScope;
|
|
1235
|
+
readonly evaluatorId: string;
|
|
1236
|
+
readonly draftValues: AddonSettingsValues;
|
|
1237
|
+
readonly targetAddress?: AddonFieldAddress;
|
|
1238
|
+
}
|
|
1239
|
+
interface AddonFormEvaluationResponse {
|
|
1240
|
+
readonly fieldMessages?: readonly AddonFieldMessageEntry[];
|
|
1241
|
+
readonly fieldVisibility?: readonly AddonFieldVisibilityEntry[];
|
|
1242
|
+
readonly fieldDisabled?: readonly AddonFieldDisabledEntry[];
|
|
1243
|
+
readonly clearFields?: readonly AddonFieldAddress[];
|
|
1244
|
+
}
|
|
1245
|
+
type AddonSettingsFormEvaluatorHandler = (request: AddonEvaluateFormRequest) => Promise<Either<AppError, AddonFormEvaluationResponse>> | Either<AppError, AddonFormEvaluationResponse>;
|
|
1246
|
+
type AddonSettingsSchemaProvider = AddonSettingsSchema | ((context?: AddonSettingsContext) => Promise<AddonSettingsSchema> | AddonSettingsSchema);
|
|
1247
|
+
|
|
1248
|
+
interface AddonStorageEntry {
|
|
1249
|
+
readonly key: string;
|
|
1250
|
+
readonly value: string;
|
|
1251
|
+
}
|
|
1252
|
+
interface AddonStorageListRequest {
|
|
1253
|
+
readonly prefix?: string;
|
|
1254
|
+
readonly limit: number;
|
|
1255
|
+
readonly cursor?: string;
|
|
1256
|
+
}
|
|
1257
|
+
type AddonStorageListPagination = {
|
|
1258
|
+
readonly hasMore: true;
|
|
1259
|
+
readonly nextCursor: string;
|
|
1260
|
+
} | {
|
|
1261
|
+
readonly hasMore: false;
|
|
1262
|
+
};
|
|
1263
|
+
type AddonStorageListPage = {
|
|
1264
|
+
readonly entries: readonly AddonStorageEntry[];
|
|
1265
|
+
} & AddonStorageListPagination;
|
|
1266
|
+
/**
|
|
1267
|
+
* Durable key-value storage for addons to persist minimal journals,
|
|
1268
|
+
* receipts, and segments outside of user configuration and vault secrets.
|
|
1269
|
+
* Enforces native pagination and prefix filtering to prevent unbounded in-memory loading.
|
|
1270
|
+
*/
|
|
1271
|
+
interface IAddonStorageAPI {
|
|
1272
|
+
get(scope: AddonVaultScope, key: string): Promise<Either<AppError, string | null>>;
|
|
1273
|
+
set(scope: AddonVaultScope, key: string, value: string): Promise<Either<AppError, void>>;
|
|
1274
|
+
delete(scope: AddonVaultScope, key: string): Promise<Either<AppError, void>>;
|
|
1275
|
+
list(scope: AddonVaultScope, request: AddonStorageListRequest): Promise<Either<AppError, AddonStorageListPage>>;
|
|
1276
|
+
}
|
|
1277
|
+
|
|
1278
|
+
interface MetadataDTO {
|
|
1279
|
+
taskStatuses: MetadataItem[];
|
|
1280
|
+
taskPriorities: MetadataItem[];
|
|
1281
|
+
activities: MetadataItem[];
|
|
1282
|
+
trackStatuses: MetadataItem[];
|
|
1283
|
+
participantRoles: MetadataItem[];
|
|
1284
|
+
estimationTypes: MetadataItem[];
|
|
1285
|
+
}
|
|
1286
|
+
interface MetadataItem {
|
|
1287
|
+
id: string;
|
|
1288
|
+
name: string;
|
|
1289
|
+
icon: string;
|
|
1290
|
+
colors: {
|
|
1291
|
+
badge: string;
|
|
1292
|
+
background: string;
|
|
1293
|
+
text: string;
|
|
1294
|
+
border?: string;
|
|
1295
|
+
};
|
|
1296
|
+
}
|
|
1297
|
+
|
|
1298
|
+
type ConnectionCredentialPayload = Readonly<Record<string, string | number | boolean>>;
|
|
1299
|
+
|
|
1300
|
+
/** Source IDs never contain RxDB composite keys. */
|
|
1301
|
+
interface CoreConnectionScope {
|
|
1302
|
+
workspaceId: string;
|
|
1303
|
+
connectionInstanceId: string;
|
|
1304
|
+
authorizationRole?: string;
|
|
1305
|
+
}
|
|
1306
|
+
/** Addon-only callback; credential access is never exposed through IHostBridge or renderer APIs. */
|
|
1307
|
+
type ConnectionCredentialOperation = (credentials: ConnectionCredentialPayload) => Promise<Either<AppError, void>>;
|
|
1308
|
+
interface CoreTaskReference extends CoreConnectionScope {
|
|
1309
|
+
taskId: string;
|
|
1310
|
+
}
|
|
1311
|
+
interface CoreWorkspace {
|
|
1312
|
+
id: string;
|
|
1313
|
+
name: string;
|
|
1314
|
+
status: 'draft' | 'configured';
|
|
1315
|
+
}
|
|
1316
|
+
interface CoreConnection extends CoreConnectionScope {
|
|
1317
|
+
addonId: string;
|
|
1318
|
+
connectionProfileId: string;
|
|
1319
|
+
cardinality: 'single' | 'multi';
|
|
1320
|
+
status: 'connected' | 'disabled' | 'disconnected' | 'archived';
|
|
1321
|
+
identity: CoreConnectionIdentity | null;
|
|
1322
|
+
capability?: string;
|
|
1323
|
+
}
|
|
1324
|
+
interface CoreConnectionIdentity {
|
|
1325
|
+
kind: 'human' | 'bot' | 'installation';
|
|
1326
|
+
displayName: string;
|
|
1327
|
+
avatarUrl: string | null;
|
|
1328
|
+
}
|
|
1329
|
+
interface CoreConnectionCreateInput {
|
|
1330
|
+
workspaceId: string;
|
|
1331
|
+
connectionProfileId: string;
|
|
1332
|
+
}
|
|
1333
|
+
interface CoreConnectionAuthorizationRequest {
|
|
1334
|
+
authUrl: string;
|
|
1335
|
+
timeoutMs: number;
|
|
1336
|
+
}
|
|
1337
|
+
interface CoreConnectionAuthorizationResponse {
|
|
1338
|
+
code: string;
|
|
1339
|
+
state: string;
|
|
1340
|
+
/** Explicit connection configuration committed atomically with the OAuth authorization. */
|
|
1341
|
+
configuration?: Readonly<Record<string, string | number | boolean>>;
|
|
1342
|
+
}
|
|
1343
|
+
interface CoreConnectionAuthenticationInput {
|
|
1344
|
+
kind: 'credentials';
|
|
1345
|
+
authorizationRole?: string;
|
|
1346
|
+
authProfileId: string;
|
|
1347
|
+
credentials: Readonly<Record<string, string | number | boolean>>;
|
|
1348
|
+
configuration: Readonly<Record<string, string | number | boolean>>;
|
|
1349
|
+
}
|
|
1350
|
+
/** Local cache snapshot. Dates are ISO 8601 strings. */
|
|
1351
|
+
interface CoreTask extends CoreTaskReference {
|
|
1352
|
+
dataSourceId: string;
|
|
1353
|
+
title: string;
|
|
1354
|
+
description?: string;
|
|
1355
|
+
url?: string;
|
|
1356
|
+
projectName?: string;
|
|
1357
|
+
status: {
|
|
1358
|
+
id: string;
|
|
1359
|
+
name: string;
|
|
1360
|
+
};
|
|
1361
|
+
createdAt: string;
|
|
1362
|
+
updatedAt: string;
|
|
1363
|
+
tracker?: {
|
|
1364
|
+
id: string;
|
|
1365
|
+
};
|
|
1366
|
+
priority?: {
|
|
1367
|
+
id: string;
|
|
1368
|
+
name: string;
|
|
1369
|
+
};
|
|
1370
|
+
assignedTo?: {
|
|
1371
|
+
id?: string;
|
|
1372
|
+
name: string;
|
|
1373
|
+
};
|
|
1374
|
+
}
|
|
1375
|
+
interface CoreTaskListRequest extends CoreConnectionScope {
|
|
1376
|
+
offset?: number;
|
|
1377
|
+
sortByUpdatedAt?: 'asc' | 'desc';
|
|
1378
|
+
statusId?: string;
|
|
1379
|
+
priorityId?: string;
|
|
1380
|
+
assignedMemberId?: string;
|
|
1381
|
+
/** Integer between 1 and 100. Ordered by source task ID ascending. */
|
|
1382
|
+
limit: number;
|
|
1383
|
+
/** Case-insensitive substring of title or source task ID. */
|
|
1384
|
+
search?: string;
|
|
1385
|
+
/** Opaque cursor for continuation beyond the initial limit. */
|
|
1386
|
+
cursor?: string;
|
|
1387
|
+
}
|
|
1388
|
+
interface CoreTaskPage {
|
|
1389
|
+
tasks: CoreTask[];
|
|
1390
|
+
hasMore: boolean;
|
|
1391
|
+
nextCursor?: string;
|
|
1392
|
+
}
|
|
1393
|
+
interface CoreMember {
|
|
1394
|
+
id: string;
|
|
1395
|
+
name: string;
|
|
1396
|
+
email?: string;
|
|
1397
|
+
avatarUrl?: string;
|
|
1398
|
+
}
|
|
1399
|
+
interface CoreMetadata extends CoreConnectionScope {
|
|
1400
|
+
dataSourceId: string;
|
|
1401
|
+
lastPulledAt: string | null;
|
|
1402
|
+
values: MetadataDTO;
|
|
1403
|
+
}
|
|
1404
|
+
interface LocalMetadataSnapshot {
|
|
1405
|
+
values: MetadataDTO;
|
|
1406
|
+
revision: string;
|
|
1407
|
+
}
|
|
1408
|
+
type CoreRuntimeState = 'starting' | 'ready' | 'restarting' | 'closed';
|
|
1409
|
+
|
|
1410
|
+
type ConnectionConfigPayload = Readonly<Record<string, string | number | boolean>>;
|
|
1411
|
+
interface AuthenticationResult {
|
|
1412
|
+
readonly kind: 'authorized';
|
|
1413
|
+
readonly identity: ConnectionIdentity;
|
|
1414
|
+
readonly credentials: ConnectionConfigPayload;
|
|
1415
|
+
}
|
|
1416
|
+
interface ConnectionAuthorizationRequest {
|
|
1417
|
+
readonly authUrl: string;
|
|
1418
|
+
readonly timeoutMs: number;
|
|
1419
|
+
}
|
|
1420
|
+
interface OAuthAuthorizationParameters {
|
|
1421
|
+
readonly state: string;
|
|
1422
|
+
readonly codeChallenge: string;
|
|
1423
|
+
readonly codeChallengeMethod: 'S256';
|
|
1424
|
+
readonly redirectUri: string;
|
|
1425
|
+
}
|
|
1426
|
+
interface OAuthTokenExchangeParameters {
|
|
1427
|
+
readonly code: string;
|
|
1428
|
+
readonly state: string;
|
|
1429
|
+
readonly codeVerifier: string;
|
|
1430
|
+
readonly redirectUri: string;
|
|
1431
|
+
}
|
|
1432
|
+
interface OAuthRenewalResult {
|
|
1433
|
+
readonly credentials: ConnectionConfigPayload;
|
|
1434
|
+
}
|
|
1435
|
+
type OAuthRevocationCapability = {
|
|
1436
|
+
readonly supportsRevocation: true;
|
|
1437
|
+
revokeToken(scope: CoreConnectionScope, currentCredentials: ConnectionConfigPayload): Promise<Either<AppError, void>>;
|
|
1438
|
+
} | {
|
|
1439
|
+
readonly supportsRevocation: false;
|
|
1440
|
+
readonly revokeToken?: never;
|
|
1441
|
+
};
|
|
1442
|
+
type AddonConnectionAuthenticator = {
|
|
1443
|
+
readonly method: 'credentials';
|
|
1444
|
+
readonly authProfileId: string;
|
|
1445
|
+
readonly supportsRefresh: false;
|
|
1446
|
+
readonly supportsRevocation: false;
|
|
1447
|
+
readonly revokeToken?: never;
|
|
1448
|
+
authenticate(credentials: ConnectionConfigPayload, configuration: ConnectionConfigPayload): Promise<Either<AppError, AuthenticationResult>>;
|
|
1449
|
+
} | ({
|
|
1450
|
+
readonly method: 'oauth';
|
|
1451
|
+
readonly authProfileId: string;
|
|
1452
|
+
readonly supportsRefresh: true;
|
|
1453
|
+
readonly redirectUri?: string;
|
|
1454
|
+
createAuthorizationRequest(scope: CoreConnectionScope, parameters: OAuthAuthorizationParameters): Promise<Either<AppError, ConnectionAuthorizationRequest>>;
|
|
1455
|
+
completeAuthentication(scope: CoreConnectionScope, parameters: OAuthTokenExchangeParameters): Promise<Either<AppError, AuthenticationResult>>;
|
|
1456
|
+
refreshToken(scope: CoreConnectionScope, currentCredentials: ConnectionConfigPayload): Promise<Either<TokenRefreshError, OAuthRenewalResult>>;
|
|
1457
|
+
} & OAuthRevocationCapability) | ({
|
|
1458
|
+
readonly method: 'oauth';
|
|
1459
|
+
readonly authProfileId: string;
|
|
1460
|
+
readonly supportsRefresh: false;
|
|
1461
|
+
readonly redirectUri?: string;
|
|
1462
|
+
createAuthorizationRequest(scope: CoreConnectionScope, parameters: OAuthAuthorizationParameters): Promise<Either<AppError, ConnectionAuthorizationRequest>>;
|
|
1463
|
+
completeAuthentication(scope: CoreConnectionScope, parameters: OAuthTokenExchangeParameters): Promise<Either<AppError, AuthenticationResult>>;
|
|
1464
|
+
} & OAuthRevocationCapability);
|
|
1465
|
+
|
|
1466
|
+
interface MemberDTO {
|
|
1467
|
+
/** Native provider identity: numeric IDs and opaque account IDs are both valid. */
|
|
1468
|
+
id: string | number;
|
|
1469
|
+
login: string;
|
|
1470
|
+
firstname: string;
|
|
1471
|
+
lastname: string;
|
|
1472
|
+
admin?: boolean;
|
|
1473
|
+
createdOn?: string;
|
|
1474
|
+
lastLoginOn?: string;
|
|
1475
|
+
avatarUrl?: string;
|
|
1476
|
+
customFields: {
|
|
1477
|
+
id: number;
|
|
1478
|
+
name: string;
|
|
1479
|
+
value: string;
|
|
1480
|
+
}[];
|
|
1481
|
+
}
|
|
1482
|
+
|
|
1483
|
+
interface AuthenticationDTO {
|
|
1484
|
+
member: MemberDTO;
|
|
1485
|
+
token: string;
|
|
1486
|
+
}
|
|
1487
|
+
|
|
1488
|
+
interface PagedResultDTO<T> {
|
|
1489
|
+
items: T[];
|
|
1490
|
+
total: number;
|
|
1491
|
+
page: number;
|
|
1492
|
+
pageSize: number;
|
|
1493
|
+
}
|
|
1494
|
+
|
|
1495
|
+
interface PaginationOptionsDTO {
|
|
1496
|
+
page?: number;
|
|
1497
|
+
pageSize?: number;
|
|
1498
|
+
orderBy?: string;
|
|
1499
|
+
orderDirection?: 'asc' | 'desc';
|
|
1500
|
+
search?: string;
|
|
1501
|
+
ids?: string[];
|
|
1502
|
+
}
|
|
1503
|
+
|
|
1504
|
+
interface TaskDTO {
|
|
1505
|
+
id: string;
|
|
1506
|
+
title: string;
|
|
1507
|
+
description?: string;
|
|
1508
|
+
url?: string;
|
|
1509
|
+
projectName?: string;
|
|
1510
|
+
status: {
|
|
1511
|
+
id: string;
|
|
1512
|
+
name: string;
|
|
1513
|
+
};
|
|
1514
|
+
priority?: {
|
|
1515
|
+
id: string;
|
|
1516
|
+
name: string;
|
|
1517
|
+
};
|
|
1518
|
+
assignedTo?: {
|
|
1519
|
+
id?: string;
|
|
1520
|
+
name: string;
|
|
1521
|
+
};
|
|
1522
|
+
author?: {
|
|
1523
|
+
id?: string;
|
|
1524
|
+
name: string;
|
|
1525
|
+
};
|
|
1526
|
+
tracker?: {
|
|
1527
|
+
id: string;
|
|
1528
|
+
name?: string;
|
|
1529
|
+
};
|
|
1530
|
+
createdAt: Date;
|
|
1531
|
+
updatedAt: Date;
|
|
1532
|
+
startDate?: Date;
|
|
1533
|
+
dueDate?: Date;
|
|
1534
|
+
doneRatio?: number;
|
|
1535
|
+
estimatedTimes?: EstimatedTime[];
|
|
1536
|
+
spentHours?: number;
|
|
1537
|
+
statusChanges?: StatusChangeDTO[];
|
|
1538
|
+
participants?: Participants[];
|
|
1539
|
+
}
|
|
1540
|
+
interface Participants {
|
|
1541
|
+
id: string;
|
|
1542
|
+
name: string;
|
|
1543
|
+
role: {
|
|
1544
|
+
id: string;
|
|
1545
|
+
};
|
|
1546
|
+
}
|
|
1547
|
+
interface EstimatedTime {
|
|
1548
|
+
id: string;
|
|
1549
|
+
name: string;
|
|
1550
|
+
activities: {
|
|
1551
|
+
id: string;
|
|
1552
|
+
name: string;
|
|
1553
|
+
}[];
|
|
1554
|
+
hours: number;
|
|
1555
|
+
}
|
|
1556
|
+
interface StatusChangeDTO {
|
|
1557
|
+
fromStatus: string;
|
|
1558
|
+
toStatus: string;
|
|
1559
|
+
description?: string;
|
|
1560
|
+
changedBy: {
|
|
1561
|
+
id: string;
|
|
1562
|
+
name: string;
|
|
1563
|
+
};
|
|
1564
|
+
changedAt: Date;
|
|
1565
|
+
}
|
|
1566
|
+
|
|
1567
|
+
interface TimeEntryDTO {
|
|
1568
|
+
id?: string;
|
|
1569
|
+
/**
|
|
1570
|
+
* Identidade imutável do apontamento na origem local (o UUID do rascunho).
|
|
1571
|
+
* Permite que o provider remoto reconheça um apontamento que ele mesmo já
|
|
1572
|
+
* criou (idempotência) e que o pull devolva o vínculo exato com o registro
|
|
1573
|
+
* local. Ausente em registros criados fora desta aplicação.
|
|
1574
|
+
*/
|
|
1575
|
+
correlationId?: string;
|
|
1576
|
+
/** Empty task.id represents an existing remote entry without a task; new remote creations require a selected task. */
|
|
1577
|
+
task: {
|
|
1578
|
+
id: string;
|
|
1579
|
+
};
|
|
1580
|
+
activity: {
|
|
1581
|
+
id: string;
|
|
1582
|
+
name?: string;
|
|
1583
|
+
};
|
|
1584
|
+
user: {
|
|
1585
|
+
id: string;
|
|
1586
|
+
name?: string;
|
|
1587
|
+
};
|
|
1588
|
+
startDate?: Date;
|
|
1589
|
+
endDate?: Date;
|
|
1590
|
+
timeSpent: number;
|
|
1591
|
+
comments?: string;
|
|
1592
|
+
createdAt: Date;
|
|
1593
|
+
updatedAt: Date;
|
|
1594
|
+
source?: 'manual' | 'timer' | 'ai_suggestion' | 'addon';
|
|
1595
|
+
addonSource?: {
|
|
1596
|
+
id: string;
|
|
1597
|
+
name: string;
|
|
1598
|
+
imageUrl?: string;
|
|
1599
|
+
metadata?: Readonly<Record<string, string | number | boolean>>;
|
|
1600
|
+
};
|
|
1601
|
+
}
|
|
1602
|
+
|
|
1603
|
+
interface TimeEntryPullCheckpointDTO {
|
|
1604
|
+
updatedAt: Date;
|
|
1605
|
+
id: string;
|
|
1606
|
+
/** Provider-owned cursor. Consumers must persist and return it unchanged. */
|
|
1607
|
+
cursor?: string;
|
|
1608
|
+
}
|
|
1609
|
+
interface TimeEntryPullPageDTO {
|
|
1610
|
+
/** Omitted means snapshot. Change feeds do not promise immutable records between pages. */
|
|
1611
|
+
kind?: 'snapshot' | 'changes';
|
|
1612
|
+
items: TimeEntryDTO[];
|
|
1613
|
+
checkpoint: TimeEntryPullCheckpointDTO;
|
|
1614
|
+
hasMore: boolean;
|
|
1615
|
+
/** Snapshot identity, or the bounded source selection identity for a change-feed page. */
|
|
1616
|
+
snapshotId: string;
|
|
1617
|
+
}
|
|
1618
|
+
|
|
1619
|
+
interface ConnectionAuthorizationDTO {
|
|
1620
|
+
readonly authorizationId: string;
|
|
1621
|
+
readonly authorizationRole: string;
|
|
1622
|
+
readonly authProfileId: string;
|
|
1623
|
+
readonly identity: ConnectionIdentity;
|
|
1624
|
+
readonly status: 'active' | 'revoked' | 'expired' | 'reauth_required';
|
|
1625
|
+
readonly createdAt?: string;
|
|
1626
|
+
readonly updatedAt?: string;
|
|
1627
|
+
}
|
|
1628
|
+
interface WorkspaceConnectionMemberDTO {
|
|
1629
|
+
id: string;
|
|
1630
|
+
name: string;
|
|
1631
|
+
login: string;
|
|
1632
|
+
avatarUrl?: string;
|
|
1633
|
+
}
|
|
1634
|
+
interface WorkspaceConnectionDTO {
|
|
1635
|
+
id: string;
|
|
1636
|
+
addonId: string;
|
|
1637
|
+
connectionProfileId: string;
|
|
1638
|
+
cardinality: 'single' | 'multi';
|
|
1639
|
+
status: 'connected' | 'disabled' | 'disconnected' | 'archived';
|
|
1640
|
+
authorizations: readonly ConnectionAuthorizationDTO[];
|
|
1641
|
+
identity?: ConnectionIdentity;
|
|
1642
|
+
member?: WorkspaceConnectionMemberDTO;
|
|
1643
|
+
config?: Record<string, string | number | boolean>;
|
|
1644
|
+
lastAuthenticatedAt?: string;
|
|
1645
|
+
}
|
|
1646
|
+
type WorkspaceStatus = 'draft' | 'configured';
|
|
1647
|
+
interface WorkspaceDTO {
|
|
1648
|
+
id: string;
|
|
1649
|
+
name: string;
|
|
1650
|
+
status: WorkspaceStatus;
|
|
1651
|
+
description?: string;
|
|
1652
|
+
avatarUrl?: string;
|
|
1653
|
+
connections: WorkspaceConnectionDTO[];
|
|
1654
|
+
createdAt: Date;
|
|
1655
|
+
updatedAt: Date;
|
|
1656
|
+
}
|
|
1657
|
+
|
|
1658
|
+
type AnalyticsColumnType = 'string' | 'number' | 'boolean' | 'date';
|
|
1659
|
+
type AnalyticsColumnUnit = 'hours' | 'points' | 'count' | 'percent' | 'none';
|
|
1660
|
+
type AnalyticsColumnOrigin = 'native' | 'custom' | 'computed';
|
|
1661
|
+
interface AnalyticsColumnSchema {
|
|
1662
|
+
name: string;
|
|
1663
|
+
label: string;
|
|
1664
|
+
type: AnalyticsColumnType;
|
|
1665
|
+
unit?: AnalyticsColumnUnit;
|
|
1666
|
+
origin?: AnalyticsColumnOrigin;
|
|
1667
|
+
providerFieldId?: string;
|
|
1668
|
+
}
|
|
1669
|
+
type AnalyticsCanonicalEntity = 'time_entries' | 'issues' | 'issue_transitions' | 'sprints_versions' | 'member_capacity' | 'custom_report';
|
|
1670
|
+
type AnalyticsFilterType = 'date_range' | 'select' | 'multi_select' | 'text' | 'number' | 'boolean';
|
|
1671
|
+
interface AnalyticsFilterOption {
|
|
1672
|
+
value: string;
|
|
1673
|
+
label: string;
|
|
1674
|
+
}
|
|
1675
|
+
type AnalyticsFilterDynamicSource = 'projects' | 'members' | 'task_statuses' | 'task_priorities' | 'task_trackers' | 'activities' | 'sprints_versions';
|
|
1676
|
+
interface AnalyticsFilterDefinition {
|
|
1677
|
+
id: string;
|
|
1678
|
+
label: string;
|
|
1679
|
+
type: AnalyticsFilterType;
|
|
1680
|
+
description?: string;
|
|
1681
|
+
required?: boolean;
|
|
1682
|
+
defaultValue?: string | string[];
|
|
1683
|
+
options?: AnalyticsFilterOption[];
|
|
1684
|
+
dynamicOptionsSource?: AnalyticsFilterDynamicSource;
|
|
1685
|
+
}
|
|
1686
|
+
type AnalyticsFilterValue = string | string[] | number | boolean | {
|
|
1687
|
+
from?: string;
|
|
1688
|
+
to?: string;
|
|
1689
|
+
};
|
|
1690
|
+
type AnalyticsExecutionKind = 'snapshot' | 'changes' | 'aggregate';
|
|
1691
|
+
type AnalyticsRowIdentity = {
|
|
1692
|
+
kind: 'scope';
|
|
1693
|
+
} | {
|
|
1694
|
+
kind: 'row';
|
|
1695
|
+
columns: readonly string[];
|
|
1696
|
+
};
|
|
1697
|
+
interface AnalyticsExtractionDescriptor {
|
|
1698
|
+
modes: readonly AnalyticsExecutionKind[];
|
|
1699
|
+
identity: AnalyticsRowIdentity;
|
|
1700
|
+
changes?: {
|
|
1701
|
+
deletions: 'none' | 'explicit';
|
|
1702
|
+
};
|
|
1703
|
+
windowRescan?: {
|
|
1704
|
+
dateColumn: string;
|
|
1705
|
+
};
|
|
1706
|
+
aggregation?: {
|
|
1707
|
+
groupByColumns: readonly string[];
|
|
1708
|
+
operators: readonly AnalyticsAggregateMeasure['operator'][];
|
|
1709
|
+
postProcessing: 'projection-only';
|
|
1710
|
+
};
|
|
1711
|
+
}
|
|
1712
|
+
interface AnalyticsDatasetManifest {
|
|
1713
|
+
id: string;
|
|
1714
|
+
canonicalEntity?: AnalyticsCanonicalEntity;
|
|
1715
|
+
name: string;
|
|
1716
|
+
description: string;
|
|
1717
|
+
extraction: AnalyticsExtractionDescriptor;
|
|
1718
|
+
/** Omission means that built-in date/project selection is unsupported. */
|
|
1719
|
+
selection?: {
|
|
1720
|
+
dateRange: boolean;
|
|
1721
|
+
project: boolean;
|
|
1722
|
+
};
|
|
1723
|
+
sourceFormat: 'csv' | 'json';
|
|
1724
|
+
endpoint: string;
|
|
1725
|
+
columns: AnalyticsColumnSchema[];
|
|
1726
|
+
supportedFilters?: AnalyticsFilterDefinition[];
|
|
1727
|
+
}
|
|
1728
|
+
interface AnalyticsAggregateMeasure {
|
|
1729
|
+
name: string;
|
|
1730
|
+
operator: 'count' | 'sum' | 'average' | 'minimum' | 'maximum';
|
|
1731
|
+
column?: string;
|
|
1732
|
+
}
|
|
1733
|
+
/** Omission means the dataset's initial snapshot request. Unsupported requests fail explicitly. */
|
|
1734
|
+
type AnalyticsExecutionRequest = {
|
|
1735
|
+
kind: 'snapshot';
|
|
1736
|
+
cursor?: string;
|
|
1737
|
+
batchSize?: number;
|
|
1738
|
+
} | {
|
|
1739
|
+
kind: 'changes';
|
|
1740
|
+
checkpoint: string;
|
|
1741
|
+
cursor?: string;
|
|
1742
|
+
batchSize?: number;
|
|
1743
|
+
} | {
|
|
1744
|
+
kind: 'aggregate';
|
|
1745
|
+
groupBy: string[];
|
|
1746
|
+
measures: AnalyticsAggregateMeasure[];
|
|
1747
|
+
cursor?: string;
|
|
1748
|
+
};
|
|
1749
|
+
interface AnalyticsDatasetQueryInput extends AnalyticsDatasetScope {
|
|
1750
|
+
execution?: AnalyticsExecutionRequest;
|
|
1751
|
+
}
|
|
1752
|
+
type AnalyticsDatasetCellValue = string | number | boolean | null;
|
|
1753
|
+
type AnalyticsDatasetRow = Record<string, AnalyticsDatasetCellValue>;
|
|
1754
|
+
interface AnalyticsDatasetPayload {
|
|
1755
|
+
dataset: AnalyticsDatasetManifest;
|
|
1756
|
+
rows: AnalyticsDatasetRow[];
|
|
1757
|
+
fetchedAt: string;
|
|
1758
|
+
rawCsvSample?: string;
|
|
1759
|
+
}
|
|
1760
|
+
/** A selection in provider terms; transport cursors never become domain identifiers. */
|
|
1761
|
+
interface AnalyticsDatasetScope {
|
|
1762
|
+
datasetId: string;
|
|
1763
|
+
startDate?: string;
|
|
1764
|
+
endDate?: string;
|
|
1765
|
+
projectId?: string;
|
|
1766
|
+
filters?: Record<string, AnalyticsFilterValue>;
|
|
1767
|
+
}
|
|
1768
|
+
interface AnalyticsContinuation {
|
|
1769
|
+
cursor: string;
|
|
1770
|
+
checkpoint?: string;
|
|
1771
|
+
}
|
|
1772
|
+
/** Completion of traversal does not prove a remotely consistent snapshot. */
|
|
1773
|
+
interface AnalyticsBatchInfo {
|
|
1774
|
+
index: number;
|
|
1775
|
+
offset: number;
|
|
1776
|
+
finished: boolean;
|
|
1777
|
+
totalRows?: number;
|
|
1778
|
+
}
|
|
1779
|
+
interface AnalyticsExecutionMetrics {
|
|
1780
|
+
requests?: number;
|
|
1781
|
+
retries?: number;
|
|
1782
|
+
bytes?: number;
|
|
1783
|
+
}
|
|
1784
|
+
/** Complete refers only to the declared scope, never to the whole provider. */
|
|
1785
|
+
type AnalyticsDatasetExecution = {
|
|
1786
|
+
kind: 'snapshot';
|
|
1787
|
+
scope: AnalyticsDatasetScope;
|
|
1788
|
+
coverage: 'complete' | 'partial' | 'unverified';
|
|
1789
|
+
coverageReason?: string;
|
|
1790
|
+
checkpoint?: string;
|
|
1791
|
+
batch?: AnalyticsBatchInfo;
|
|
1792
|
+
continuation?: AnalyticsContinuation;
|
|
1793
|
+
metrics?: AnalyticsExecutionMetrics;
|
|
1794
|
+
} | {
|
|
1795
|
+
kind: 'changes';
|
|
1796
|
+
scope: AnalyticsDatasetScope;
|
|
1797
|
+
checkpoint: string;
|
|
1798
|
+
deletedIds: string[];
|
|
1799
|
+
coverage: 'complete' | 'partial' | 'unverified';
|
|
1800
|
+
coverageReason?: string;
|
|
1801
|
+
batch?: AnalyticsBatchInfo;
|
|
1802
|
+
continuation?: AnalyticsContinuation;
|
|
1803
|
+
metrics?: AnalyticsExecutionMetrics;
|
|
1804
|
+
} | {
|
|
1805
|
+
kind: 'aggregate';
|
|
1806
|
+
scope: AnalyticsDatasetScope;
|
|
1807
|
+
coverage: 'complete' | 'partial';
|
|
1808
|
+
continuation?: AnalyticsContinuation;
|
|
1809
|
+
metrics?: AnalyticsExecutionMetrics;
|
|
1810
|
+
};
|
|
1811
|
+
interface AnalyticsDatasetResult extends AnalyticsDatasetPayload {
|
|
1812
|
+
execution: AnalyticsDatasetExecution;
|
|
1813
|
+
}
|
|
1814
|
+
interface IAnalyticsProvider {
|
|
1815
|
+
listAnalyticsDatasets(): Promise<Either<AppError, AnalyticsDatasetManifest[]>>;
|
|
1816
|
+
fetchAnalyticsDataset(input: AnalyticsDatasetQueryInput): Promise<Either<AppError, AnalyticsDatasetResult>>;
|
|
1817
|
+
getFilterOptions(source: AnalyticsFilterDynamicSource): Promise<Either<AppError, AnalyticsFilterOption[]>>;
|
|
1818
|
+
}
|
|
1819
|
+
/** A continuation changes progress, never the identity of the selected data. */
|
|
1820
|
+
declare function createAnalyticsDatasetScope(input: AnalyticsDatasetQueryInput): AnalyticsDatasetScope;
|
|
1821
|
+
|
|
1822
|
+
type AnalyticsFilterOperator = 'eq' | 'neq' | 'gt' | 'gte' | 'lt' | 'lte' | 'contains' | 'not_empty';
|
|
1823
|
+
type AnalyticsAggregationOperator = 'sum' | 'count' | 'count_distinct' | 'avg';
|
|
1824
|
+
type AnalyticsFormulaOperator = 'divide' | 'multiply' | 'subtract' | 'add' | 'percent_of';
|
|
1825
|
+
interface AnalyticsCaseRule {
|
|
1826
|
+
whenColumn: string;
|
|
1827
|
+
operator: AnalyticsFilterOperator;
|
|
1828
|
+
whenValue: string;
|
|
1829
|
+
thenMode: 'column' | 'literal';
|
|
1830
|
+
thenValue: string;
|
|
1831
|
+
}
|
|
1832
|
+
interface AnalyticsNodeTransformConfig {
|
|
1833
|
+
filterColumn?: string;
|
|
1834
|
+
filterOperator?: AnalyticsFilterOperator;
|
|
1835
|
+
filterValue?: string;
|
|
1836
|
+
additionalFilters?: {
|
|
1837
|
+
filterColumn: string;
|
|
1838
|
+
filterOperator: AnalyticsFilterOperator;
|
|
1839
|
+
filterValue: string;
|
|
1840
|
+
}[];
|
|
1841
|
+
caseColumnName?: string;
|
|
1842
|
+
caseWhenColumn?: string;
|
|
1843
|
+
caseWhenValue?: string;
|
|
1844
|
+
caseThenValue?: string;
|
|
1845
|
+
caseRules?: AnalyticsCaseRule[];
|
|
1846
|
+
caseElseMode?: 'column' | 'literal';
|
|
1847
|
+
caseElseValue?: string;
|
|
1848
|
+
groupByColumn?: string;
|
|
1849
|
+
pivotColumn?: string;
|
|
1850
|
+
valueColumn?: string;
|
|
1851
|
+
aggregation?: AnalyticsAggregationOperator;
|
|
1852
|
+
formulaColumnName?: string;
|
|
1853
|
+
formulaLeftColumn?: string;
|
|
1854
|
+
formulaOperator?: AnalyticsFormulaOperator;
|
|
1855
|
+
formulaRightColumn?: string;
|
|
1856
|
+
}
|
|
1857
|
+
interface AnalyticsNodeJoinConfig {
|
|
1858
|
+
joinType: 'inner' | 'left' | 'full' | 'union';
|
|
1859
|
+
leftNodeId?: string;
|
|
1860
|
+
rightNodeId?: string;
|
|
1861
|
+
leftKey: string;
|
|
1862
|
+
rightKey: string;
|
|
1863
|
+
formulaColumnName?: string;
|
|
1864
|
+
formulaLeftColumn?: string;
|
|
1865
|
+
formulaOperator?: AnalyticsFormulaOperator;
|
|
1866
|
+
formulaRightColumn?: string;
|
|
1867
|
+
postFormulaColumnName?: string;
|
|
1868
|
+
postFormulaLeftColumn?: string;
|
|
1869
|
+
postFormulaOperator?: AnalyticsFormulaOperator;
|
|
1870
|
+
postFormulaRightColumn?: string;
|
|
1871
|
+
}
|
|
1872
|
+
interface AnalyticsNodeSqlConfig {
|
|
1873
|
+
sqlQuery: string;
|
|
1874
|
+
inputAliases?: string[];
|
|
1875
|
+
templateId?: string;
|
|
1876
|
+
snippetId?: string;
|
|
1877
|
+
}
|
|
1878
|
+
type AnalyticsPlanNode = {
|
|
1879
|
+
id: string;
|
|
1880
|
+
kind: 'source';
|
|
1881
|
+
connectionInstanceId: string;
|
|
1882
|
+
selectionKey: string;
|
|
1883
|
+
columns?: string[];
|
|
1884
|
+
casts?: Record<string, 'string' | 'number' | 'date'>;
|
|
1885
|
+
} | {
|
|
1886
|
+
id: string;
|
|
1887
|
+
kind: 'transform' | 'filter' | 'aggregate';
|
|
1888
|
+
upstreamNodeIds: string[];
|
|
1889
|
+
transformConfig: AnalyticsNodeTransformConfig;
|
|
1890
|
+
} | {
|
|
1891
|
+
id: string;
|
|
1892
|
+
kind: 'join';
|
|
1893
|
+
upstreamNodeIds: string[];
|
|
1894
|
+
joinConfig: AnalyticsNodeJoinConfig;
|
|
1895
|
+
} | {
|
|
1896
|
+
id: string;
|
|
1897
|
+
kind: 'sql';
|
|
1898
|
+
upstreamNodeIds: string[];
|
|
1899
|
+
sqlConfig: AnalyticsNodeSqlConfig;
|
|
1900
|
+
} | {
|
|
1901
|
+
id: string;
|
|
1902
|
+
kind: 'output';
|
|
1903
|
+
upstreamNodeIds: string[];
|
|
1904
|
+
};
|
|
1905
|
+
interface AnalyticsLocalFilter {
|
|
1906
|
+
column: string;
|
|
1907
|
+
operator: AnalyticsFilterOperator;
|
|
1908
|
+
value: string;
|
|
1909
|
+
}
|
|
1910
|
+
interface AnalyticsLocalMeasure {
|
|
1911
|
+
name: string;
|
|
1912
|
+
column?: string;
|
|
1913
|
+
operator: AnalyticsAggregationOperator;
|
|
1914
|
+
}
|
|
1915
|
+
interface AnalyticsQueryInput {
|
|
1916
|
+
workspaceId: string;
|
|
1917
|
+
nodes: AnalyticsPlanNode[];
|
|
1918
|
+
targetNodeId: string;
|
|
1919
|
+
projection?: string[];
|
|
1920
|
+
filters?: AnalyticsLocalFilter[];
|
|
1921
|
+
search?: string;
|
|
1922
|
+
calculation?: AnalyticsNodeTransformConfig;
|
|
1923
|
+
rollup?: boolean;
|
|
1924
|
+
groupBy?: string[];
|
|
1925
|
+
measures?: AnalyticsLocalMeasure[];
|
|
1926
|
+
pivot?: {
|
|
1927
|
+
rowColumn: string;
|
|
1928
|
+
pivotColumn: string;
|
|
1929
|
+
valueColumn?: string;
|
|
1930
|
+
operator: AnalyticsAggregationOperator;
|
|
1931
|
+
};
|
|
1932
|
+
offset: number;
|
|
1933
|
+
limit: number;
|
|
1934
|
+
version?: string;
|
|
1935
|
+
}
|
|
1936
|
+
interface AnalyticsQueryResult {
|
|
1937
|
+
columns: AnalyticsColumnSchema[];
|
|
1938
|
+
rows: AnalyticsDatasetRow[];
|
|
1939
|
+
totalRows: number;
|
|
1940
|
+
offset: number;
|
|
1941
|
+
limit: number;
|
|
1942
|
+
hasMore: boolean;
|
|
1943
|
+
version: string;
|
|
1944
|
+
coverage: 'complete' | 'unverified';
|
|
1945
|
+
coverageReason?: string;
|
|
1946
|
+
loadedAt: string;
|
|
1947
|
+
remoteAggregate: boolean;
|
|
1948
|
+
groupingColumn?: string;
|
|
1949
|
+
}
|
|
1950
|
+
interface AnalyticsPublication {
|
|
1951
|
+
generationId: string;
|
|
1952
|
+
selectionKey: string;
|
|
1953
|
+
connectionInstanceId: string;
|
|
1954
|
+
manifest: AnalyticsDatasetManifest;
|
|
1955
|
+
query: AnalyticsDatasetQueryInput;
|
|
1956
|
+
rowCount: number;
|
|
1957
|
+
coverage: 'complete' | 'unverified';
|
|
1958
|
+
coverageReason?: string;
|
|
1959
|
+
loadedAt: string;
|
|
1960
|
+
fetchedAt: string;
|
|
1961
|
+
remoteAggregate: boolean;
|
|
1962
|
+
}
|
|
1963
|
+
type AnalyticsRefreshMode = 'auto' | 'fast' | 'full';
|
|
1964
|
+
interface AnalyticsRefreshPolicy {
|
|
1965
|
+
mode?: AnalyticsRefreshMode;
|
|
1966
|
+
rollingWindowDays?: number;
|
|
1967
|
+
fullReconcileIntervalMinutes?: number;
|
|
1968
|
+
}
|
|
1969
|
+
type AnalyticsSyncStrategy = 'incremental_changes' | 'window_rescan' | 'full_replace';
|
|
1970
|
+
interface AnalyticsSyncState {
|
|
1971
|
+
connectionInstanceId: string;
|
|
1972
|
+
selectionKey: string;
|
|
1973
|
+
datasetId: string;
|
|
1974
|
+
strategy: AnalyticsSyncStrategy;
|
|
1975
|
+
checkpoint?: string;
|
|
1976
|
+
lastFastSyncAt: string;
|
|
1977
|
+
lastFullReconcileAt: string;
|
|
1978
|
+
coverage: 'complete' | 'unverified';
|
|
1979
|
+
coverageReason?: string;
|
|
1980
|
+
lastWindowStart?: string;
|
|
1981
|
+
lastWindowEnd?: string;
|
|
1982
|
+
lastRecentReconcileAt?: string;
|
|
1983
|
+
lastRecentStart?: string;
|
|
1984
|
+
lastRecentEnd?: string;
|
|
1985
|
+
lastError?: string;
|
|
1986
|
+
lastErrorAt?: string;
|
|
1987
|
+
lastRunRequests?: number;
|
|
1988
|
+
lastRunPages?: number;
|
|
1989
|
+
lastRunDurationMs?: number;
|
|
1990
|
+
lastRunRetries?: number;
|
|
1991
|
+
lastRunBytes?: number;
|
|
1992
|
+
}
|
|
1993
|
+
interface AnalyticsWorkspaceState {
|
|
1994
|
+
workspaceId: string;
|
|
1995
|
+
pollingIntervalMinutes: number;
|
|
1996
|
+
spacesJson?: string;
|
|
1997
|
+
startDate?: string;
|
|
1998
|
+
endDate?: string;
|
|
1999
|
+
updatedAt: string;
|
|
2000
|
+
}
|
|
2001
|
+
interface SaveAnalyticsWorkspaceStateInput {
|
|
2002
|
+
workspaceId: string;
|
|
2003
|
+
pollingIntervalMinutes: number;
|
|
2004
|
+
spacesJson?: string;
|
|
2005
|
+
startDate?: string;
|
|
2006
|
+
endDate?: string;
|
|
2007
|
+
}
|
|
2008
|
+
interface AnalyticsPublicationEntry {
|
|
2009
|
+
publication: AnalyticsPublication;
|
|
2010
|
+
syncState: AnalyticsSyncState;
|
|
2011
|
+
}
|
|
2012
|
+
interface AnalyticsHydrateInput {
|
|
2013
|
+
workspaceId: string;
|
|
2014
|
+
}
|
|
2015
|
+
interface AnalyticsHydrateResult {
|
|
2016
|
+
settings?: AnalyticsWorkspaceState;
|
|
2017
|
+
publications: AnalyticsPublicationEntry[];
|
|
2018
|
+
}
|
|
2019
|
+
interface AnalyticsLoadInput {
|
|
2020
|
+
workspaceId: string;
|
|
2021
|
+
connectionInstanceId: string;
|
|
2022
|
+
query: AnalyticsDatasetQueryInput;
|
|
2023
|
+
policy?: AnalyticsRefreshPolicy;
|
|
2024
|
+
}
|
|
2025
|
+
interface AnalyticsLoadResult {
|
|
2026
|
+
publication: AnalyticsPublication;
|
|
2027
|
+
syncState: AnalyticsSyncState;
|
|
2028
|
+
strategy: AnalyticsSyncStrategy;
|
|
2029
|
+
reused?: boolean;
|
|
2030
|
+
}
|
|
2031
|
+
|
|
2032
|
+
interface MappingFieldDefinition {
|
|
2033
|
+
id: string;
|
|
2034
|
+
name: string;
|
|
2035
|
+
category: string;
|
|
2036
|
+
categoryLabel?: string;
|
|
2037
|
+
defaultIcon?: string;
|
|
2038
|
+
defaultColor?: string;
|
|
2039
|
+
description?: string;
|
|
2040
|
+
}
|
|
2041
|
+
interface IMetadataProvider {
|
|
2042
|
+
getMetadata(memberId: string, checkpoint: {
|
|
2043
|
+
updatedAt: Date;
|
|
2044
|
+
id: string;
|
|
2045
|
+
}, batch: number): Promise<Either<AppError, MetadataDTO>>;
|
|
2046
|
+
getMappingFields?(): Promise<Either<AppError, MappingFieldDefinition[]>>;
|
|
2047
|
+
}
|
|
2048
|
+
|
|
2049
|
+
interface IEventsAPI<TEvents extends object = ISystemEvents> {
|
|
2050
|
+
on<K extends keyof TEvents>(event: K, handler: (payload: TEvents[K]) => void): () => void;
|
|
2051
|
+
on<T = void>(channel: string, handler: (data: T) => void): () => void;
|
|
2052
|
+
once?<K extends keyof TEvents>(event: K, handler: (payload: TEvents[K]) => void): void;
|
|
2053
|
+
once?<T = void>(channel: string, handler: (data: T) => void): void;
|
|
2054
|
+
emit<K extends keyof TEvents>(event: K, payload: TEvents[K]): void;
|
|
2055
|
+
emit<T = void>(channel: string, payload?: T): void;
|
|
2056
|
+
off?<K extends keyof TEvents>(event: K, handler: (payload: TEvents[K]) => void): void;
|
|
2057
|
+
off?<T = void>(channel: string, handler: (data: T) => void): void;
|
|
2058
|
+
}
|
|
2059
|
+
interface AddonSidebarMenuItem {
|
|
2060
|
+
id: string;
|
|
2061
|
+
label: string;
|
|
2062
|
+
href?: string;
|
|
2063
|
+
icon?: string;
|
|
2064
|
+
children?: {
|
|
2065
|
+
id: string;
|
|
2066
|
+
label: string;
|
|
2067
|
+
href: string;
|
|
2068
|
+
icon?: string;
|
|
2069
|
+
}[];
|
|
2070
|
+
}
|
|
2071
|
+
interface AddonTimerbarPopoverSubItem {
|
|
2072
|
+
id: string;
|
|
2073
|
+
label: string;
|
|
2074
|
+
icon?: string;
|
|
2075
|
+
description?: string;
|
|
2076
|
+
shortcut?: string;
|
|
2077
|
+
danger?: boolean;
|
|
2078
|
+
}
|
|
2079
|
+
interface AddonTimerbarActionItem {
|
|
2080
|
+
id: string;
|
|
2081
|
+
type: 'action';
|
|
2082
|
+
label?: string;
|
|
2083
|
+
icon: string;
|
|
2084
|
+
tooltip?: string;
|
|
2085
|
+
}
|
|
2086
|
+
interface AddonTimerbarPopoverItem {
|
|
2087
|
+
id: string;
|
|
2088
|
+
type: 'popover';
|
|
2089
|
+
label?: string;
|
|
2090
|
+
icon: string;
|
|
2091
|
+
tooltip?: string;
|
|
2092
|
+
items?: AddonTimerbarPopoverSubItem[];
|
|
2093
|
+
}
|
|
2094
|
+
type AddonTimerbarMenuItem = AddonTimerbarActionItem | AddonTimerbarPopoverItem;
|
|
2095
|
+
|
|
2096
|
+
interface ICoreConnectionsReadAPI {
|
|
2097
|
+
list(workspaceId: string, filter?: {
|
|
2098
|
+
capability?: string;
|
|
2099
|
+
}): Promise<Either<AppError, CoreConnection[]>>;
|
|
2100
|
+
get(scope: CoreConnectionScope): Promise<Either<AppError, CoreConnection>>;
|
|
2101
|
+
}
|
|
2102
|
+
interface ICoreConnectionsAPI extends ICoreConnectionsReadAPI {
|
|
2103
|
+
create(input: CoreConnectionCreateInput): Promise<Either<AppError, CoreConnection>>;
|
|
2104
|
+
createAuthorizationRequest(scope: CoreConnectionScope): Promise<Either<AppError, CoreConnectionAuthorizationRequest>>;
|
|
2105
|
+
completeAuthentication(scope: CoreConnectionScope, response: CoreConnectionAuthorizationResponse): Promise<Either<AppError, CoreConnection>>;
|
|
2106
|
+
submitCredentials(scope: CoreConnectionScope, input: CoreConnectionAuthenticationInput): Promise<Either<AppError, CoreConnection>>;
|
|
2107
|
+
withCredentials(scope: CoreConnectionScope, operation: ConnectionCredentialOperation): Promise<Either<AppError, void>>;
|
|
2108
|
+
refresh(scope: CoreConnectionScope): Promise<Either<AppError, void>>;
|
|
2109
|
+
disconnect(scope: CoreConnectionScope): Promise<Either<AppError, void>>;
|
|
2110
|
+
archive(scope: CoreConnectionScope): Promise<Either<AppError, void>>;
|
|
2111
|
+
restore(scope: CoreConnectionScope): Promise<Either<AppError, CoreConnection>>;
|
|
2112
|
+
remove(scope: CoreConnectionScope): Promise<Either<AppError, void>>;
|
|
2113
|
+
}
|
|
2114
|
+
|
|
2115
|
+
interface ICoreMembersAPI {
|
|
2116
|
+
getCurrentUser(scope: CoreConnectionScope): Promise<Either<AppError, CoreMember>>;
|
|
2117
|
+
}
|
|
2118
|
+
|
|
2119
|
+
interface ICoreMetadataAPI {
|
|
2120
|
+
getLocal(workspaceId: string): Promise<Either<AppError, LocalMetadataSnapshot>>;
|
|
2121
|
+
get(scope: CoreConnectionScope): Promise<Either<AppError, CoreMetadata>>;
|
|
2122
|
+
}
|
|
2123
|
+
|
|
2124
|
+
interface ICoreRuntimeAPI {
|
|
2125
|
+
getState(): CoreRuntimeState;
|
|
2126
|
+
/** Receives the current state immediately, then subsequent changes. */
|
|
2127
|
+
onStateChanged(listener: (state: CoreRuntimeState) => void): () => void;
|
|
2128
|
+
}
|
|
2129
|
+
|
|
2130
|
+
interface ICoreTasksAPI {
|
|
2131
|
+
search(request: CoreTaskListRequest): Promise<Either<AppError, CoreTaskPage>>;
|
|
2132
|
+
list(request: CoreTaskListRequest): Promise<Either<AppError, CoreTaskPage>>;
|
|
2133
|
+
get(reference: CoreTaskReference): Promise<Either<AppError, CoreTask>>;
|
|
2134
|
+
}
|
|
2135
|
+
|
|
2136
|
+
interface ICoreWorkspacesAPI {
|
|
2137
|
+
list(): Promise<Either<AppError, CoreWorkspace[]>>;
|
|
2138
|
+
get(workspaceId: string): Promise<Either<AppError, CoreWorkspace>>;
|
|
2139
|
+
}
|
|
2140
|
+
|
|
2141
|
+
/** Read-only context supplied by the host's local cache adapter. */
|
|
2142
|
+
interface ICoreReadAPI {
|
|
2143
|
+
readonly runtime: ICoreRuntimeAPI;
|
|
2144
|
+
readonly workspaces: ICoreWorkspacesAPI;
|
|
2145
|
+
readonly connections: ICoreConnectionsReadAPI;
|
|
2146
|
+
readonly tasks: ICoreTasksAPI;
|
|
2147
|
+
readonly metadata: ICoreMetadataAPI;
|
|
2148
|
+
readonly members: ICoreMembersAPI;
|
|
2149
|
+
}
|
|
2150
|
+
|
|
2151
|
+
/** Owner-scoped addon surface; mutable connection actions are separated from cache reads. */
|
|
2152
|
+
interface ICoreAddonCapabilities extends ICoreReadAPI {
|
|
2153
|
+
readonly connections: ICoreConnectionsAPI;
|
|
2154
|
+
}
|
|
2155
|
+
|
|
2156
|
+
type ICoreTimeEntriesAPI = ILocalTimeEntriesCapability;
|
|
2157
|
+
|
|
2158
|
+
type ICoreTimerAPI = ILocalTimerCapability;
|
|
2159
|
+
|
|
2160
|
+
/** Core product operations exposed to addon consumers. */
|
|
2161
|
+
interface ICoreAPI extends ICoreAddonCapabilities {
|
|
2162
|
+
readonly timer: ICoreTimerAPI;
|
|
2163
|
+
readonly timeEntries: ICoreTimeEntriesAPI;
|
|
2164
|
+
}
|
|
2165
|
+
|
|
2166
|
+
interface IMemberProvider {
|
|
2167
|
+
getCurrentUser(): Promise<Either<AppError, MemberDTO | null>>;
|
|
2168
|
+
findById(id: string): Promise<Either<AppError, MemberDTO | null>>;
|
|
2169
|
+
findByCredentials(login: string, password: string): Promise<Either<AppError, MemberDTO>>;
|
|
2170
|
+
findAll(pagination?: PaginationOptionsDTO): Promise<Either<AppError, PagedResultDTO<MemberDTO>>>;
|
|
2171
|
+
}
|
|
2172
|
+
|
|
2173
|
+
interface CreatedTaskResult {
|
|
2174
|
+
id: string;
|
|
2175
|
+
updatedAt?: Date;
|
|
2176
|
+
}
|
|
2177
|
+
interface UpdatedTaskResult {
|
|
2178
|
+
id: string;
|
|
2179
|
+
updatedAt?: Date;
|
|
2180
|
+
}
|
|
2181
|
+
interface ITaskProvider {
|
|
2182
|
+
pull(memberId: string, checkpoint: {
|
|
2183
|
+
updatedAt: Date;
|
|
2184
|
+
id: string;
|
|
2185
|
+
}, batch: number): Promise<Either<AppError, TaskDTO[]>>;
|
|
2186
|
+
findAll(pagination?: PaginationOptionsDTO): Promise<Either<AppError, PagedResultDTO<TaskDTO>>>;
|
|
2187
|
+
findById(id: string): Promise<Either<AppError, TaskDTO | null>>;
|
|
2188
|
+
create(task: TaskDTO): Promise<Either<AppError, CreatedTaskResult>>;
|
|
2189
|
+
update(task: TaskDTO): Promise<Either<AppError, UpdatedTaskResult>>;
|
|
2190
|
+
delete(id: string): Promise<Either<AppError, void>>;
|
|
2191
|
+
}
|
|
2192
|
+
|
|
2193
|
+
interface CreatedTimeEntryResult {
|
|
2194
|
+
id: string;
|
|
2195
|
+
updatedAt?: Date;
|
|
2196
|
+
/**
|
|
2197
|
+
* Estado do apontamento exatamente como o destino o gravou (valores
|
|
2198
|
+
* normalizados, como horas arredondadas). O destino é a fonte da verdade:
|
|
2199
|
+
* quando presente, substitui o que o usuário digitou.
|
|
2200
|
+
*/
|
|
2201
|
+
entry?: TimeEntryDTO;
|
|
2202
|
+
}
|
|
2203
|
+
interface UpdatedTimeEntryResult {
|
|
2204
|
+
id: string;
|
|
2205
|
+
updatedAt?: Date;
|
|
2206
|
+
/** Ver {@link CreatedTimeEntryResult.entry}. */
|
|
2207
|
+
entry?: TimeEntryDTO;
|
|
2208
|
+
}
|
|
2209
|
+
type TimeEntryCreateIdempotency = 'native' | 'reconcilable' | 'none';
|
|
2210
|
+
interface ITimeEntryProvider {
|
|
2211
|
+
readonly timeEntryCreateIdempotency?: TimeEntryCreateIdempotency;
|
|
2212
|
+
pull(memberId: string, checkpoint: TimeEntryPullCheckpointDTO, batch: number): Promise<Either<AppError, TimeEntryPullPageDTO>>;
|
|
2213
|
+
findByMemberId(memberId: string, startDate: Date, endDate: Date): Promise<Either<AppError, PagedResultDTO<TimeEntryDTO>>>;
|
|
2214
|
+
findByCorrelation?(correlationId: string, entry: TimeEntryDTO): Promise<Either<AppError, TimeEntryDTO | null>>;
|
|
2215
|
+
create(entry: TimeEntryDTO): Promise<Either<AppError, CreatedTimeEntryResult>>;
|
|
2216
|
+
update(entry: TimeEntryDTO): Promise<Either<AppError, UpdatedTimeEntryResult>>;
|
|
2217
|
+
/** Server must atomically compare the expected revision/snapshot and write.
|
|
2218
|
+
* A mismatch returns 409/412 without changing the remote record.
|
|
2219
|
+
* Omit this method when the backend cannot guarantee the condition.
|
|
2220
|
+
*/
|
|
2221
|
+
updateConditional?(entry: TimeEntryDTO, expected: TimeEntryDTO): Promise<Either<AppError, UpdatedTimeEntryResult>>;
|
|
2222
|
+
delete(id: string): Promise<Either<AppError, void>>;
|
|
2223
|
+
findById(id: string): Promise<Either<AppError, TimeEntryDTO | null>>;
|
|
2224
|
+
findAll(pagination?: PaginationOptionsDTO): Promise<Either<AppError, PagedResultDTO<TimeEntryDTO>>>;
|
|
2225
|
+
}
|
|
2226
|
+
|
|
2227
|
+
/** Minimal member reference derivable from a connection identity. */
|
|
2228
|
+
interface AuthenticatedMember {
|
|
2229
|
+
readonly id: string;
|
|
2230
|
+
readonly firstname: string;
|
|
2231
|
+
readonly lastname: string;
|
|
2232
|
+
}
|
|
2233
|
+
|
|
2234
|
+
interface IHttpClientConfig {
|
|
2235
|
+
readonly baseURL?: string;
|
|
2236
|
+
readonly params?: Record<string, string>;
|
|
2237
|
+
readonly headers?: Record<string, string>;
|
|
2238
|
+
readonly sensitiveHeaders?: readonly string[];
|
|
2239
|
+
readonly timeout?: number;
|
|
2240
|
+
}
|
|
2241
|
+
type JsonValue = null | boolean | number | string | JsonValue[] | {
|
|
2242
|
+
[key: string]: JsonValue;
|
|
2243
|
+
};
|
|
2244
|
+
type HttpResponseValidator<T extends JsonValue> = (value: JsonValue) => value is T;
|
|
2245
|
+
interface IHttpRequestOptions<T extends JsonValue> {
|
|
2246
|
+
/** Opt-in provider decoder. Return only approved, user-facing error fields; never the entire body. */
|
|
2247
|
+
readonly readErrorMessage?: (payload: JsonValue) => string | undefined;
|
|
2248
|
+
readonly params?: Record<string, string | number | boolean>;
|
|
2249
|
+
readonly headers?: Record<string, string>;
|
|
2250
|
+
readonly sensitiveHeaders?: readonly string[];
|
|
2251
|
+
readonly timeout?: number;
|
|
2252
|
+
readonly responseType?: 'json' | 'text';
|
|
2253
|
+
readonly priority?: 'manual' | 'background';
|
|
2254
|
+
readonly responseValidator: HttpResponseValidator<T>;
|
|
2255
|
+
}
|
|
2256
|
+
type HttpPayload = Record<string, boolean | number | string | null | undefined | object | Array<boolean | number | string | object>> | string;
|
|
2257
|
+
interface IHttpClient {
|
|
2258
|
+
get<T extends JsonValue>(url: string, config: IHttpRequestOptions<T>): Promise<Either<AppError, T>>;
|
|
2259
|
+
post<T extends JsonValue>(url: string, data: HttpPayload, config: IHttpRequestOptions<T>): Promise<Either<AppError, T>>;
|
|
2260
|
+
put<T extends JsonValue>(url: string, data: HttpPayload, config: IHttpRequestOptions<T>): Promise<Either<AppError, T>>;
|
|
2261
|
+
patch<T extends JsonValue>(url: string, data: HttpPayload, config: IHttpRequestOptions<T>): Promise<Either<AppError, T>>;
|
|
2262
|
+
delete<T extends JsonValue>(url: string, config: IHttpRequestOptions<T>): Promise<Either<AppError, T>>;
|
|
2263
|
+
withConfig(config: IHttpClientConfig): IHttpClient;
|
|
2264
|
+
}
|
|
2265
|
+
interface IHttpClientFactory {
|
|
2266
|
+
createClient(config: IHttpClientConfig): IHttpClient;
|
|
2267
|
+
}
|
|
2268
|
+
interface DataSourcePKCEPair {
|
|
2269
|
+
codeVerifier: string;
|
|
2270
|
+
codeChallenge: string;
|
|
2271
|
+
}
|
|
2272
|
+
interface DataSourceOAuthAuthorizeOptions {
|
|
2273
|
+
authUrl: string;
|
|
2274
|
+
state?: string;
|
|
2275
|
+
timeoutMs?: number;
|
|
2276
|
+
}
|
|
2277
|
+
interface DataSourceOAuthResult {
|
|
2278
|
+
code: string;
|
|
2279
|
+
state?: string;
|
|
2280
|
+
[param: string]: string | undefined;
|
|
2281
|
+
}
|
|
2282
|
+
interface IDataSourceOAuthAPI {
|
|
2283
|
+
generatePKCE(): DataSourcePKCEPair;
|
|
2284
|
+
generateState(prefix?: string): string;
|
|
2285
|
+
authorize(options: DataSourceOAuthAuthorizeOptions): Promise<DataSourceOAuthResult>;
|
|
2286
|
+
}
|
|
2287
|
+
interface AddonConnectionContext {
|
|
2288
|
+
httpClient: IHttpClient;
|
|
2289
|
+
config?: Record<string, string | number | boolean>;
|
|
2290
|
+
credentials?: Record<string, string | number | boolean>;
|
|
2291
|
+
oauth?: IDataSourceOAuthAPI;
|
|
2292
|
+
scope: {
|
|
2293
|
+
workspaceId: string;
|
|
2294
|
+
connectionInstanceId: string;
|
|
2295
|
+
};
|
|
2296
|
+
}
|
|
2297
|
+
interface DataSourceContext extends AddonConnectionContext {
|
|
2298
|
+
authenticatedMemberData?: AuthenticatedMember;
|
|
2299
|
+
}
|
|
2300
|
+
|
|
2301
|
+
interface AnalyticsProviderContext extends AddonConnectionContext {
|
|
2302
|
+
identity: ConnectionIdentity;
|
|
2303
|
+
}
|
|
2304
|
+
interface IAnalyticsSource {
|
|
2305
|
+
createInstance(context: AnalyticsProviderContext): IAnalyticsProvider;
|
|
2306
|
+
}
|
|
2307
|
+
|
|
2308
|
+
/** A single analytics source owned by the registering addon. */
|
|
2309
|
+
interface IAddonAnalyticsAPI {
|
|
2310
|
+
register(source: IAnalyticsSource): Either<AppError, void>;
|
|
2311
|
+
unregister(): void;
|
|
2312
|
+
}
|
|
2313
|
+
|
|
2314
|
+
type CommandArgument = string | number | boolean | Record<string, string | number | boolean>;
|
|
2315
|
+
type CommandResult = object | string | number | boolean | void;
|
|
2316
|
+
type CommandHandler = (...args: CommandArgument[]) => Promise<CommandResult> | CommandResult;
|
|
2317
|
+
interface IAddonCommandsAPI {
|
|
2318
|
+
register(commandId: string, handler: CommandHandler): void;
|
|
2319
|
+
unregister(commandId: string): void;
|
|
2320
|
+
execute(commandId: string, ...args: CommandArgument[]): Promise<CommandResult>;
|
|
2321
|
+
has?(commandId: string): boolean;
|
|
2322
|
+
}
|
|
2323
|
+
|
|
2324
|
+
/** Requires the manifest capability `auth`; profiles are independent of datasources. */
|
|
2325
|
+
interface IAddonConnectionsContributionAPI {
|
|
2326
|
+
registerProfiles(profiles: readonly ConnectionProfileDescriptor[]): Either<AppError, void>;
|
|
2327
|
+
unregisterProfiles(): void;
|
|
2328
|
+
registerSchema(connectionProfileId: string, schema: AddonSettingsSchema): Either<AppError, void>;
|
|
2329
|
+
unregisterSchema(connectionProfileId: string): void;
|
|
2330
|
+
registerAuthenticator(authenticator: AddonConnectionAuthenticator): Either<AppError, void>;
|
|
2331
|
+
unregisterAuthenticator(authProfileId: string): void;
|
|
2332
|
+
}
|
|
2333
|
+
|
|
2334
|
+
interface IDataSourceInstance {
|
|
2335
|
+
readonly tasksProvider: ITaskProvider;
|
|
2336
|
+
readonly timeEntriesProvider: ITimeEntryProvider;
|
|
2337
|
+
readonly membersProvider: IMemberProvider;
|
|
2338
|
+
readonly metadataProvider: IMetadataProvider;
|
|
2339
|
+
}
|
|
2340
|
+
interface IDataSource {
|
|
2341
|
+
createInstance(context: DataSourceContext): IDataSourceInstance;
|
|
2342
|
+
getStaticMappingFields?(): MappingFieldDefinition[];
|
|
2343
|
+
getMappingFields?(scope: {
|
|
2344
|
+
workspaceId: string;
|
|
2345
|
+
connectionInstanceId: string;
|
|
2346
|
+
}): Promise<Either<AppError, MappingFieldDefinition[]>>;
|
|
2347
|
+
}
|
|
2348
|
+
|
|
2349
|
+
interface IRegistry<T> {
|
|
2350
|
+
register(item: T): void;
|
|
2351
|
+
unregister(id: string): void;
|
|
2352
|
+
getItems(): T[];
|
|
2353
|
+
}
|
|
2354
|
+
|
|
2355
|
+
type IAddonDataSourcesAPI = IRegistry<IDataSource>;
|
|
2356
|
+
|
|
2357
|
+
interface SidebarSubItem {
|
|
2358
|
+
id: string;
|
|
2359
|
+
label: string;
|
|
2360
|
+
href: string;
|
|
2361
|
+
icon?: string;
|
|
2362
|
+
}
|
|
2363
|
+
interface SidebarMenuItem {
|
|
2364
|
+
id: string;
|
|
2365
|
+
label: string;
|
|
2366
|
+
href?: string;
|
|
2367
|
+
icon?: string;
|
|
2368
|
+
children?: SidebarSubItem[];
|
|
2369
|
+
}
|
|
2370
|
+
|
|
2371
|
+
type IAddonSidebarAPI = IRegistry<SidebarMenuItem>;
|
|
2372
|
+
|
|
2373
|
+
type TimerbarItemType = 'action' | 'popover';
|
|
2374
|
+
interface TimerbarPopoverSubItem {
|
|
2375
|
+
id: string;
|
|
2376
|
+
label: string;
|
|
2377
|
+
icon?: string;
|
|
2378
|
+
description?: string;
|
|
2379
|
+
shortcut?: string;
|
|
2380
|
+
danger?: boolean;
|
|
2381
|
+
}
|
|
2382
|
+
interface TimerbarActionItem {
|
|
2383
|
+
id: string;
|
|
2384
|
+
type: 'action';
|
|
2385
|
+
label?: string;
|
|
2386
|
+
icon: string;
|
|
2387
|
+
tooltip?: string;
|
|
2388
|
+
}
|
|
2389
|
+
interface TimerbarPopoverItem {
|
|
2390
|
+
id: string;
|
|
2391
|
+
type: 'popover';
|
|
2392
|
+
label?: string;
|
|
2393
|
+
icon: string;
|
|
2394
|
+
tooltip?: string;
|
|
2395
|
+
items: TimerbarPopoverSubItem[];
|
|
2396
|
+
}
|
|
2397
|
+
type TimerbarMenuItem = TimerbarActionItem | TimerbarPopoverItem;
|
|
2398
|
+
|
|
2399
|
+
type IAddonTimerbarAPI = IRegistry<TimerbarMenuItem>;
|
|
2400
|
+
|
|
2401
|
+
interface IAddonMenusAPI {
|
|
2402
|
+
readonly sidebar: IAddonSidebarAPI;
|
|
2403
|
+
readonly timerbar: IAddonTimerbarAPI;
|
|
2404
|
+
}
|
|
2405
|
+
|
|
2406
|
+
type AddonSystemEvents = Pick<ISystemEvents, 'timer:start' | 'timer:pause' | 'timer:resume' | 'timer:stop' | 'timer:update' | 'workspace:changed' | 'addon:settings:saved'>;
|
|
2407
|
+
interface IAddonEventsAPI extends IEventsAPI<AddonSystemEvents> {
|
|
2408
|
+
}
|
|
2409
|
+
|
|
2410
|
+
interface AddonSettingsApplyContext {
|
|
2411
|
+
readonly scope: AddonVaultScope;
|
|
2412
|
+
readonly revision: number;
|
|
2413
|
+
readonly values: AddonSettingsValues;
|
|
2414
|
+
readonly events: IAddonEventsAPI;
|
|
2415
|
+
readonly track: (cleanup: () => void) => () => void;
|
|
2416
|
+
}
|
|
2417
|
+
type AddonSettingsApplyHandler = (context: AddonSettingsApplyContext) => Promise<Either<AppError, void>> | Either<AppError, void>;
|
|
2418
|
+
interface AddonSettingsRegisterOptions {
|
|
2419
|
+
readonly onApply?: AddonSettingsApplyHandler;
|
|
2420
|
+
readonly onValidate?: AddonSettingsValidateHandler;
|
|
2421
|
+
readonly optionsProviders?: Record<string, AddonSettingsOptionsProviderHandler>;
|
|
2422
|
+
readonly operationalListProviders?: Record<string, AddonSettingsOperationalListProviderHandler>;
|
|
2423
|
+
readonly operationalActionHandlers?: Record<string, AddonSettingsOperationalActionHandler>;
|
|
2424
|
+
readonly formEvaluators?: Record<string, AddonSettingsFormEvaluatorHandler>;
|
|
2425
|
+
}
|
|
2426
|
+
interface IAddonSettingsAPI {
|
|
2427
|
+
register(schema: AddonSettingsSchemaProvider, options?: AddonSettingsRegisterOptions): void;
|
|
2428
|
+
getSchema(context?: AddonSettingsContext): Promise<AddonSettingsSchema | undefined> | AddonSettingsSchema | undefined;
|
|
2429
|
+
}
|
|
2430
|
+
|
|
2431
|
+
interface AddonTheme {
|
|
2432
|
+
id: string;
|
|
2433
|
+
name: string;
|
|
2434
|
+
description?: string;
|
|
2435
|
+
/** Conteúdo CSS completo (100% do arquivo .css contendo :root, .dark, @theme, @layer, etc.) */
|
|
2436
|
+
css: string;
|
|
2437
|
+
}
|
|
2438
|
+
|
|
2439
|
+
type IAddonThemesAPI = IRegistry<AddonTheme>;
|
|
2440
|
+
|
|
2441
|
+
/** Contributions registered with the host and owned by this addon. */
|
|
2442
|
+
interface IAddonContributionsAPI {
|
|
2443
|
+
readonly analytics: IAddonAnalyticsAPI;
|
|
2444
|
+
readonly commands: IAddonCommandsAPI;
|
|
2445
|
+
readonly menus: IAddonMenusAPI;
|
|
2446
|
+
readonly settings: IAddonSettingsAPI;
|
|
2447
|
+
readonly dataSources: IAddonDataSourcesAPI;
|
|
2448
|
+
readonly connections: IAddonConnectionsContributionAPI;
|
|
2449
|
+
readonly themes: IAddonThemesAPI;
|
|
2450
|
+
}
|
|
2451
|
+
|
|
2452
|
+
interface IAddonNotificationsAPI {
|
|
2453
|
+
info(message: string, title?: string): Promise<string>;
|
|
2454
|
+
success(message: string, title?: string): Promise<string>;
|
|
2455
|
+
warning(message: string, title?: string): Promise<string>;
|
|
2456
|
+
error(message: string, title?: string): Promise<string>;
|
|
2457
|
+
loading(message: string, title?: string): Promise<string>;
|
|
2458
|
+
dismiss(toastId: string): Promise<void>;
|
|
2459
|
+
}
|
|
2460
|
+
|
|
2461
|
+
interface PKCEPair {
|
|
2462
|
+
codeVerifier: string;
|
|
2463
|
+
codeChallenge: string;
|
|
2464
|
+
}
|
|
2465
|
+
interface OAuthAuthorizeOptions {
|
|
2466
|
+
authUrl: string;
|
|
2467
|
+
state?: string;
|
|
2468
|
+
timeoutMs?: number;
|
|
2469
|
+
}
|
|
2470
|
+
interface OAuthResult {
|
|
2471
|
+
code: string;
|
|
2472
|
+
state?: string;
|
|
2473
|
+
[param: string]: string | undefined;
|
|
2474
|
+
}
|
|
2475
|
+
interface OAuthTokenResponse {
|
|
2476
|
+
access_token: string;
|
|
2477
|
+
token_type?: string;
|
|
2478
|
+
expires_in?: number;
|
|
2479
|
+
refresh_token?: string;
|
|
2480
|
+
scope?: string;
|
|
2481
|
+
[key: string]: string | number | boolean | undefined | null;
|
|
2482
|
+
}
|
|
2483
|
+
interface OAuthStoredToken {
|
|
2484
|
+
accessToken: string;
|
|
2485
|
+
refreshToken?: string;
|
|
2486
|
+
tokenType?: string;
|
|
2487
|
+
expiresAt?: string;
|
|
2488
|
+
scope?: string;
|
|
2489
|
+
}
|
|
2490
|
+
interface IAddonOAuthAPI {
|
|
2491
|
+
generatePKCE(): PKCEPair;
|
|
2492
|
+
generateState(prefix?: string): string;
|
|
2493
|
+
authorize(options: OAuthAuthorizeOptions): Promise<OAuthResult>;
|
|
2494
|
+
}
|
|
2495
|
+
|
|
2496
|
+
/** Host facilities scoped to the current addon. */
|
|
2497
|
+
interface IAddonHostAPI {
|
|
2498
|
+
readonly events: IAddonEventsAPI;
|
|
2499
|
+
readonly notifications: IAddonNotificationsAPI;
|
|
2500
|
+
readonly vault: IAddonVaultAPI;
|
|
2501
|
+
readonly storage: IAddonStorageAPI;
|
|
2502
|
+
readonly oauth: IAddonOAuthAPI;
|
|
2503
|
+
readonly http: IHttpClient;
|
|
2504
|
+
}
|
|
2505
|
+
|
|
2506
|
+
/** Public addon surface, grouped by responsibility. */
|
|
2507
|
+
interface AddonContext {
|
|
2508
|
+
readonly core: ICoreAPI;
|
|
2509
|
+
readonly contributions: IAddonContributionsAPI;
|
|
2510
|
+
readonly host: IAddonHostAPI;
|
|
2511
|
+
readonly http: IHttpClient;
|
|
2512
|
+
}
|
|
2513
|
+
|
|
2514
|
+
interface AddonActionResponse {
|
|
2515
|
+
isSuccess: boolean;
|
|
2516
|
+
error?: string;
|
|
2517
|
+
display?: {
|
|
2518
|
+
title?: string;
|
|
2519
|
+
message?: string;
|
|
2520
|
+
avatarUrl?: string;
|
|
2521
|
+
data?: Record<string, string>;
|
|
2522
|
+
};
|
|
2523
|
+
}
|
|
2524
|
+
interface IAddon {
|
|
2525
|
+
activate(context: AddonContext): Promise<void> | void;
|
|
2526
|
+
deactivate(): Promise<void> | void;
|
|
2527
|
+
}
|
|
2528
|
+
|
|
2529
|
+
declare class FetchHttpClient implements IHttpClient {
|
|
2530
|
+
private readonly baseURL;
|
|
2531
|
+
private readonly defaultParams;
|
|
2532
|
+
private readonly defaultHeaders;
|
|
2533
|
+
private readonly timeout;
|
|
2534
|
+
constructor(config?: IHttpClientConfig);
|
|
2535
|
+
withConfig(config: IHttpClientConfig): FetchHttpClient;
|
|
2536
|
+
private buildUrl;
|
|
2537
|
+
private buildHeaders;
|
|
2538
|
+
private formatBody;
|
|
2539
|
+
private request;
|
|
2540
|
+
get<T extends JsonValue>(url: string, config: IHttpRequestOptions<T>): Promise<Either<AppError, T>>;
|
|
2541
|
+
post<T extends JsonValue>(url: string, data: HttpPayload, config: IHttpRequestOptions<T>): Promise<Either<AppError, T>>;
|
|
2542
|
+
put<T extends JsonValue>(url: string, data: HttpPayload, config: IHttpRequestOptions<T>): Promise<Either<AppError, T>>;
|
|
2543
|
+
patch<T extends JsonValue>(url: string, data: HttpPayload, config: IHttpRequestOptions<T>): Promise<Either<AppError, T>>;
|
|
2544
|
+
delete<T extends JsonValue>(url: string, config: IHttpRequestOptions<T>): Promise<Either<AppError, T>>;
|
|
2545
|
+
}
|
|
2546
|
+
|
|
2547
|
+
declare class AddonTimerControlLock {
|
|
2548
|
+
private owner;
|
|
2549
|
+
acquire(addonId: string): boolean;
|
|
2550
|
+
release(addonId: string): void;
|
|
2551
|
+
owns(addonId: string): boolean;
|
|
2552
|
+
allows(addonId: string): boolean;
|
|
2553
|
+
}
|
|
2554
|
+
interface RuntimeAddonIdentity {
|
|
2555
|
+
id: string;
|
|
2556
|
+
name: string;
|
|
2557
|
+
imageUrl?: string;
|
|
2558
|
+
}
|
|
2559
|
+
declare class AddonRuntimeCapabilities {
|
|
2560
|
+
private readonly runtime;
|
|
2561
|
+
private readonly addon;
|
|
2562
|
+
private readonly controlLock;
|
|
2563
|
+
readonly timeEntries: ILocalTimeEntriesCapability;
|
|
2564
|
+
readonly timer: ILocalTimerCapability;
|
|
2565
|
+
constructor(runtime: ILocalRuntimeAPI, addon: RuntimeAddonIdentity, controlLock: AddonTimerControlLock);
|
|
2566
|
+
private call;
|
|
2567
|
+
private list;
|
|
2568
|
+
private get;
|
|
2569
|
+
private getTimer;
|
|
2570
|
+
private create;
|
|
2571
|
+
private update;
|
|
2572
|
+
private entryCommand;
|
|
2573
|
+
private deleteCommand;
|
|
2574
|
+
private requiredEntry;
|
|
2575
|
+
private startTimer;
|
|
2576
|
+
private timerCommand;
|
|
2577
|
+
}
|
|
2578
|
+
|
|
2579
|
+
/** Stateless snapshot pagination; a changed source view starts a new finite scan. */
|
|
2580
|
+
declare function createTimeEntrySnapshotPage(entries: TimeEntryDTO[], checkpoint: TimeEntryPullCheckpointDTO, batch: number, scope: string): Promise<Either<AppError, TimeEntryPullPageDTO>>;
|
|
2581
|
+
|
|
2582
|
+
declare class MarkupConverter {
|
|
2583
|
+
private constructor();
|
|
2584
|
+
private static _detectCodeLanguage;
|
|
2585
|
+
static fromTextile(textileString: string | null | undefined, baseUrl: string): string;
|
|
2586
|
+
}
|
|
2587
|
+
|
|
2588
|
+
/**
|
|
2589
|
+
* Generate a cryptographically random PKCE code_verifier and SHA-256 code_challenge (RFC 7636).
|
|
2590
|
+
*/
|
|
2591
|
+
declare function generatePKCE(): PKCEPair;
|
|
2592
|
+
/**
|
|
2593
|
+
* Generate a cryptographically secure random state parameter for OAuth 2.0 requests.
|
|
2594
|
+
*/
|
|
2595
|
+
declare function generateOAuthState(prefix?: string): string;
|
|
2596
|
+
/**
|
|
2597
|
+
* Formats a raw OAuth 2.0 token response into a standardized OAuthStoredToken structure.
|
|
2598
|
+
* Calculates `expiresAt` (ISO 8601 string) when `expires_in` (in seconds) is provided.
|
|
2599
|
+
*/
|
|
2600
|
+
declare function formatStoredToken(tokenResponse: OAuthTokenResponse): OAuthStoredToken;
|
|
2601
|
+
interface ExchangeAuthorizationCodeOptions {
|
|
2602
|
+
tokenUrl: string;
|
|
2603
|
+
clientId: string;
|
|
2604
|
+
code: string;
|
|
2605
|
+
codeVerifier: string;
|
|
2606
|
+
redirectUri: string;
|
|
2607
|
+
extraParams?: Record<string, string>;
|
|
2608
|
+
headers?: Record<string, string>;
|
|
2609
|
+
}
|
|
2610
|
+
/**
|
|
2611
|
+
* Generic helper for exchanging an OAuth 2.0 authorization code with PKCE for tokens.
|
|
2612
|
+
* Handles HTTP status validation and formats the response safely.
|
|
2613
|
+
*/
|
|
2614
|
+
declare function exchangeAuthorizationCode(options: ExchangeAuthorizationCodeOptions): Promise<OAuthStoredToken>;
|
|
2615
|
+
|
|
2616
|
+
export { ADDON_CATALOG_RECEIPT_FILE, type LocalTimerStateDTO as ActiveTimeEntryDTO, type AddonActionResponse, type AddonBaseSettingsField, type AddonCapability, type AddonCatalogFileEntry, type AddonCatalogManifestV1, type AddonCatalogManifestV2, type AddonCollectionItemEnvelope, type AddonCollectionItemField, type AddonCollectionItemRecord, type AddonConfig, type AddonConnectionAuthenticator, type AddonConnectionContext, type AddonContext, type AddonEvaluateFormRequest, type AddonExecuteOperationalActionRequest, type AddonFieldAddress, type AddonFieldAddressStep, type AddonFieldDisabledEntry, type AddonFieldMessageEntry, type AddonFieldVisibilityEntry, type AddonFormEvaluationResponse, type AddonInstallerViewModel, type AddonLoadFailureReason, type AddonLoadFailureStage, type AddonLoadFailureViewModel, type AddonLoadFailuresSnapshot, type AddonManifestViewModel, type AddonMappingPreset, type AddonOperationalActionDefinition, type AddonOperationalItem, type AddonOperationalListPagination, type AddonOperationalListRequest, type AddonOperationalListResponse, type AddonPackage, type AddonPackageViewModel, type AddonResolveOptionsPagination, type AddonResolveOptionsRequest, type AddonResolveOptionsResponse, type AddonResolvedDependencyEntry, AddonRuntimeCapabilities, type AddonScreenshot, type AddonScreenshotViewModel, type AddonSettingArrayValue, type AddonSettingObjectValue, type AddonSettingScalarValue, type AddonSettingValue, type AddonSettingsApplyContext, type AddonSettingsApplyHandler, type AddonSettingsApplyState, type AddonSettingsApplyStatus, type AddonSettingsAuthType, type AddonSettingsBooleanField, type AddonSettingsButtonField, type AddonSettingsCollectionField, type AddonSettingsContext, type AddonSettingsDataSourceInstancesField, type AddonSettingsDateField, type AddonSettingsDirectoryField, type AddonSettingsField, type AddonSettingsFieldDependency, type AddonSettingsFieldScope, type AddonSettingsFieldType, type AddonSettingsFileField, type AddonSettingsFormEvaluatorHandler, type AddonSettingsGroup, type AddonSettingsGroupField, type AddonSettingsInfoCardField, type AddonSettingsJsonField, type AddonSettingsMappingField, type AddonSettingsMultiSelectField, type AddonSettingsMultiSelectOption, type AddonSettingsMultiSelectSource, type AddonSettingsNumberField, type AddonSettingsOperationalActionHandler, type AddonSettingsOperationalListField, type AddonSettingsOperationalListProviderHandler, type AddonSettingsOption, type AddonSettingsOptionGroup, type AddonSettingsOptionPresentation, type AddonSettingsOptionsProviderHandler, type AddonSettingsPasswordField, type AddonSettingsRegisterOptions, type AddonSettingsSchema, type AddonSettingsSchemaProvider, type AddonSettingsSelectField, type AddonSettingsSelectSource, type AddonSettingsSnapshot, type AddonSettingsTab, type AddonSettingsTabKind, type AddonSettingsTaskReferenceField, type AddonSettingsTextField, type AddonSettingsTextareaField, type AddonSettingsTimeField, type AddonSettingsTimezoneField, type AddonSettingsValidateHandler, type AddonSettingsValues, type AddonSidebarMenuItem, type AddonStorageEntry, type AddonStorageListPage, type AddonStorageListPagination, type AddonStorageListRequest, type AddonSystemEvents, type AddonTaskReferenceValue, type AddonTheme, type AddonThemeViewModel, type AddonTier, type AddonTierViewModel, AddonTimerControlLock, type AddonTimerbarActionItem, type AddonTimerbarMenuItem, type AddonTimerbarPopoverItem, type AddonTimerbarPopoverSubItem, type AddonValidateSettingsRequest, type AddonVaultScope, type AnalyticsAggregateMeasure, type AnalyticsBatchInfo, type AnalyticsCanonicalEntity, type AnalyticsColumnOrigin, type AnalyticsColumnSchema, type AnalyticsColumnType, type AnalyticsColumnUnit, type AnalyticsContinuation, type AnalyticsDatasetCellValue, type AnalyticsDatasetExecution, type AnalyticsDatasetManifest, type AnalyticsDatasetPayload, type AnalyticsDatasetQueryInput, type AnalyticsDatasetResult, type AnalyticsDatasetRow, type AnalyticsDatasetScope, type AnalyticsExecutionKind, type AnalyticsExecutionMetrics, type AnalyticsExecutionRequest, type AnalyticsExtractionDescriptor, type AnalyticsFilterDefinition, type AnalyticsFilterDynamicSource, type AnalyticsFilterOption, type AnalyticsFilterType, type AnalyticsFilterValue, type AnalyticsHydrateInput, type AnalyticsHydrateResult, type AnalyticsLoadInput, type AnalyticsLoadResult, type AnalyticsLocalFilter, type AnalyticsLocalMeasure, type AnalyticsPlanNode, type AnalyticsProviderContext, type AnalyticsPublication, type AnalyticsPublicationEntry, type AnalyticsQueryInput, type AnalyticsQueryResult, type AnalyticsRefreshMode, type AnalyticsRefreshPolicy, type AnalyticsRowIdentity, type AnalyticsSyncState, type AnalyticsSyncStrategy, type AnalyticsWorkspaceState, AppError, type AuthenticationDTO, type AuthenticationResult, type AuthenticationViewModel, type CommandArgument, type CommandHandler, type CommandResult, type ConfiguredFieldMapping, type ConnectionCredentialOperation, type ConnectionProfileDescriptor, type ConnectionResultViewModel, type CoreConnection, type CoreConnectionAuthenticationInput, type CoreConnectionAuthorizationRequest, type CoreConnectionAuthorizationResponse, type CoreConnectionCreateInput, type CoreConnectionScope, type CoreMember, type CoreMetadata, type CoreRuntimeState, type CoreTask, type CoreTaskListRequest, type CoreTaskPage, type CoreTaskReference, type CoreWorkspace, type CreatedTaskResult, type CreatedTimeEntryResult, type DataSourceConfigPreset, type DataSourceContext, Either, type EstimatedTime$1 as EstimatedTime, type ExchangeAuthorizationCodeOptions, FetchHttpClient, type HttpPayload, type HttpResponseValidator, type IAddon, type IAddonAnalyticsAPI, type IAddonCommandsAPI, type IAddonConnectionsContributionAPI, type IAddonContributionsAPI, type IAddonDataSourcesAPI, type IAddonEventsAPI, type IAddonHostAPI, type IAddonManifest, type IAddonMenusAPI, type IAddonNotificationsAPI, type IAddonOAuthAPI, type IAddonSettingsAPI, type IAddonSidebarAPI, type IAddonStorageAPI, type IAddonThemesAPI, type IAddonTimerbarAPI, type IAddonVaultAPI, type IAnalyticsProvider, type IAnalyticsSource, type ICoreAPI, type ICoreConnectionsAPI, type ICoreMembersAPI, type ICoreMetadataAPI, type ICoreRuntimeAPI, type ICoreTasksAPI, type ICoreTimeEntriesAPI, type ICoreTimerAPI, type ICoreWorkspacesAPI, type IDataSource, type IDataSourceInstance, type IHeaders, type IHttpClient, type IHttpClientConfig, type IHttpClientFactory, type IHttpRequestOptions, type IMemberProvider, type IMetadataProvider, type IRegistry, type IRequest, type ITaskProvider, type ITimeEntryProvider, type JsonValue, type LicensingStatusStateViewModel, type LicensingStatusViewModel, type LocalEntryChanges, type LocalEntryFilter, type LocalEntryInput, type LocalMetadataSnapshot, type LocalOperationIdentity, type LocalTimerInput, type MappingFieldDefinition, MarkupConverter, type MemberDTO, type MemberViewModel, type MetadataDTO, type MetadataItem, type MetadataViewModel, type OAuthAuthorizationParameters, type OAuthAuthorizeOptions, type OAuthRenewalResult, type OAuthResult, type OAuthStoredToken, type OAuthTokenExchangeParameters, type OAuthTokenResponse, type PKCEPair, type PagedResultDTO, type PaginatedViewModel, type PaginationOptionsDTO, type Participants, type RuntimeAddonIdentity, type SaveAnalyticsWorkspaceStateInput, type SidebarMenuItem, type SidebarSubItem, type SignedAddonCatalogManifestV1, type SignedAddonCatalogManifestV2, type StatusChange, type SyncDocumentViewModel, type SyncFailureViewModel, type TaskDTO, type TaskViewModel, type TimeEntryCreateIdempotency, type TimeEntryDTO, type TimeEntryRecordDTO as TimeEntryItemDTO, type TimeEntryPullCheckpointDTO, type TimeEntryPullPageDTO, type TimeEntryRecordDTO, type TimeEntryViewModel, type TimerStateDTO, type TimerbarActionItem, type TimerbarItemType, type TimerbarMenuItem, type TimerbarPopoverItem, type TimerbarPopoverSubItem, TokenRefreshError, type TokenRefreshErrorOptions, type UpdatedTaskResult, type UpdatedTimeEntryResult, VALID_ADDON_CAPABILITIES, VALID_ADDON_TIERS, type ViewModel, type WorkspaceConnectionIdentityViewModel, type WorkspaceConnectionMemberViewModel, type WorkspaceConnectionViewModel, type WorkspaceDTO, type WorkspaceStatus$1 as WorkspaceStatus, type WorkspaceViewModel, createAnalyticsDatasetScope, createTimeEntrySnapshotPage, exchangeAuthorizationCode, formatStoredToken, generateOAuthState, generatePKCE, hasCapability, hasProperty, isAddonCapability, isAnalytics, isArray, isBoolean, isDataSource, isFunction, isNonEmptyString, isNumber, isRecord, isString, isTheme, isWatcher, isWorkspaceScoped };
|