@madewithremy/admin 0.1.23 → 0.1.25
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/dist/index.d.ts +89 -40
- package/dist/index.js +64 -12
- package/dist/index.js.map +1 -1
- package/dist/prod.js +196 -63
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -11,6 +11,18 @@ interface AdminContext {
|
|
|
11
11
|
apiKey: string;
|
|
12
12
|
/** The app every operation is scoped to. */
|
|
13
13
|
appId: string;
|
|
14
|
+
/**
|
|
15
|
+
* Who is acting, when that is not `appId` itself — set only when the caller
|
|
16
|
+
* has retargeted at another app (`--app`, or `forApp()`), and carrying the
|
|
17
|
+
* app they came FROM.
|
|
18
|
+
*
|
|
19
|
+
* Writes that record authorship attach it, so a cross-app issue says which
|
|
20
|
+
* app filed it without the caller having to remember a second flag. That
|
|
21
|
+
* matters more than it sounds: the information was always available here and
|
|
22
|
+
* being optional at the call site is precisely how it came to be omitted
|
|
23
|
+
* everywhere.
|
|
24
|
+
*/
|
|
25
|
+
originAppId?: string;
|
|
14
26
|
/** API origin, no trailing slash. */
|
|
15
27
|
baseUrl: string;
|
|
16
28
|
}
|
|
@@ -5064,14 +5076,16 @@ declare namespace infra {
|
|
|
5064
5076
|
* youai-api/src/common/Db/v2Apps/V2AppIssuesDao.ts
|
|
5065
5077
|
* youai-api/src/common/Db/v2Apps/V2AppIssueCommentsDao.ts
|
|
5066
5078
|
*/
|
|
5067
|
-
type IssueKind = 'bug' | 'idea' | 'task';
|
|
5068
5079
|
type IssueStatus = 'open' | 'closed';
|
|
5069
5080
|
/**
|
|
5070
|
-
* 'user' = workspace member; 'agent' = Remy agent;
|
|
5071
|
-
* 'system' = server-set activity events; 'sdk' = end-user report.
|
|
5081
|
+
* 'user' = workspace member; 'agent' = Remy agent; 'app' = another app's
|
|
5082
|
+
* backend; 'system' = server-set activity events; 'sdk' = end-user report.
|
|
5083
|
+
*
|
|
5084
|
+
* Authorship is this × `originAppId`: 'agent' with an origin is another app's
|
|
5085
|
+
* agent, 'app' with an origin is its backend, 'agent' alone is the app's own.
|
|
5072
5086
|
*/
|
|
5073
|
-
type IssueAuthorKind = 'user' | 'agent' | 'system' | 'sdk';
|
|
5074
|
-
type IssueEventType = 'closed' | 'reopened'
|
|
5087
|
+
type IssueAuthorKind = 'user' | 'agent' | 'system' | 'sdk' | 'app';
|
|
5088
|
+
type IssueEventType = 'closed' | 'reopened';
|
|
5075
5089
|
/** One issue row (V2AppIssue from V2AppIssuesDao). */
|
|
5076
5090
|
interface IssueRow {
|
|
5077
5091
|
id: string;
|
|
@@ -5080,21 +5094,21 @@ interface IssueRow {
|
|
|
5080
5094
|
number: number;
|
|
5081
5095
|
title: string;
|
|
5082
5096
|
body: string;
|
|
5083
|
-
kind
|
|
5097
|
+
/** Open label set. Replaced the closed bug/idea/task `kind` enum. */
|
|
5098
|
+
labels: string[];
|
|
5084
5099
|
status: IssueStatus;
|
|
5085
5100
|
authorKind: IssueAuthorKind;
|
|
5086
5101
|
authorUserId: string | null;
|
|
5102
|
+
/** The app that filed this, when another app did; null otherwise. */
|
|
5103
|
+
originAppId: string | null;
|
|
5087
5104
|
/** Free-form reporter label for 'sdk'-authored (end-user) reports; null otherwise. */
|
|
5088
5105
|
reporter: string | null;
|
|
5089
5106
|
releaseId: string | null;
|
|
5090
5107
|
commitSha: string | null;
|
|
5091
5108
|
/** Full source blob for error/crash-linked issues (e.g. { kind, key, releaseId }). */
|
|
5092
5109
|
linkedSignal: unknown | null;
|
|
5093
|
-
/** Namespaced grouping key (`<
|
|
5110
|
+
/** Namespaced grouping key (`<sourceKind>:<key>`) used for open-issue dedup. */
|
|
5094
5111
|
sourceKey: string | null;
|
|
5095
|
-
/** Triage enrichment payload; null until enrichmentStatus is 'ready'. */
|
|
5096
|
-
enrichment: unknown | null;
|
|
5097
|
-
enrichmentStatus: string;
|
|
5098
5112
|
createdAt: string;
|
|
5099
5113
|
updatedAt: string;
|
|
5100
5114
|
closedAt: string | null;
|
|
@@ -5113,12 +5127,17 @@ interface IssueCommentRow {
|
|
|
5113
5127
|
body: string;
|
|
5114
5128
|
authorKind: IssueAuthorKind;
|
|
5115
5129
|
authorUserId: string | null;
|
|
5116
|
-
/**
|
|
5130
|
+
/** The app that wrote this entry, when another app did; null otherwise. */
|
|
5131
|
+
originAppId: string | null;
|
|
5132
|
+
/** Free-form blob an agent-authored entry may carry; null otherwise. */
|
|
5117
5133
|
metadata: unknown | null;
|
|
5118
5134
|
createdAt: string;
|
|
5119
5135
|
updatedAt: string;
|
|
5120
5136
|
}
|
|
5121
|
-
/**
|
|
5137
|
+
/**
|
|
5138
|
+
* issues list → GET /_internal/v2/apps/:appId/issues
|
|
5139
|
+
* issues filed → GET /_internal/v2/apps/:appId/issues/filed
|
|
5140
|
+
*/
|
|
5122
5141
|
interface IssuesListResult {
|
|
5123
5142
|
issues: IssueRow[];
|
|
5124
5143
|
/** Opaque keyset cursor; pass as ?cursor= to fetch the next page. */
|
|
@@ -5167,24 +5186,39 @@ interface IssuesDeleteResult {
|
|
|
5167
5186
|
*/
|
|
5168
5187
|
|
|
5169
5188
|
interface IssuesListParams {
|
|
5170
|
-
/** Filter by status: `open` or `closed`. */
|
|
5189
|
+
/** Filter by status: `open` or `closed`. Omit for any state. */
|
|
5171
5190
|
status?: string;
|
|
5172
|
-
/**
|
|
5173
|
-
|
|
5191
|
+
/** Match issues carrying ANY of these labels. */
|
|
5192
|
+
labels?: string[];
|
|
5193
|
+
/** Only issues another app filed here, by that app's id. */
|
|
5194
|
+
originAppId?: string;
|
|
5174
5195
|
/** Max issues to return (default 50). */
|
|
5175
5196
|
limit?: number;
|
|
5176
5197
|
/** Keyset cursor from a previous response's `nextCursor`. */
|
|
5177
5198
|
cursor?: string;
|
|
5178
5199
|
}
|
|
5179
5200
|
/**
|
|
5180
|
-
* List issues newest-first.
|
|
5201
|
+
* List the issues filed IN an app, newest-first.
|
|
5181
5202
|
*
|
|
5182
5203
|
* @throws AdminApiError `invalid_status` (400) — status is not `open` or
|
|
5183
|
-
* `closed
|
|
5204
|
+
* `closed`.
|
|
5184
5205
|
* @example
|
|
5185
|
-
* const { issues } = await admin.issues.list({ status: 'open',
|
|
5206
|
+
* const { issues } = await admin.issues.list({ status: 'open', labels: ['bug'] });
|
|
5186
5207
|
*/
|
|
5187
5208
|
declare function list$5(ctx: AdminContext, params?: IssuesListParams): Promise<IssuesListResult>;
|
|
5209
|
+
/**
|
|
5210
|
+
* List the issues this app filed INTO other apps, newest-first.
|
|
5211
|
+
*
|
|
5212
|
+
* The sender's half of a cross-app thread: one call returns every issue the
|
|
5213
|
+
* app sent out, so a fan-out across forty apps is read once rather than forty
|
|
5214
|
+
* times. Scoped to apps in the same workspace.
|
|
5215
|
+
*
|
|
5216
|
+
* @throws AdminApiError `invalid_status` (400) — status is not `open` or
|
|
5217
|
+
* `closed`.
|
|
5218
|
+
* @example
|
|
5219
|
+
* const { issues } = await admin.issues.filed({ status: 'open' });
|
|
5220
|
+
*/
|
|
5221
|
+
declare function filed(ctx: AdminContext, params?: Omit<IssuesListParams, 'originAppId'>): Promise<IssuesListResult>;
|
|
5188
5222
|
/**
|
|
5189
5223
|
* Get one issue with its full comment thread.
|
|
5190
5224
|
*
|
|
@@ -5201,8 +5235,15 @@ interface IssuesCreateParams {
|
|
|
5201
5235
|
title: string;
|
|
5202
5236
|
/** Issue body in markdown. */
|
|
5203
5237
|
body?: string;
|
|
5204
|
-
/**
|
|
5205
|
-
|
|
5238
|
+
/** Labels to file it under. Open set, at most 20, 64 chars each. */
|
|
5239
|
+
labels?: string[];
|
|
5240
|
+
/**
|
|
5241
|
+
* The app filing this, when it isn't the app the issue lands in. Defaults to
|
|
5242
|
+
* `ctx.originAppId` — set whenever the caller retargeted at another app — so
|
|
5243
|
+
* cross-app authorship is recorded without anyone opting in. Pass it
|
|
5244
|
+
* explicitly only to override that.
|
|
5245
|
+
*/
|
|
5246
|
+
originAppId?: string;
|
|
5206
5247
|
}
|
|
5207
5248
|
/**
|
|
5208
5249
|
* File a new issue authored as the agent (`authorKind: "agent"`).
|
|
@@ -5213,9 +5254,10 @@ interface IssuesCreateParams {
|
|
|
5213
5254
|
* not accept `source`, so `deduped` is always absent from op-layer responses.
|
|
5214
5255
|
*
|
|
5215
5256
|
* @throws AdminApiError `missing_title` (400) — title is required or empty;
|
|
5216
|
-
* `
|
|
5257
|
+
* `invalid_labels` (400) — labels are not strings, or exceed the count /
|
|
5258
|
+
* length caps; `invalid_origin_app_id` (400) — originAppId is not an app id.
|
|
5217
5259
|
* @example
|
|
5218
|
-
* const { issue } = await admin.issues.create({ title: 'Checkout 500s on empty cart',
|
|
5260
|
+
* const { issue } = await admin.issues.create({ title: 'Checkout 500s on empty cart', labels: ['bug'] });
|
|
5219
5261
|
*/
|
|
5220
5262
|
declare function create(ctx: AdminContext, params: IssuesCreateParams): Promise<IssuesCreateResult>;
|
|
5221
5263
|
/**
|
|
@@ -5230,17 +5272,20 @@ declare function create(ctx: AdminContext, params: IssuesCreateParams): Promise<
|
|
|
5230
5272
|
*/
|
|
5231
5273
|
declare function comment(ctx: AdminContext, number: string, body: string): Promise<IssuesCommentResult>;
|
|
5232
5274
|
/**
|
|
5233
|
-
* Close an issue.
|
|
5275
|
+
* Close an issue, optionally with a closing comment.
|
|
5234
5276
|
*
|
|
5235
|
-
* Records a `closed` timeline event on the thread
|
|
5277
|
+
* Records a `closed` timeline event on the thread, preceded by the comment
|
|
5278
|
+
* when one is given — so answering and resolving is one call, which is what
|
|
5279
|
+
* replying to an issue another app filed usually amounts to.
|
|
5236
5280
|
*
|
|
5237
5281
|
* @param number The issue number.
|
|
5282
|
+
* @param comment Optional prose posted before the close event.
|
|
5238
5283
|
* @throws AdminApiError `issue_not_found` (404) — no issue with this number
|
|
5239
5284
|
* in this app.
|
|
5240
5285
|
* @example
|
|
5241
|
-
* await admin.issues.close('42');
|
|
5286
|
+
* await admin.issues.close('42', 'Already fixed in v3 — no change needed.');
|
|
5242
5287
|
*/
|
|
5243
|
-
declare function close(ctx: AdminContext, number: string): Promise<IssuesUpdateResult>;
|
|
5288
|
+
declare function close(ctx: AdminContext, number: string, comment?: string): Promise<IssuesUpdateResult>;
|
|
5244
5289
|
/**
|
|
5245
5290
|
* Reopen a closed issue.
|
|
5246
5291
|
*
|
|
@@ -5258,23 +5303,23 @@ interface IssuesEditParams {
|
|
|
5258
5303
|
title?: string;
|
|
5259
5304
|
/** Replace the issue's body. */
|
|
5260
5305
|
body?: string;
|
|
5261
|
-
/**
|
|
5262
|
-
|
|
5306
|
+
/** Replace the issue's labels wholesale (not a merge). */
|
|
5307
|
+
labels?: string[];
|
|
5263
5308
|
/** Change the status to `open` or `closed`. */
|
|
5264
5309
|
status?: string;
|
|
5265
5310
|
}
|
|
5266
5311
|
/**
|
|
5267
|
-
* Edit an issue's title, body,
|
|
5312
|
+
* Edit an issue's title, body, labels, or status.
|
|
5268
5313
|
*
|
|
5269
5314
|
* Status transitions record a `closed` or `reopened` timeline event
|
|
5270
5315
|
* automatically. At least one field must be provided.
|
|
5271
5316
|
*
|
|
5272
5317
|
* @param number The issue number.
|
|
5273
5318
|
* @throws AdminApiError `missing_title` (400) — title was supplied but empty;
|
|
5274
|
-
* `
|
|
5275
|
-
* `invalid_status` (400) — status is not `open` or `closed`;
|
|
5276
|
-
* (400) — no editable field was provided; `issue_not_found`
|
|
5277
|
-
* issue with this number in this app.
|
|
5319
|
+
* `invalid_labels` (400) — labels are not strings, or exceed the count /
|
|
5320
|
+
* length caps; `invalid_status` (400) — status is not `open` or `closed`;
|
|
5321
|
+
* `no_fields` (400) — no editable field was provided; `issue_not_found`
|
|
5322
|
+
* (404) — no issue with this number in this app.
|
|
5278
5323
|
* @example
|
|
5279
5324
|
* await admin.issues.edit('42', { status: 'closed' });
|
|
5280
5325
|
*/
|
|
@@ -5297,9 +5342,10 @@ declare const issues_close: typeof close;
|
|
|
5297
5342
|
declare const issues_comment: typeof comment;
|
|
5298
5343
|
declare const issues_create: typeof create;
|
|
5299
5344
|
declare const issues_edit: typeof edit;
|
|
5345
|
+
declare const issues_filed: typeof filed;
|
|
5300
5346
|
declare const issues_reopen: typeof reopen;
|
|
5301
5347
|
declare namespace issues {
|
|
5302
|
-
export { type issues_IssuesCreateParams as IssuesCreateParams, type issues_IssuesEditParams as IssuesEditParams, type issues_IssuesListParams as IssuesListParams, issues_close as close, issues_comment as comment, issues_create as create, del$1 as del, issues_edit as edit, get$3 as get, list$5 as list, issues_reopen as reopen };
|
|
5348
|
+
export { type issues_IssuesCreateParams as IssuesCreateParams, type issues_IssuesEditParams as IssuesEditParams, type issues_IssuesListParams as IssuesListParams, issues_close as close, issues_comment as comment, issues_create as create, del$1 as del, issues_edit as edit, issues_filed as filed, get$3 as get, list$5 as list, issues_reopen as reopen };
|
|
5303
5349
|
}
|
|
5304
5350
|
|
|
5305
5351
|
/**
|
|
@@ -6914,10 +6960,6 @@ interface V2AppSettings {
|
|
|
6914
6960
|
* (e.g. 'https://app.acme.com'). Capped at 25 entries.
|
|
6915
6961
|
*/
|
|
6916
6962
|
additionalFrameAncestors?: string[];
|
|
6917
|
-
/**
|
|
6918
|
-
* When true, auto-run the read-only triage agent on new bug issues. Default false.
|
|
6919
|
-
*/
|
|
6920
|
-
autoTriageIssues?: boolean;
|
|
6921
6963
|
}
|
|
6922
6964
|
/**
|
|
6923
6965
|
* Response from GET /_internal/v2/apps/:appId/settings/v2 and
|
|
@@ -7502,7 +7544,14 @@ type BoundOps<T> = {
|
|
|
7502
7544
|
declare function buildClient(ctx: AdminContext): {
|
|
7503
7545
|
/** The resolved context this client is bound to. */
|
|
7504
7546
|
context: Readonly<AdminContext>;
|
|
7505
|
-
/**
|
|
7547
|
+
/**
|
|
7548
|
+
* A sibling client for another app, sharing credentials.
|
|
7549
|
+
*
|
|
7550
|
+
* The app we came from becomes the origin, so a write through the returned
|
|
7551
|
+
* client records which app acted — the same rule the CLI's `--app` follows.
|
|
7552
|
+
* Chaining `forApp` twice keeps the FIRST app as the origin, since that is
|
|
7553
|
+
* the one whose workspace this code is running in.
|
|
7554
|
+
*/
|
|
7506
7555
|
forApp(appId: string): /*elided*/ any;
|
|
7507
7556
|
agent: BoundOps<typeof agent>;
|
|
7508
7557
|
analytics: BoundOps<typeof analytics>;
|
|
@@ -7591,4 +7640,4 @@ declare class AdminTimeoutError extends Error {
|
|
|
7591
7640
|
|
|
7592
7641
|
declare const admin: AdminClient;
|
|
7593
7642
|
|
|
7594
|
-
export { AdminApiError, type AdminClient, type AdminClientOptions, type AdminContext, AdminTimeoutError, type AgentThreadDetail, type AgentThreadListItem, type AgentThreadsGetResult, type AgentThreadsListResult, type AgentToolCall, type AgentTranscriptMessage, type AgentTurnError, type AnalyticsAiHostRow, type AnalyticsAiSourcesResult, type AnalyticsAiVendorRow, type AnalyticsBatchResult, type AnalyticsCrawlersOverviewResult, type AnalyticsCrawlersRecentResult, type AnalyticsCrawlersRecentRow, type AnalyticsCrawlersResult, type AnalyticsCrawlersTimeseriesBucket, type AnalyticsCrawlersTimeseriesResult, type AnalyticsLiveResult, type AnalyticsMapPoint, type AnalyticsMapResult, type AnalyticsMetric, type AnalyticsQueryResult, type AnalyticsQueryResultRow, type AnalyticsSourceRow, type AnalyticsSourcesResult, type AppCronJobStatus, type AppCronJobStatusReason, type AppCronRunState, type AppEmailSuppression, type AppSecretRow, type CrashGroup, type CrashOccurrenceRow, type CrashesGetResult, type CrashesListResult, type CrashesOccurrencesResult, type CrashesStatsBucket, type CrashesStatsResult, type CronJobDecorated, type CronOverviewResult, type CronRunResult, type CronRunSummary, type DashboardLiveRelease, type DashboardReleaseMethod, type DashboardResult, type DataLiftFromDevResult, type DataLiftFromLiveResult, type DataSourceConnector, type DataSourceConnectorCredentials, type DataSourceConnectorDeletions, type DataSourceConnectorGetResult, type DataSourceConnectorPolicy, type DataSourceConnectorResult, type DataSourceInspectReport, type DataSourceInspectResult, type DataSourceJob, type DataSourceJobGetResult, type DataSourceJobManifestTokenResult, type DataSourceJobPlan, type DataSourceJobResult, type DataSourceJobSource, type DataSourceJobState, type DataSourceJobsListResult, type DataSourceMapDeployResult, type DataSourceMapTestDocument, type DataSourceMapTestOutcome, type DataSourceMapTestResult, type DataSourceMapper, type DataSourceObjectSelection, type DataSourceQuarantineResult, type DataSourceQuarantinedObject, type DataSourceRemapResult, type DataSourceSyncResult, type DataSourcesBuildProgress, type DataSourcesChunkingConfig, type DataSourcesChunkingStrategy, type DataSourcesConfigResult, type DataSourcesConfigUpdateResult, type DataSourcesCountResult, type DataSourcesCreateResult, type DataSourcesDeleteResult, type DataSourcesDocument, type DataSourcesDocumentConfirmResult, type DataSourcesDocumentDeleteManyResult, type DataSourcesDocumentDeleteResult, type DataSourcesDocumentSelector, type DataSourcesDocumentStatus, type DataSourcesDocumentsResult, type DataSourcesDropResult, type DataSourcesHydrateResult, type DataSourcesHydration, type DataSourcesIndex, type DataSourcesIngestConfig, type DataSourcesIngestUpdate, type DataSourcesListEntry, type DataSourcesListResult, type DataSourcesMigration, type DataSourcesMoveResult, type DataSourcesPlacement, type DataSourcesPromoteResult, type DataSourcesRetrievalConfig, type DataSourcesRetrievalUpdate, type DataSourcesRevectorizeResult, type DataSourcesSampleResult, type DataSourcesSearchCitation, type DataSourcesSearchResult, type DataSourcesSearchResultItem, type DataSourcesUploadTokenResult, type DatasetFile, type DbQueryResult, type DiagnosticsAuditEnvironment, type DiagnosticsDashboardResult, type DiagnosticsFinding, type DiagnosticsLighthouseScores, type DiagnosticsPayload, type DiagnosticsReleaseResult, type DiagnosticsRuntimeFindings, type DomainsCheckResult, type DomainsCustomAddResult, type DomainsCustomCheckResult, type DomainsCustomHostnameUiStatus, type DomainsCustomHostnameView, type DomainsCustomListResult, type DomainsCustomRemoveResult, type DomainsCustomRetryResult, type DomainsDnsInstructions, type DomainsGetResult, type DomainsSetResult, type EmailBatchLifecycle, type EmailBatchResult, type EmailBatchSummary, type EmailBatchesResult, type EmailDomainBase, type EmailEffectiveSender, type EmailInboxResult, type EmailListResult, type EmailMessageKind, type EmailMessageResult, type EmailMessageStatus, type EmailSenderTier, type EmailSendingStatusResult, type EmailStatsResult, type EmailSummary, type EmailSuppressResult, type EmailSuppressionsResult, type EmailUnsuppressResult, type EvalAggregates, type EvalCompareResult, type EvalExpectation, type EvalQueriesAddResult, type EvalQueriesListResult, type EvalQuery, type EvalQueryResult, type EvalQueryStyle, type EvalRetrieval, type EvalRun, type EvalRunResult, type EvalRunState, type EvalRunsListResult, type EvalSet, type EvalSetGetResult, type EvalSetResult, type EvalSetState, type EvalSetsListResult, type EventChannelActivity, type EventsChannelsListResult, type EventsPublishResult, type EventsTailFrame, type FilesDeleteResult, type FilesFileMeta, type FilesListEntry, type FilesListResult, type FilesLsResult, type FilesScanBadge, type FilesScanFlagged, type FilesScanStore, type FilesStatResult, type FilesStoreSummaryEntry, type FilesUploadUrlResult, type FilesUrlResult, type FrontendErrorType, type InboundDnsInstructions, type InboundEmailDomainAddResult, type InboundEmailDomainCheckResult, type InboundEmailDomainDeleteResult, type InboundEmailDomainUiStatus, type InboundEmailDomainVerifyResult, type InboundEmailDomainView, type InboundEmailDomainsListResult, type InboxEmailPreview, type IssueAuthorKind, type IssueCommentRow, type IssueEventType, type
|
|
7643
|
+
export { AdminApiError, type AdminClient, type AdminClientOptions, type AdminContext, AdminTimeoutError, type AgentThreadDetail, type AgentThreadListItem, type AgentThreadsGetResult, type AgentThreadsListResult, type AgentToolCall, type AgentTranscriptMessage, type AgentTurnError, type AnalyticsAiHostRow, type AnalyticsAiSourcesResult, type AnalyticsAiVendorRow, type AnalyticsBatchResult, type AnalyticsCrawlersOverviewResult, type AnalyticsCrawlersRecentResult, type AnalyticsCrawlersRecentRow, type AnalyticsCrawlersResult, type AnalyticsCrawlersTimeseriesBucket, type AnalyticsCrawlersTimeseriesResult, type AnalyticsLiveResult, type AnalyticsMapPoint, type AnalyticsMapResult, type AnalyticsMetric, type AnalyticsQueryResult, type AnalyticsQueryResultRow, type AnalyticsSourceRow, type AnalyticsSourcesResult, type AppCronJobStatus, type AppCronJobStatusReason, type AppCronRunState, type AppEmailSuppression, type AppSecretRow, type CrashGroup, type CrashOccurrenceRow, type CrashesGetResult, type CrashesListResult, type CrashesOccurrencesResult, type CrashesStatsBucket, type CrashesStatsResult, type CronJobDecorated, type CronOverviewResult, type CronRunResult, type CronRunSummary, type DashboardLiveRelease, type DashboardReleaseMethod, type DashboardResult, type DataLiftFromDevResult, type DataLiftFromLiveResult, type DataSourceConnector, type DataSourceConnectorCredentials, type DataSourceConnectorDeletions, type DataSourceConnectorGetResult, type DataSourceConnectorPolicy, type DataSourceConnectorResult, type DataSourceInspectReport, type DataSourceInspectResult, type DataSourceJob, type DataSourceJobGetResult, type DataSourceJobManifestTokenResult, type DataSourceJobPlan, type DataSourceJobResult, type DataSourceJobSource, type DataSourceJobState, type DataSourceJobsListResult, type DataSourceMapDeployResult, type DataSourceMapTestDocument, type DataSourceMapTestOutcome, type DataSourceMapTestResult, type DataSourceMapper, type DataSourceObjectSelection, type DataSourceQuarantineResult, type DataSourceQuarantinedObject, type DataSourceRemapResult, type DataSourceSyncResult, type DataSourcesBuildProgress, type DataSourcesChunkingConfig, type DataSourcesChunkingStrategy, type DataSourcesConfigResult, type DataSourcesConfigUpdateResult, type DataSourcesCountResult, type DataSourcesCreateResult, type DataSourcesDeleteResult, type DataSourcesDocument, type DataSourcesDocumentConfirmResult, type DataSourcesDocumentDeleteManyResult, type DataSourcesDocumentDeleteResult, type DataSourcesDocumentSelector, type DataSourcesDocumentStatus, type DataSourcesDocumentsResult, type DataSourcesDropResult, type DataSourcesHydrateResult, type DataSourcesHydration, type DataSourcesIndex, type DataSourcesIngestConfig, type DataSourcesIngestUpdate, type DataSourcesListEntry, type DataSourcesListResult, type DataSourcesMigration, type DataSourcesMoveResult, type DataSourcesPlacement, type DataSourcesPromoteResult, type DataSourcesRetrievalConfig, type DataSourcesRetrievalUpdate, type DataSourcesRevectorizeResult, type DataSourcesSampleResult, type DataSourcesSearchCitation, type DataSourcesSearchResult, type DataSourcesSearchResultItem, type DataSourcesUploadTokenResult, type DatasetFile, type DbQueryResult, type DiagnosticsAuditEnvironment, type DiagnosticsDashboardResult, type DiagnosticsFinding, type DiagnosticsLighthouseScores, type DiagnosticsPayload, type DiagnosticsReleaseResult, type DiagnosticsRuntimeFindings, type DomainsCheckResult, type DomainsCustomAddResult, type DomainsCustomCheckResult, type DomainsCustomHostnameUiStatus, type DomainsCustomHostnameView, type DomainsCustomListResult, type DomainsCustomRemoveResult, type DomainsCustomRetryResult, type DomainsDnsInstructions, type DomainsGetResult, type DomainsSetResult, type EmailBatchLifecycle, type EmailBatchResult, type EmailBatchSummary, type EmailBatchesResult, type EmailDomainBase, type EmailEffectiveSender, type EmailInboxResult, type EmailListResult, type EmailMessageKind, type EmailMessageResult, type EmailMessageStatus, type EmailSenderTier, type EmailSendingStatusResult, type EmailStatsResult, type EmailSummary, type EmailSuppressResult, type EmailSuppressionsResult, type EmailUnsuppressResult, type EvalAggregates, type EvalCompareResult, type EvalExpectation, type EvalQueriesAddResult, type EvalQueriesListResult, type EvalQuery, type EvalQueryResult, type EvalQueryStyle, type EvalRetrieval, type EvalRun, type EvalRunResult, type EvalRunState, type EvalRunsListResult, type EvalSet, type EvalSetGetResult, type EvalSetResult, type EvalSetState, type EvalSetsListResult, type EventChannelActivity, type EventsChannelsListResult, type EventsPublishResult, type EventsTailFrame, type FilesDeleteResult, type FilesFileMeta, type FilesListEntry, type FilesListResult, type FilesLsResult, type FilesScanBadge, type FilesScanFlagged, type FilesScanStore, type FilesStatResult, type FilesStoreSummaryEntry, type FilesUploadUrlResult, type FilesUrlResult, type FrontendErrorType, type InboundDnsInstructions, type InboundEmailDomainAddResult, type InboundEmailDomainCheckResult, type InboundEmailDomainDeleteResult, type InboundEmailDomainUiStatus, type InboundEmailDomainVerifyResult, type InboundEmailDomainView, type InboundEmailDomainsListResult, type InboxEmailPreview, type IssueAuthorKind, type IssueCommentRow, type IssueEventType, type IssueRow, type IssueStatus, type IssuesCommentResult, type IssuesCreateResult, type IssuesDeleteResult, type IssuesGetResult, type IssuesListResult, type IssuesUpdateResult, type JewelPairRow, type JewelPairSummaryRow, type JewelVerdict, type JewelsDatasetSummary, type JewelsDryrunResult, type JewelsExportResult, type JewelsGradeResult, type JewelsGrading, type JewelsOverviewResult, type JewelsPairResult, type JewelsPairsResult, type JewelsQueueResult, type JewelsResolveResult, type JewelsRunResult, type JewelsRunsResult, type JewelsTimeseriesBucket, type JewelsTimeseriesResult, type JewelsTrainResult, type LiftedDatabase, type MethodsInvokeResult, type OperationProgress, type OutboundDnsInstructions, type OutboundEmailDomainAddResult, type OutboundEmailDomainCheckResult, type OutboundEmailDomainDeleteResult, type OutboundEmailDomainUiStatus, type OutboundEmailDomainVerifyResult, type OutboundEmailDomainView, type OutboundEmailDomainsListResult, type PlatformSuppression, type PrerenderGetResult, type PrerenderInvalidateResult, type PrerenderPage, type PrerenderPagesResult, type PrerenderViewResult, type ReleaseFailureFields, type ReleaseFragment, type ReleasesByCommitResult, type ReleasesGetResult, type ReleasesListResult, type RequestsGetResult, type RequestsListResult, type RequestsListRow, type RequestsStatsMethodBucket, type RequestsStatsMethodResult, type RequestsStatsSummaryBucket, type RequestsStatsSummaryResult, type SecretsDeleteResult, type SecretsGetResult, type SecretsListResult, type SecretsSetResult, type SettingsResult, type SuppressionSource, type TrainingLogEntry, type TrainingRunRow, type TrainingRunStatus, type UserAuthProvider, type UserListItem, type UserRecord, type UsersCreateApiKeyResult, type UsersListResult, type UsersRevokeApiKeyResult, type UsersSetRoleResult, type V2AppSettings, type V2BuildLogEntry, type V2BuildStats, type V2CommitInfo, type V2EmailMessage, type V2ReleaseStatus, type VoiceAvailableNumber, type VoiceNumbersBuyResult, type VoiceNumbersListResult, type VoiceNumbersReleaseResult, type VoiceNumbersSearchResult, type VoiceNumbersSetNameResult, type VoicePhoneNumberStatus, type VoicePhoneNumberView, type VoiceResolvedPolicy, type VoiceSessionChannel, type VoiceSessionCost, type VoiceSessionCostLine, type VoiceSessionDetail, type VoiceSessionGetResult, type VoiceSessionListItem, type VoiceSessionSip, type VoiceSessionSpeechEntry, type VoiceSessionStatus, type VoiceSessionToolEntry, type VoiceSessionTranscriptEntry, type VoiceSessionsListResult, type VoiceSettingsCeilings, type VoiceSettingsGetResult, type VoiceSettingsOverrides, type VoiceSettingsSetResult, admin, createAdminClient, admin as default };
|
package/dist/index.js
CHANGED
|
@@ -109,6 +109,12 @@ function qs(params) {
|
|
|
109
109
|
if (value === void 0 || value === null) {
|
|
110
110
|
continue;
|
|
111
111
|
}
|
|
112
|
+
if (Array.isArray(value)) {
|
|
113
|
+
for (const entry of value) {
|
|
114
|
+
search2.append(key, String(entry));
|
|
115
|
+
}
|
|
116
|
+
continue;
|
|
117
|
+
}
|
|
112
118
|
search2.set(key, String(value));
|
|
113
119
|
}
|
|
114
120
|
const text = search2.toString();
|
|
@@ -2105,15 +2111,35 @@ __export(issues_exports, {
|
|
|
2105
2111
|
create: () => create2,
|
|
2106
2112
|
del: () => del,
|
|
2107
2113
|
edit: () => edit,
|
|
2114
|
+
filed: () => filed,
|
|
2108
2115
|
get: () => get8,
|
|
2109
2116
|
list: () => list8,
|
|
2110
2117
|
reopen: () => reopen
|
|
2111
2118
|
});
|
|
2119
|
+
function authorship(ctx) {
|
|
2120
|
+
return ctx.originAppId ? { originAppId: ctx.originAppId } : {};
|
|
2121
|
+
}
|
|
2122
|
+
function listQuery(params) {
|
|
2123
|
+
return qs({
|
|
2124
|
+
status: params.status,
|
|
2125
|
+
label: params.labels,
|
|
2126
|
+
originAppId: params.originAppId,
|
|
2127
|
+
limit: params.limit,
|
|
2128
|
+
cursor: params.cursor
|
|
2129
|
+
});
|
|
2130
|
+
}
|
|
2112
2131
|
function list8(ctx, params = {}) {
|
|
2113
2132
|
return call(
|
|
2114
2133
|
ctx,
|
|
2115
2134
|
"GET",
|
|
2116
|
-
`/_internal/v2/apps/${ctx.appId}/issues${
|
|
2135
|
+
`/_internal/v2/apps/${ctx.appId}/issues${listQuery(params)}`
|
|
2136
|
+
);
|
|
2137
|
+
}
|
|
2138
|
+
function filed(ctx, params = {}) {
|
|
2139
|
+
return call(
|
|
2140
|
+
ctx,
|
|
2141
|
+
"GET",
|
|
2142
|
+
`/_internal/v2/apps/${ctx.appId}/issues/filed${listQuery(params)}`
|
|
2117
2143
|
);
|
|
2118
2144
|
}
|
|
2119
2145
|
function get8(ctx, number) {
|
|
@@ -2131,8 +2157,12 @@ function create2(ctx, params) {
|
|
|
2131
2157
|
if (params.body !== void 0) {
|
|
2132
2158
|
requestBody.body = params.body;
|
|
2133
2159
|
}
|
|
2134
|
-
if (params.
|
|
2135
|
-
requestBody.
|
|
2160
|
+
if (params.labels !== void 0) {
|
|
2161
|
+
requestBody.labels = params.labels;
|
|
2162
|
+
}
|
|
2163
|
+
const originAppId = params.originAppId ?? ctx.originAppId;
|
|
2164
|
+
if (originAppId !== void 0) {
|
|
2165
|
+
requestBody.originAppId = originAppId;
|
|
2136
2166
|
}
|
|
2137
2167
|
return call(
|
|
2138
2168
|
ctx,
|
|
@@ -2146,15 +2176,23 @@ function comment(ctx, number, body) {
|
|
|
2146
2176
|
ctx,
|
|
2147
2177
|
"POST",
|
|
2148
2178
|
`/_internal/v2/apps/${ctx.appId}/issues/${seg(number)}/comments`,
|
|
2149
|
-
{ body, authorKind: "agent" }
|
|
2179
|
+
{ body, authorKind: "agent", ...authorship(ctx) }
|
|
2150
2180
|
);
|
|
2151
2181
|
}
|
|
2152
|
-
function close(ctx, number) {
|
|
2182
|
+
function close(ctx, number, comment2) {
|
|
2183
|
+
const requestBody = {
|
|
2184
|
+
status: "closed",
|
|
2185
|
+
authorKind: "agent",
|
|
2186
|
+
...authorship(ctx)
|
|
2187
|
+
};
|
|
2188
|
+
if (comment2 !== void 0) {
|
|
2189
|
+
requestBody.comment = comment2;
|
|
2190
|
+
}
|
|
2153
2191
|
return call(
|
|
2154
2192
|
ctx,
|
|
2155
2193
|
"POST",
|
|
2156
2194
|
`/_internal/v2/apps/${ctx.appId}/issues/${seg(number)}/update`,
|
|
2157
|
-
|
|
2195
|
+
requestBody
|
|
2158
2196
|
);
|
|
2159
2197
|
}
|
|
2160
2198
|
function reopen(ctx, number) {
|
|
@@ -2162,19 +2200,22 @@ function reopen(ctx, number) {
|
|
|
2162
2200
|
ctx,
|
|
2163
2201
|
"POST",
|
|
2164
2202
|
`/_internal/v2/apps/${ctx.appId}/issues/${seg(number)}/update`,
|
|
2165
|
-
{ status: "open", authorKind: "agent" }
|
|
2203
|
+
{ status: "open", authorKind: "agent", ...authorship(ctx) }
|
|
2166
2204
|
);
|
|
2167
2205
|
}
|
|
2168
2206
|
function edit(ctx, number, params) {
|
|
2169
|
-
const requestBody = {
|
|
2207
|
+
const requestBody = {
|
|
2208
|
+
authorKind: "agent",
|
|
2209
|
+
...authorship(ctx)
|
|
2210
|
+
};
|
|
2170
2211
|
if (params.title !== void 0) {
|
|
2171
2212
|
requestBody.title = params.title;
|
|
2172
2213
|
}
|
|
2173
2214
|
if (params.body !== void 0) {
|
|
2174
2215
|
requestBody.body = params.body;
|
|
2175
2216
|
}
|
|
2176
|
-
if (params.
|
|
2177
|
-
requestBody.
|
|
2217
|
+
if (params.labels !== void 0) {
|
|
2218
|
+
requestBody.labels = params.labels;
|
|
2178
2219
|
}
|
|
2179
2220
|
if (params.status !== void 0) {
|
|
2180
2221
|
requestBody.status = params.status;
|
|
@@ -2661,9 +2702,20 @@ function buildClient(ctx) {
|
|
|
2661
2702
|
return {
|
|
2662
2703
|
/** The resolved context this client is bound to. */
|
|
2663
2704
|
context: ctx,
|
|
2664
|
-
/**
|
|
2705
|
+
/**
|
|
2706
|
+
* A sibling client for another app, sharing credentials.
|
|
2707
|
+
*
|
|
2708
|
+
* The app we came from becomes the origin, so a write through the returned
|
|
2709
|
+
* client records which app acted — the same rule the CLI's `--app` follows.
|
|
2710
|
+
* Chaining `forApp` twice keeps the FIRST app as the origin, since that is
|
|
2711
|
+
* the one whose workspace this code is running in.
|
|
2712
|
+
*/
|
|
2665
2713
|
forApp(appId) {
|
|
2666
|
-
return buildClient({
|
|
2714
|
+
return buildClient({
|
|
2715
|
+
...ctx,
|
|
2716
|
+
appId,
|
|
2717
|
+
originAppId: appId === ctx.appId ? ctx.originAppId : ctx.originAppId ?? ctx.appId
|
|
2718
|
+
});
|
|
2667
2719
|
},
|
|
2668
2720
|
agent: bindOps(agent_exports, ctx),
|
|
2669
2721
|
analytics: bindOps(analytics_exports, ctx),
|