@credibledata/cred-cli 0.0.105 → 0.0.107
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 +12 -4
- package/dist/agent-contract.spec.js +21 -6
- package/dist/agent-contract.spec.js.map +1 -1
- package/dist/client/api.js +900 -521
- package/dist/client/api.js.map +1 -1
- package/dist/client-codeassist/api.js.map +1 -1
- package/dist/commands/misc/mcp.boot.harness.js +14 -0
- package/dist/commands/misc/mcp.boot.harness.js.map +1 -0
- package/dist/commands/misc/mcp.harness.js +9 -0
- package/dist/commands/misc/mcp.harness.js.map +1 -0
- package/dist/commands/misc/mcp.js +258 -0
- package/dist/commands/misc/mcp.js.map +1 -0
- package/dist/commands/misc/mcp.spec.js +213 -0
- package/dist/commands/misc/mcp.spec.js.map +1 -0
- package/dist/commands/misc/setup.js +72 -3
- package/dist/commands/misc/setup.js.map +1 -1
- package/dist/commands/misc/setup.spec.js +51 -6
- package/dist/commands/misc/setup.spec.js.map +1 -1
- package/dist/commands/misc/status.js +7 -1
- package/dist/commands/misc/status.js.map +1 -1
- package/dist/commands/misc/status.spec.js +34 -0
- package/dist/commands/misc/status.spec.js.map +1 -1
- package/dist/index.js +52 -11
- package/dist/index.js.map +1 -1
- package/dist/setup-core/briefing.d.ts +68 -0
- package/dist/setup-core/briefing.js +20 -11
- package/dist/setup-core/briefing.js.map +1 -1
- package/dist/setup-core/credstore.d.ts +229 -0
- package/dist/setup-core/environments.d.ts +112 -0
- package/dist/setup-core/flow.d.ts +171 -0
- package/dist/setup-core/flow.js +54 -28
- package/dist/setup-core/flow.js.map +1 -1
- package/dist/setup-core/flow.spec.js +135 -54
- package/dist/setup-core/flow.spec.js.map +1 -1
- package/dist/setup-core/folderconfig.d.ts +184 -0
- package/dist/setup-core/folderconfig.js +82 -21
- package/dist/setup-core/folderconfig.js.map +1 -1
- package/dist/setup-core/git.d.ts +57 -0
- package/dist/setup-core/git.js +37 -0
- package/dist/setup-core/git.js.map +1 -1
- package/dist/setup-core/host.d.ts +121 -0
- package/dist/setup-core/importconnections.d.ts +171 -0
- package/dist/setup-core/liveness.d.ts +17 -0
- package/dist/setup-core/localpublisherconfig.d.ts +10 -0
- package/dist/setup-core/mcpconfig.d.ts +132 -0
- package/dist/setup-core/mcpconfig.js +41 -17
- package/dist/setup-core/mcpconfig.js.map +1 -1
- package/dist/setup-core/mcpconfig.spec.js +17 -6
- package/dist/setup-core/mcpconfig.spec.js.map +1 -1
- package/dist/setup-core/packagemanifest.d.ts +28 -0
- package/dist/setup-core/ports.d.ts +95 -0
- package/dist/setup-core/ports.js +6 -5
- package/dist/setup-core/ports.js.map +1 -1
- package/dist/setup-core/publisherconfig.d.ts +163 -0
- package/dist/setup-core/publisherversion.d.ts +22 -0
- package/dist/setup-core/publisherversion.js +1 -1
- package/dist/setup-core/readylines.d.ts +109 -0
- package/dist/setup-core/refresh.d.ts +80 -0
- package/dist/setup-core/skills.d.ts +114 -0
- package/dist/setup-core/skills.js +34 -11
- package/dist/setup-core/skills.js.map +1 -1
- package/dist/setup-core/skills.spec.js +20 -0
- package/dist/setup-core/skills.spec.js.map +1 -1
- package/dist/setup-core/staleservers.d.ts +27 -0
- package/dist/setup-core/staleservers.js +97 -0
- package/dist/setup-core/staleservers.js.map +1 -0
- package/dist/setup-core/staleservers.spec.js +63 -0
- package/dist/setup-core/staleservers.spec.js.map +1 -0
- package/dist/setup-core/supervisor.d.ts +187 -0
- package/dist/setup-core/supervisor.js +1 -0
- package/dist/setup-core/supervisor.js.map +1 -1
- package/dist/setup-core/writefile.d.ts +27 -0
- package/package.json +4 -3
package/dist/client/api.js
CHANGED
|
@@ -25,10 +25,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
25
25
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
26
26
|
};
|
|
27
27
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
-
exports.PackagePermissionInheritedPermissionEnum = exports.PackagePermissionPermissionEnum = exports.OrganizationPermissionPermissionEnum = exports.MaterializationFreshnessFallbackEnum = exports.MaterializationScopeEnum = exports.MaterializationStatusEnum = exports.MaterializationOriginEnum = exports.LiveWorkItemStatusEnum = exports.IntegrationTemplateAuthEnum = exports.IntegrationSecretFieldShapeEnum = exports.IndexStatus = exports.IndexFreshnessFallbackEnum = exports.IndexScopeEnum = exports.IndexStatusEnum = exports.GroupMemberStatusEnum = exports.GetOrganizationResponseUserPermissionEnum = exports.EnvironmentPermissionPermissionEnum = exports.EnvironmentUserPermissionEnum = exports.
|
|
29
|
-
exports.
|
|
30
|
-
exports.
|
|
31
|
-
exports.WorkspacesApi = exports.WorkspacesApiFactory = exports.WorkspacesApiFp = exports.WorkspacesApiAxiosParamCreator = exports.WorkspacePermissionsApi = exports.WorkspacePermissionsApiFactory = exports.WorkspacePermissionsApiFp = exports.WorkspacePermissionsApiAxiosParamCreator = exports.WebhooksApi = exports.WebhooksApiFactory = exports.WebhooksApiFp = exports.WebhooksApiAxiosParamCreator = exports.VersionsApi = exports.VersionsApiFactory = exports.VersionsApiFp = exports.VersionsApiAxiosParamCreator = exports.UsersApi = exports.UsersApiFactory = exports.UsersApiFp = exports.UsersApiAxiosParamCreator = exports.RunActionActionEnum = exports.RunsApi = exports.RunsApiFactory = exports.RunsApiFp = exports.RunsApiAxiosParamCreator = exports.PreaggregatesApi = exports.PreaggregatesApiFactory = exports.PreaggregatesApiFp = exports.PreaggregatesApiAxiosParamCreator = exports.PermissionsApi = exports.PermissionsApiFactory = exports.PermissionsApiFp = exports.PermissionsApiAxiosParamCreator = exports.PackagesApi = exports.PackagesApiFactory = exports.PackagesApiFp = exports.PackagesApiAxiosParamCreator = exports.PackagePermissionsApi = exports.PackagePermissionsApiFactory = void 0;
|
|
28
|
+
exports.PreaggregateStatusEnum = exports.PackageWarningSeverityEnum = exports.PackagePermissionInheritedPermissionEnum = exports.PackagePermissionPermissionEnum = exports.OrganizationPermissionPermissionEnum = exports.MaterializationFreshnessFallbackEnum = exports.MaterializationScopeEnum = exports.MaterializationStatusEnum = exports.MaterializationOriginEnum = exports.LiveWorkItemStatusEnum = exports.IntegrationTemplateAuthEnum = exports.IntegrationSecretFieldShapeEnum = exports.IndexStatus = exports.IndexFreshnessFallbackEnum = exports.IndexScopeEnum = exports.IndexStatusEnum = exports.GroupMemberStatusEnum = exports.GetOrganizationResponseUserPermissionEnum = exports.EnvironmentPermissionPermissionEnum = exports.EnvironmentUserPermissionEnum = exports.DraftPullRequestStateEnum = exports.DraftDocumentChangeSincePublicationEnum = exports.DraftDocumentStatusEnum = exports.DraftDocumentKindEnum = exports.DraftDocumentTypeEnum = exports.DraftCompileVerdictStatusEnum = exports.DraftCheckpointStatusEnum = exports.DraftCapabilitiesPublishModesEnum = exports.DraftBackingEnum = exports.DocumentTypeEnum = exports.DatabaseTableUploadMethodEnum = exports.DatabaseTableSourceKindEnum = exports.DatabaseTableFileFormatEnum = exports.DatabaseTableStatusEnum = exports.DatabaseTableSchemaEnum = exports.DatabaseIndexingStatusEnum = exports.DatabaseStatusEnum = exports.CredentialCheckOutcome = exports.ConnectionS3ConnectionProviderEnum = exports.ConnectionPostgresConnectionSslmodeEnum = exports.ConnectionAllOfProxyTypeEnum = exports.ConnectionAllOfDucklakeConnectionStorageS3ConnectionProviderEnum = exports.ConnectionAllOfDuckdbConnectionPostgresConnectionSslmodeEnum = exports.ConnectionAllOfDuckdbConnectionAzureConnectionAuthTypeEnum = exports.ConnectionAllOfDuckdbConnectionAttachedDatabasesTypeEnum = exports.ConnectionIndexingStatusEnum = exports.ConnectionTemplateEnum = exports.ConnectionTypeEnum = exports.BookmarkType = exports.AttributeValueEntryScopeEnum = void 0;
|
|
29
|
+
exports.DocumentsApi = exports.DocumentsApiFactory = exports.DocumentsApiFp = exports.DocumentsApiAxiosParamCreator = exports.DemoApi = exports.DemoApiFactory = exports.DemoApiFp = exports.DemoApiAxiosParamCreator = exports.DatabasesApi = exports.DatabasesApiFactory = exports.DatabasesApiFp = exports.DatabasesApiAxiosParamCreator = exports.CredentialsApi = exports.CredentialsApiFactory = exports.CredentialsApiFp = exports.CredentialsApiAxiosParamCreator = exports.ConnectionsApi = exports.ConnectionsApiFactory = exports.ConnectionsApiFp = exports.ConnectionsApiAxiosParamCreator = exports.BookmarksApi = exports.BookmarksApiFactory = exports.BookmarksApiFp = exports.BookmarksApiAxiosParamCreator = exports.AttributesApi = exports.AttributesApiFactory = exports.AttributesApiFp = exports.AttributesApiAxiosParamCreator = exports.AgentSchedulesApi = exports.AgentSchedulesApiFactory = exports.AgentSchedulesApiFp = exports.AgentSchedulesApiAxiosParamCreator = exports.WorkspacePermissionPermissionEnum = exports.WorkspaceWorkspaceTypeEnum = exports.VersionScopeEnum = exports.VersionBuildStatusEnum = exports.VersionArchiveStatusEnum = exports.UpdateGroupMemberStatusRequestStatusEnum = exports.UpdateDatabaseTableRequestUploadStatusEnum = exports.SystemPermissionPermissionEnum = exports.StalenessReason = exports.SourceEntityFieldTypeEnum = exports.SharedItemTypeEnum = exports.RunBuildPlanNodeArtifactEnum = exports.RunBuildPlanNodeStatusEnum = exports.RunBuildPlanNodeNodeTypeEnum = exports.RunStatusEnum = exports.RunTriggerEnum = exports.PreaggregateFreshnessFallbackEnum = exports.PreaggregateScopeEnum = void 0;
|
|
30
|
+
exports.OrganizationPermissionsApiAxiosParamCreator = exports.MaterializationsApi = exports.MaterializationsApiFactory = exports.MaterializationsApiFp = exports.MaterializationsApiAxiosParamCreator = exports.MarketplaceSubscriptionsApi = exports.MarketplaceSubscriptionsApiFactory = exports.MarketplaceSubscriptionsApiFp = exports.MarketplaceSubscriptionsApiAxiosParamCreator = exports.MarketplaceSignupsApi = exports.MarketplaceSignupsApiFactory = exports.MarketplaceSignupsApiFp = exports.MarketplaceSignupsApiAxiosParamCreator = exports.InvitesApi = exports.InvitesApiFactory = exports.InvitesApiFp = exports.InvitesApiAxiosParamCreator = exports.IntegrationTemplatesApi = exports.IntegrationTemplatesApiFactory = exports.IntegrationTemplatesApiFp = exports.IntegrationTemplatesApiAxiosParamCreator = exports.IndexesApi = exports.IndexesApiFactory = exports.IndexesApiFp = exports.IndexesApiAxiosParamCreator = exports.GroupsApi = exports.GroupsApiFactory = exports.GroupsApiFp = exports.GroupsApiAxiosParamCreator = exports.GitRepositoryRegistrationsApi = exports.GitRepositoryRegistrationsApiFactory = exports.GitRepositoryRegistrationsApiFp = exports.GitRepositoryRegistrationsApiAxiosParamCreator = exports.EnvironmentsApi = exports.EnvironmentsApiFactory = exports.EnvironmentsApiFp = exports.EnvironmentsApiAxiosParamCreator = exports.EnvironmentPermissionsApi = exports.EnvironmentPermissionsApiFactory = exports.EnvironmentPermissionsApiFp = exports.EnvironmentPermissionsApiAxiosParamCreator = exports.EntitiesApi = exports.EntitiesApiFactory = exports.EntitiesApiFp = exports.EntitiesApiAxiosParamCreator = exports.DraftsApi = exports.DraftsApiFactory = exports.DraftsApiFp = exports.DraftsApiAxiosParamCreator = exports.UpdateDocumentUpdateMaskEnum = void 0;
|
|
31
|
+
exports.WorkspacesApi = exports.WorkspacesApiFactory = exports.WorkspacesApiFp = exports.WorkspacesApiAxiosParamCreator = exports.WorkspacePermissionsApi = exports.WorkspacePermissionsApiFactory = exports.WorkspacePermissionsApiFp = exports.WorkspacePermissionsApiAxiosParamCreator = exports.WebhooksApi = exports.WebhooksApiFactory = exports.WebhooksApiFp = exports.WebhooksApiAxiosParamCreator = exports.VersionsApi = exports.VersionsApiFactory = exports.VersionsApiFp = exports.VersionsApiAxiosParamCreator = exports.UsersApi = exports.UsersApiFactory = exports.UsersApiFp = exports.UsersApiAxiosParamCreator = exports.RunActionActionEnum = exports.RunsApi = exports.RunsApiFactory = exports.RunsApiFp = exports.RunsApiAxiosParamCreator = exports.PreaggregatesApi = exports.PreaggregatesApiFactory = exports.PreaggregatesApiFp = exports.PreaggregatesApiAxiosParamCreator = exports.PermissionsApi = exports.PermissionsApiFactory = exports.PermissionsApiFp = exports.PermissionsApiAxiosParamCreator = exports.PackagesApi = exports.PackagesApiFactory = exports.PackagesApiFp = exports.PackagesApiAxiosParamCreator = exports.PackagePermissionsApi = exports.PackagePermissionsApiFactory = exports.PackagePermissionsApiFp = exports.PackagePermissionsApiAxiosParamCreator = exports.ListOrganizationsUserPermissionEnum = exports.OrganizationsApi = exports.OrganizationsApiFactory = exports.OrganizationsApiFp = exports.OrganizationsApiAxiosParamCreator = exports.OrganizationPermissionsApi = exports.OrganizationPermissionsApiFactory = exports.OrganizationPermissionsApiFp = void 0;
|
|
32
32
|
const axios_1 = __importDefault(require("axios"));
|
|
33
33
|
// Some imports not used depending on template conditions
|
|
34
34
|
// @ts-ignore
|
|
@@ -179,6 +179,10 @@ exports.DraftBackingEnum = {
|
|
|
179
179
|
Git: 'git',
|
|
180
180
|
Provisioning: 'provisioning'
|
|
181
181
|
};
|
|
182
|
+
exports.DraftCapabilitiesPublishModesEnum = {
|
|
183
|
+
Direct: 'direct',
|
|
184
|
+
PullRequest: 'pullRequest'
|
|
185
|
+
};
|
|
182
186
|
exports.DraftCheckpointStatusEnum = {
|
|
183
187
|
None: 'none',
|
|
184
188
|
Pending: 'pending',
|
|
@@ -211,28 +215,12 @@ exports.DraftDocumentChangeSincePublicationEnum = {
|
|
|
211
215
|
Modified: 'modified',
|
|
212
216
|
Removed: 'removed'
|
|
213
217
|
};
|
|
214
|
-
exports.DraftDocumentChangeStatusEnum = {
|
|
215
|
-
Added: 'added',
|
|
216
|
-
Modified: 'modified',
|
|
217
|
-
Removed: 'removed',
|
|
218
|
-
Renamed: 'renamed'
|
|
219
|
-
};
|
|
220
|
-
exports.DraftFileDiffStatusEnum = {
|
|
221
|
-
Added: 'added',
|
|
222
|
-
Modified: 'modified',
|
|
223
|
-
Removed: 'removed',
|
|
224
|
-
Renamed: 'renamed'
|
|
225
|
-
};
|
|
226
218
|
exports.DraftPullRequestStateEnum = {
|
|
227
219
|
None: 'none',
|
|
228
220
|
Open: 'open',
|
|
229
221
|
Closed: 'closed',
|
|
230
222
|
Merged: 'merged'
|
|
231
223
|
};
|
|
232
|
-
exports.DraftTreeEntryTypeEnum = {
|
|
233
|
-
Blob: 'blob',
|
|
234
|
-
Tree: 'tree'
|
|
235
|
-
};
|
|
236
224
|
exports.EnvironmentUserPermissionEnum = {
|
|
237
225
|
Admin: 'admin',
|
|
238
226
|
Modeler: 'modeler',
|
|
@@ -428,6 +416,292 @@ exports.WorkspacePermissionPermissionEnum = {
|
|
|
428
416
|
Manager: 'manager',
|
|
429
417
|
Viewer: 'viewer'
|
|
430
418
|
};
|
|
419
|
+
/**
|
|
420
|
+
* AgentSchedulesApi - axios parameter creator
|
|
421
|
+
* @export
|
|
422
|
+
*/
|
|
423
|
+
const AgentSchedulesApiAxiosParamCreator = function (configuration) {
|
|
424
|
+
return {
|
|
425
|
+
/**
|
|
426
|
+
* Runs one task of a package agent on a cron schedule, at the package\'s latest version. Each fire is the turn the app\'s Run button sends, run as the person who created the schedule: the same access, budget and chat as if they had pressed it. **Authorization**: Requires membership of the organization, managing the workspace (`can_update_workspace`) and the caller\'s own read access to the package (`can_read_package`). **Cron**: exactly five whitespace-separated fields, evaluated in UTC, no `@nicknames`. The cron must have a future fire. There is no minimum interval and no limit per workspace; a run\'s cost is bounded by the organization\'s LLM budget and the agent\'s run caps. **Refused** with `400`: an invalid `cron` (`invalid-cron`), an `agentName` that is not a lowercase hyphenated name of at most 64 characters (`VALIDATION_ERROR`), a `taskPath` or `taskTitle` that is empty or over 255 characters (`VALIDATION_ERROR`), a `taskPath` that is not `/`-separated segments of letters, digits, `.`, `_` and `-`, or that has a `.` or `..` segment (`VALIDATION_ERROR`), a `taskTitle` that is blank or holds a control character (`invalid-task-title`), and an environment draft package (`draft-package`). `403` from a caller that is not a person.
|
|
427
|
+
* @summary Schedule a package agent\'s task in a workspace
|
|
428
|
+
* @param {string} organizationName The unique identifier of the organization
|
|
429
|
+
* @param {string} workspaceName The unique identifier of the workspace
|
|
430
|
+
* @param {CreateAgentScheduleRequest} createAgentScheduleRequest
|
|
431
|
+
* @param {*} [options] Override http request option.
|
|
432
|
+
* @throws {RequiredError}
|
|
433
|
+
*/
|
|
434
|
+
createAgentSchedule: (organizationName_1, workspaceName_1, createAgentScheduleRequest_1, ...args_1) => __awaiter(this, [organizationName_1, workspaceName_1, createAgentScheduleRequest_1, ...args_1], void 0, function* (organizationName, workspaceName, createAgentScheduleRequest, options = {}) {
|
|
435
|
+
// verify required parameter 'organizationName' is not null or undefined
|
|
436
|
+
(0, common_1.assertParamExists)('createAgentSchedule', 'organizationName', organizationName);
|
|
437
|
+
// verify required parameter 'workspaceName' is not null or undefined
|
|
438
|
+
(0, common_1.assertParamExists)('createAgentSchedule', 'workspaceName', workspaceName);
|
|
439
|
+
// verify required parameter 'createAgentScheduleRequest' is not null or undefined
|
|
440
|
+
(0, common_1.assertParamExists)('createAgentSchedule', 'createAgentScheduleRequest', createAgentScheduleRequest);
|
|
441
|
+
const localVarPath = `/organizations/{organizationName}/workspaces/{workspaceName}/agent-schedules`
|
|
442
|
+
.replace(`{${"organizationName"}}`, encodeURIComponent(String(organizationName)))
|
|
443
|
+
.replace(`{${"workspaceName"}}`, encodeURIComponent(String(workspaceName)));
|
|
444
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
445
|
+
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
446
|
+
let baseOptions;
|
|
447
|
+
if (configuration) {
|
|
448
|
+
baseOptions = configuration.baseOptions;
|
|
449
|
+
}
|
|
450
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
|
|
451
|
+
const localVarHeaderParameter = {};
|
|
452
|
+
const localVarQueryParameter = {};
|
|
453
|
+
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
454
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
455
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
456
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
457
|
+
localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(createAgentScheduleRequest, localVarRequestOptions, configuration);
|
|
458
|
+
return {
|
|
459
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
460
|
+
options: localVarRequestOptions,
|
|
461
|
+
};
|
|
462
|
+
}),
|
|
463
|
+
/**
|
|
464
|
+
* Deletes the schedule: it never fires again. A run already started is its creator\'s chat and carries on, and the chats it produced are kept. **Authorization**: Requires reading the workspace, and either being the schedule\'s creator, managing the workspace (`can_update_workspace`) or administering the organization (`can_update_organization`).
|
|
465
|
+
* @summary Delete an agent schedule
|
|
466
|
+
* @param {string} organizationName The unique identifier of the organization
|
|
467
|
+
* @param {string} workspaceName The unique identifier of the workspace
|
|
468
|
+
* @param {string} scheduleId The unique identifier of the schedule
|
|
469
|
+
* @param {*} [options] Override http request option.
|
|
470
|
+
* @throws {RequiredError}
|
|
471
|
+
*/
|
|
472
|
+
deleteAgentSchedule: (organizationName_1, workspaceName_1, scheduleId_1, ...args_1) => __awaiter(this, [organizationName_1, workspaceName_1, scheduleId_1, ...args_1], void 0, function* (organizationName, workspaceName, scheduleId, options = {}) {
|
|
473
|
+
// verify required parameter 'organizationName' is not null or undefined
|
|
474
|
+
(0, common_1.assertParamExists)('deleteAgentSchedule', 'organizationName', organizationName);
|
|
475
|
+
// verify required parameter 'workspaceName' is not null or undefined
|
|
476
|
+
(0, common_1.assertParamExists)('deleteAgentSchedule', 'workspaceName', workspaceName);
|
|
477
|
+
// verify required parameter 'scheduleId' is not null or undefined
|
|
478
|
+
(0, common_1.assertParamExists)('deleteAgentSchedule', 'scheduleId', scheduleId);
|
|
479
|
+
const localVarPath = `/organizations/{organizationName}/workspaces/{workspaceName}/agent-schedules/{scheduleId}`
|
|
480
|
+
.replace(`{${"organizationName"}}`, encodeURIComponent(String(organizationName)))
|
|
481
|
+
.replace(`{${"workspaceName"}}`, encodeURIComponent(String(workspaceName)))
|
|
482
|
+
.replace(`{${"scheduleId"}}`, encodeURIComponent(String(scheduleId)));
|
|
483
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
484
|
+
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
485
|
+
let baseOptions;
|
|
486
|
+
if (configuration) {
|
|
487
|
+
baseOptions = configuration.baseOptions;
|
|
488
|
+
}
|
|
489
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'DELETE' }, baseOptions), options);
|
|
490
|
+
const localVarHeaderParameter = {};
|
|
491
|
+
const localVarQueryParameter = {};
|
|
492
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
493
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
494
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
495
|
+
return {
|
|
496
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
497
|
+
options: localVarRequestOptions,
|
|
498
|
+
};
|
|
499
|
+
}),
|
|
500
|
+
/**
|
|
501
|
+
* Lists the workspace\'s schedules, oldest first, each with its last fire\'s session id as `lastSessionId`. **Authorization**: Requires read access to the workspace. **Pagination**: `limit` / `offset` with `Total-Count` and `Link`.
|
|
502
|
+
* @summary List a workspace\'s agent schedules
|
|
503
|
+
* @param {string} organizationName The unique identifier of the organization
|
|
504
|
+
* @param {string} workspaceName The unique identifier of the workspace
|
|
505
|
+
* @param {number} [limit] Maximum number of items to return. Use -1 or omit to return all results. Valid values: -1 (all results) or 1–500.
|
|
506
|
+
* @param {number} [offset] Number of items to skip before starting to return results
|
|
507
|
+
* @param {*} [options] Override http request option.
|
|
508
|
+
* @throws {RequiredError}
|
|
509
|
+
*/
|
|
510
|
+
listAgentSchedules: (organizationName_1, workspaceName_1, limit_1, offset_1, ...args_1) => __awaiter(this, [organizationName_1, workspaceName_1, limit_1, offset_1, ...args_1], void 0, function* (organizationName, workspaceName, limit, offset, options = {}) {
|
|
511
|
+
// verify required parameter 'organizationName' is not null or undefined
|
|
512
|
+
(0, common_1.assertParamExists)('listAgentSchedules', 'organizationName', organizationName);
|
|
513
|
+
// verify required parameter 'workspaceName' is not null or undefined
|
|
514
|
+
(0, common_1.assertParamExists)('listAgentSchedules', 'workspaceName', workspaceName);
|
|
515
|
+
const localVarPath = `/organizations/{organizationName}/workspaces/{workspaceName}/agent-schedules`
|
|
516
|
+
.replace(`{${"organizationName"}}`, encodeURIComponent(String(organizationName)))
|
|
517
|
+
.replace(`{${"workspaceName"}}`, encodeURIComponent(String(workspaceName)));
|
|
518
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
519
|
+
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
520
|
+
let baseOptions;
|
|
521
|
+
if (configuration) {
|
|
522
|
+
baseOptions = configuration.baseOptions;
|
|
523
|
+
}
|
|
524
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
|
|
525
|
+
const localVarHeaderParameter = {};
|
|
526
|
+
const localVarQueryParameter = {};
|
|
527
|
+
if (limit !== undefined) {
|
|
528
|
+
localVarQueryParameter['limit'] = limit;
|
|
529
|
+
}
|
|
530
|
+
if (offset !== undefined) {
|
|
531
|
+
localVarQueryParameter['offset'] = offset;
|
|
532
|
+
}
|
|
533
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
534
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
535
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
536
|
+
return {
|
|
537
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
538
|
+
options: localVarRequestOptions,
|
|
539
|
+
};
|
|
540
|
+
}),
|
|
541
|
+
};
|
|
542
|
+
};
|
|
543
|
+
exports.AgentSchedulesApiAxiosParamCreator = AgentSchedulesApiAxiosParamCreator;
|
|
544
|
+
/**
|
|
545
|
+
* AgentSchedulesApi - functional programming interface
|
|
546
|
+
* @export
|
|
547
|
+
*/
|
|
548
|
+
const AgentSchedulesApiFp = function (configuration) {
|
|
549
|
+
const localVarAxiosParamCreator = (0, exports.AgentSchedulesApiAxiosParamCreator)(configuration);
|
|
550
|
+
return {
|
|
551
|
+
/**
|
|
552
|
+
* Runs one task of a package agent on a cron schedule, at the package\'s latest version. Each fire is the turn the app\'s Run button sends, run as the person who created the schedule: the same access, budget and chat as if they had pressed it. **Authorization**: Requires membership of the organization, managing the workspace (`can_update_workspace`) and the caller\'s own read access to the package (`can_read_package`). **Cron**: exactly five whitespace-separated fields, evaluated in UTC, no `@nicknames`. The cron must have a future fire. There is no minimum interval and no limit per workspace; a run\'s cost is bounded by the organization\'s LLM budget and the agent\'s run caps. **Refused** with `400`: an invalid `cron` (`invalid-cron`), an `agentName` that is not a lowercase hyphenated name of at most 64 characters (`VALIDATION_ERROR`), a `taskPath` or `taskTitle` that is empty or over 255 characters (`VALIDATION_ERROR`), a `taskPath` that is not `/`-separated segments of letters, digits, `.`, `_` and `-`, or that has a `.` or `..` segment (`VALIDATION_ERROR`), a `taskTitle` that is blank or holds a control character (`invalid-task-title`), and an environment draft package (`draft-package`). `403` from a caller that is not a person.
|
|
553
|
+
* @summary Schedule a package agent\'s task in a workspace
|
|
554
|
+
* @param {string} organizationName The unique identifier of the organization
|
|
555
|
+
* @param {string} workspaceName The unique identifier of the workspace
|
|
556
|
+
* @param {CreateAgentScheduleRequest} createAgentScheduleRequest
|
|
557
|
+
* @param {*} [options] Override http request option.
|
|
558
|
+
* @throws {RequiredError}
|
|
559
|
+
*/
|
|
560
|
+
createAgentSchedule(organizationName, workspaceName, createAgentScheduleRequest, options) {
|
|
561
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
562
|
+
var _a, _b, _c;
|
|
563
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.createAgentSchedule(organizationName, workspaceName, createAgentScheduleRequest, options);
|
|
564
|
+
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
565
|
+
const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['AgentSchedulesApi.createAgentSchedule']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
|
|
566
|
+
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
567
|
+
});
|
|
568
|
+
},
|
|
569
|
+
/**
|
|
570
|
+
* Deletes the schedule: it never fires again. A run already started is its creator\'s chat and carries on, and the chats it produced are kept. **Authorization**: Requires reading the workspace, and either being the schedule\'s creator, managing the workspace (`can_update_workspace`) or administering the organization (`can_update_organization`).
|
|
571
|
+
* @summary Delete an agent schedule
|
|
572
|
+
* @param {string} organizationName The unique identifier of the organization
|
|
573
|
+
* @param {string} workspaceName The unique identifier of the workspace
|
|
574
|
+
* @param {string} scheduleId The unique identifier of the schedule
|
|
575
|
+
* @param {*} [options] Override http request option.
|
|
576
|
+
* @throws {RequiredError}
|
|
577
|
+
*/
|
|
578
|
+
deleteAgentSchedule(organizationName, workspaceName, scheduleId, options) {
|
|
579
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
580
|
+
var _a, _b, _c;
|
|
581
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.deleteAgentSchedule(organizationName, workspaceName, scheduleId, options);
|
|
582
|
+
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
583
|
+
const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['AgentSchedulesApi.deleteAgentSchedule']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
|
|
584
|
+
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
585
|
+
});
|
|
586
|
+
},
|
|
587
|
+
/**
|
|
588
|
+
* Lists the workspace\'s schedules, oldest first, each with its last fire\'s session id as `lastSessionId`. **Authorization**: Requires read access to the workspace. **Pagination**: `limit` / `offset` with `Total-Count` and `Link`.
|
|
589
|
+
* @summary List a workspace\'s agent schedules
|
|
590
|
+
* @param {string} organizationName The unique identifier of the organization
|
|
591
|
+
* @param {string} workspaceName The unique identifier of the workspace
|
|
592
|
+
* @param {number} [limit] Maximum number of items to return. Use -1 or omit to return all results. Valid values: -1 (all results) or 1–500.
|
|
593
|
+
* @param {number} [offset] Number of items to skip before starting to return results
|
|
594
|
+
* @param {*} [options] Override http request option.
|
|
595
|
+
* @throws {RequiredError}
|
|
596
|
+
*/
|
|
597
|
+
listAgentSchedules(organizationName, workspaceName, limit, offset, options) {
|
|
598
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
599
|
+
var _a, _b, _c;
|
|
600
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.listAgentSchedules(organizationName, workspaceName, limit, offset, options);
|
|
601
|
+
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
602
|
+
const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['AgentSchedulesApi.listAgentSchedules']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
|
|
603
|
+
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
604
|
+
});
|
|
605
|
+
},
|
|
606
|
+
};
|
|
607
|
+
};
|
|
608
|
+
exports.AgentSchedulesApiFp = AgentSchedulesApiFp;
|
|
609
|
+
/**
|
|
610
|
+
* AgentSchedulesApi - factory interface
|
|
611
|
+
* @export
|
|
612
|
+
*/
|
|
613
|
+
const AgentSchedulesApiFactory = function (configuration, basePath, axios) {
|
|
614
|
+
const localVarFp = (0, exports.AgentSchedulesApiFp)(configuration);
|
|
615
|
+
return {
|
|
616
|
+
/**
|
|
617
|
+
* Runs one task of a package agent on a cron schedule, at the package\'s latest version. Each fire is the turn the app\'s Run button sends, run as the person who created the schedule: the same access, budget and chat as if they had pressed it. **Authorization**: Requires membership of the organization, managing the workspace (`can_update_workspace`) and the caller\'s own read access to the package (`can_read_package`). **Cron**: exactly five whitespace-separated fields, evaluated in UTC, no `@nicknames`. The cron must have a future fire. There is no minimum interval and no limit per workspace; a run\'s cost is bounded by the organization\'s LLM budget and the agent\'s run caps. **Refused** with `400`: an invalid `cron` (`invalid-cron`), an `agentName` that is not a lowercase hyphenated name of at most 64 characters (`VALIDATION_ERROR`), a `taskPath` or `taskTitle` that is empty or over 255 characters (`VALIDATION_ERROR`), a `taskPath` that is not `/`-separated segments of letters, digits, `.`, `_` and `-`, or that has a `.` or `..` segment (`VALIDATION_ERROR`), a `taskTitle` that is blank or holds a control character (`invalid-task-title`), and an environment draft package (`draft-package`). `403` from a caller that is not a person.
|
|
618
|
+
* @summary Schedule a package agent\'s task in a workspace
|
|
619
|
+
* @param {string} organizationName The unique identifier of the organization
|
|
620
|
+
* @param {string} workspaceName The unique identifier of the workspace
|
|
621
|
+
* @param {CreateAgentScheduleRequest} createAgentScheduleRequest
|
|
622
|
+
* @param {*} [options] Override http request option.
|
|
623
|
+
* @throws {RequiredError}
|
|
624
|
+
*/
|
|
625
|
+
createAgentSchedule(organizationName, workspaceName, createAgentScheduleRequest, options) {
|
|
626
|
+
return localVarFp.createAgentSchedule(organizationName, workspaceName, createAgentScheduleRequest, options).then((request) => request(axios, basePath));
|
|
627
|
+
},
|
|
628
|
+
/**
|
|
629
|
+
* Deletes the schedule: it never fires again. A run already started is its creator\'s chat and carries on, and the chats it produced are kept. **Authorization**: Requires reading the workspace, and either being the schedule\'s creator, managing the workspace (`can_update_workspace`) or administering the organization (`can_update_organization`).
|
|
630
|
+
* @summary Delete an agent schedule
|
|
631
|
+
* @param {string} organizationName The unique identifier of the organization
|
|
632
|
+
* @param {string} workspaceName The unique identifier of the workspace
|
|
633
|
+
* @param {string} scheduleId The unique identifier of the schedule
|
|
634
|
+
* @param {*} [options] Override http request option.
|
|
635
|
+
* @throws {RequiredError}
|
|
636
|
+
*/
|
|
637
|
+
deleteAgentSchedule(organizationName, workspaceName, scheduleId, options) {
|
|
638
|
+
return localVarFp.deleteAgentSchedule(organizationName, workspaceName, scheduleId, options).then((request) => request(axios, basePath));
|
|
639
|
+
},
|
|
640
|
+
/**
|
|
641
|
+
* Lists the workspace\'s schedules, oldest first, each with its last fire\'s session id as `lastSessionId`. **Authorization**: Requires read access to the workspace. **Pagination**: `limit` / `offset` with `Total-Count` and `Link`.
|
|
642
|
+
* @summary List a workspace\'s agent schedules
|
|
643
|
+
* @param {string} organizationName The unique identifier of the organization
|
|
644
|
+
* @param {string} workspaceName The unique identifier of the workspace
|
|
645
|
+
* @param {number} [limit] Maximum number of items to return. Use -1 or omit to return all results. Valid values: -1 (all results) or 1–500.
|
|
646
|
+
* @param {number} [offset] Number of items to skip before starting to return results
|
|
647
|
+
* @param {*} [options] Override http request option.
|
|
648
|
+
* @throws {RequiredError}
|
|
649
|
+
*/
|
|
650
|
+
listAgentSchedules(organizationName, workspaceName, limit, offset, options) {
|
|
651
|
+
return localVarFp.listAgentSchedules(organizationName, workspaceName, limit, offset, options).then((request) => request(axios, basePath));
|
|
652
|
+
},
|
|
653
|
+
};
|
|
654
|
+
};
|
|
655
|
+
exports.AgentSchedulesApiFactory = AgentSchedulesApiFactory;
|
|
656
|
+
/**
|
|
657
|
+
* AgentSchedulesApi - object-oriented interface
|
|
658
|
+
* @export
|
|
659
|
+
* @class AgentSchedulesApi
|
|
660
|
+
* @extends {BaseAPI}
|
|
661
|
+
*/
|
|
662
|
+
class AgentSchedulesApi extends base_1.BaseAPI {
|
|
663
|
+
/**
|
|
664
|
+
* Runs one task of a package agent on a cron schedule, at the package\'s latest version. Each fire is the turn the app\'s Run button sends, run as the person who created the schedule: the same access, budget and chat as if they had pressed it. **Authorization**: Requires membership of the organization, managing the workspace (`can_update_workspace`) and the caller\'s own read access to the package (`can_read_package`). **Cron**: exactly five whitespace-separated fields, evaluated in UTC, no `@nicknames`. The cron must have a future fire. There is no minimum interval and no limit per workspace; a run\'s cost is bounded by the organization\'s LLM budget and the agent\'s run caps. **Refused** with `400`: an invalid `cron` (`invalid-cron`), an `agentName` that is not a lowercase hyphenated name of at most 64 characters (`VALIDATION_ERROR`), a `taskPath` or `taskTitle` that is empty or over 255 characters (`VALIDATION_ERROR`), a `taskPath` that is not `/`-separated segments of letters, digits, `.`, `_` and `-`, or that has a `.` or `..` segment (`VALIDATION_ERROR`), a `taskTitle` that is blank or holds a control character (`invalid-task-title`), and an environment draft package (`draft-package`). `403` from a caller that is not a person.
|
|
665
|
+
* @summary Schedule a package agent\'s task in a workspace
|
|
666
|
+
* @param {string} organizationName The unique identifier of the organization
|
|
667
|
+
* @param {string} workspaceName The unique identifier of the workspace
|
|
668
|
+
* @param {CreateAgentScheduleRequest} createAgentScheduleRequest
|
|
669
|
+
* @param {*} [options] Override http request option.
|
|
670
|
+
* @throws {RequiredError}
|
|
671
|
+
* @memberof AgentSchedulesApi
|
|
672
|
+
*/
|
|
673
|
+
createAgentSchedule(organizationName, workspaceName, createAgentScheduleRequest, options) {
|
|
674
|
+
return (0, exports.AgentSchedulesApiFp)(this.configuration).createAgentSchedule(organizationName, workspaceName, createAgentScheduleRequest, options).then((request) => request(this.axios, this.basePath));
|
|
675
|
+
}
|
|
676
|
+
/**
|
|
677
|
+
* Deletes the schedule: it never fires again. A run already started is its creator\'s chat and carries on, and the chats it produced are kept. **Authorization**: Requires reading the workspace, and either being the schedule\'s creator, managing the workspace (`can_update_workspace`) or administering the organization (`can_update_organization`).
|
|
678
|
+
* @summary Delete an agent schedule
|
|
679
|
+
* @param {string} organizationName The unique identifier of the organization
|
|
680
|
+
* @param {string} workspaceName The unique identifier of the workspace
|
|
681
|
+
* @param {string} scheduleId The unique identifier of the schedule
|
|
682
|
+
* @param {*} [options] Override http request option.
|
|
683
|
+
* @throws {RequiredError}
|
|
684
|
+
* @memberof AgentSchedulesApi
|
|
685
|
+
*/
|
|
686
|
+
deleteAgentSchedule(organizationName, workspaceName, scheduleId, options) {
|
|
687
|
+
return (0, exports.AgentSchedulesApiFp)(this.configuration).deleteAgentSchedule(organizationName, workspaceName, scheduleId, options).then((request) => request(this.axios, this.basePath));
|
|
688
|
+
}
|
|
689
|
+
/**
|
|
690
|
+
* Lists the workspace\'s schedules, oldest first, each with its last fire\'s session id as `lastSessionId`. **Authorization**: Requires read access to the workspace. **Pagination**: `limit` / `offset` with `Total-Count` and `Link`.
|
|
691
|
+
* @summary List a workspace\'s agent schedules
|
|
692
|
+
* @param {string} organizationName The unique identifier of the organization
|
|
693
|
+
* @param {string} workspaceName The unique identifier of the workspace
|
|
694
|
+
* @param {number} [limit] Maximum number of items to return. Use -1 or omit to return all results. Valid values: -1 (all results) or 1–500.
|
|
695
|
+
* @param {number} [offset] Number of items to skip before starting to return results
|
|
696
|
+
* @param {*} [options] Override http request option.
|
|
697
|
+
* @throws {RequiredError}
|
|
698
|
+
* @memberof AgentSchedulesApi
|
|
699
|
+
*/
|
|
700
|
+
listAgentSchedules(organizationName, workspaceName, limit, offset, options) {
|
|
701
|
+
return (0, exports.AgentSchedulesApiFp)(this.configuration).listAgentSchedules(organizationName, workspaceName, limit, offset, options).then((request) => request(this.axios, this.basePath));
|
|
702
|
+
}
|
|
703
|
+
}
|
|
704
|
+
exports.AgentSchedulesApi = AgentSchedulesApi;
|
|
431
705
|
/**
|
|
432
706
|
* AttributesApi - axios parameter creator
|
|
433
707
|
* @export
|
|
@@ -3617,10 +3891,11 @@ const DocumentsApiAxiosParamCreator = function (configuration) {
|
|
|
3617
3891
|
* @param {string} organizationName The unique identifier of the organization
|
|
3618
3892
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
3619
3893
|
* @param {boolean} [retrieveContent] If true, include the document content in the response. Defaults to false.
|
|
3894
|
+
* @param {string} [pathPrefix] List only the documents whose path starts with this string, matched literally (`%` and `_` are not wildcards). A draft\'s files are `drafts/{draftId}/`, so a caller that wants one draft\'s files reads those rather than the whole workspace. Omitted, every document is listed.
|
|
3620
3895
|
* @param {*} [options] Override http request option.
|
|
3621
3896
|
* @throws {RequiredError}
|
|
3622
3897
|
*/
|
|
3623
|
-
listDocuments: (organizationName_1, workspaceName_1, retrieveContent_1, ...args_1) => __awaiter(this, [organizationName_1, workspaceName_1, retrieveContent_1, ...args_1], void 0, function* (organizationName, workspaceName, retrieveContent, options = {}) {
|
|
3898
|
+
listDocuments: (organizationName_1, workspaceName_1, retrieveContent_1, pathPrefix_1, ...args_1) => __awaiter(this, [organizationName_1, workspaceName_1, retrieveContent_1, pathPrefix_1, ...args_1], void 0, function* (organizationName, workspaceName, retrieveContent, pathPrefix, options = {}) {
|
|
3624
3899
|
// verify required parameter 'organizationName' is not null or undefined
|
|
3625
3900
|
(0, common_1.assertParamExists)('listDocuments', 'organizationName', organizationName);
|
|
3626
3901
|
// verify required parameter 'workspaceName' is not null or undefined
|
|
@@ -3640,6 +3915,9 @@ const DocumentsApiAxiosParamCreator = function (configuration) {
|
|
|
3640
3915
|
if (retrieveContent !== undefined) {
|
|
3641
3916
|
localVarQueryParameter['retrieveContent'] = retrieveContent;
|
|
3642
3917
|
}
|
|
3918
|
+
if (pathPrefix !== undefined) {
|
|
3919
|
+
localVarQueryParameter['pathPrefix'] = pathPrefix;
|
|
3920
|
+
}
|
|
3643
3921
|
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
3644
3922
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
3645
3923
|
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
@@ -3772,13 +4050,14 @@ const DocumentsApiFp = function (configuration) {
|
|
|
3772
4050
|
* @param {string} organizationName The unique identifier of the organization
|
|
3773
4051
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
3774
4052
|
* @param {boolean} [retrieveContent] If true, include the document content in the response. Defaults to false.
|
|
4053
|
+
* @param {string} [pathPrefix] List only the documents whose path starts with this string, matched literally (`%` and `_` are not wildcards). A draft\'s files are `drafts/{draftId}/`, so a caller that wants one draft\'s files reads those rather than the whole workspace. Omitted, every document is listed.
|
|
3775
4054
|
* @param {*} [options] Override http request option.
|
|
3776
4055
|
* @throws {RequiredError}
|
|
3777
4056
|
*/
|
|
3778
|
-
listDocuments(organizationName, workspaceName, retrieveContent, options) {
|
|
4057
|
+
listDocuments(organizationName, workspaceName, retrieveContent, pathPrefix, options) {
|
|
3779
4058
|
return __awaiter(this, void 0, void 0, function* () {
|
|
3780
4059
|
var _a, _b, _c;
|
|
3781
|
-
const localVarAxiosArgs = yield localVarAxiosParamCreator.listDocuments(organizationName, workspaceName, retrieveContent, options);
|
|
4060
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.listDocuments(organizationName, workspaceName, retrieveContent, pathPrefix, options);
|
|
3782
4061
|
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
3783
4062
|
const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['DocumentsApi.listDocuments']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
|
|
3784
4063
|
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
@@ -3861,11 +4140,12 @@ const DocumentsApiFactory = function (configuration, basePath, axios) {
|
|
|
3861
4140
|
* @param {string} organizationName The unique identifier of the organization
|
|
3862
4141
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
3863
4142
|
* @param {boolean} [retrieveContent] If true, include the document content in the response. Defaults to false.
|
|
4143
|
+
* @param {string} [pathPrefix] List only the documents whose path starts with this string, matched literally (`%` and `_` are not wildcards). A draft\'s files are `drafts/{draftId}/`, so a caller that wants one draft\'s files reads those rather than the whole workspace. Omitted, every document is listed.
|
|
3864
4144
|
* @param {*} [options] Override http request option.
|
|
3865
4145
|
* @throws {RequiredError}
|
|
3866
4146
|
*/
|
|
3867
|
-
listDocuments(organizationName, workspaceName, retrieveContent, options) {
|
|
3868
|
-
return localVarFp.listDocuments(organizationName, workspaceName, retrieveContent, options).then((request) => request(axios, basePath));
|
|
4147
|
+
listDocuments(organizationName, workspaceName, retrieveContent, pathPrefix, options) {
|
|
4148
|
+
return localVarFp.listDocuments(organizationName, workspaceName, retrieveContent, pathPrefix, options).then((request) => request(axios, basePath));
|
|
3869
4149
|
},
|
|
3870
4150
|
/**
|
|
3871
4151
|
* Updates the content and metadata of an existing document within the workspace. **Authorization**: `can_create_document` in the workspace (its managers, and its members who belong to the organization). Anything in a draft (`drafts/{draftId}` and every path under it) additionally takes `can_create_package` on the environment its manifest names, so a member who is not a modeler there cannot change a colleague\'s draft. When the REQUEST BODY\'s `type` is `draft_package`, the environment named by its `metadata.target_env` must additionally grant the caller `can_create_package` — the same bar `createDocument` applies, checked here on the incoming type because this operation ASSIGNS the type from the body: without it, converting any writable document into a `draft_package` would reach the modeling surface. A missing or blank `metadata.target_env` is refused. This narrows the existing 403; it is not a new status. **Content**: Supports updating document content, type, and other properties. Refuses with `400` (`draft-notebook-read-only`) when the path is a `.malloynb` file inside a draft (`drafts/{draftId}/...`) and the write would change it or add a new one to a draft that already has files, whatever the request\'s `type`. See `writeDraftDocument`. **Precondition**: `expectedUpdatedAt` is the `updatedAt` the writer read the document at. When sent, the write applies only if the document still carries that `updatedAt` (compared to the millisecond), else `409` `stale-document` and nothing is written; the check and the write hold the row lock together, so of two writers holding the same value exactly one wins. Absent, the write is last-writer-wins as it has always been. **Partial update**: `updateMask=metadata` writes only the body\'s `metadata`. The stored `type` and `content` are kept whatever the body carries, so a caller changing metadata need not read or resend the content, and the response omits `content`. Every check above applies, against the stored type. Absent, the body replaces type, content and metadata. **A public-link visitor** changes a document of theirs only while the package it is about (metadata `visitor_package`) is still public to them; otherwise 403. `visitor_package` is controlplane\'s: an update cannot change or remove it.
|
|
@@ -3941,12 +4221,13 @@ class DocumentsApi extends base_1.BaseAPI {
|
|
|
3941
4221
|
* @param {string} organizationName The unique identifier of the organization
|
|
3942
4222
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
3943
4223
|
* @param {boolean} [retrieveContent] If true, include the document content in the response. Defaults to false.
|
|
4224
|
+
* @param {string} [pathPrefix] List only the documents whose path starts with this string, matched literally (`%` and `_` are not wildcards). A draft\'s files are `drafts/{draftId}/`, so a caller that wants one draft\'s files reads those rather than the whole workspace. Omitted, every document is listed.
|
|
3944
4225
|
* @param {*} [options] Override http request option.
|
|
3945
4226
|
* @throws {RequiredError}
|
|
3946
4227
|
* @memberof DocumentsApi
|
|
3947
4228
|
*/
|
|
3948
|
-
listDocuments(organizationName, workspaceName, retrieveContent, options) {
|
|
3949
|
-
return (0, exports.DocumentsApiFp)(this.configuration).listDocuments(organizationName, workspaceName, retrieveContent, options).then((request) => request(this.axios, this.basePath));
|
|
4229
|
+
listDocuments(organizationName, workspaceName, retrieveContent, pathPrefix, options) {
|
|
4230
|
+
return (0, exports.DocumentsApiFp)(this.configuration).listDocuments(organizationName, workspaceName, retrieveContent, pathPrefix, options).then((request) => request(this.axios, this.basePath));
|
|
3950
4231
|
}
|
|
3951
4232
|
/**
|
|
3952
4233
|
* Updates the content and metadata of an existing document within the workspace. **Authorization**: `can_create_document` in the workspace (its managers, and its members who belong to the organization). Anything in a draft (`drafts/{draftId}` and every path under it) additionally takes `can_create_package` on the environment its manifest names, so a member who is not a modeler there cannot change a colleague\'s draft. When the REQUEST BODY\'s `type` is `draft_package`, the environment named by its `metadata.target_env` must additionally grant the caller `can_create_package` — the same bar `createDocument` applies, checked here on the incoming type because this operation ASSIGNS the type from the body: without it, converting any writable document into a `draft_package` would reach the modeling surface. A missing or blank `metadata.target_env` is refused. This narrows the existing 403; it is not a new status. **Content**: Supports updating document content, type, and other properties. Refuses with `400` (`draft-notebook-read-only`) when the path is a `.malloynb` file inside a draft (`drafts/{draftId}/...`) and the write would change it or add a new one to a draft that already has files, whatever the request\'s `type`. See `writeDraftDocument`. **Precondition**: `expectedUpdatedAt` is the `updatedAt` the writer read the document at. When sent, the write applies only if the document still carries that `updatedAt` (compared to the millisecond), else `409` `stale-document` and nothing is written; the check and the write hold the row lock together, so of two writers holding the same value exactly one wins. Absent, the write is last-writer-wins as it has always been. **Partial update**: `updateMask=metadata` writes only the body\'s `metadata`. The stored `type` and `content` are kept whatever the body carries, so a caller changing metadata need not read or resend the content, and the response omits `content`. Every check above applies, against the stored type. Absent, the body replaces type, content and metadata. **A public-link visitor** changes a document of theirs only while the package it is about (metadata `visitor_package`) is still public to them; otherwise 403. `visitor_package` is controlplane\'s: an update cannot change or remove it.
|
|
@@ -3979,7 +4260,7 @@ exports.UpdateDocumentUpdateMaskEnum = {
|
|
|
3979
4260
|
const DraftsApiAxiosParamCreator = function (configuration) {
|
|
3980
4261
|
return {
|
|
3981
4262
|
/**
|
|
3982
|
-
* Mints a draft in this workspace and returns it. **Always creates**: a package can hold any number of drafts, one per chat by default, so a second request for the same `targetPackageName` mints a second draft rather than returning the first. Callers that want an existing draft list the workspace\'s drafts and open one by id. What keeps two writers off one draft is the draft\'s work-item claim, not uniqueness here.
|
|
4263
|
+
* Mints a draft in this workspace and returns it. **Always creates**: a package can hold any number of drafts, one per chat by default, so a second request for the same `targetPackageName` mints a second draft rather than returning the first. Callers that want an existing draft list the workspace\'s drafts and open one by id. What keeps two writers off one draft is the draft\'s work-item claim, not uniqueness here. Every draft is a document-store draft, in a git-enrolled environment as in any other: the draft\'s files are workspace documents, and git is only where a pushed draft goes for review. **`seedFromPublished` returns the draft already holding a published version\'s files**, in this one call: what opening a published package for editing takes, without a chat. Its refusals all come before the draft exists, and a seed that fails afterwards removes the draft; see the field. `201` with the new draft. **Authorization**: `can_create_document` in the workspace, and on every create the target environment\'s modeling bar (`can_create_package`, modeler or admin): putting a package in draft mode, or starting a new package\'s draft, is modeling work in that environment, and in a git-enrolled one creating the branch is a write into its repository. It is taken before anything is created; refused, it answers `403 draft-modeling-permission-required`.
|
|
3983
4264
|
* @summary Create a draft package
|
|
3984
4265
|
* @param {string} organizationName The unique identifier of the organization
|
|
3985
4266
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
@@ -4017,7 +4298,7 @@ const DraftsApiAxiosParamCreator = function (configuration) {
|
|
|
4017
4298
|
};
|
|
4018
4299
|
}),
|
|
4019
4300
|
/**
|
|
4020
|
-
* Deletes the draft: its manifest and, for a document-store draft, its files. Its environment draft package is marked for the checkpoint reaper, so what was serving the draft is removed on the next tick. **The branch lives on.** Deleting a draft does not delete its git branch (docs/git-synced-modeling.md §7.2)
|
|
4301
|
+
* Deletes the draft: its manifest and, for a document-store draft, its files. Its environment draft package is marked for the checkpoint reaper, so what was serving the draft is removed on the next tick. **The branch usually lives on.** Deleting a draft does not delete its git branch (docs/git-synced-modeling.md §7.2), with one server-side exception: a draft that was never published and still sits at its seed commit has its branch deleted first, best-effort, so a draft minted from a misread intent leaves nothing behind. The delete is pinned to the seed commit, so a commit that landed since keeps the branch; the pin is not a compare-and-swap, so a commit landing in the instant between the gateway\'s tip re-read and its delete is lost. A failed branch delete never blocks the draft\'s delete, and retrying after a partial failure finds the branch already gone. Every other branch is removed by `DELETE .../drafts/{draftId}/branch`, or by the close after a successful publish (see `writeDraftPublication` and `createOrUpdatePackage`\'s `draftId`). **A second delete, or a read after this one, answers 404** to a caller who can use the workspace (403 to one who cannot): the gate is the workspace\'s, and the row is gone. **Authorization**: requires `can_delete_document` on the draft document, and `can_create_package` on the environment it targets.
|
|
4021
4302
|
* @summary Delete a draft package
|
|
4022
4303
|
* @param {string} organizationName The unique identifier of the organization
|
|
4023
4304
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
@@ -4054,7 +4335,7 @@ const DraftsApiAxiosParamCreator = function (configuration) {
|
|
|
4054
4335
|
};
|
|
4055
4336
|
}),
|
|
4056
4337
|
/**
|
|
4057
|
-
* Thin proxy to the code-assist git-gateway\'s `deleteDraft` — deletes the draft\'s branch in the managed monorepo
|
|
4338
|
+
* Thin proxy to the code-assist git-gateway\'s `deleteDraft` — deletes the draft\'s branch in the managed monorepo, forwarding the caller\'s own bearer token. **This is branch removal only — it does not delete the draft.** Deleting the draft is `DELETE` on the draft itself. Stays as the primitive operator tooling needs: `deleteDraft` deletes an untouched draft\'s branch at its seed commit on the server (docs/git-synced-modeling.md §7.2), so neither the app nor the agent needs to call this. See docs/tenant-offboarding-playbook.md, which prefers it over a raw GitHub call precisely because it carries the FGA check below. The close after a successful publish also deletes a draft\'s branch, but through the gateway directly rather than through this endpoint. **Authorization**: Requires write access to the draft\'s workspace (`can_create_document`) and `can_create_package` on the environment the draft targets, as deleting the draft does. The gateway re-checks the workspace relation. Idempotent, and deliberately not gated on the draft being git-backed, so a provisioning draft\'s half-cut branch can still be cleaned up.
|
|
4058
4339
|
* @summary Delete a git-backed draft\'s branch
|
|
4059
4340
|
* @param {string} organizationName The unique identifier of the organization
|
|
4060
4341
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
@@ -4091,18 +4372,18 @@ const DraftsApiAxiosParamCreator = function (configuration) {
|
|
|
4091
4372
|
};
|
|
4092
4373
|
}),
|
|
4093
4374
|
/**
|
|
4094
|
-
* Removes a document from the draft
|
|
4375
|
+
* Removes a document from the draft: it deletes the document row, only if it still holds the `sha` in `expectedSha` when one is sent, and unconditionally (and idempotently) otherwise. **Authorization**: as `writeDraftDocument`.
|
|
4095
4376
|
* @summary Delete one of a draft\'s documents
|
|
4096
4377
|
* @param {string} organizationName The unique identifier of the organization
|
|
4097
4378
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
4098
4379
|
* @param {string} draftId The draft package identifier
|
|
4099
4380
|
* @param {string} documentPath The document\'s path relative to the draft root
|
|
4100
|
-
* @param {string} [
|
|
4101
|
-
* @param {string} [
|
|
4381
|
+
* @param {string} [expectedSha] The `sha` the caller read the document at: the delete applies only if the document still holds that version, else `409` `draft-document-stale`; a file already gone counts as deleted when this is the whole request, so a lost response can be resent.
|
|
4382
|
+
* @param {string} [expectedRef] Deprecated: use `expectedSha`. A git branch head, refused with `400` when set: a draft has no commits to compare it against, and a caller that sends a precondition believes it holds one. Kept one release, so a client from before the document store is refused rather than written unconditionally; removed in the release after.
|
|
4102
4383
|
* @param {*} [options] Override http request option.
|
|
4103
4384
|
* @throws {RequiredError}
|
|
4104
4385
|
*/
|
|
4105
|
-
deleteDraftDocument: (organizationName_1, workspaceName_1, draftId_1, documentPath_1,
|
|
4386
|
+
deleteDraftDocument: (organizationName_1, workspaceName_1, draftId_1, documentPath_1, expectedSha_1, expectedRef_1, ...args_1) => __awaiter(this, [organizationName_1, workspaceName_1, draftId_1, documentPath_1, expectedSha_1, expectedRef_1, ...args_1], void 0, function* (organizationName, workspaceName, draftId, documentPath, expectedSha, expectedRef, options = {}) {
|
|
4106
4387
|
// verify required parameter 'organizationName' is not null or undefined
|
|
4107
4388
|
(0, common_1.assertParamExists)('deleteDraftDocument', 'organizationName', organizationName);
|
|
4108
4389
|
// verify required parameter 'workspaceName' is not null or undefined
|
|
@@ -4125,12 +4406,12 @@ const DraftsApiAxiosParamCreator = function (configuration) {
|
|
|
4125
4406
|
const localVarRequestOptions = Object.assign(Object.assign({ method: 'DELETE' }, baseOptions), options);
|
|
4126
4407
|
const localVarHeaderParameter = {};
|
|
4127
4408
|
const localVarQueryParameter = {};
|
|
4128
|
-
if (expectedRef !== undefined) {
|
|
4129
|
-
localVarQueryParameter['expectedRef'] = expectedRef;
|
|
4130
|
-
}
|
|
4131
4409
|
if (expectedSha !== undefined) {
|
|
4132
4410
|
localVarQueryParameter['expectedSha'] = expectedSha;
|
|
4133
4411
|
}
|
|
4412
|
+
if (expectedRef !== undefined) {
|
|
4413
|
+
localVarQueryParameter['expectedRef'] = expectedRef;
|
|
4414
|
+
}
|
|
4134
4415
|
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
4135
4416
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
4136
4417
|
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
@@ -4140,13 +4421,13 @@ const DraftsApiAxiosParamCreator = function (configuration) {
|
|
|
4140
4421
|
};
|
|
4141
4422
|
}),
|
|
4142
4423
|
/**
|
|
4143
|
-
* Discards the draft\'s change to one file, so the draft carries what its publication has at this path again. This is Restore, for any kind of file; after it the path has no `changeSincePublication` marker. `DELETE` on the document itself deletes the file instead — a different change, which this would undo. What it does follows the file\'s change marker, never whether a published copy can be read: - A data file: the draft\'s own upload or deletion is dropped. Where the draft\'s last publish shipped its own upload, the path returns to that upload; otherwise the published copy is inherited again, and a small UTF-8 file, which a draft holds as a document rather than inheriting, is written back as one.
|
|
4424
|
+
* Discards the draft\'s change to one file, so the draft carries what its publication has at this path again. This is Restore, for any kind of file; after it the path has no `changeSincePublication` marker. `DELETE` on the document itself deletes the file instead — a different change, which this would undo. What it does follows the file\'s change marker, never whether a published copy can be read: - A data file: the draft\'s own upload or deletion is dropped. Where the draft\'s last publish shipped its own upload, the path returns to that upload; otherwise the published copy is inherited again, and a small UTF-8 file, which a draft holds as a document rather than inheriting, is written back as one. - A text file the draft added: deleted. - A text file the draft edited or deleted: the published copy written back. Answers as `getDraftDocument` with `ref=publication` does when that copy cannot be read (`404` `draft-file-not-in-publication`, `409`, `413`, `503`), changing nothing. `404` `draft-document-unchanged` when the draft has no change at this path — a data file the draft\'s last publish shipped and has not touched since included. Before any change is found, the comparison itself can be refused, with the answers a read of the baseline gives: `403` when the caller cannot read the package the draft is measured against, `409` `draft-publication-baseline-missing` when that baseline cannot be measured (a corrupt archive), and `503` `draft-changes-unavailable` when it could not be read. **Authorization** — the same pair `writeDraftDocument` takes.
|
|
4144
4425
|
* @summary Restore one of a draft\'s files to its published copy
|
|
4145
4426
|
* @param {string} organizationName The unique identifier of the organization
|
|
4146
4427
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
4147
4428
|
* @param {string} draftId The draft package identifier
|
|
4148
4429
|
* @param {string} documentPath The file\'s path relative to the draft root
|
|
4149
|
-
* @param {string} [expectedRef]
|
|
4430
|
+
* @param {string} [expectedRef] Deprecated: a restore takes no precondition. A git branch head, refused with `400` when set: a draft has no commits to compare it against, and a caller that sends a precondition believes it holds one. Kept one release, so a client from before the document store is refused rather than written unconditionally; removed in the release after.
|
|
4150
4431
|
* @param {*} [options] Override http request option.
|
|
4151
4432
|
* @throws {RequiredError}
|
|
4152
4433
|
*/
|
|
@@ -4222,22 +4503,22 @@ const DraftsApiAxiosParamCreator = function (configuration) {
|
|
|
4222
4503
|
};
|
|
4223
4504
|
}),
|
|
4224
4505
|
/**
|
|
4225
|
-
* The
|
|
4226
|
-
* @summary
|
|
4506
|
+
* The draft\'s capabilities, derived by the server from its environment and what its package has published. The same value `getDraft` carries as `capabilities`, for a caller that does not need the rest of the draft: it reads the draft\'s manifest, its review state and one published-version lookup, not the checkpoint or the files. A draft that is moving to the new store answers `409` `draft-converting`: retry. **Authorization**: requires read access to the draft document.
|
|
4507
|
+
* @summary What the draft\'s storage can do
|
|
4227
4508
|
* @param {string} organizationName The unique identifier of the organization
|
|
4228
4509
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
4229
4510
|
* @param {string} draftId The draft package identifier
|
|
4230
4511
|
* @param {*} [options] Override http request option.
|
|
4231
4512
|
* @throws {RequiredError}
|
|
4232
4513
|
*/
|
|
4233
|
-
|
|
4514
|
+
getDraftCapabilities: (organizationName_1, workspaceName_1, draftId_1, ...args_1) => __awaiter(this, [organizationName_1, workspaceName_1, draftId_1, ...args_1], void 0, function* (organizationName, workspaceName, draftId, options = {}) {
|
|
4234
4515
|
// verify required parameter 'organizationName' is not null or undefined
|
|
4235
|
-
(0, common_1.assertParamExists)('
|
|
4516
|
+
(0, common_1.assertParamExists)('getDraftCapabilities', 'organizationName', organizationName);
|
|
4236
4517
|
// verify required parameter 'workspaceName' is not null or undefined
|
|
4237
|
-
(0, common_1.assertParamExists)('
|
|
4518
|
+
(0, common_1.assertParamExists)('getDraftCapabilities', 'workspaceName', workspaceName);
|
|
4238
4519
|
// verify required parameter 'draftId' is not null or undefined
|
|
4239
|
-
(0, common_1.assertParamExists)('
|
|
4240
|
-
const localVarPath = `/organizations/{organizationName}/workspaces/{workspaceName}/drafts/{draftId}/
|
|
4520
|
+
(0, common_1.assertParamExists)('getDraftCapabilities', 'draftId', draftId);
|
|
4521
|
+
const localVarPath = `/organizations/{organizationName}/workspaces/{workspaceName}/drafts/{draftId}/capabilities`
|
|
4241
4522
|
.replace(`{${"organizationName"}}`, encodeURIComponent(String(organizationName)))
|
|
4242
4523
|
.replace(`{${"workspaceName"}}`, encodeURIComponent(String(workspaceName)))
|
|
4243
4524
|
.replace(`{${"draftId"}}`, encodeURIComponent(String(draftId)));
|
|
@@ -4296,30 +4577,65 @@ const DraftsApiAxiosParamCreator = function (configuration) {
|
|
|
4296
4577
|
};
|
|
4297
4578
|
}),
|
|
4298
4579
|
/**
|
|
4299
|
-
*
|
|
4300
|
-
* @summary
|
|
4580
|
+
* One entry of `getDraftConflicts` with the incoming side\'s, the draft\'s and their common ancestor\'s version of the file, so the caller can reconcile them and write the result through `writeDraftDocuments` with the `conflictSha` this returns. **Authorization**: requires read access to the draft document, and `can_create_package` on the environment it targets: only a modeler can act on what this serves. `404` when the path has no conflict (it was resolved, or never conflicted).
|
|
4581
|
+
* @summary One conflicting file, with all three of its versions
|
|
4301
4582
|
* @param {string} organizationName The unique identifier of the organization
|
|
4302
4583
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
4303
4584
|
* @param {string} draftId The draft package identifier
|
|
4304
|
-
* @param {string}
|
|
4305
|
-
* @param {
|
|
4306
|
-
* @
|
|
4585
|
+
* @param {string} documentPath The conflicting file\'s path relative to the draft root, as `getDraftConflicts` lists it.
|
|
4586
|
+
* @param {*} [options] Override http request option.
|
|
4587
|
+
* @throws {RequiredError}
|
|
4588
|
+
*/
|
|
4589
|
+
getDraftConflict: (organizationName_1, workspaceName_1, draftId_1, documentPath_1, ...args_1) => __awaiter(this, [organizationName_1, workspaceName_1, draftId_1, documentPath_1, ...args_1], void 0, function* (organizationName, workspaceName, draftId, documentPath, options = {}) {
|
|
4590
|
+
// verify required parameter 'organizationName' is not null or undefined
|
|
4591
|
+
(0, common_1.assertParamExists)('getDraftConflict', 'organizationName', organizationName);
|
|
4592
|
+
// verify required parameter 'workspaceName' is not null or undefined
|
|
4593
|
+
(0, common_1.assertParamExists)('getDraftConflict', 'workspaceName', workspaceName);
|
|
4594
|
+
// verify required parameter 'draftId' is not null or undefined
|
|
4595
|
+
(0, common_1.assertParamExists)('getDraftConflict', 'draftId', draftId);
|
|
4596
|
+
// verify required parameter 'documentPath' is not null or undefined
|
|
4597
|
+
(0, common_1.assertParamExists)('getDraftConflict', 'documentPath', documentPath);
|
|
4598
|
+
const localVarPath = `/organizations/{organizationName}/workspaces/{workspaceName}/drafts/{draftId}/conflicts/{documentPath}`
|
|
4599
|
+
.replace(`{${"organizationName"}}`, encodeURIComponent(String(organizationName)))
|
|
4600
|
+
.replace(`{${"workspaceName"}}`, encodeURIComponent(String(workspaceName)))
|
|
4601
|
+
.replace(`{${"draftId"}}`, encodeURIComponent(String(draftId)))
|
|
4602
|
+
.replace(`{${"documentPath"}}`, encodeURIComponent(String(documentPath)));
|
|
4603
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
4604
|
+
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
4605
|
+
let baseOptions;
|
|
4606
|
+
if (configuration) {
|
|
4607
|
+
baseOptions = configuration.baseOptions;
|
|
4608
|
+
}
|
|
4609
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
|
|
4610
|
+
const localVarHeaderParameter = {};
|
|
4611
|
+
const localVarQueryParameter = {};
|
|
4612
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
4613
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
4614
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
4615
|
+
return {
|
|
4616
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
4617
|
+
options: localVarRequestOptions,
|
|
4618
|
+
};
|
|
4619
|
+
}),
|
|
4620
|
+
/**
|
|
4621
|
+
* A page of the draft\'s conflicts: every path both the draft and what came in changed since their common ancestor, where what came in is a newer published version of its package (the base moved) or a commit someone pushed to its pull request. A superset of what cannot merge on its own, because nothing here runs a merge. Ordered by `relpath`. Each entry says where its incoming side came from, and carries the `conflictSha` a resolution sends back through `writeDraftDocuments`, a member per file. `getDraftConflict` returns one file\'s three versions. An empty list means nothing waits on the author: what only one side changed is absorbed in the background. Conflicts never block editing or a Submit; a submitted draft\'s push waits for the last one to be resolved and then starts on its own. Served from controlplane\'s record alone: no file content, no archive read and no GitHub call. **Authorization**: requires read access to the draft document. `409` `draft-converting` means the draft is moving to the new store; retry.
|
|
4622
|
+
* @summary The files the draft and what came in both changed
|
|
4623
|
+
* @param {string} organizationName The unique identifier of the organization
|
|
4624
|
+
* @param {string} workspaceName The unique identifier of the workspace
|
|
4625
|
+
* @param {string} draftId The draft package identifier
|
|
4626
|
+
* @param {number} [limit] Maximum number of items to return. Use -1 or omit to return all results. Valid values: -1 (all results) or 1–500.
|
|
4307
4627
|
* @param {number} [offset] Number of items to skip before starting to return results
|
|
4308
4628
|
* @param {*} [options] Override http request option.
|
|
4309
4629
|
* @throws {RequiredError}
|
|
4310
4630
|
*/
|
|
4311
|
-
|
|
4631
|
+
getDraftConflicts: (organizationName_1, workspaceName_1, draftId_1, limit_1, offset_1, ...args_1) => __awaiter(this, [organizationName_1, workspaceName_1, draftId_1, limit_1, offset_1, ...args_1], void 0, function* (organizationName, workspaceName, draftId, limit, offset, options = {}) {
|
|
4312
4632
|
// verify required parameter 'organizationName' is not null or undefined
|
|
4313
|
-
(0, common_1.assertParamExists)('
|
|
4633
|
+
(0, common_1.assertParamExists)('getDraftConflicts', 'organizationName', organizationName);
|
|
4314
4634
|
// verify required parameter 'workspaceName' is not null or undefined
|
|
4315
|
-
(0, common_1.assertParamExists)('
|
|
4635
|
+
(0, common_1.assertParamExists)('getDraftConflicts', 'workspaceName', workspaceName);
|
|
4316
4636
|
// verify required parameter 'draftId' is not null or undefined
|
|
4317
|
-
(0, common_1.assertParamExists)('
|
|
4318
|
-
|
|
4319
|
-
(0, common_1.assertParamExists)('getDraftComparison', 'base', base);
|
|
4320
|
-
// verify required parameter 'head' is not null or undefined
|
|
4321
|
-
(0, common_1.assertParamExists)('getDraftComparison', 'head', head);
|
|
4322
|
-
const localVarPath = `/organizations/{organizationName}/workspaces/{workspaceName}/drafts/{draftId}/comparison`
|
|
4637
|
+
(0, common_1.assertParamExists)('getDraftConflicts', 'draftId', draftId);
|
|
4638
|
+
const localVarPath = `/organizations/{organizationName}/workspaces/{workspaceName}/drafts/{draftId}/conflicts`
|
|
4323
4639
|
.replace(`{${"organizationName"}}`, encodeURIComponent(String(organizationName)))
|
|
4324
4640
|
.replace(`{${"workspaceName"}}`, encodeURIComponent(String(workspaceName)))
|
|
4325
4641
|
.replace(`{${"draftId"}}`, encodeURIComponent(String(draftId)));
|
|
@@ -4332,12 +4648,6 @@ const DraftsApiAxiosParamCreator = function (configuration) {
|
|
|
4332
4648
|
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
|
|
4333
4649
|
const localVarHeaderParameter = {};
|
|
4334
4650
|
const localVarQueryParameter = {};
|
|
4335
|
-
if (base !== undefined) {
|
|
4336
|
-
localVarQueryParameter['base'] = base;
|
|
4337
|
-
}
|
|
4338
|
-
if (head !== undefined) {
|
|
4339
|
-
localVarQueryParameter['head'] = head;
|
|
4340
|
-
}
|
|
4341
4651
|
if (limit !== undefined) {
|
|
4342
4652
|
localVarQueryParameter['limit'] = limit;
|
|
4343
4653
|
}
|
|
@@ -4353,7 +4663,7 @@ const DraftsApiAxiosParamCreator = function (configuration) {
|
|
|
4353
4663
|
};
|
|
4354
4664
|
}),
|
|
4355
4665
|
/**
|
|
4356
|
-
* The draft as it stands, as a package archive: its own files at its latest content, its uploaded data files, and the data files it inherits from the published version, minus any it deleted — the same layering its checkpoints and publishes use (docs/draft-data-file-upload-design.md §4.3), but built from the draft\'s current content rather than its last checkpoint, and with its own `publisher.json`. For working on the package locally. `409` `draft-
|
|
4666
|
+
* The draft as it stands, as a package archive: its own files at its latest content, its uploaded data files, and the data files it inherits from the published version, minus any it deleted — the same layering its checkpoints and publishes use (docs/draft-data-file-upload-design.md §4.3), but built from the draft\'s current content rather than its last checkpoint, and with its own `publisher.json`. For working on the package locally. `409` `draft-converting` while the draft is moving to the new store; `503` `draft-data-file-storage-unavailable` when an upload\'s object or the published archive could not be read. **Authorization**: requires read access to the draft document, and — when the draft\'s package has a published version, whose data files the zip would inherit — update access to the package, as downloading that version does (`getPackageVersionContent`). That check runs before the published archive is fetched, so a reader without it never causes that read.
|
|
4357
4667
|
* @summary Download a draft package as a zip
|
|
4358
4668
|
* @param {string} organizationName The unique identifier of the organization
|
|
4359
4669
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
@@ -4390,13 +4700,13 @@ const DraftsApiAxiosParamCreator = function (configuration) {
|
|
|
4390
4700
|
};
|
|
4391
4701
|
}),
|
|
4392
4702
|
/**
|
|
4393
|
-
* One document\'s content
|
|
4703
|
+
* One document\'s content. `409` `draft-converting` while the draft is moving to the new store. Refuses with `413` (`draft-file-unreadable`) when the document is not readable as UTF-8 text under 1MB. That is a permanent refusal about the file\'s shape, not a transient failure: the same refusal stops a publish, so retrying achieves nothing until the file is removed or replaced. **`ref=publication`** reads the document as it is in the version the draft\'s `changeSincePublication` markers compare against. The baseline is resolved server-side, never taken from the caller: the stored archive of the draft\'s last published version, or — for one never published — of the version it was opened on. The answers, each distinct: - `200`: the file\'s content in that baseline. - `403`: the caller can read the draft but not the package whose stored archive is the baseline. Workspace access does not imply environment access, so this read also takes `can_read_package` on it. - `404` `draft-file-not-in-publication`: the baseline exists and does not hold this file. There is nothing to restore from it. - `409` `draft-publication-baseline-missing`: there is no baseline to read — a draft never published and opened on nothing, a publication recorded before baselines were, a published version with no stored archive, one whose archive is corrupt, or one that no longer holds what its publish recorded. Permanent until the draft publishes again. - `413` `draft-file-unreadable`: the baseline\'s copy is not UTF-8 text under 1MB. - `503` `draft-publication-unreadable`: the baseline exists but could not be read right now. Retryable. The content is the published archive\'s bytes decoded as UTF-8, so its SHA-256 is the hash the markers were computed from. A published file a draft cannot hold (binary, or 1 MiB and over) is inherited by the draft rather than held, so it is not in the baseline and answers `404`. **Authorization**: requires read access to the draft document.
|
|
4394
4704
|
* @summary Read one of a draft\'s documents
|
|
4395
4705
|
* @param {string} organizationName The unique identifier of the organization
|
|
4396
4706
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
4397
4707
|
* @param {string} draftId The draft package identifier
|
|
4398
4708
|
* @param {string} documentPath The document\'s path relative to the draft root
|
|
4399
|
-
* @param {string} [ref]
|
|
4709
|
+
* @param {string} [ref] The literal `publication` reads the file as it is in the draft\'s publication baseline — see the operation\'s description. It is matched exactly (lower case). Any other value is ignored: a draft keeps no commits to read at.
|
|
4400
4710
|
* @param {*} [options] Override http request option.
|
|
4401
4711
|
* @throws {RequiredError}
|
|
4402
4712
|
*/
|
|
@@ -4435,7 +4745,7 @@ const DraftsApiAxiosParamCreator = function (configuration) {
|
|
|
4435
4745
|
};
|
|
4436
4746
|
}),
|
|
4437
4747
|
/**
|
|
4438
|
-
* The bytes of a file as the draft carries it: a text document\'s content, a data file\'s own upload, or otherwise the data file it inherits from the package\'s published version. So a download works the same on any file of the draft. A path the draft deleted answers `404`; `409` `draft-
|
|
4748
|
+
* The bytes of a file as the draft carries it: a text document\'s content, a data file\'s own upload, or otherwise the data file it inherits from the package\'s published version. So a download works the same on any file of the draft. A path the draft deleted answers `404`; `409` `draft-converting` while the draft is moving to the new store. A text document that cannot be served as text (1 MiB or more) answers `413` `draft-file-unreadable`, as `getDraftDocument` does. An uploaded data file never takes this path. **Authorization**: requires read access to the draft document. A data file the draft inherits also requires update access to the package, as downloading the published version does (`getPackageVersionContent`); the draft\'s own uploads do not. That check runs before the published archive is fetched, so a reader without it gets `403` for any path the draft itself does not hold, a missing one included.
|
|
4439
4749
|
* @summary Download one of a draft\'s files
|
|
4440
4750
|
* @param {string} organizationName The unique identifier of the organization
|
|
4441
4751
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
@@ -4476,22 +4786,22 @@ const DraftsApiAxiosParamCreator = function (configuration) {
|
|
|
4476
4786
|
};
|
|
4477
4787
|
}),
|
|
4478
4788
|
/**
|
|
4479
|
-
*
|
|
4480
|
-
* @summary
|
|
4789
|
+
* The gates `writeDraftPublication` applies, read without acting on any of them: no submit, no build request, no merge and no listing of the package on GitHub, so it costs database reads only. `ready` false comes with the `reason` the publish would answer now. `ready` true means every gate this read covers passed; the publish\'s own listing of the package at the pull request\'s head can still refuse it. `ready` says nothing about the caller: a reader who may not publish reads it too, and the publish refuses them `403`. A draft that is owed a push or a build reads `sending` or `building` here, and only `writeDraftPublication` starts them. A `blocked` pull request reads `pull-request-blocked` here even when the publish would re-post its check and merge. `warnings` are about what the publish would ship, not whether it can: today, that a first publish exposes every source (see `DraftPublicationWarning`). They are read only when `ready` is true, and are empty otherwise. **Authorization**: requires read access to the draft document. `409` `draft-converting` means the draft is moving to the new store; retry.
|
|
4790
|
+
* @summary Whether the draft can be published now
|
|
4481
4791
|
* @param {string} organizationName The unique identifier of the organization
|
|
4482
4792
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
4483
4793
|
* @param {string} draftId The draft package identifier
|
|
4484
4794
|
* @param {*} [options] Override http request option.
|
|
4485
4795
|
* @throws {RequiredError}
|
|
4486
4796
|
*/
|
|
4487
|
-
|
|
4797
|
+
getDraftPublication: (organizationName_1, workspaceName_1, draftId_1, ...args_1) => __awaiter(this, [organizationName_1, workspaceName_1, draftId_1, ...args_1], void 0, function* (organizationName, workspaceName, draftId, options = {}) {
|
|
4488
4798
|
// verify required parameter 'organizationName' is not null or undefined
|
|
4489
|
-
(0, common_1.assertParamExists)('
|
|
4799
|
+
(0, common_1.assertParamExists)('getDraftPublication', 'organizationName', organizationName);
|
|
4490
4800
|
// verify required parameter 'workspaceName' is not null or undefined
|
|
4491
|
-
(0, common_1.assertParamExists)('
|
|
4801
|
+
(0, common_1.assertParamExists)('getDraftPublication', 'workspaceName', workspaceName);
|
|
4492
4802
|
// verify required parameter 'draftId' is not null or undefined
|
|
4493
|
-
(0, common_1.assertParamExists)('
|
|
4494
|
-
const localVarPath = `/organizations/{organizationName}/workspaces/{workspaceName}/drafts/{draftId}/
|
|
4803
|
+
(0, common_1.assertParamExists)('getDraftPublication', 'draftId', draftId);
|
|
4804
|
+
const localVarPath = `/organizations/{organizationName}/workspaces/{workspaceName}/drafts/{draftId}/publication`
|
|
4495
4805
|
.replace(`{${"organizationName"}}`, encodeURIComponent(String(organizationName)))
|
|
4496
4806
|
.replace(`{${"workspaceName"}}`, encodeURIComponent(String(workspaceName)))
|
|
4497
4807
|
.replace(`{${"draftId"}}`, encodeURIComponent(String(draftId)));
|
|
@@ -4513,24 +4823,22 @@ const DraftsApiAxiosParamCreator = function (configuration) {
|
|
|
4513
4823
|
};
|
|
4514
4824
|
}),
|
|
4515
4825
|
/**
|
|
4516
|
-
*
|
|
4517
|
-
* @summary
|
|
4826
|
+
* Served from controlplane\'s record of the draft and nothing else: no GitHub read and no side effect, so polling it costs controlplane\'s own reads only. Always answers `200` for a draft the caller can read. `state` is `none` when the draft has no pull request, and a draft whose environment does not review on GitHub answers `state: none`, `reviewState: notSubmitted`, so a polling client treats absence as an answer, not an error. `reviewState` says where the review stands and `nextAttemptAt` when it is next worked on; `unsubmittedChanges` says whether the draft has edits since its last push. Poll while `reviewState` is `sending` or a pull request is open, and stop otherwise. `mergeable` is GitHub\'s own verdict as last recorded and is `null` while GitHub is still computing it. Treat `null` as \"not yet known\" and re-read; never as \"not mergeable\". **Authorization**: requires read access to the draft document. `409` `draft-converting` means the draft is moving to the new store; retry.
|
|
4827
|
+
* @summary The draft\'s pull request and review state
|
|
4518
4828
|
* @param {string} organizationName The unique identifier of the organization
|
|
4519
4829
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
4520
4830
|
* @param {string} draftId The draft package identifier
|
|
4521
|
-
* @param {number} [limit]
|
|
4522
|
-
* @param {number} [offset]
|
|
4523
4831
|
* @param {*} [options] Override http request option.
|
|
4524
4832
|
* @throws {RequiredError}
|
|
4525
4833
|
*/
|
|
4526
|
-
|
|
4834
|
+
getDraftPullRequest: (organizationName_1, workspaceName_1, draftId_1, ...args_1) => __awaiter(this, [organizationName_1, workspaceName_1, draftId_1, ...args_1], void 0, function* (organizationName, workspaceName, draftId, options = {}) {
|
|
4527
4835
|
// verify required parameter 'organizationName' is not null or undefined
|
|
4528
|
-
(0, common_1.assertParamExists)('
|
|
4836
|
+
(0, common_1.assertParamExists)('getDraftPullRequest', 'organizationName', organizationName);
|
|
4529
4837
|
// verify required parameter 'workspaceName' is not null or undefined
|
|
4530
|
-
(0, common_1.assertParamExists)('
|
|
4838
|
+
(0, common_1.assertParamExists)('getDraftPullRequest', 'workspaceName', workspaceName);
|
|
4531
4839
|
// verify required parameter 'draftId' is not null or undefined
|
|
4532
|
-
(0, common_1.assertParamExists)('
|
|
4533
|
-
const localVarPath = `/organizations/{organizationName}/workspaces/{workspaceName}/drafts/{draftId}/
|
|
4840
|
+
(0, common_1.assertParamExists)('getDraftPullRequest', 'draftId', draftId);
|
|
4841
|
+
const localVarPath = `/organizations/{organizationName}/workspaces/{workspaceName}/drafts/{draftId}/pull-request`
|
|
4534
4842
|
.replace(`{${"organizationName"}}`, encodeURIComponent(String(organizationName)))
|
|
4535
4843
|
.replace(`{${"workspaceName"}}`, encodeURIComponent(String(workspaceName)))
|
|
4536
4844
|
.replace(`{${"draftId"}}`, encodeURIComponent(String(draftId)));
|
|
@@ -4543,12 +4851,6 @@ const DraftsApiAxiosParamCreator = function (configuration) {
|
|
|
4543
4851
|
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
|
|
4544
4852
|
const localVarHeaderParameter = {};
|
|
4545
4853
|
const localVarQueryParameter = {};
|
|
4546
|
-
if (limit !== undefined) {
|
|
4547
|
-
localVarQueryParameter['limit'] = limit;
|
|
4548
|
-
}
|
|
4549
|
-
if (offset !== undefined) {
|
|
4550
|
-
localVarQueryParameter['offset'] = offset;
|
|
4551
|
-
}
|
|
4552
4854
|
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
4553
4855
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
4554
4856
|
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
@@ -4558,20 +4860,20 @@ const DraftsApiAxiosParamCreator = function (configuration) {
|
|
|
4558
4860
|
};
|
|
4559
4861
|
}),
|
|
4560
4862
|
/**
|
|
4561
|
-
* The draft\'s files
|
|
4863
|
+
* The draft\'s files: the documents under `path` to `depth`, held as workspace documents. `409` `draft-converting` while the draft is moving to the new store. **Listed against the draft\'s last publication.** A draft is a package in draft mode, so a listing reports each document\'s `changeSincePublication` — added, modified, or unchanged — and includes the files the publication shipped that the draft has since deleted, as `removed` entries. A deletion is an edit like any other, and a page rendering the draft\'s files needs all of them from one read. A draft never published is measured against the published version it was opened on (the package\'s latest version when none was recorded), and only for a caller with read access to that package: the markers would otherwise name the package\'s published files, and their absence say which of them the draft leaves unchanged, to a reader who cannot read it. For such a caller the draft\'s own files are listed without markers, with `Changes-Unavailable`. A baseline that exists but cannot be measured or read (an archive that failed to download) is `Changes-Unavailable` too, never \"nothing to compare against\". A never-published draft of a package with no published version carries no markers and no removed entries. When the comparison cannot be made (a transient failure, or a publication recorded before its baseline existed), the listing is still returned, without markers, and says so with the `Changes-Unavailable` header rather than failing. Content is omitted from the listing unless `withContent=true`; otherwise read a document to get it. **Authorization**: requires read access to the draft document.
|
|
4562
4864
|
* @summary List a draft\'s documents
|
|
4563
4865
|
* @param {string} organizationName The unique identifier of the organization
|
|
4564
4866
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
4565
4867
|
* @param {string} draftId The draft package identifier
|
|
4566
4868
|
* @param {string} [path] Restrict the listing to this subtree, relative to the draft root.
|
|
4567
|
-
* @param {number} [depth] `1` lists only the
|
|
4568
|
-
* @param {
|
|
4869
|
+
* @param {number} [depth] `1` lists only the files directly under `path`, as a file browser would. Omitted returns every file in the subtree, which is what a section listing wants. A draft\'s paths are flat, so neither returns directory entries.
|
|
4870
|
+
* @param {boolean} [withContent] Carry each document\'s content on its entry, so a caller that wants the whole draft makes one request rather than one per file. A document\'s text comes as `content`. A data file the draft holds beside its documents (`kind` `data`) carries neither, as in any listing. The listing is whole-draft or refused: past the same file-count and byte limits a checkpoint collects under, it answers `413` `draft-listing-too-large` rather than a partial one, and `limit` and `offset` do not lower what is read, only what is returned. Read the files one at a time instead.
|
|
4569
4871
|
* @param {number} [limit] Maximum number of items to return. Use -1 or omit to return all results.
|
|
4570
4872
|
* @param {number} [offset] Number of items to skip before starting to return results
|
|
4571
4873
|
* @param {*} [options] Override http request option.
|
|
4572
4874
|
* @throws {RequiredError}
|
|
4573
4875
|
*/
|
|
4574
|
-
listDraftDocuments: (organizationName_1, workspaceName_1, draftId_1, path_1, depth_1,
|
|
4876
|
+
listDraftDocuments: (organizationName_1, workspaceName_1, draftId_1, path_1, depth_1, withContent_1, limit_1, offset_1, ...args_1) => __awaiter(this, [organizationName_1, workspaceName_1, draftId_1, path_1, depth_1, withContent_1, limit_1, offset_1, ...args_1], void 0, function* (organizationName, workspaceName, draftId, path, depth, withContent, limit, offset, options = {}) {
|
|
4575
4877
|
// verify required parameter 'organizationName' is not null or undefined
|
|
4576
4878
|
(0, common_1.assertParamExists)('listDraftDocuments', 'organizationName', organizationName);
|
|
4577
4879
|
// verify required parameter 'workspaceName' is not null or undefined
|
|
@@ -4597,8 +4899,8 @@ const DraftsApiAxiosParamCreator = function (configuration) {
|
|
|
4597
4899
|
if (depth !== undefined) {
|
|
4598
4900
|
localVarQueryParameter['depth'] = depth;
|
|
4599
4901
|
}
|
|
4600
|
-
if (
|
|
4601
|
-
localVarQueryParameter['
|
|
4902
|
+
if (withContent !== undefined) {
|
|
4903
|
+
localVarQueryParameter['withContent'] = withContent;
|
|
4602
4904
|
}
|
|
4603
4905
|
if (limit !== undefined) {
|
|
4604
4906
|
localVarQueryParameter['limit'] = limit;
|
|
@@ -4660,7 +4962,7 @@ const DraftsApiAxiosParamCreator = function (configuration) {
|
|
|
4660
4962
|
};
|
|
4661
4963
|
}),
|
|
4662
4964
|
/**
|
|
4663
|
-
* Changes a draft\'s own fields. Every field is optional and an absent one is left alone. Its writers own different slices — a display name comes from a person, `publishedAs` from a publish
|
|
4965
|
+
* Changes a draft\'s own fields. Every field is optional and an absent one is left alone. Its writers own different slices — a display name comes from a person, `publishedAs` from a publish. The package name is not one of them once set: `targetPackageName` cannot change a draft\'s package (`409 draft-package-name-fixed`). A replacement would make each of them responsible for preserving the others\' fields. **A deleted or nonexistent draft answers 404 to a caller who can write its workspace**, and 403 to one who cannot, for the same reason `getDraft` does. **Authorization**: requires `can_update_document` on the draft document, and `can_create_package` on the environment it targets.
|
|
4664
4966
|
* @summary Update a draft package
|
|
4665
4967
|
* @param {string} organizationName The unique identifier of the organization
|
|
4666
4968
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
@@ -4702,86 +5004,7 @@ const DraftsApiAxiosParamCreator = function (configuration) {
|
|
|
4702
5004
|
};
|
|
4703
5005
|
}),
|
|
4704
5006
|
/**
|
|
4705
|
-
*
|
|
4706
|
-
* @summary Move the draft\'s branch
|
|
4707
|
-
* @param {string} organizationName The unique identifier of the organization
|
|
4708
|
-
* @param {string} workspaceName The unique identifier of the workspace
|
|
4709
|
-
* @param {string} draftId The draft package identifier
|
|
4710
|
-
* @param {*} [options] Override http request option.
|
|
4711
|
-
* @throws {RequiredError}
|
|
4712
|
-
*/
|
|
4713
|
-
updateDraftBranch: (organizationName_1, workspaceName_1, draftId_1, ...args_1) => __awaiter(this, [organizationName_1, workspaceName_1, draftId_1, ...args_1], void 0, function* (organizationName, workspaceName, draftId, options = {}) {
|
|
4714
|
-
// verify required parameter 'organizationName' is not null or undefined
|
|
4715
|
-
(0, common_1.assertParamExists)('updateDraftBranch', 'organizationName', organizationName);
|
|
4716
|
-
// verify required parameter 'workspaceName' is not null or undefined
|
|
4717
|
-
(0, common_1.assertParamExists)('updateDraftBranch', 'workspaceName', workspaceName);
|
|
4718
|
-
// verify required parameter 'draftId' is not null or undefined
|
|
4719
|
-
(0, common_1.assertParamExists)('updateDraftBranch', 'draftId', draftId);
|
|
4720
|
-
const localVarPath = `/organizations/{organizationName}/workspaces/{workspaceName}/drafts/{draftId}/branch`
|
|
4721
|
-
.replace(`{${"organizationName"}}`, encodeURIComponent(String(organizationName)))
|
|
4722
|
-
.replace(`{${"workspaceName"}}`, encodeURIComponent(String(workspaceName)))
|
|
4723
|
-
.replace(`{${"draftId"}}`, encodeURIComponent(String(draftId)));
|
|
4724
|
-
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
4725
|
-
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
4726
|
-
let baseOptions;
|
|
4727
|
-
if (configuration) {
|
|
4728
|
-
baseOptions = configuration.baseOptions;
|
|
4729
|
-
}
|
|
4730
|
-
const localVarRequestOptions = Object.assign(Object.assign({ method: 'PATCH' }, baseOptions), options);
|
|
4731
|
-
const localVarHeaderParameter = {};
|
|
4732
|
-
const localVarQueryParameter = {};
|
|
4733
|
-
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
4734
|
-
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
4735
|
-
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
4736
|
-
return {
|
|
4737
|
-
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
4738
|
-
options: localVarRequestOptions,
|
|
4739
|
-
};
|
|
4740
|
-
}),
|
|
4741
|
-
/**
|
|
4742
|
-
* Advances the pull request\'s state. Merging is a transition of the pull request, not an action filed under it — `PATCH` on the resource rather than a `/merge` verb in the path, which is what every other resource in this API does. Proxies the git-gateway\'s `mergeDraftPullRequest`. Squash-merges into the base branch and returns the merge commit SHA, which becomes the published version\'s `git_commit_sha` — the first provenance anchor reachable from the base branch. `expectedHeadSha` is required and pins what is merged to what the caller read, so a checkpoint that landed after the review cannot be merged silently. Read it from `getDraftPullRequest` and pass it straight back. A `409` means the head moved, the pull request is gone, `publisher.json` names a version that already exists, or the package is known not to compile at this head (`draft-compile-failed`); a `405` means GitHub says the branch is not mergeable — a conflict, or a required review that has not passed. The compile check is READ here, never run — it is started by `getDraftPullRequest` and can take minutes, so this call adds no compile latency. The consequence is that it refuses only a `failing` verdict already computed for this exact `expectedHeadSha`. `pending`, `unverified`, and a verdict this replica has not computed at all ALL allow the merge. Treat it as a guard against merging a known-broken package, not as a guarantee that a merged package compiled. **Authorization**: Requires the environment\'s `can_update_project` (enforced by the gateway) — a strictly higher bar than opening the pull request, because a merge changes what serves for the whole environment. **Git-backed drafts only.** A document-store draft answers `400` `draft-not-git-backed` before any call to the gateway: it has no branch, commits or pull request, so the operation does not apply to it. `409` `draft-provisioning` means the draft\'s branch is still being cut; retry.
|
|
4743
|
-
* @summary Merge the draft\'s pull request
|
|
4744
|
-
* @param {string} organizationName The unique identifier of the organization
|
|
4745
|
-
* @param {string} workspaceName The unique identifier of the workspace
|
|
4746
|
-
* @param {string} draftId The draft package identifier
|
|
4747
|
-
* @param {MergeDraftPullRequest} mergeDraftPullRequest
|
|
4748
|
-
* @param {*} [options] Override http request option.
|
|
4749
|
-
* @throws {RequiredError}
|
|
4750
|
-
*/
|
|
4751
|
-
updateDraftPullRequest: (organizationName_1, workspaceName_1, draftId_1, mergeDraftPullRequest_1, ...args_1) => __awaiter(this, [organizationName_1, workspaceName_1, draftId_1, mergeDraftPullRequest_1, ...args_1], void 0, function* (organizationName, workspaceName, draftId, mergeDraftPullRequest, options = {}) {
|
|
4752
|
-
// verify required parameter 'organizationName' is not null or undefined
|
|
4753
|
-
(0, common_1.assertParamExists)('updateDraftPullRequest', 'organizationName', organizationName);
|
|
4754
|
-
// verify required parameter 'workspaceName' is not null or undefined
|
|
4755
|
-
(0, common_1.assertParamExists)('updateDraftPullRequest', 'workspaceName', workspaceName);
|
|
4756
|
-
// verify required parameter 'draftId' is not null or undefined
|
|
4757
|
-
(0, common_1.assertParamExists)('updateDraftPullRequest', 'draftId', draftId);
|
|
4758
|
-
// verify required parameter 'mergeDraftPullRequest' is not null or undefined
|
|
4759
|
-
(0, common_1.assertParamExists)('updateDraftPullRequest', 'mergeDraftPullRequest', mergeDraftPullRequest);
|
|
4760
|
-
const localVarPath = `/organizations/{organizationName}/workspaces/{workspaceName}/drafts/{draftId}/pull-request`
|
|
4761
|
-
.replace(`{${"organizationName"}}`, encodeURIComponent(String(organizationName)))
|
|
4762
|
-
.replace(`{${"workspaceName"}}`, encodeURIComponent(String(workspaceName)))
|
|
4763
|
-
.replace(`{${"draftId"}}`, encodeURIComponent(String(draftId)));
|
|
4764
|
-
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
4765
|
-
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
4766
|
-
let baseOptions;
|
|
4767
|
-
if (configuration) {
|
|
4768
|
-
baseOptions = configuration.baseOptions;
|
|
4769
|
-
}
|
|
4770
|
-
const localVarRequestOptions = Object.assign(Object.assign({ method: 'PATCH' }, baseOptions), options);
|
|
4771
|
-
const localVarHeaderParameter = {};
|
|
4772
|
-
const localVarQueryParameter = {};
|
|
4773
|
-
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
4774
|
-
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
4775
|
-
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
4776
|
-
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
4777
|
-
localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(mergeDraftPullRequest, localVarRequestOptions, configuration);
|
|
4778
|
-
return {
|
|
4779
|
-
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
4780
|
-
options: localVarRequestOptions,
|
|
4781
|
-
};
|
|
4782
|
-
}),
|
|
4783
|
-
/**
|
|
4784
|
-
* Asks for a checkpoint of the draft\'s current content. A `POST` to the collection rather than a `PUT` on a singleton: this starts a job and answers `202`, and the checkpoints it appends to are a series (`1.0.N`), not one value being set. Sending it twice is still safe — see the coalescing note below — but that is a property of the nudge, not a claim that the request is idempotent in the `PUT` sense. The current checkpoint\'s status is a separate read: `GET` on `../checkpoint`. Records that the draft\'s current content should be published as the next checkpoint (`1.0.N`) of its environment draft package — an ordinary published package named `draft-{draftKey}` in the draft\'s target environment, served by the Publisher exactly like any other package there (docs/workspace-architecture-design.md §4). Always answers `202` with the current status: this call is a nudge, not the publish. The reconciler resolves the draft\'s current content itself when it collects the work — the git branch head for a git-backed draft, the doc-store tree otherwise — which is why the request carries no ref and no content: a caller-supplied ref would be both spoofable and racy against the agent\'s own commits, and a nudge that arrives late still publishes what the draft says NOW. Nudges coalesce: any number recorded between publishes produce one checkpoint of the newest content, and a nudge whose content is identical to the latest published checkpoint publishes nothing. That is this operation\'s own contract, not something the verb supplies — a `POST` to a collection is not idempotent, so a retry after a lost response would otherwise mint a second checkpoint of content that has not changed. A failed publish (the draft does not compile, most commonly) records `failed` with the compiler\'s message and leaves the previous checkpoint serving; the next nudge retries with the then-current content. **This is also how a reaped draft package comes back.** A draft whose package has been idle-reaped (24 hours without a checkpoint request) keeps its row as a witness, and a nudge clears the reap marker and re-queues the publish — the same row update that publishes anything else, so no separate verb is needed. `GET` on this path reports `resurrectable` so a client knows to send one. A merge reap comes back the same way, but a client with the draft page open asks automatically: the app\'s own `POST` rebuilds the package unless the reap\'s own tick wins the race first — at `1.0.0` after the reap, or cancelling the reap and republishing into it. A package a resurrect brought back is a live draft again from there, so the ordinary idle sweep (24 hours since the *last checkpoint request*, not tied to a viewer leaving) reclaims it if nobody keeps asking. Either way a draft that outlives its merge (its close was skipped or its publish failed) can be nudged again, and any later nudge rebuilds it the same way: at `1.0.0` once the reap is deleting the package, or as the next `1.0.N` when the nudge lands before the reap starts and keeps it. Only a deleted draft\'s reap is terminal — its content has no home left — and a nudge for one is refused rather than honoured. **Authorization**: requires `can_update_document` on the draft document AND the target environment\'s `can_create_package` — the same two bars every content-writing draft operation already takes, so anyone modeling in the draft holds both.
|
|
5007
|
+
* Asks for a checkpoint of the draft\'s current content. A `POST` to the collection rather than a `PUT` on a singleton: this starts a job and answers `202`, and the checkpoints it appends to are a series (`1.0.N`), not one value being set. Sending it twice is still safe — see the coalescing note below — but that is a property of the nudge, not a claim that the request is idempotent in the `PUT` sense. The current checkpoint\'s status is a separate read: `GET` on `../checkpoint`. Records that the draft\'s current content should be published as the next checkpoint (`1.0.N`) of its environment draft package — an ordinary published package named `draft-{draftKey}` in the draft\'s target environment, served by the Publisher exactly like any other package there (docs/workspace-architecture-design.md §4). Answers `202` with the current status: this call is a nudge, not the publish. A draft that is moving to the new store answers `409` `draft-converting` and records nothing; retry after a moment. The reconciler resolves the draft\'s current content itself when it collects the work — the draft\'s documents — which is why the request carries no ref and no content: a caller-supplied ref would be both spoofable and racy against the agent\'s own commits, and a nudge that arrives late still publishes what the draft says NOW. Nudges coalesce: any number recorded between publishes produce one checkpoint of the newest content, and a nudge whose content is identical to the latest published checkpoint publishes nothing. That is this operation\'s own contract, not something the verb supplies — a `POST` to a collection is not idempotent, so a retry after a lost response would otherwise mint a second checkpoint of content that has not changed. A failed publish (the draft does not compile, most commonly) records `failed` with the compiler\'s message and leaves the previous checkpoint serving; the next nudge retries with the then-current content. **This is also how a reaped draft package comes back.** A draft whose package has been idle-reaped (24 hours without a checkpoint request) keeps its row as a witness, and a nudge clears the reap marker and re-queues the publish — the same row update that publishes anything else, so no separate verb is needed. `GET` on this path reports `resurrectable` so a client knows to send one. A merge reap comes back the same way, but a client with the draft page open asks automatically: the app\'s own `POST` rebuilds the package unless the reap\'s own tick wins the race first — at `1.0.0` after the reap, or cancelling the reap and republishing into it. A package a resurrect brought back is a live draft again from there, so the ordinary idle sweep (24 hours since the *last checkpoint request*, not tied to a viewer leaving) reclaims it if nobody keeps asking. Either way a draft that outlives its merge (its close was skipped or its publish failed) can be nudged again, and any later nudge rebuilds it the same way: at `1.0.0` once the reap is deleting the package, or as the next `1.0.N` when the nudge lands before the reap starts and keeps it. Only a deleted draft\'s reap is terminal — its content has no home left — and a nudge for one is refused rather than honoured. **Authorization**: requires `can_update_document` on the draft document AND the target environment\'s `can_create_package` — the same two bars every content-writing draft operation already takes, so anyone modeling in the draft holds both.
|
|
4785
5008
|
* @summary Set the draft\'s checkpoint to its current content
|
|
4786
5009
|
* @param {string} organizationName The unique identifier of the organization
|
|
4787
5010
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
@@ -4818,7 +5041,7 @@ const DraftsApiAxiosParamCreator = function (configuration) {
|
|
|
4818
5041
|
};
|
|
4819
5042
|
}),
|
|
4820
5043
|
/**
|
|
4821
|
-
* Creates or replaces a document
|
|
5044
|
+
* Creates or replaces a document. `PUT` rather than `POST` because the path is the identifier and the caller chooses it — there is no server-assigned id for a file, so a collection `POST` would have nothing to assign. **The precondition is per file.** `expectedSha` (the `sha` the writer read) replaces the document only if it still holds that version, and `createOnly` creates it only if no document is there. Of two writers holding the same `sha` exactly one wins and the other gets `409` `draft-document-stale`, except that a resent write that already landed is answered as applied (below). They are mutually exclusive (`400` when both are sent). With neither, the write is last-writer-wins, as a write through the documents API has always been. A retry whose change is already in place (the content is current, or the file to delete is gone) is answered as applied, not as a conflict, so a lost response can be resent. A deletion of a gone file with an `expectedSha` counts as applied only when no write in the same set is still to land: a move whose old path was deleted or moved by someone else is stale (`\"\"`), not a second copy. The server requests the draft\'s checkpoint after the write commits, so a client does not request one itself. **Authorization** — `can_update_document` on the draft document, **and** `can_create_package` on the draft\'s target environment. The second is not redundant: `can_update_document` on a draft is satisfied by bare workspace membership, while a file written here reaches the environment on the draft author\'s next checkpoint, carrying the checkpointer\'s bar rather than the writer\'s. The environment comes from the draft\'s own manifest and is never a request field; a draft that names none is refused, since it could not be published either. Refuses with `400` (`draft-notebook-read-only`) when a document path ends `.malloynb` and the write would change it or add a new one to a draft that already has files. A `.malloynb` notebook in a draft is read-only: convert it to a `.malloy` notebook (the same name with `.malloy`, beside it) and edit that, or delete it. Writing identical content, or seeding an empty draft, is allowed, and so is a deletion.
|
|
4822
5045
|
* @summary Write one of a draft\'s documents
|
|
4823
5046
|
* @param {string} organizationName The unique identifier of the organization
|
|
4824
5047
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
@@ -4864,7 +5087,7 @@ const DraftsApiAxiosParamCreator = function (configuration) {
|
|
|
4864
5087
|
};
|
|
4865
5088
|
}),
|
|
4866
5089
|
/**
|
|
4867
|
-
* Writes a data file\'s bytes — a Parquet, CSV, JSON or Excel (`.xlsx`) file a model reads — into the draft, creating it or replacing the draft\'s earlier upload at the same path. A data file lives beside the draft\'s text documents
|
|
5090
|
+
* Writes a data file\'s bytes — a Parquet, CSV, JSON or Excel (`.xlsx`) file a model reads — into the draft, creating it or replacing the draft\'s earlier upload at the same path. A data file lives beside the draft\'s text documents (docs/draft-data-file-upload-design.md). The body is the file itself, `application/octet-stream`, with `Content-Length` set; a chunked body without one is refused before it is read. Uploading over a data file the package\'s published version serves replaces it in the draft: the draft\'s checkpoint and its next publish carry the upload, and the published version keeps its copy until then. A path the draft holds as a small text document (a CSV the published version shipped, which a draft holds as text) moves: the upload is stored and the text copy removed, so the path lives in one place. `DELETE` on the document path deletes a data file, or — for one the draft inherits — records that the draft no longer carries it; `DELETE` on its `change` restores it to the published copy. Refusals, each with its `code`: - `400` `draft-data-file-body-unreadable`: the request body ended or failed before it was read through (a dropped connection, a truncating proxy). Nothing was written; send it again. - `400` `draft-data-file-invalid`: the path holds a character outside Malloy\'s unquoted DuckDB path set `[A-Za-z0-9._~:/?#@!$&*+,=%-]`, such as a space, a bracket, a quote or an accented letter (a model can\'t name such a file in `duckdb.table(\'…\')`; the message names the path with accents dropped and each run of any other such character replaced by `_`, which the app uploads to instead), or ends in `.txt` (DuckDB has no reader for that extension; rename it `.csv` or `.tsv`), or ends in any other extension outside the formats a model reads as data: `.csv`, `.tsv`, `.parquet`, `.xlsx`, `.json`, `.jsonl`, `.ndjson`, and `.csv.gz`, `.tsv.gz`, `.json.gz`, `.jsonl.gz`, `.ndjson.gz` (an `.xls` is told to save as `.xlsx`). Decided by the path, before the body is read. - `409` `draft-content-not-data`: the path names a file the package treats as text (`publisher.json`, `.malloy`, `.malloynb`, `.md`, `.html`, or a `.json` at the package root). Those are written through `writeDraftDocument`. - `411` `draft-data-file-length-required`: the request declared no `Content-Length`. - `413` `draft-data-file-too-large`: over 32 MiB. - `413` `draft-data-files-over-quota`: the draft would hold more than 64 data files or 128 MiB of them. - `422` `draft-data-file-invalid`: a `.parquet` or `.xlsx` path whose bytes are not that format, or an empty body. - `429` `draft-data-file-rate-limited`: more than 30 uploads into this draft in the last minute, or more uploads in flight on the serving replica than it spools at once (8). Both are counted per replica. Retry after a moment. **Authorization** — the same pair `writeDraftDocument` takes: `can_update_document` on the draft document, and `can_create_package` on the draft\'s target environment.
|
|
4868
5091
|
* @summary Upload a data file into a draft
|
|
4869
5092
|
* @param {string} organizationName The unique identifier of the organization
|
|
4870
5093
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
@@ -4910,7 +5133,7 @@ const DraftsApiAxiosParamCreator = function (configuration) {
|
|
|
4910
5133
|
};
|
|
4911
5134
|
}),
|
|
4912
5135
|
/**
|
|
4913
|
-
* Writes a set of documents together
|
|
5136
|
+
* Writes a set of documents together, in one transaction: a seed, or a multi-file edit that must not be seen half applied. Ordinary editing uses the per-document `PUT`. This is for the cases that are atomic by nature. Each member may carry its own `expectedSha` or `createOnly` (see `writeDraftDocument`), so a move is one set: `createOnly` on the new path and a deletion with `expectedSha` on the old one. If any member\'s precondition fails, none is written and the `409` `draft-document-stale` names every conflicting path; a set already partly in place (a resent one) commits only what remains. **Authorization**: as `writeDraftDocument`. **Resolving conflicts.** A member carrying the `conflictSha` that `getDraftConflicts` gave its path resolves that one conflict: the path leaves the conflict list and its base moves to the incoming side, so the next sync does not raise it again. With no content and no `deleted` the member keeps the draft\'s file as it is (an uploaded data file too), and only the conflict is cleared. Members without a `conflictSha` write as usual, and a write may resolve any subset of the list. A `conflictSha` that no longer names the path\'s conflict (the incoming side moved, or it was resolved) is `409` `draft-conflict-changed`, and nothing is written. Once none remain, the draft moves on to what came in, and a submitted draft\'s push starts. A resolution never fails on an archive: when the published version the last conflicts came from cannot be read, the draft\'s next sync moves its base instead. **Fenced by a work item.** A caller executing a work item (one claimed through the controlplane\'s private work-item API) sends its claim in `Work-Item-Claim` (`{id}@{generation}`). The claim is checked first thing in the transaction that writes the document rows, and refused with `409` `draft-write-fenced` -- writing nothing -- when it is no longer the live one: released, cancelled, or swept after its holder stopped heartbeating. A malformed header is a `400`. Without the header the write is unfenced, as before. Only this operation honors the header. Refuses with `400` (`draft-notebook-read-only`) when a document path ends `.malloynb` and the write would change it or add a new one to a draft that already has files. A `.malloynb` notebook in a draft is read-only: convert it to a `.malloy` notebook (the same name with `.malloy`, beside it) and edit that, or delete it. Writing identical content, or seeding an empty draft, is allowed, and so is a deletion.
|
|
4914
5137
|
* @summary Write several of a draft\'s documents as one change
|
|
4915
5138
|
* @param {string} organizationName The unique identifier of the organization
|
|
4916
5139
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
@@ -4956,15 +5179,16 @@ const DraftsApiAxiosParamCreator = function (configuration) {
|
|
|
4956
5179
|
};
|
|
4957
5180
|
}),
|
|
4958
5181
|
/**
|
|
4959
|
-
*
|
|
4960
|
-
* @summary Publish
|
|
5182
|
+
* The one way a draft ships, whether or not its environment reviews drafts on GitHub. Either the draft\'s package is published and this answers `200` with it, or nothing is published and it answers `409` `draft-not-ready` with `details.reason` saying what it waits on. Call it again once that clears: every step is safe to repeat, and a repeat after a publish answers with the version already published. `getDraftPublication` reads the same gates without acting on them. **A draft whose environment does not review on GitHub** is published from its own files, in this order: 1. `conflicts`: the draft has unresolved conflicts (`details.conflictCount`). 2. `stale`: the package has a newer version than the one the draft is synced to; the background sync brings it in. 3. `building` / `build-failed`: the draft\'s latest content has no passing build from the last hour. A missing, pending or stale build is requested here and answers `building`; a failing one answers `build-failed`, with the compiler\'s message. 4. The publish, `createOrUpdatePackage` naming this draft. The body\'s `description` is written into the published `publisher.json`. A package that moved under the draft while it published answers `stale`. **A draft whose environment reviews on GitHub** merges its pull request and publishes the merge commit: 1. A draft whose pull request merged, and which has not changed since, goes straight to the publish (8). One edited after its merge is a new pull request. While a rebuild of a merged draft is pending this answers `building`: the build says whether it holds an edit. A rebuild that failed on the merged content still publishes the merge. One whose content cannot be compared answers `build-failed` when it failed to compile, and `building` when it failed on Credible\'s side, which this call asks to rebuild. 2. A push GitHub refused for good answers `push-refused`, with the reason in `details.pushError`: `data_files_only`, `no_changes`, `content_refused`, `review_outside_package`, `repository_too_large` or `push_refused`, until the draft\'s content changes, which sends it again (`repository_too_large` only fails again: see `push-refused` below). Otherwise a push is owed when the draft has never been sent, has changed since its last push, or the body\'s `title` / `description` differ from the pull request\'s; this call submits it. 3. `conflicts` (the draft\'s own, `details.conflictCount`) and `stale` (as above). 4. `sending` until the owed push lands and the pull request is open at it. 5. The build at the pull request\'s head must be a pass from the last hour. Otherwise this call asks for one, which posts the head\'s check run once it settles, and answers `building`, or `build-failed` for a failing one. 6. GitHub\'s mergeable state, as last recorded: `dirty` answers `pull-request-conflicts` (the draft\'s own conflicts are step 3\'s `conflicts`, so this one is resolved on GitHub), `draft` is read once more, as a press may follow a pull request marked ready, and answers `pull-request-draft` if it still is (or if GitHub cannot be read), and a state GitHub has not computed is read once more and otherwise answers `sending`. `blocked` with a passing build re-posts the head\'s passing check run, since a check run left from an earlier answer can be what blocks it, and goes on to the merge. `behind` alone does not refuse: the merge itself refuses a base branch that changed the package. 7. The package at the head is listed once and refused for what a publish cannot carry: `draft-publish-unreadable-file`, `draft-publish-too-large`, or `draft-publish-manifest-missing` (no `publisher.json`). 8. The pull request is merged at that head, confined to the package and only while the base branch has not changed the package since the draft\'s base, and the merge commit is published. GitHub refusing the merge answers `pull-request-blocked` (a required review or check is outstanding), a base branch that changed the package `stale`, a head that moved `sending`, and a pull request that changes files outside the package `push-refused` with `details.pushError` `review_outside_package`: a merge here never carries them onto the base branch, so they are reconciled on GitHub. A refusal because the pull request already merged (a second Publish racing the first) publishes that merge. Until the merge\'s version exists this answers `publishing` (the webhook or the merge record holds it, or GitHub\'s merge time is not read yet); call again, which never merges twice. **A successful publish closes the draft**, as the publish of a draft always has: the draft and its branch are deleted unless it changed meanwhile, a pull request is open on its branch, the publish created the package without attaching it to the workspace (`workspaceAttached: false`), or an agent sandbox turn is live on it. The close never fails this call; `publishedVersion` names the version published, or the existing one that already carries this merge. **Authorization**: the draft\'s modeling bar (`can_create_document` on the workspace, `can_create_package` on its environment) and `can_update_package` on a package that already exists; the publish itself re-checks them. `409` `draft-converting` means the draft is moving to the new store; retry. A `400` is the publish refusing the package itself (an archive it cannot read, a name it does not accept).
|
|
5183
|
+
* @summary Publish the draft
|
|
4961
5184
|
* @param {string} organizationName The unique identifier of the organization
|
|
4962
5185
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
4963
5186
|
* @param {string} draftId The draft package identifier
|
|
5187
|
+
* @param {DraftPublicationRequest} [draftPublicationRequest]
|
|
4964
5188
|
* @param {*} [options] Override http request option.
|
|
4965
5189
|
* @throws {RequiredError}
|
|
4966
5190
|
*/
|
|
4967
|
-
writeDraftPublication: (organizationName_1, workspaceName_1, draftId_1, ...args_1) => __awaiter(this, [organizationName_1, workspaceName_1, draftId_1, ...args_1], void 0, function* (organizationName, workspaceName, draftId, options = {}) {
|
|
5191
|
+
writeDraftPublication: (organizationName_1, workspaceName_1, draftId_1, draftPublicationRequest_1, ...args_1) => __awaiter(this, [organizationName_1, workspaceName_1, draftId_1, draftPublicationRequest_1, ...args_1], void 0, function* (organizationName, workspaceName, draftId, draftPublicationRequest, options = {}) {
|
|
4968
5192
|
// verify required parameter 'organizationName' is not null or undefined
|
|
4969
5193
|
(0, common_1.assertParamExists)('writeDraftPublication', 'organizationName', organizationName);
|
|
4970
5194
|
// verify required parameter 'workspaceName' is not null or undefined
|
|
@@ -4984,46 +5208,11 @@ const DraftsApiAxiosParamCreator = function (configuration) {
|
|
|
4984
5208
|
const localVarRequestOptions = Object.assign(Object.assign({ method: 'PUT' }, baseOptions), options);
|
|
4985
5209
|
const localVarHeaderParameter = {};
|
|
4986
5210
|
const localVarQueryParameter = {};
|
|
5211
|
+
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
4987
5212
|
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
4988
5213
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
4989
5214
|
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
4990
|
-
|
|
4991
|
-
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
4992
|
-
options: localVarRequestOptions,
|
|
4993
|
-
};
|
|
4994
|
-
}),
|
|
4995
|
-
/**
|
|
4996
|
-
* Proxies the code-assist git-gateway\'s `createDraftPullRequest`, forwarding the caller\'s own bearer token exactly as the History operations do. The gateway remains the sole authorizer; this endpoint performs no authorization of its own. Idempotent — an already-open pull request for this draft comes back rather than a second one. **Not a pure proxy: this call can sync and retry on your behalf.** A draft whose package already exists on the base branch — most commonly because this draft\'s own earlier pull request already merged it — is refused `409 draft-behind-base` unless it can be shown to derive from the base branch\'s current tip. Rather than surfacing that refusal immediately, this endpoint calls `updateDraftBranch`\'s own implementation, which merges the base branch into the draft\'s branch and writes `metadata.git.package_base_sha` on the draft\'s manifest from what that sync proves, then retries the create exactly once. Only a second refusal (a real race, or a draft whose package belongs to another name entirely) reaches the caller as `409`. A `sync-conflict` or `sync-rejected` from that internal sync surfaces as its own clear refusal, naming the manual paths out (resolve on github.com, or start a fresh draft) — resolve it there, or call `updateDraftBranch` directly for the same outcome without going through this endpoint. **Authorization**: Requires the environment\'s `can_create_package` (enforced by the gateway) — proposing a change is the same authority as writing the draft. **Git-backed drafts only.** A document-store draft answers `400` `draft-not-git-backed` before any call to the gateway: it has no branch, commits or pull request, so the operation does not apply to it. `409` `draft-provisioning` means the draft\'s branch is still being cut; retry.
|
|
4997
|
-
* @summary Open a pull request for a git-backed draft
|
|
4998
|
-
* @param {string} organizationName The unique identifier of the organization
|
|
4999
|
-
* @param {string} workspaceName The unique identifier of the workspace
|
|
5000
|
-
* @param {string} draftId The draft package identifier
|
|
5001
|
-
* @param {*} [options] Override http request option.
|
|
5002
|
-
* @throws {RequiredError}
|
|
5003
|
-
*/
|
|
5004
|
-
writeDraftPullRequest: (organizationName_1, workspaceName_1, draftId_1, ...args_1) => __awaiter(this, [organizationName_1, workspaceName_1, draftId_1, ...args_1], void 0, function* (organizationName, workspaceName, draftId, options = {}) {
|
|
5005
|
-
// verify required parameter 'organizationName' is not null or undefined
|
|
5006
|
-
(0, common_1.assertParamExists)('writeDraftPullRequest', 'organizationName', organizationName);
|
|
5007
|
-
// verify required parameter 'workspaceName' is not null or undefined
|
|
5008
|
-
(0, common_1.assertParamExists)('writeDraftPullRequest', 'workspaceName', workspaceName);
|
|
5009
|
-
// verify required parameter 'draftId' is not null or undefined
|
|
5010
|
-
(0, common_1.assertParamExists)('writeDraftPullRequest', 'draftId', draftId);
|
|
5011
|
-
const localVarPath = `/organizations/{organizationName}/workspaces/{workspaceName}/drafts/{draftId}/pull-request`
|
|
5012
|
-
.replace(`{${"organizationName"}}`, encodeURIComponent(String(organizationName)))
|
|
5013
|
-
.replace(`{${"workspaceName"}}`, encodeURIComponent(String(workspaceName)))
|
|
5014
|
-
.replace(`{${"draftId"}}`, encodeURIComponent(String(draftId)));
|
|
5015
|
-
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
5016
|
-
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
5017
|
-
let baseOptions;
|
|
5018
|
-
if (configuration) {
|
|
5019
|
-
baseOptions = configuration.baseOptions;
|
|
5020
|
-
}
|
|
5021
|
-
const localVarRequestOptions = Object.assign(Object.assign({ method: 'PUT' }, baseOptions), options);
|
|
5022
|
-
const localVarHeaderParameter = {};
|
|
5023
|
-
const localVarQueryParameter = {};
|
|
5024
|
-
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
5025
|
-
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
5026
|
-
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
5215
|
+
localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(draftPublicationRequest, localVarRequestOptions, configuration);
|
|
5027
5216
|
return {
|
|
5028
5217
|
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
5029
5218
|
options: localVarRequestOptions,
|
|
@@ -5040,7 +5229,7 @@ const DraftsApiFp = function (configuration) {
|
|
|
5040
5229
|
const localVarAxiosParamCreator = (0, exports.DraftsApiAxiosParamCreator)(configuration);
|
|
5041
5230
|
return {
|
|
5042
5231
|
/**
|
|
5043
|
-
* Mints a draft in this workspace and returns it. **Always creates**: a package can hold any number of drafts, one per chat by default, so a second request for the same `targetPackageName` mints a second draft rather than returning the first. Callers that want an existing draft list the workspace\'s drafts and open one by id. What keeps two writers off one draft is the draft\'s work-item claim, not uniqueness here.
|
|
5232
|
+
* Mints a draft in this workspace and returns it. **Always creates**: a package can hold any number of drafts, one per chat by default, so a second request for the same `targetPackageName` mints a second draft rather than returning the first. Callers that want an existing draft list the workspace\'s drafts and open one by id. What keeps two writers off one draft is the draft\'s work-item claim, not uniqueness here. Every draft is a document-store draft, in a git-enrolled environment as in any other: the draft\'s files are workspace documents, and git is only where a pushed draft goes for review. **`seedFromPublished` returns the draft already holding a published version\'s files**, in this one call: what opening a published package for editing takes, without a chat. Its refusals all come before the draft exists, and a seed that fails afterwards removes the draft; see the field. `201` with the new draft. **Authorization**: `can_create_document` in the workspace, and on every create the target environment\'s modeling bar (`can_create_package`, modeler or admin): putting a package in draft mode, or starting a new package\'s draft, is modeling work in that environment, and in a git-enrolled one creating the branch is a write into its repository. It is taken before anything is created; refused, it answers `403 draft-modeling-permission-required`.
|
|
5044
5233
|
* @summary Create a draft package
|
|
5045
5234
|
* @param {string} organizationName The unique identifier of the organization
|
|
5046
5235
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
@@ -5058,7 +5247,7 @@ const DraftsApiFp = function (configuration) {
|
|
|
5058
5247
|
});
|
|
5059
5248
|
},
|
|
5060
5249
|
/**
|
|
5061
|
-
* Deletes the draft: its manifest and, for a document-store draft, its files. Its environment draft package is marked for the checkpoint reaper, so what was serving the draft is removed on the next tick. **The branch lives on.** Deleting a draft does not delete its git branch (docs/git-synced-modeling.md §7.2)
|
|
5250
|
+
* Deletes the draft: its manifest and, for a document-store draft, its files. Its environment draft package is marked for the checkpoint reaper, so what was serving the draft is removed on the next tick. **The branch usually lives on.** Deleting a draft does not delete its git branch (docs/git-synced-modeling.md §7.2), with one server-side exception: a draft that was never published and still sits at its seed commit has its branch deleted first, best-effort, so a draft minted from a misread intent leaves nothing behind. The delete is pinned to the seed commit, so a commit that landed since keeps the branch; the pin is not a compare-and-swap, so a commit landing in the instant between the gateway\'s tip re-read and its delete is lost. A failed branch delete never blocks the draft\'s delete, and retrying after a partial failure finds the branch already gone. Every other branch is removed by `DELETE .../drafts/{draftId}/branch`, or by the close after a successful publish (see `writeDraftPublication` and `createOrUpdatePackage`\'s `draftId`). **A second delete, or a read after this one, answers 404** to a caller who can use the workspace (403 to one who cannot): the gate is the workspace\'s, and the row is gone. **Authorization**: requires `can_delete_document` on the draft document, and `can_create_package` on the environment it targets.
|
|
5062
5251
|
* @summary Delete a draft package
|
|
5063
5252
|
* @param {string} organizationName The unique identifier of the organization
|
|
5064
5253
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
@@ -5076,7 +5265,7 @@ const DraftsApiFp = function (configuration) {
|
|
|
5076
5265
|
});
|
|
5077
5266
|
},
|
|
5078
5267
|
/**
|
|
5079
|
-
* Thin proxy to the code-assist git-gateway\'s `deleteDraft` — deletes the draft\'s branch in the managed monorepo
|
|
5268
|
+
* Thin proxy to the code-assist git-gateway\'s `deleteDraft` — deletes the draft\'s branch in the managed monorepo, forwarding the caller\'s own bearer token. **This is branch removal only — it does not delete the draft.** Deleting the draft is `DELETE` on the draft itself. Stays as the primitive operator tooling needs: `deleteDraft` deletes an untouched draft\'s branch at its seed commit on the server (docs/git-synced-modeling.md §7.2), so neither the app nor the agent needs to call this. See docs/tenant-offboarding-playbook.md, which prefers it over a raw GitHub call precisely because it carries the FGA check below. The close after a successful publish also deletes a draft\'s branch, but through the gateway directly rather than through this endpoint. **Authorization**: Requires write access to the draft\'s workspace (`can_create_document`) and `can_create_package` on the environment the draft targets, as deleting the draft does. The gateway re-checks the workspace relation. Idempotent, and deliberately not gated on the draft being git-backed, so a provisioning draft\'s half-cut branch can still be cleaned up.
|
|
5080
5269
|
* @summary Delete a git-backed draft\'s branch
|
|
5081
5270
|
* @param {string} organizationName The unique identifier of the organization
|
|
5082
5271
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
@@ -5094,34 +5283,34 @@ const DraftsApiFp = function (configuration) {
|
|
|
5094
5283
|
});
|
|
5095
5284
|
},
|
|
5096
5285
|
/**
|
|
5097
|
-
* Removes a document from the draft
|
|
5286
|
+
* Removes a document from the draft: it deletes the document row, only if it still holds the `sha` in `expectedSha` when one is sent, and unconditionally (and idempotently) otherwise. **Authorization**: as `writeDraftDocument`.
|
|
5098
5287
|
* @summary Delete one of a draft\'s documents
|
|
5099
5288
|
* @param {string} organizationName The unique identifier of the organization
|
|
5100
5289
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
5101
5290
|
* @param {string} draftId The draft package identifier
|
|
5102
5291
|
* @param {string} documentPath The document\'s path relative to the draft root
|
|
5103
|
-
* @param {string} [
|
|
5104
|
-
* @param {string} [
|
|
5292
|
+
* @param {string} [expectedSha] The `sha` the caller read the document at: the delete applies only if the document still holds that version, else `409` `draft-document-stale`; a file already gone counts as deleted when this is the whole request, so a lost response can be resent.
|
|
5293
|
+
* @param {string} [expectedRef] Deprecated: use `expectedSha`. A git branch head, refused with `400` when set: a draft has no commits to compare it against, and a caller that sends a precondition believes it holds one. Kept one release, so a client from before the document store is refused rather than written unconditionally; removed in the release after.
|
|
5105
5294
|
* @param {*} [options] Override http request option.
|
|
5106
5295
|
* @throws {RequiredError}
|
|
5107
5296
|
*/
|
|
5108
|
-
deleteDraftDocument(organizationName, workspaceName, draftId, documentPath,
|
|
5297
|
+
deleteDraftDocument(organizationName, workspaceName, draftId, documentPath, expectedSha, expectedRef, options) {
|
|
5109
5298
|
return __awaiter(this, void 0, void 0, function* () {
|
|
5110
5299
|
var _a, _b, _c;
|
|
5111
|
-
const localVarAxiosArgs = yield localVarAxiosParamCreator.deleteDraftDocument(organizationName, workspaceName, draftId, documentPath,
|
|
5300
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.deleteDraftDocument(organizationName, workspaceName, draftId, documentPath, expectedSha, expectedRef, options);
|
|
5112
5301
|
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
5113
5302
|
const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['DraftsApi.deleteDraftDocument']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
|
|
5114
5303
|
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
5115
5304
|
});
|
|
5116
5305
|
},
|
|
5117
5306
|
/**
|
|
5118
|
-
* Discards the draft\'s change to one file, so the draft carries what its publication has at this path again. This is Restore, for any kind of file; after it the path has no `changeSincePublication` marker. `DELETE` on the document itself deletes the file instead — a different change, which this would undo. What it does follows the file\'s change marker, never whether a published copy can be read: - A data file: the draft\'s own upload or deletion is dropped. Where the draft\'s last publish shipped its own upload, the path returns to that upload; otherwise the published copy is inherited again, and a small UTF-8 file, which a draft holds as a document rather than inheriting, is written back as one.
|
|
5307
|
+
* Discards the draft\'s change to one file, so the draft carries what its publication has at this path again. This is Restore, for any kind of file; after it the path has no `changeSincePublication` marker. `DELETE` on the document itself deletes the file instead — a different change, which this would undo. What it does follows the file\'s change marker, never whether a published copy can be read: - A data file: the draft\'s own upload or deletion is dropped. Where the draft\'s last publish shipped its own upload, the path returns to that upload; otherwise the published copy is inherited again, and a small UTF-8 file, which a draft holds as a document rather than inheriting, is written back as one. - A text file the draft added: deleted. - A text file the draft edited or deleted: the published copy written back. Answers as `getDraftDocument` with `ref=publication` does when that copy cannot be read (`404` `draft-file-not-in-publication`, `409`, `413`, `503`), changing nothing. `404` `draft-document-unchanged` when the draft has no change at this path — a data file the draft\'s last publish shipped and has not touched since included. Before any change is found, the comparison itself can be refused, with the answers a read of the baseline gives: `403` when the caller cannot read the package the draft is measured against, `409` `draft-publication-baseline-missing` when that baseline cannot be measured (a corrupt archive), and `503` `draft-changes-unavailable` when it could not be read. **Authorization** — the same pair `writeDraftDocument` takes.
|
|
5119
5308
|
* @summary Restore one of a draft\'s files to its published copy
|
|
5120
5309
|
* @param {string} organizationName The unique identifier of the organization
|
|
5121
5310
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
5122
5311
|
* @param {string} draftId The draft package identifier
|
|
5123
5312
|
* @param {string} documentPath The file\'s path relative to the draft root
|
|
5124
|
-
* @param {string} [expectedRef]
|
|
5313
|
+
* @param {string} [expectedRef] Deprecated: a restore takes no precondition. A git branch head, refused with `400` when set: a draft has no commits to compare it against, and a caller that sends a precondition believes it holds one. Kept one release, so a client from before the document store is refused rather than written unconditionally; removed in the release after.
|
|
5125
5314
|
* @param {*} [options] Override http request option.
|
|
5126
5315
|
* @throws {RequiredError}
|
|
5127
5316
|
*/
|
|
@@ -5153,20 +5342,20 @@ const DraftsApiFp = function (configuration) {
|
|
|
5153
5342
|
});
|
|
5154
5343
|
},
|
|
5155
5344
|
/**
|
|
5156
|
-
* The
|
|
5157
|
-
* @summary
|
|
5345
|
+
* The draft\'s capabilities, derived by the server from its environment and what its package has published. The same value `getDraft` carries as `capabilities`, for a caller that does not need the rest of the draft: it reads the draft\'s manifest, its review state and one published-version lookup, not the checkpoint or the files. A draft that is moving to the new store answers `409` `draft-converting`: retry. **Authorization**: requires read access to the draft document.
|
|
5346
|
+
* @summary What the draft\'s storage can do
|
|
5158
5347
|
* @param {string} organizationName The unique identifier of the organization
|
|
5159
5348
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
5160
5349
|
* @param {string} draftId The draft package identifier
|
|
5161
5350
|
* @param {*} [options] Override http request option.
|
|
5162
5351
|
* @throws {RequiredError}
|
|
5163
5352
|
*/
|
|
5164
|
-
|
|
5353
|
+
getDraftCapabilities(organizationName, workspaceName, draftId, options) {
|
|
5165
5354
|
return __awaiter(this, void 0, void 0, function* () {
|
|
5166
5355
|
var _a, _b, _c;
|
|
5167
|
-
const localVarAxiosArgs = yield localVarAxiosParamCreator.
|
|
5356
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.getDraftCapabilities(organizationName, workspaceName, draftId, options);
|
|
5168
5357
|
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
5169
|
-
const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['DraftsApi.
|
|
5358
|
+
const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['DraftsApi.getDraftCapabilities']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
|
|
5170
5359
|
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
5171
5360
|
});
|
|
5172
5361
|
},
|
|
@@ -5189,29 +5378,46 @@ const DraftsApiFp = function (configuration) {
|
|
|
5189
5378
|
});
|
|
5190
5379
|
},
|
|
5191
5380
|
/**
|
|
5192
|
-
*
|
|
5193
|
-
* @summary
|
|
5381
|
+
* One entry of `getDraftConflicts` with the incoming side\'s, the draft\'s and their common ancestor\'s version of the file, so the caller can reconcile them and write the result through `writeDraftDocuments` with the `conflictSha` this returns. **Authorization**: requires read access to the draft document, and `can_create_package` on the environment it targets: only a modeler can act on what this serves. `404` when the path has no conflict (it was resolved, or never conflicted).
|
|
5382
|
+
* @summary One conflicting file, with all three of its versions
|
|
5194
5383
|
* @param {string} organizationName The unique identifier of the organization
|
|
5195
5384
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
5196
5385
|
* @param {string} draftId The draft package identifier
|
|
5197
|
-
* @param {string}
|
|
5198
|
-
* @param {
|
|
5199
|
-
* @
|
|
5386
|
+
* @param {string} documentPath The conflicting file\'s path relative to the draft root, as `getDraftConflicts` lists it.
|
|
5387
|
+
* @param {*} [options] Override http request option.
|
|
5388
|
+
* @throws {RequiredError}
|
|
5389
|
+
*/
|
|
5390
|
+
getDraftConflict(organizationName, workspaceName, draftId, documentPath, options) {
|
|
5391
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
5392
|
+
var _a, _b, _c;
|
|
5393
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.getDraftConflict(organizationName, workspaceName, draftId, documentPath, options);
|
|
5394
|
+
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
5395
|
+
const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['DraftsApi.getDraftConflict']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
|
|
5396
|
+
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
5397
|
+
});
|
|
5398
|
+
},
|
|
5399
|
+
/**
|
|
5400
|
+
* A page of the draft\'s conflicts: every path both the draft and what came in changed since their common ancestor, where what came in is a newer published version of its package (the base moved) or a commit someone pushed to its pull request. A superset of what cannot merge on its own, because nothing here runs a merge. Ordered by `relpath`. Each entry says where its incoming side came from, and carries the `conflictSha` a resolution sends back through `writeDraftDocuments`, a member per file. `getDraftConflict` returns one file\'s three versions. An empty list means nothing waits on the author: what only one side changed is absorbed in the background. Conflicts never block editing or a Submit; a submitted draft\'s push waits for the last one to be resolved and then starts on its own. Served from controlplane\'s record alone: no file content, no archive read and no GitHub call. **Authorization**: requires read access to the draft document. `409` `draft-converting` means the draft is moving to the new store; retry.
|
|
5401
|
+
* @summary The files the draft and what came in both changed
|
|
5402
|
+
* @param {string} organizationName The unique identifier of the organization
|
|
5403
|
+
* @param {string} workspaceName The unique identifier of the workspace
|
|
5404
|
+
* @param {string} draftId The draft package identifier
|
|
5405
|
+
* @param {number} [limit] Maximum number of items to return. Use -1 or omit to return all results. Valid values: -1 (all results) or 1–500.
|
|
5200
5406
|
* @param {number} [offset] Number of items to skip before starting to return results
|
|
5201
5407
|
* @param {*} [options] Override http request option.
|
|
5202
5408
|
* @throws {RequiredError}
|
|
5203
5409
|
*/
|
|
5204
|
-
|
|
5410
|
+
getDraftConflicts(organizationName, workspaceName, draftId, limit, offset, options) {
|
|
5205
5411
|
return __awaiter(this, void 0, void 0, function* () {
|
|
5206
5412
|
var _a, _b, _c;
|
|
5207
|
-
const localVarAxiosArgs = yield localVarAxiosParamCreator.
|
|
5413
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.getDraftConflicts(organizationName, workspaceName, draftId, limit, offset, options);
|
|
5208
5414
|
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
5209
|
-
const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['DraftsApi.
|
|
5415
|
+
const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['DraftsApi.getDraftConflicts']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
|
|
5210
5416
|
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
5211
5417
|
});
|
|
5212
5418
|
},
|
|
5213
5419
|
/**
|
|
5214
|
-
* The draft as it stands, as a package archive: its own files at its latest content, its uploaded data files, and the data files it inherits from the published version, minus any it deleted — the same layering its checkpoints and publishes use (docs/draft-data-file-upload-design.md §4.3), but built from the draft\'s current content rather than its last checkpoint, and with its own `publisher.json`. For working on the package locally. `409` `draft-
|
|
5420
|
+
* The draft as it stands, as a package archive: its own files at its latest content, its uploaded data files, and the data files it inherits from the published version, minus any it deleted — the same layering its checkpoints and publishes use (docs/draft-data-file-upload-design.md §4.3), but built from the draft\'s current content rather than its last checkpoint, and with its own `publisher.json`. For working on the package locally. `409` `draft-converting` while the draft is moving to the new store; `503` `draft-data-file-storage-unavailable` when an upload\'s object or the published archive could not be read. **Authorization**: requires read access to the draft document, and — when the draft\'s package has a published version, whose data files the zip would inherit — update access to the package, as downloading that version does (`getPackageVersionContent`). That check runs before the published archive is fetched, so a reader without it never causes that read.
|
|
5215
5421
|
* @summary Download a draft package as a zip
|
|
5216
5422
|
* @param {string} organizationName The unique identifier of the organization
|
|
5217
5423
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
@@ -5229,13 +5435,13 @@ const DraftsApiFp = function (configuration) {
|
|
|
5229
5435
|
});
|
|
5230
5436
|
},
|
|
5231
5437
|
/**
|
|
5232
|
-
* One document\'s content
|
|
5438
|
+
* One document\'s content. `409` `draft-converting` while the draft is moving to the new store. Refuses with `413` (`draft-file-unreadable`) when the document is not readable as UTF-8 text under 1MB. That is a permanent refusal about the file\'s shape, not a transient failure: the same refusal stops a publish, so retrying achieves nothing until the file is removed or replaced. **`ref=publication`** reads the document as it is in the version the draft\'s `changeSincePublication` markers compare against. The baseline is resolved server-side, never taken from the caller: the stored archive of the draft\'s last published version, or — for one never published — of the version it was opened on. The answers, each distinct: - `200`: the file\'s content in that baseline. - `403`: the caller can read the draft but not the package whose stored archive is the baseline. Workspace access does not imply environment access, so this read also takes `can_read_package` on it. - `404` `draft-file-not-in-publication`: the baseline exists and does not hold this file. There is nothing to restore from it. - `409` `draft-publication-baseline-missing`: there is no baseline to read — a draft never published and opened on nothing, a publication recorded before baselines were, a published version with no stored archive, one whose archive is corrupt, or one that no longer holds what its publish recorded. Permanent until the draft publishes again. - `413` `draft-file-unreadable`: the baseline\'s copy is not UTF-8 text under 1MB. - `503` `draft-publication-unreadable`: the baseline exists but could not be read right now. Retryable. The content is the published archive\'s bytes decoded as UTF-8, so its SHA-256 is the hash the markers were computed from. A published file a draft cannot hold (binary, or 1 MiB and over) is inherited by the draft rather than held, so it is not in the baseline and answers `404`. **Authorization**: requires read access to the draft document.
|
|
5233
5439
|
* @summary Read one of a draft\'s documents
|
|
5234
5440
|
* @param {string} organizationName The unique identifier of the organization
|
|
5235
5441
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
5236
5442
|
* @param {string} draftId The draft package identifier
|
|
5237
5443
|
* @param {string} documentPath The document\'s path relative to the draft root
|
|
5238
|
-
* @param {string} [ref]
|
|
5444
|
+
* @param {string} [ref] The literal `publication` reads the file as it is in the draft\'s publication baseline — see the operation\'s description. It is matched exactly (lower case). Any other value is ignored: a draft keeps no commits to read at.
|
|
5239
5445
|
* @param {*} [options] Override http request option.
|
|
5240
5446
|
* @throws {RequiredError}
|
|
5241
5447
|
*/
|
|
@@ -5249,7 +5455,7 @@ const DraftsApiFp = function (configuration) {
|
|
|
5249
5455
|
});
|
|
5250
5456
|
},
|
|
5251
5457
|
/**
|
|
5252
|
-
* The bytes of a file as the draft carries it: a text document\'s content, a data file\'s own upload, or otherwise the data file it inherits from the package\'s published version. So a download works the same on any file of the draft. A path the draft deleted answers `404`; `409` `draft-
|
|
5458
|
+
* The bytes of a file as the draft carries it: a text document\'s content, a data file\'s own upload, or otherwise the data file it inherits from the package\'s published version. So a download works the same on any file of the draft. A path the draft deleted answers `404`; `409` `draft-converting` while the draft is moving to the new store. A text document that cannot be served as text (1 MiB or more) answers `413` `draft-file-unreadable`, as `getDraftDocument` does. An uploaded data file never takes this path. **Authorization**: requires read access to the draft document. A data file the draft inherits also requires update access to the package, as downloading the published version does (`getPackageVersionContent`); the draft\'s own uploads do not. That check runs before the published archive is fetched, so a reader without it gets `403` for any path the draft itself does not hold, a missing one included.
|
|
5253
5459
|
* @summary Download one of a draft\'s files
|
|
5254
5460
|
* @param {string} organizationName The unique identifier of the organization
|
|
5255
5461
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
@@ -5268,61 +5474,59 @@ const DraftsApiFp = function (configuration) {
|
|
|
5268
5474
|
});
|
|
5269
5475
|
},
|
|
5270
5476
|
/**
|
|
5271
|
-
*
|
|
5272
|
-
* @summary
|
|
5477
|
+
* The gates `writeDraftPublication` applies, read without acting on any of them: no submit, no build request, no merge and no listing of the package on GitHub, so it costs database reads only. `ready` false comes with the `reason` the publish would answer now. `ready` true means every gate this read covers passed; the publish\'s own listing of the package at the pull request\'s head can still refuse it. `ready` says nothing about the caller: a reader who may not publish reads it too, and the publish refuses them `403`. A draft that is owed a push or a build reads `sending` or `building` here, and only `writeDraftPublication` starts them. A `blocked` pull request reads `pull-request-blocked` here even when the publish would re-post its check and merge. `warnings` are about what the publish would ship, not whether it can: today, that a first publish exposes every source (see `DraftPublicationWarning`). They are read only when `ready` is true, and are empty otherwise. **Authorization**: requires read access to the draft document. `409` `draft-converting` means the draft is moving to the new store; retry.
|
|
5478
|
+
* @summary Whether the draft can be published now
|
|
5273
5479
|
* @param {string} organizationName The unique identifier of the organization
|
|
5274
5480
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
5275
5481
|
* @param {string} draftId The draft package identifier
|
|
5276
5482
|
* @param {*} [options] Override http request option.
|
|
5277
5483
|
* @throws {RequiredError}
|
|
5278
5484
|
*/
|
|
5279
|
-
|
|
5485
|
+
getDraftPublication(organizationName, workspaceName, draftId, options) {
|
|
5280
5486
|
return __awaiter(this, void 0, void 0, function* () {
|
|
5281
5487
|
var _a, _b, _c;
|
|
5282
|
-
const localVarAxiosArgs = yield localVarAxiosParamCreator.
|
|
5488
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.getDraftPublication(organizationName, workspaceName, draftId, options);
|
|
5283
5489
|
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
5284
|
-
const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['DraftsApi.
|
|
5490
|
+
const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['DraftsApi.getDraftPublication']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
|
|
5285
5491
|
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
5286
5492
|
});
|
|
5287
5493
|
},
|
|
5288
5494
|
/**
|
|
5289
|
-
*
|
|
5290
|
-
* @summary
|
|
5495
|
+
* Served from controlplane\'s record of the draft and nothing else: no GitHub read and no side effect, so polling it costs controlplane\'s own reads only. Always answers `200` for a draft the caller can read. `state` is `none` when the draft has no pull request, and a draft whose environment does not review on GitHub answers `state: none`, `reviewState: notSubmitted`, so a polling client treats absence as an answer, not an error. `reviewState` says where the review stands and `nextAttemptAt` when it is next worked on; `unsubmittedChanges` says whether the draft has edits since its last push. Poll while `reviewState` is `sending` or a pull request is open, and stop otherwise. `mergeable` is GitHub\'s own verdict as last recorded and is `null` while GitHub is still computing it. Treat `null` as \"not yet known\" and re-read; never as \"not mergeable\". **Authorization**: requires read access to the draft document. `409` `draft-converting` means the draft is moving to the new store; retry.
|
|
5496
|
+
* @summary The draft\'s pull request and review state
|
|
5291
5497
|
* @param {string} organizationName The unique identifier of the organization
|
|
5292
5498
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
5293
5499
|
* @param {string} draftId The draft package identifier
|
|
5294
|
-
* @param {number} [limit]
|
|
5295
|
-
* @param {number} [offset]
|
|
5296
5500
|
* @param {*} [options] Override http request option.
|
|
5297
5501
|
* @throws {RequiredError}
|
|
5298
5502
|
*/
|
|
5299
|
-
|
|
5503
|
+
getDraftPullRequest(organizationName, workspaceName, draftId, options) {
|
|
5300
5504
|
return __awaiter(this, void 0, void 0, function* () {
|
|
5301
5505
|
var _a, _b, _c;
|
|
5302
|
-
const localVarAxiosArgs = yield localVarAxiosParamCreator.
|
|
5506
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.getDraftPullRequest(organizationName, workspaceName, draftId, options);
|
|
5303
5507
|
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
5304
|
-
const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['DraftsApi.
|
|
5508
|
+
const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['DraftsApi.getDraftPullRequest']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
|
|
5305
5509
|
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
5306
5510
|
});
|
|
5307
5511
|
},
|
|
5308
5512
|
/**
|
|
5309
|
-
* The draft\'s files
|
|
5513
|
+
* The draft\'s files: the documents under `path` to `depth`, held as workspace documents. `409` `draft-converting` while the draft is moving to the new store. **Listed against the draft\'s last publication.** A draft is a package in draft mode, so a listing reports each document\'s `changeSincePublication` — added, modified, or unchanged — and includes the files the publication shipped that the draft has since deleted, as `removed` entries. A deletion is an edit like any other, and a page rendering the draft\'s files needs all of them from one read. A draft never published is measured against the published version it was opened on (the package\'s latest version when none was recorded), and only for a caller with read access to that package: the markers would otherwise name the package\'s published files, and their absence say which of them the draft leaves unchanged, to a reader who cannot read it. For such a caller the draft\'s own files are listed without markers, with `Changes-Unavailable`. A baseline that exists but cannot be measured or read (an archive that failed to download) is `Changes-Unavailable` too, never \"nothing to compare against\". A never-published draft of a package with no published version carries no markers and no removed entries. When the comparison cannot be made (a transient failure, or a publication recorded before its baseline existed), the listing is still returned, without markers, and says so with the `Changes-Unavailable` header rather than failing. Content is omitted from the listing unless `withContent=true`; otherwise read a document to get it. **Authorization**: requires read access to the draft document.
|
|
5310
5514
|
* @summary List a draft\'s documents
|
|
5311
5515
|
* @param {string} organizationName The unique identifier of the organization
|
|
5312
5516
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
5313
5517
|
* @param {string} draftId The draft package identifier
|
|
5314
5518
|
* @param {string} [path] Restrict the listing to this subtree, relative to the draft root.
|
|
5315
|
-
* @param {number} [depth] `1` lists only the
|
|
5316
|
-
* @param {
|
|
5519
|
+
* @param {number} [depth] `1` lists only the files directly under `path`, as a file browser would. Omitted returns every file in the subtree, which is what a section listing wants. A draft\'s paths are flat, so neither returns directory entries.
|
|
5520
|
+
* @param {boolean} [withContent] Carry each document\'s content on its entry, so a caller that wants the whole draft makes one request rather than one per file. A document\'s text comes as `content`. A data file the draft holds beside its documents (`kind` `data`) carries neither, as in any listing. The listing is whole-draft or refused: past the same file-count and byte limits a checkpoint collects under, it answers `413` `draft-listing-too-large` rather than a partial one, and `limit` and `offset` do not lower what is read, only what is returned. Read the files one at a time instead.
|
|
5317
5521
|
* @param {number} [limit] Maximum number of items to return. Use -1 or omit to return all results.
|
|
5318
5522
|
* @param {number} [offset] Number of items to skip before starting to return results
|
|
5319
5523
|
* @param {*} [options] Override http request option.
|
|
5320
5524
|
* @throws {RequiredError}
|
|
5321
5525
|
*/
|
|
5322
|
-
listDraftDocuments(organizationName, workspaceName, draftId, path, depth,
|
|
5526
|
+
listDraftDocuments(organizationName, workspaceName, draftId, path, depth, withContent, limit, offset, options) {
|
|
5323
5527
|
return __awaiter(this, void 0, void 0, function* () {
|
|
5324
5528
|
var _a, _b, _c;
|
|
5325
|
-
const localVarAxiosArgs = yield localVarAxiosParamCreator.listDraftDocuments(organizationName, workspaceName, draftId, path, depth,
|
|
5529
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.listDraftDocuments(organizationName, workspaceName, draftId, path, depth, withContent, limit, offset, options);
|
|
5326
5530
|
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
5327
5531
|
const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['DraftsApi.listDraftDocuments']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
|
|
5328
5532
|
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
@@ -5349,7 +5553,7 @@ const DraftsApiFp = function (configuration) {
|
|
|
5349
5553
|
});
|
|
5350
5554
|
},
|
|
5351
5555
|
/**
|
|
5352
|
-
* Changes a draft\'s own fields. Every field is optional and an absent one is left alone. Its writers own different slices — a display name comes from a person, `publishedAs` from a publish
|
|
5556
|
+
* Changes a draft\'s own fields. Every field is optional and an absent one is left alone. Its writers own different slices — a display name comes from a person, `publishedAs` from a publish. The package name is not one of them once set: `targetPackageName` cannot change a draft\'s package (`409 draft-package-name-fixed`). A replacement would make each of them responsible for preserving the others\' fields. **A deleted or nonexistent draft answers 404 to a caller who can write its workspace**, and 403 to one who cannot, for the same reason `getDraft` does. **Authorization**: requires `can_update_document` on the draft document, and `can_create_package` on the environment it targets.
|
|
5353
5557
|
* @summary Update a draft package
|
|
5354
5558
|
* @param {string} organizationName The unique identifier of the organization
|
|
5355
5559
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
@@ -5368,44 +5572,7 @@ const DraftsApiFp = function (configuration) {
|
|
|
5368
5572
|
});
|
|
5369
5573
|
},
|
|
5370
5574
|
/**
|
|
5371
|
-
*
|
|
5372
|
-
* @summary Move the draft\'s branch
|
|
5373
|
-
* @param {string} organizationName The unique identifier of the organization
|
|
5374
|
-
* @param {string} workspaceName The unique identifier of the workspace
|
|
5375
|
-
* @param {string} draftId The draft package identifier
|
|
5376
|
-
* @param {*} [options] Override http request option.
|
|
5377
|
-
* @throws {RequiredError}
|
|
5378
|
-
*/
|
|
5379
|
-
updateDraftBranch(organizationName, workspaceName, draftId, options) {
|
|
5380
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
5381
|
-
var _a, _b, _c;
|
|
5382
|
-
const localVarAxiosArgs = yield localVarAxiosParamCreator.updateDraftBranch(organizationName, workspaceName, draftId, options);
|
|
5383
|
-
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
5384
|
-
const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['DraftsApi.updateDraftBranch']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
|
|
5385
|
-
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
5386
|
-
});
|
|
5387
|
-
},
|
|
5388
|
-
/**
|
|
5389
|
-
* Advances the pull request\'s state. Merging is a transition of the pull request, not an action filed under it — `PATCH` on the resource rather than a `/merge` verb in the path, which is what every other resource in this API does. Proxies the git-gateway\'s `mergeDraftPullRequest`. Squash-merges into the base branch and returns the merge commit SHA, which becomes the published version\'s `git_commit_sha` — the first provenance anchor reachable from the base branch. `expectedHeadSha` is required and pins what is merged to what the caller read, so a checkpoint that landed after the review cannot be merged silently. Read it from `getDraftPullRequest` and pass it straight back. A `409` means the head moved, the pull request is gone, `publisher.json` names a version that already exists, or the package is known not to compile at this head (`draft-compile-failed`); a `405` means GitHub says the branch is not mergeable — a conflict, or a required review that has not passed. The compile check is READ here, never run — it is started by `getDraftPullRequest` and can take minutes, so this call adds no compile latency. The consequence is that it refuses only a `failing` verdict already computed for this exact `expectedHeadSha`. `pending`, `unverified`, and a verdict this replica has not computed at all ALL allow the merge. Treat it as a guard against merging a known-broken package, not as a guarantee that a merged package compiled. **Authorization**: Requires the environment\'s `can_update_project` (enforced by the gateway) — a strictly higher bar than opening the pull request, because a merge changes what serves for the whole environment. **Git-backed drafts only.** A document-store draft answers `400` `draft-not-git-backed` before any call to the gateway: it has no branch, commits or pull request, so the operation does not apply to it. `409` `draft-provisioning` means the draft\'s branch is still being cut; retry.
|
|
5390
|
-
* @summary Merge the draft\'s pull request
|
|
5391
|
-
* @param {string} organizationName The unique identifier of the organization
|
|
5392
|
-
* @param {string} workspaceName The unique identifier of the workspace
|
|
5393
|
-
* @param {string} draftId The draft package identifier
|
|
5394
|
-
* @param {MergeDraftPullRequest} mergeDraftPullRequest
|
|
5395
|
-
* @param {*} [options] Override http request option.
|
|
5396
|
-
* @throws {RequiredError}
|
|
5397
|
-
*/
|
|
5398
|
-
updateDraftPullRequest(organizationName, workspaceName, draftId, mergeDraftPullRequest, options) {
|
|
5399
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
5400
|
-
var _a, _b, _c;
|
|
5401
|
-
const localVarAxiosArgs = yield localVarAxiosParamCreator.updateDraftPullRequest(organizationName, workspaceName, draftId, mergeDraftPullRequest, options);
|
|
5402
|
-
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
5403
|
-
const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['DraftsApi.updateDraftPullRequest']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
|
|
5404
|
-
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
5405
|
-
});
|
|
5406
|
-
},
|
|
5407
|
-
/**
|
|
5408
|
-
* Asks for a checkpoint of the draft\'s current content. A `POST` to the collection rather than a `PUT` on a singleton: this starts a job and answers `202`, and the checkpoints it appends to are a series (`1.0.N`), not one value being set. Sending it twice is still safe — see the coalescing note below — but that is a property of the nudge, not a claim that the request is idempotent in the `PUT` sense. The current checkpoint\'s status is a separate read: `GET` on `../checkpoint`. Records that the draft\'s current content should be published as the next checkpoint (`1.0.N`) of its environment draft package — an ordinary published package named `draft-{draftKey}` in the draft\'s target environment, served by the Publisher exactly like any other package there (docs/workspace-architecture-design.md §4). Always answers `202` with the current status: this call is a nudge, not the publish. The reconciler resolves the draft\'s current content itself when it collects the work — the git branch head for a git-backed draft, the doc-store tree otherwise — which is why the request carries no ref and no content: a caller-supplied ref would be both spoofable and racy against the agent\'s own commits, and a nudge that arrives late still publishes what the draft says NOW. Nudges coalesce: any number recorded between publishes produce one checkpoint of the newest content, and a nudge whose content is identical to the latest published checkpoint publishes nothing. That is this operation\'s own contract, not something the verb supplies — a `POST` to a collection is not idempotent, so a retry after a lost response would otherwise mint a second checkpoint of content that has not changed. A failed publish (the draft does not compile, most commonly) records `failed` with the compiler\'s message and leaves the previous checkpoint serving; the next nudge retries with the then-current content. **This is also how a reaped draft package comes back.** A draft whose package has been idle-reaped (24 hours without a checkpoint request) keeps its row as a witness, and a nudge clears the reap marker and re-queues the publish — the same row update that publishes anything else, so no separate verb is needed. `GET` on this path reports `resurrectable` so a client knows to send one. A merge reap comes back the same way, but a client with the draft page open asks automatically: the app\'s own `POST` rebuilds the package unless the reap\'s own tick wins the race first — at `1.0.0` after the reap, or cancelling the reap and republishing into it. A package a resurrect brought back is a live draft again from there, so the ordinary idle sweep (24 hours since the *last checkpoint request*, not tied to a viewer leaving) reclaims it if nobody keeps asking. Either way a draft that outlives its merge (its close was skipped or its publish failed) can be nudged again, and any later nudge rebuilds it the same way: at `1.0.0` once the reap is deleting the package, or as the next `1.0.N` when the nudge lands before the reap starts and keeps it. Only a deleted draft\'s reap is terminal — its content has no home left — and a nudge for one is refused rather than honoured. **Authorization**: requires `can_update_document` on the draft document AND the target environment\'s `can_create_package` — the same two bars every content-writing draft operation already takes, so anyone modeling in the draft holds both.
|
|
5575
|
+
* Asks for a checkpoint of the draft\'s current content. A `POST` to the collection rather than a `PUT` on a singleton: this starts a job and answers `202`, and the checkpoints it appends to are a series (`1.0.N`), not one value being set. Sending it twice is still safe — see the coalescing note below — but that is a property of the nudge, not a claim that the request is idempotent in the `PUT` sense. The current checkpoint\'s status is a separate read: `GET` on `../checkpoint`. Records that the draft\'s current content should be published as the next checkpoint (`1.0.N`) of its environment draft package — an ordinary published package named `draft-{draftKey}` in the draft\'s target environment, served by the Publisher exactly like any other package there (docs/workspace-architecture-design.md §4). Answers `202` with the current status: this call is a nudge, not the publish. A draft that is moving to the new store answers `409` `draft-converting` and records nothing; retry after a moment. The reconciler resolves the draft\'s current content itself when it collects the work — the draft\'s documents — which is why the request carries no ref and no content: a caller-supplied ref would be both spoofable and racy against the agent\'s own commits, and a nudge that arrives late still publishes what the draft says NOW. Nudges coalesce: any number recorded between publishes produce one checkpoint of the newest content, and a nudge whose content is identical to the latest published checkpoint publishes nothing. That is this operation\'s own contract, not something the verb supplies — a `POST` to a collection is not idempotent, so a retry after a lost response would otherwise mint a second checkpoint of content that has not changed. A failed publish (the draft does not compile, most commonly) records `failed` with the compiler\'s message and leaves the previous checkpoint serving; the next nudge retries with the then-current content. **This is also how a reaped draft package comes back.** A draft whose package has been idle-reaped (24 hours without a checkpoint request) keeps its row as a witness, and a nudge clears the reap marker and re-queues the publish — the same row update that publishes anything else, so no separate verb is needed. `GET` on this path reports `resurrectable` so a client knows to send one. A merge reap comes back the same way, but a client with the draft page open asks automatically: the app\'s own `POST` rebuilds the package unless the reap\'s own tick wins the race first — at `1.0.0` after the reap, or cancelling the reap and republishing into it. A package a resurrect brought back is a live draft again from there, so the ordinary idle sweep (24 hours since the *last checkpoint request*, not tied to a viewer leaving) reclaims it if nobody keeps asking. Either way a draft that outlives its merge (its close was skipped or its publish failed) can be nudged again, and any later nudge rebuilds it the same way: at `1.0.0` once the reap is deleting the package, or as the next `1.0.N` when the nudge lands before the reap starts and keeps it. Only a deleted draft\'s reap is terminal — its content has no home left — and a nudge for one is refused rather than honoured. **Authorization**: requires `can_update_document` on the draft document AND the target environment\'s `can_create_package` — the same two bars every content-writing draft operation already takes, so anyone modeling in the draft holds both.
|
|
5409
5576
|
* @summary Set the draft\'s checkpoint to its current content
|
|
5410
5577
|
* @param {string} organizationName The unique identifier of the organization
|
|
5411
5578
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
@@ -5423,7 +5590,7 @@ const DraftsApiFp = function (configuration) {
|
|
|
5423
5590
|
});
|
|
5424
5591
|
},
|
|
5425
5592
|
/**
|
|
5426
|
-
* Creates or replaces a document
|
|
5593
|
+
* Creates or replaces a document. `PUT` rather than `POST` because the path is the identifier and the caller chooses it — there is no server-assigned id for a file, so a collection `POST` would have nothing to assign. **The precondition is per file.** `expectedSha` (the `sha` the writer read) replaces the document only if it still holds that version, and `createOnly` creates it only if no document is there. Of two writers holding the same `sha` exactly one wins and the other gets `409` `draft-document-stale`, except that a resent write that already landed is answered as applied (below). They are mutually exclusive (`400` when both are sent). With neither, the write is last-writer-wins, as a write through the documents API has always been. A retry whose change is already in place (the content is current, or the file to delete is gone) is answered as applied, not as a conflict, so a lost response can be resent. A deletion of a gone file with an `expectedSha` counts as applied only when no write in the same set is still to land: a move whose old path was deleted or moved by someone else is stale (`\"\"`), not a second copy. The server requests the draft\'s checkpoint after the write commits, so a client does not request one itself. **Authorization** — `can_update_document` on the draft document, **and** `can_create_package` on the draft\'s target environment. The second is not redundant: `can_update_document` on a draft is satisfied by bare workspace membership, while a file written here reaches the environment on the draft author\'s next checkpoint, carrying the checkpointer\'s bar rather than the writer\'s. The environment comes from the draft\'s own manifest and is never a request field; a draft that names none is refused, since it could not be published either. Refuses with `400` (`draft-notebook-read-only`) when a document path ends `.malloynb` and the write would change it or add a new one to a draft that already has files. A `.malloynb` notebook in a draft is read-only: convert it to a `.malloy` notebook (the same name with `.malloy`, beside it) and edit that, or delete it. Writing identical content, or seeding an empty draft, is allowed, and so is a deletion.
|
|
5427
5594
|
* @summary Write one of a draft\'s documents
|
|
5428
5595
|
* @param {string} organizationName The unique identifier of the organization
|
|
5429
5596
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
@@ -5443,7 +5610,7 @@ const DraftsApiFp = function (configuration) {
|
|
|
5443
5610
|
});
|
|
5444
5611
|
},
|
|
5445
5612
|
/**
|
|
5446
|
-
* Writes a data file\'s bytes — a Parquet, CSV, JSON or Excel (`.xlsx`) file a model reads — into the draft, creating it or replacing the draft\'s earlier upload at the same path. A data file lives beside the draft\'s text documents
|
|
5613
|
+
* Writes a data file\'s bytes — a Parquet, CSV, JSON or Excel (`.xlsx`) file a model reads — into the draft, creating it or replacing the draft\'s earlier upload at the same path. A data file lives beside the draft\'s text documents (docs/draft-data-file-upload-design.md). The body is the file itself, `application/octet-stream`, with `Content-Length` set; a chunked body without one is refused before it is read. Uploading over a data file the package\'s published version serves replaces it in the draft: the draft\'s checkpoint and its next publish carry the upload, and the published version keeps its copy until then. A path the draft holds as a small text document (a CSV the published version shipped, which a draft holds as text) moves: the upload is stored and the text copy removed, so the path lives in one place. `DELETE` on the document path deletes a data file, or — for one the draft inherits — records that the draft no longer carries it; `DELETE` on its `change` restores it to the published copy. Refusals, each with its `code`: - `400` `draft-data-file-body-unreadable`: the request body ended or failed before it was read through (a dropped connection, a truncating proxy). Nothing was written; send it again. - `400` `draft-data-file-invalid`: the path holds a character outside Malloy\'s unquoted DuckDB path set `[A-Za-z0-9._~:/?#@!$&*+,=%-]`, such as a space, a bracket, a quote or an accented letter (a model can\'t name such a file in `duckdb.table(\'…\')`; the message names the path with accents dropped and each run of any other such character replaced by `_`, which the app uploads to instead), or ends in `.txt` (DuckDB has no reader for that extension; rename it `.csv` or `.tsv`), or ends in any other extension outside the formats a model reads as data: `.csv`, `.tsv`, `.parquet`, `.xlsx`, `.json`, `.jsonl`, `.ndjson`, and `.csv.gz`, `.tsv.gz`, `.json.gz`, `.jsonl.gz`, `.ndjson.gz` (an `.xls` is told to save as `.xlsx`). Decided by the path, before the body is read. - `409` `draft-content-not-data`: the path names a file the package treats as text (`publisher.json`, `.malloy`, `.malloynb`, `.md`, `.html`, or a `.json` at the package root). Those are written through `writeDraftDocument`. - `411` `draft-data-file-length-required`: the request declared no `Content-Length`. - `413` `draft-data-file-too-large`: over 32 MiB. - `413` `draft-data-files-over-quota`: the draft would hold more than 64 data files or 128 MiB of them. - `422` `draft-data-file-invalid`: a `.parquet` or `.xlsx` path whose bytes are not that format, or an empty body. - `429` `draft-data-file-rate-limited`: more than 30 uploads into this draft in the last minute, or more uploads in flight on the serving replica than it spools at once (8). Both are counted per replica. Retry after a moment. **Authorization** — the same pair `writeDraftDocument` takes: `can_update_document` on the draft document, and `can_create_package` on the draft\'s target environment.
|
|
5447
5614
|
* @summary Upload a data file into a draft
|
|
5448
5615
|
* @param {string} organizationName The unique identifier of the organization
|
|
5449
5616
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
@@ -5463,7 +5630,7 @@ const DraftsApiFp = function (configuration) {
|
|
|
5463
5630
|
});
|
|
5464
5631
|
},
|
|
5465
5632
|
/**
|
|
5466
|
-
* Writes a set of documents together
|
|
5633
|
+
* Writes a set of documents together, in one transaction: a seed, or a multi-file edit that must not be seen half applied. Ordinary editing uses the per-document `PUT`. This is for the cases that are atomic by nature. Each member may carry its own `expectedSha` or `createOnly` (see `writeDraftDocument`), so a move is one set: `createOnly` on the new path and a deletion with `expectedSha` on the old one. If any member\'s precondition fails, none is written and the `409` `draft-document-stale` names every conflicting path; a set already partly in place (a resent one) commits only what remains. **Authorization**: as `writeDraftDocument`. **Resolving conflicts.** A member carrying the `conflictSha` that `getDraftConflicts` gave its path resolves that one conflict: the path leaves the conflict list and its base moves to the incoming side, so the next sync does not raise it again. With no content and no `deleted` the member keeps the draft\'s file as it is (an uploaded data file too), and only the conflict is cleared. Members without a `conflictSha` write as usual, and a write may resolve any subset of the list. A `conflictSha` that no longer names the path\'s conflict (the incoming side moved, or it was resolved) is `409` `draft-conflict-changed`, and nothing is written. Once none remain, the draft moves on to what came in, and a submitted draft\'s push starts. A resolution never fails on an archive: when the published version the last conflicts came from cannot be read, the draft\'s next sync moves its base instead. **Fenced by a work item.** A caller executing a work item (one claimed through the controlplane\'s private work-item API) sends its claim in `Work-Item-Claim` (`{id}@{generation}`). The claim is checked first thing in the transaction that writes the document rows, and refused with `409` `draft-write-fenced` -- writing nothing -- when it is no longer the live one: released, cancelled, or swept after its holder stopped heartbeating. A malformed header is a `400`. Without the header the write is unfenced, as before. Only this operation honors the header. Refuses with `400` (`draft-notebook-read-only`) when a document path ends `.malloynb` and the write would change it or add a new one to a draft that already has files. A `.malloynb` notebook in a draft is read-only: convert it to a `.malloy` notebook (the same name with `.malloy`, beside it) and edit that, or delete it. Writing identical content, or seeding an empty draft, is allowed, and so is a deletion.
|
|
5467
5634
|
* @summary Write several of a draft\'s documents as one change
|
|
5468
5635
|
* @param {string} organizationName The unique identifier of the organization
|
|
5469
5636
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
@@ -5483,41 +5650,24 @@ const DraftsApiFp = function (configuration) {
|
|
|
5483
5650
|
});
|
|
5484
5651
|
},
|
|
5485
5652
|
/**
|
|
5486
|
-
*
|
|
5487
|
-
* @summary Publish
|
|
5653
|
+
* The one way a draft ships, whether or not its environment reviews drafts on GitHub. Either the draft\'s package is published and this answers `200` with it, or nothing is published and it answers `409` `draft-not-ready` with `details.reason` saying what it waits on. Call it again once that clears: every step is safe to repeat, and a repeat after a publish answers with the version already published. `getDraftPublication` reads the same gates without acting on them. **A draft whose environment does not review on GitHub** is published from its own files, in this order: 1. `conflicts`: the draft has unresolved conflicts (`details.conflictCount`). 2. `stale`: the package has a newer version than the one the draft is synced to; the background sync brings it in. 3. `building` / `build-failed`: the draft\'s latest content has no passing build from the last hour. A missing, pending or stale build is requested here and answers `building`; a failing one answers `build-failed`, with the compiler\'s message. 4. The publish, `createOrUpdatePackage` naming this draft. The body\'s `description` is written into the published `publisher.json`. A package that moved under the draft while it published answers `stale`. **A draft whose environment reviews on GitHub** merges its pull request and publishes the merge commit: 1. A draft whose pull request merged, and which has not changed since, goes straight to the publish (8). One edited after its merge is a new pull request. While a rebuild of a merged draft is pending this answers `building`: the build says whether it holds an edit. A rebuild that failed on the merged content still publishes the merge. One whose content cannot be compared answers `build-failed` when it failed to compile, and `building` when it failed on Credible\'s side, which this call asks to rebuild. 2. A push GitHub refused for good answers `push-refused`, with the reason in `details.pushError`: `data_files_only`, `no_changes`, `content_refused`, `review_outside_package`, `repository_too_large` or `push_refused`, until the draft\'s content changes, which sends it again (`repository_too_large` only fails again: see `push-refused` below). Otherwise a push is owed when the draft has never been sent, has changed since its last push, or the body\'s `title` / `description` differ from the pull request\'s; this call submits it. 3. `conflicts` (the draft\'s own, `details.conflictCount`) and `stale` (as above). 4. `sending` until the owed push lands and the pull request is open at it. 5. The build at the pull request\'s head must be a pass from the last hour. Otherwise this call asks for one, which posts the head\'s check run once it settles, and answers `building`, or `build-failed` for a failing one. 6. GitHub\'s mergeable state, as last recorded: `dirty` answers `pull-request-conflicts` (the draft\'s own conflicts are step 3\'s `conflicts`, so this one is resolved on GitHub), `draft` is read once more, as a press may follow a pull request marked ready, and answers `pull-request-draft` if it still is (or if GitHub cannot be read), and a state GitHub has not computed is read once more and otherwise answers `sending`. `blocked` with a passing build re-posts the head\'s passing check run, since a check run left from an earlier answer can be what blocks it, and goes on to the merge. `behind` alone does not refuse: the merge itself refuses a base branch that changed the package. 7. The package at the head is listed once and refused for what a publish cannot carry: `draft-publish-unreadable-file`, `draft-publish-too-large`, or `draft-publish-manifest-missing` (no `publisher.json`). 8. The pull request is merged at that head, confined to the package and only while the base branch has not changed the package since the draft\'s base, and the merge commit is published. GitHub refusing the merge answers `pull-request-blocked` (a required review or check is outstanding), a base branch that changed the package `stale`, a head that moved `sending`, and a pull request that changes files outside the package `push-refused` with `details.pushError` `review_outside_package`: a merge here never carries them onto the base branch, so they are reconciled on GitHub. A refusal because the pull request already merged (a second Publish racing the first) publishes that merge. Until the merge\'s version exists this answers `publishing` (the webhook or the merge record holds it, or GitHub\'s merge time is not read yet); call again, which never merges twice. **A successful publish closes the draft**, as the publish of a draft always has: the draft and its branch are deleted unless it changed meanwhile, a pull request is open on its branch, the publish created the package without attaching it to the workspace (`workspaceAttached: false`), or an agent sandbox turn is live on it. The close never fails this call; `publishedVersion` names the version published, or the existing one that already carries this merge. **Authorization**: the draft\'s modeling bar (`can_create_document` on the workspace, `can_create_package` on its environment) and `can_update_package` on a package that already exists; the publish itself re-checks them. `409` `draft-converting` means the draft is moving to the new store; retry. A `400` is the publish refusing the package itself (an archive it cannot read, a name it does not accept).
|
|
5654
|
+
* @summary Publish the draft
|
|
5488
5655
|
* @param {string} organizationName The unique identifier of the organization
|
|
5489
5656
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
5490
5657
|
* @param {string} draftId The draft package identifier
|
|
5658
|
+
* @param {DraftPublicationRequest} [draftPublicationRequest]
|
|
5491
5659
|
* @param {*} [options] Override http request option.
|
|
5492
5660
|
* @throws {RequiredError}
|
|
5493
5661
|
*/
|
|
5494
|
-
writeDraftPublication(organizationName, workspaceName, draftId, options) {
|
|
5662
|
+
writeDraftPublication(organizationName, workspaceName, draftId, draftPublicationRequest, options) {
|
|
5495
5663
|
return __awaiter(this, void 0, void 0, function* () {
|
|
5496
5664
|
var _a, _b, _c;
|
|
5497
|
-
const localVarAxiosArgs = yield localVarAxiosParamCreator.writeDraftPublication(organizationName, workspaceName, draftId, options);
|
|
5665
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.writeDraftPublication(organizationName, workspaceName, draftId, draftPublicationRequest, options);
|
|
5498
5666
|
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
5499
5667
|
const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['DraftsApi.writeDraftPublication']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
|
|
5500
5668
|
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
5501
5669
|
});
|
|
5502
5670
|
},
|
|
5503
|
-
/**
|
|
5504
|
-
* Proxies the code-assist git-gateway\'s `createDraftPullRequest`, forwarding the caller\'s own bearer token exactly as the History operations do. The gateway remains the sole authorizer; this endpoint performs no authorization of its own. Idempotent — an already-open pull request for this draft comes back rather than a second one. **Not a pure proxy: this call can sync and retry on your behalf.** A draft whose package already exists on the base branch — most commonly because this draft\'s own earlier pull request already merged it — is refused `409 draft-behind-base` unless it can be shown to derive from the base branch\'s current tip. Rather than surfacing that refusal immediately, this endpoint calls `updateDraftBranch`\'s own implementation, which merges the base branch into the draft\'s branch and writes `metadata.git.package_base_sha` on the draft\'s manifest from what that sync proves, then retries the create exactly once. Only a second refusal (a real race, or a draft whose package belongs to another name entirely) reaches the caller as `409`. A `sync-conflict` or `sync-rejected` from that internal sync surfaces as its own clear refusal, naming the manual paths out (resolve on github.com, or start a fresh draft) — resolve it there, or call `updateDraftBranch` directly for the same outcome without going through this endpoint. **Authorization**: Requires the environment\'s `can_create_package` (enforced by the gateway) — proposing a change is the same authority as writing the draft. **Git-backed drafts only.** A document-store draft answers `400` `draft-not-git-backed` before any call to the gateway: it has no branch, commits or pull request, so the operation does not apply to it. `409` `draft-provisioning` means the draft\'s branch is still being cut; retry.
|
|
5505
|
-
* @summary Open a pull request for a git-backed draft
|
|
5506
|
-
* @param {string} organizationName The unique identifier of the organization
|
|
5507
|
-
* @param {string} workspaceName The unique identifier of the workspace
|
|
5508
|
-
* @param {string} draftId The draft package identifier
|
|
5509
|
-
* @param {*} [options] Override http request option.
|
|
5510
|
-
* @throws {RequiredError}
|
|
5511
|
-
*/
|
|
5512
|
-
writeDraftPullRequest(organizationName, workspaceName, draftId, options) {
|
|
5513
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
5514
|
-
var _a, _b, _c;
|
|
5515
|
-
const localVarAxiosArgs = yield localVarAxiosParamCreator.writeDraftPullRequest(organizationName, workspaceName, draftId, options);
|
|
5516
|
-
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
5517
|
-
const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['DraftsApi.writeDraftPullRequest']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
|
|
5518
|
-
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
5519
|
-
});
|
|
5520
|
-
},
|
|
5521
5671
|
};
|
|
5522
5672
|
};
|
|
5523
5673
|
exports.DraftsApiFp = DraftsApiFp;
|
|
@@ -5529,7 +5679,7 @@ const DraftsApiFactory = function (configuration, basePath, axios) {
|
|
|
5529
5679
|
const localVarFp = (0, exports.DraftsApiFp)(configuration);
|
|
5530
5680
|
return {
|
|
5531
5681
|
/**
|
|
5532
|
-
* Mints a draft in this workspace and returns it. **Always creates**: a package can hold any number of drafts, one per chat by default, so a second request for the same `targetPackageName` mints a second draft rather than returning the first. Callers that want an existing draft list the workspace\'s drafts and open one by id. What keeps two writers off one draft is the draft\'s work-item claim, not uniqueness here.
|
|
5682
|
+
* Mints a draft in this workspace and returns it. **Always creates**: a package can hold any number of drafts, one per chat by default, so a second request for the same `targetPackageName` mints a second draft rather than returning the first. Callers that want an existing draft list the workspace\'s drafts and open one by id. What keeps two writers off one draft is the draft\'s work-item claim, not uniqueness here. Every draft is a document-store draft, in a git-enrolled environment as in any other: the draft\'s files are workspace documents, and git is only where a pushed draft goes for review. **`seedFromPublished` returns the draft already holding a published version\'s files**, in this one call: what opening a published package for editing takes, without a chat. Its refusals all come before the draft exists, and a seed that fails afterwards removes the draft; see the field. `201` with the new draft. **Authorization**: `can_create_document` in the workspace, and on every create the target environment\'s modeling bar (`can_create_package`, modeler or admin): putting a package in draft mode, or starting a new package\'s draft, is modeling work in that environment, and in a git-enrolled one creating the branch is a write into its repository. It is taken before anything is created; refused, it answers `403 draft-modeling-permission-required`.
|
|
5533
5683
|
* @summary Create a draft package
|
|
5534
5684
|
* @param {string} organizationName The unique identifier of the organization
|
|
5535
5685
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
@@ -5541,7 +5691,7 @@ const DraftsApiFactory = function (configuration, basePath, axios) {
|
|
|
5541
5691
|
return localVarFp.createDraft(organizationName, workspaceName, draftCreateRequest, options).then((request) => request(axios, basePath));
|
|
5542
5692
|
},
|
|
5543
5693
|
/**
|
|
5544
|
-
* Deletes the draft: its manifest and, for a document-store draft, its files. Its environment draft package is marked for the checkpoint reaper, so what was serving the draft is removed on the next tick. **The branch lives on.** Deleting a draft does not delete its git branch (docs/git-synced-modeling.md §7.2)
|
|
5694
|
+
* Deletes the draft: its manifest and, for a document-store draft, its files. Its environment draft package is marked for the checkpoint reaper, so what was serving the draft is removed on the next tick. **The branch usually lives on.** Deleting a draft does not delete its git branch (docs/git-synced-modeling.md §7.2), with one server-side exception: a draft that was never published and still sits at its seed commit has its branch deleted first, best-effort, so a draft minted from a misread intent leaves nothing behind. The delete is pinned to the seed commit, so a commit that landed since keeps the branch; the pin is not a compare-and-swap, so a commit landing in the instant between the gateway\'s tip re-read and its delete is lost. A failed branch delete never blocks the draft\'s delete, and retrying after a partial failure finds the branch already gone. Every other branch is removed by `DELETE .../drafts/{draftId}/branch`, or by the close after a successful publish (see `writeDraftPublication` and `createOrUpdatePackage`\'s `draftId`). **A second delete, or a read after this one, answers 404** to a caller who can use the workspace (403 to one who cannot): the gate is the workspace\'s, and the row is gone. **Authorization**: requires `can_delete_document` on the draft document, and `can_create_package` on the environment it targets.
|
|
5545
5695
|
* @summary Delete a draft package
|
|
5546
5696
|
* @param {string} organizationName The unique identifier of the organization
|
|
5547
5697
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
@@ -5553,7 +5703,7 @@ const DraftsApiFactory = function (configuration, basePath, axios) {
|
|
|
5553
5703
|
return localVarFp.deleteDraft(organizationName, workspaceName, draftId, options).then((request) => request(axios, basePath));
|
|
5554
5704
|
},
|
|
5555
5705
|
/**
|
|
5556
|
-
* Thin proxy to the code-assist git-gateway\'s `deleteDraft` — deletes the draft\'s branch in the managed monorepo
|
|
5706
|
+
* Thin proxy to the code-assist git-gateway\'s `deleteDraft` — deletes the draft\'s branch in the managed monorepo, forwarding the caller\'s own bearer token. **This is branch removal only — it does not delete the draft.** Deleting the draft is `DELETE` on the draft itself. Stays as the primitive operator tooling needs: `deleteDraft` deletes an untouched draft\'s branch at its seed commit on the server (docs/git-synced-modeling.md §7.2), so neither the app nor the agent needs to call this. See docs/tenant-offboarding-playbook.md, which prefers it over a raw GitHub call precisely because it carries the FGA check below. The close after a successful publish also deletes a draft\'s branch, but through the gateway directly rather than through this endpoint. **Authorization**: Requires write access to the draft\'s workspace (`can_create_document`) and `can_create_package` on the environment the draft targets, as deleting the draft does. The gateway re-checks the workspace relation. Idempotent, and deliberately not gated on the draft being git-backed, so a provisioning draft\'s half-cut branch can still be cleaned up.
|
|
5557
5707
|
* @summary Delete a git-backed draft\'s branch
|
|
5558
5708
|
* @param {string} organizationName The unique identifier of the organization
|
|
5559
5709
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
@@ -5565,28 +5715,28 @@ const DraftsApiFactory = function (configuration, basePath, axios) {
|
|
|
5565
5715
|
return localVarFp.deleteDraftBranch(organizationName, workspaceName, draftId, options).then((request) => request(axios, basePath));
|
|
5566
5716
|
},
|
|
5567
5717
|
/**
|
|
5568
|
-
* Removes a document from the draft
|
|
5718
|
+
* Removes a document from the draft: it deletes the document row, only if it still holds the `sha` in `expectedSha` when one is sent, and unconditionally (and idempotently) otherwise. **Authorization**: as `writeDraftDocument`.
|
|
5569
5719
|
* @summary Delete one of a draft\'s documents
|
|
5570
5720
|
* @param {string} organizationName The unique identifier of the organization
|
|
5571
5721
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
5572
5722
|
* @param {string} draftId The draft package identifier
|
|
5573
5723
|
* @param {string} documentPath The document\'s path relative to the draft root
|
|
5574
|
-
* @param {string} [
|
|
5575
|
-
* @param {string} [
|
|
5724
|
+
* @param {string} [expectedSha] The `sha` the caller read the document at: the delete applies only if the document still holds that version, else `409` `draft-document-stale`; a file already gone counts as deleted when this is the whole request, so a lost response can be resent.
|
|
5725
|
+
* @param {string} [expectedRef] Deprecated: use `expectedSha`. A git branch head, refused with `400` when set: a draft has no commits to compare it against, and a caller that sends a precondition believes it holds one. Kept one release, so a client from before the document store is refused rather than written unconditionally; removed in the release after.
|
|
5576
5726
|
* @param {*} [options] Override http request option.
|
|
5577
5727
|
* @throws {RequiredError}
|
|
5578
5728
|
*/
|
|
5579
|
-
deleteDraftDocument(organizationName, workspaceName, draftId, documentPath,
|
|
5580
|
-
return localVarFp.deleteDraftDocument(organizationName, workspaceName, draftId, documentPath,
|
|
5729
|
+
deleteDraftDocument(organizationName, workspaceName, draftId, documentPath, expectedSha, expectedRef, options) {
|
|
5730
|
+
return localVarFp.deleteDraftDocument(organizationName, workspaceName, draftId, documentPath, expectedSha, expectedRef, options).then((request) => request(axios, basePath));
|
|
5581
5731
|
},
|
|
5582
5732
|
/**
|
|
5583
|
-
* Discards the draft\'s change to one file, so the draft carries what its publication has at this path again. This is Restore, for any kind of file; after it the path has no `changeSincePublication` marker. `DELETE` on the document itself deletes the file instead — a different change, which this would undo. What it does follows the file\'s change marker, never whether a published copy can be read: - A data file: the draft\'s own upload or deletion is dropped. Where the draft\'s last publish shipped its own upload, the path returns to that upload; otherwise the published copy is inherited again, and a small UTF-8 file, which a draft holds as a document rather than inheriting, is written back as one.
|
|
5733
|
+
* Discards the draft\'s change to one file, so the draft carries what its publication has at this path again. This is Restore, for any kind of file; after it the path has no `changeSincePublication` marker. `DELETE` on the document itself deletes the file instead — a different change, which this would undo. What it does follows the file\'s change marker, never whether a published copy can be read: - A data file: the draft\'s own upload or deletion is dropped. Where the draft\'s last publish shipped its own upload, the path returns to that upload; otherwise the published copy is inherited again, and a small UTF-8 file, which a draft holds as a document rather than inheriting, is written back as one. - A text file the draft added: deleted. - A text file the draft edited or deleted: the published copy written back. Answers as `getDraftDocument` with `ref=publication` does when that copy cannot be read (`404` `draft-file-not-in-publication`, `409`, `413`, `503`), changing nothing. `404` `draft-document-unchanged` when the draft has no change at this path — a data file the draft\'s last publish shipped and has not touched since included. Before any change is found, the comparison itself can be refused, with the answers a read of the baseline gives: `403` when the caller cannot read the package the draft is measured against, `409` `draft-publication-baseline-missing` when that baseline cannot be measured (a corrupt archive), and `503` `draft-changes-unavailable` when it could not be read. **Authorization** — the same pair `writeDraftDocument` takes.
|
|
5584
5734
|
* @summary Restore one of a draft\'s files to its published copy
|
|
5585
5735
|
* @param {string} organizationName The unique identifier of the organization
|
|
5586
5736
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
5587
5737
|
* @param {string} draftId The draft package identifier
|
|
5588
5738
|
* @param {string} documentPath The file\'s path relative to the draft root
|
|
5589
|
-
* @param {string} [expectedRef]
|
|
5739
|
+
* @param {string} [expectedRef] Deprecated: a restore takes no precondition. A git branch head, refused with `400` when set: a draft has no commits to compare it against, and a caller that sends a precondition believes it holds one. Kept one release, so a client from before the document store is refused rather than written unconditionally; removed in the release after.
|
|
5590
5740
|
* @param {*} [options] Override http request option.
|
|
5591
5741
|
* @throws {RequiredError}
|
|
5592
5742
|
*/
|
|
@@ -5606,16 +5756,16 @@ const DraftsApiFactory = function (configuration, basePath, axios) {
|
|
|
5606
5756
|
return localVarFp.getDraft(organizationName, workspaceName, draftId, options).then((request) => request(axios, basePath));
|
|
5607
5757
|
},
|
|
5608
5758
|
/**
|
|
5609
|
-
* The
|
|
5610
|
-
* @summary
|
|
5759
|
+
* The draft\'s capabilities, derived by the server from its environment and what its package has published. The same value `getDraft` carries as `capabilities`, for a caller that does not need the rest of the draft: it reads the draft\'s manifest, its review state and one published-version lookup, not the checkpoint or the files. A draft that is moving to the new store answers `409` `draft-converting`: retry. **Authorization**: requires read access to the draft document.
|
|
5760
|
+
* @summary What the draft\'s storage can do
|
|
5611
5761
|
* @param {string} organizationName The unique identifier of the organization
|
|
5612
5762
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
5613
5763
|
* @param {string} draftId The draft package identifier
|
|
5614
5764
|
* @param {*} [options] Override http request option.
|
|
5615
5765
|
* @throws {RequiredError}
|
|
5616
5766
|
*/
|
|
5617
|
-
|
|
5618
|
-
return localVarFp.
|
|
5767
|
+
getDraftCapabilities(organizationName, workspaceName, draftId, options) {
|
|
5768
|
+
return localVarFp.getDraftCapabilities(organizationName, workspaceName, draftId, options).then((request) => request(axios, basePath));
|
|
5619
5769
|
},
|
|
5620
5770
|
/**
|
|
5621
5771
|
* Reports where the draft\'s environment package stands. Always answers `200`; `status` is `none` before the first checkpoint is requested, so a polling client does not treat absence as an error. **A pure read**, and the cheap one: this is what a client polls while a checkpoint is unsettled. It performs no write and starts no publish. This is a pure read. Resurrecting an idle-reaped draft package is a `POST` to `../checkpoints`, so that a publish into a live environment follows from an explicit request rather than from whichever tab last refreshed. `resurrectable` on the response says whether such a request would rebuild anything. **Authorization**: requires read access to the draft document, the same bar as the other draft reads.
|
|
@@ -5630,23 +5780,34 @@ const DraftsApiFactory = function (configuration, basePath, axios) {
|
|
|
5630
5780
|
return localVarFp.getDraftCheckpointStatus(organizationName, workspaceName, draftId, options).then((request) => request(axios, basePath));
|
|
5631
5781
|
},
|
|
5632
5782
|
/**
|
|
5633
|
-
*
|
|
5634
|
-
* @summary
|
|
5783
|
+
* One entry of `getDraftConflicts` with the incoming side\'s, the draft\'s and their common ancestor\'s version of the file, so the caller can reconcile them and write the result through `writeDraftDocuments` with the `conflictSha` this returns. **Authorization**: requires read access to the draft document, and `can_create_package` on the environment it targets: only a modeler can act on what this serves. `404` when the path has no conflict (it was resolved, or never conflicted).
|
|
5784
|
+
* @summary One conflicting file, with all three of its versions
|
|
5635
5785
|
* @param {string} organizationName The unique identifier of the organization
|
|
5636
5786
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
5637
5787
|
* @param {string} draftId The draft package identifier
|
|
5638
|
-
* @param {string}
|
|
5639
|
-
* @param {
|
|
5640
|
-
* @
|
|
5788
|
+
* @param {string} documentPath The conflicting file\'s path relative to the draft root, as `getDraftConflicts` lists it.
|
|
5789
|
+
* @param {*} [options] Override http request option.
|
|
5790
|
+
* @throws {RequiredError}
|
|
5791
|
+
*/
|
|
5792
|
+
getDraftConflict(organizationName, workspaceName, draftId, documentPath, options) {
|
|
5793
|
+
return localVarFp.getDraftConflict(organizationName, workspaceName, draftId, documentPath, options).then((request) => request(axios, basePath));
|
|
5794
|
+
},
|
|
5795
|
+
/**
|
|
5796
|
+
* A page of the draft\'s conflicts: every path both the draft and what came in changed since their common ancestor, where what came in is a newer published version of its package (the base moved) or a commit someone pushed to its pull request. A superset of what cannot merge on its own, because nothing here runs a merge. Ordered by `relpath`. Each entry says where its incoming side came from, and carries the `conflictSha` a resolution sends back through `writeDraftDocuments`, a member per file. `getDraftConflict` returns one file\'s three versions. An empty list means nothing waits on the author: what only one side changed is absorbed in the background. Conflicts never block editing or a Submit; a submitted draft\'s push waits for the last one to be resolved and then starts on its own. Served from controlplane\'s record alone: no file content, no archive read and no GitHub call. **Authorization**: requires read access to the draft document. `409` `draft-converting` means the draft is moving to the new store; retry.
|
|
5797
|
+
* @summary The files the draft and what came in both changed
|
|
5798
|
+
* @param {string} organizationName The unique identifier of the organization
|
|
5799
|
+
* @param {string} workspaceName The unique identifier of the workspace
|
|
5800
|
+
* @param {string} draftId The draft package identifier
|
|
5801
|
+
* @param {number} [limit] Maximum number of items to return. Use -1 or omit to return all results. Valid values: -1 (all results) or 1–500.
|
|
5641
5802
|
* @param {number} [offset] Number of items to skip before starting to return results
|
|
5642
5803
|
* @param {*} [options] Override http request option.
|
|
5643
5804
|
* @throws {RequiredError}
|
|
5644
5805
|
*/
|
|
5645
|
-
|
|
5646
|
-
return localVarFp.
|
|
5806
|
+
getDraftConflicts(organizationName, workspaceName, draftId, limit, offset, options) {
|
|
5807
|
+
return localVarFp.getDraftConflicts(organizationName, workspaceName, draftId, limit, offset, options).then((request) => request(axios, basePath));
|
|
5647
5808
|
},
|
|
5648
5809
|
/**
|
|
5649
|
-
* The draft as it stands, as a package archive: its own files at its latest content, its uploaded data files, and the data files it inherits from the published version, minus any it deleted — the same layering its checkpoints and publishes use (docs/draft-data-file-upload-design.md §4.3), but built from the draft\'s current content rather than its last checkpoint, and with its own `publisher.json`. For working on the package locally. `409` `draft-
|
|
5810
|
+
* The draft as it stands, as a package archive: its own files at its latest content, its uploaded data files, and the data files it inherits from the published version, minus any it deleted — the same layering its checkpoints and publishes use (docs/draft-data-file-upload-design.md §4.3), but built from the draft\'s current content rather than its last checkpoint, and with its own `publisher.json`. For working on the package locally. `409` `draft-converting` while the draft is moving to the new store; `503` `draft-data-file-storage-unavailable` when an upload\'s object or the published archive could not be read. **Authorization**: requires read access to the draft document, and — when the draft\'s package has a published version, whose data files the zip would inherit — update access to the package, as downloading that version does (`getPackageVersionContent`). That check runs before the published archive is fetched, so a reader without it never causes that read.
|
|
5650
5811
|
* @summary Download a draft package as a zip
|
|
5651
5812
|
* @param {string} organizationName The unique identifier of the organization
|
|
5652
5813
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
@@ -5658,13 +5819,13 @@ const DraftsApiFactory = function (configuration, basePath, axios) {
|
|
|
5658
5819
|
return localVarFp.getDraftContent(organizationName, workspaceName, draftId, options).then((request) => request(axios, basePath));
|
|
5659
5820
|
},
|
|
5660
5821
|
/**
|
|
5661
|
-
* One document\'s content
|
|
5822
|
+
* One document\'s content. `409` `draft-converting` while the draft is moving to the new store. Refuses with `413` (`draft-file-unreadable`) when the document is not readable as UTF-8 text under 1MB. That is a permanent refusal about the file\'s shape, not a transient failure: the same refusal stops a publish, so retrying achieves nothing until the file is removed or replaced. **`ref=publication`** reads the document as it is in the version the draft\'s `changeSincePublication` markers compare against. The baseline is resolved server-side, never taken from the caller: the stored archive of the draft\'s last published version, or — for one never published — of the version it was opened on. The answers, each distinct: - `200`: the file\'s content in that baseline. - `403`: the caller can read the draft but not the package whose stored archive is the baseline. Workspace access does not imply environment access, so this read also takes `can_read_package` on it. - `404` `draft-file-not-in-publication`: the baseline exists and does not hold this file. There is nothing to restore from it. - `409` `draft-publication-baseline-missing`: there is no baseline to read — a draft never published and opened on nothing, a publication recorded before baselines were, a published version with no stored archive, one whose archive is corrupt, or one that no longer holds what its publish recorded. Permanent until the draft publishes again. - `413` `draft-file-unreadable`: the baseline\'s copy is not UTF-8 text under 1MB. - `503` `draft-publication-unreadable`: the baseline exists but could not be read right now. Retryable. The content is the published archive\'s bytes decoded as UTF-8, so its SHA-256 is the hash the markers were computed from. A published file a draft cannot hold (binary, or 1 MiB and over) is inherited by the draft rather than held, so it is not in the baseline and answers `404`. **Authorization**: requires read access to the draft document.
|
|
5662
5823
|
* @summary Read one of a draft\'s documents
|
|
5663
5824
|
* @param {string} organizationName The unique identifier of the organization
|
|
5664
5825
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
5665
5826
|
* @param {string} draftId The draft package identifier
|
|
5666
5827
|
* @param {string} documentPath The document\'s path relative to the draft root
|
|
5667
|
-
* @param {string} [ref]
|
|
5828
|
+
* @param {string} [ref] The literal `publication` reads the file as it is in the draft\'s publication baseline — see the operation\'s description. It is matched exactly (lower case). Any other value is ignored: a draft keeps no commits to read at.
|
|
5668
5829
|
* @param {*} [options] Override http request option.
|
|
5669
5830
|
* @throws {RequiredError}
|
|
5670
5831
|
*/
|
|
@@ -5672,7 +5833,7 @@ const DraftsApiFactory = function (configuration, basePath, axios) {
|
|
|
5672
5833
|
return localVarFp.getDraftDocument(organizationName, workspaceName, draftId, documentPath, ref, options).then((request) => request(axios, basePath));
|
|
5673
5834
|
},
|
|
5674
5835
|
/**
|
|
5675
|
-
* The bytes of a file as the draft carries it: a text document\'s content, a data file\'s own upload, or otherwise the data file it inherits from the package\'s published version. So a download works the same on any file of the draft. A path the draft deleted answers `404`; `409` `draft-
|
|
5836
|
+
* The bytes of a file as the draft carries it: a text document\'s content, a data file\'s own upload, or otherwise the data file it inherits from the package\'s published version. So a download works the same on any file of the draft. A path the draft deleted answers `404`; `409` `draft-converting` while the draft is moving to the new store. A text document that cannot be served as text (1 MiB or more) answers `413` `draft-file-unreadable`, as `getDraftDocument` does. An uploaded data file never takes this path. **Authorization**: requires read access to the draft document. A data file the draft inherits also requires update access to the package, as downloading the published version does (`getPackageVersionContent`); the draft\'s own uploads do not. That check runs before the published archive is fetched, so a reader without it gets `403` for any path the draft itself does not hold, a missing one included.
|
|
5676
5837
|
* @summary Download one of a draft\'s files
|
|
5677
5838
|
* @param {string} organizationName The unique identifier of the organization
|
|
5678
5839
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
@@ -5685,47 +5846,45 @@ const DraftsApiFactory = function (configuration, basePath, axios) {
|
|
|
5685
5846
|
return localVarFp.getDraftDocumentContent(organizationName, workspaceName, draftId, documentPath, options).then((request) => request(axios, basePath));
|
|
5686
5847
|
},
|
|
5687
5848
|
/**
|
|
5688
|
-
*
|
|
5689
|
-
* @summary
|
|
5849
|
+
* The gates `writeDraftPublication` applies, read without acting on any of them: no submit, no build request, no merge and no listing of the package on GitHub, so it costs database reads only. `ready` false comes with the `reason` the publish would answer now. `ready` true means every gate this read covers passed; the publish\'s own listing of the package at the pull request\'s head can still refuse it. `ready` says nothing about the caller: a reader who may not publish reads it too, and the publish refuses them `403`. A draft that is owed a push or a build reads `sending` or `building` here, and only `writeDraftPublication` starts them. A `blocked` pull request reads `pull-request-blocked` here even when the publish would re-post its check and merge. `warnings` are about what the publish would ship, not whether it can: today, that a first publish exposes every source (see `DraftPublicationWarning`). They are read only when `ready` is true, and are empty otherwise. **Authorization**: requires read access to the draft document. `409` `draft-converting` means the draft is moving to the new store; retry.
|
|
5850
|
+
* @summary Whether the draft can be published now
|
|
5690
5851
|
* @param {string} organizationName The unique identifier of the organization
|
|
5691
5852
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
5692
5853
|
* @param {string} draftId The draft package identifier
|
|
5693
5854
|
* @param {*} [options] Override http request option.
|
|
5694
5855
|
* @throws {RequiredError}
|
|
5695
5856
|
*/
|
|
5696
|
-
|
|
5697
|
-
return localVarFp.
|
|
5857
|
+
getDraftPublication(organizationName, workspaceName, draftId, options) {
|
|
5858
|
+
return localVarFp.getDraftPublication(organizationName, workspaceName, draftId, options).then((request) => request(axios, basePath));
|
|
5698
5859
|
},
|
|
5699
5860
|
/**
|
|
5700
|
-
*
|
|
5701
|
-
* @summary
|
|
5861
|
+
* Served from controlplane\'s record of the draft and nothing else: no GitHub read and no side effect, so polling it costs controlplane\'s own reads only. Always answers `200` for a draft the caller can read. `state` is `none` when the draft has no pull request, and a draft whose environment does not review on GitHub answers `state: none`, `reviewState: notSubmitted`, so a polling client treats absence as an answer, not an error. `reviewState` says where the review stands and `nextAttemptAt` when it is next worked on; `unsubmittedChanges` says whether the draft has edits since its last push. Poll while `reviewState` is `sending` or a pull request is open, and stop otherwise. `mergeable` is GitHub\'s own verdict as last recorded and is `null` while GitHub is still computing it. Treat `null` as \"not yet known\" and re-read; never as \"not mergeable\". **Authorization**: requires read access to the draft document. `409` `draft-converting` means the draft is moving to the new store; retry.
|
|
5862
|
+
* @summary The draft\'s pull request and review state
|
|
5702
5863
|
* @param {string} organizationName The unique identifier of the organization
|
|
5703
5864
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
5704
5865
|
* @param {string} draftId The draft package identifier
|
|
5705
|
-
* @param {number} [limit]
|
|
5706
|
-
* @param {number} [offset]
|
|
5707
5866
|
* @param {*} [options] Override http request option.
|
|
5708
5867
|
* @throws {RequiredError}
|
|
5709
5868
|
*/
|
|
5710
|
-
|
|
5711
|
-
return localVarFp.
|
|
5869
|
+
getDraftPullRequest(organizationName, workspaceName, draftId, options) {
|
|
5870
|
+
return localVarFp.getDraftPullRequest(organizationName, workspaceName, draftId, options).then((request) => request(axios, basePath));
|
|
5712
5871
|
},
|
|
5713
5872
|
/**
|
|
5714
|
-
* The draft\'s files
|
|
5873
|
+
* The draft\'s files: the documents under `path` to `depth`, held as workspace documents. `409` `draft-converting` while the draft is moving to the new store. **Listed against the draft\'s last publication.** A draft is a package in draft mode, so a listing reports each document\'s `changeSincePublication` — added, modified, or unchanged — and includes the files the publication shipped that the draft has since deleted, as `removed` entries. A deletion is an edit like any other, and a page rendering the draft\'s files needs all of them from one read. A draft never published is measured against the published version it was opened on (the package\'s latest version when none was recorded), and only for a caller with read access to that package: the markers would otherwise name the package\'s published files, and their absence say which of them the draft leaves unchanged, to a reader who cannot read it. For such a caller the draft\'s own files are listed without markers, with `Changes-Unavailable`. A baseline that exists but cannot be measured or read (an archive that failed to download) is `Changes-Unavailable` too, never \"nothing to compare against\". A never-published draft of a package with no published version carries no markers and no removed entries. When the comparison cannot be made (a transient failure, or a publication recorded before its baseline existed), the listing is still returned, without markers, and says so with the `Changes-Unavailable` header rather than failing. Content is omitted from the listing unless `withContent=true`; otherwise read a document to get it. **Authorization**: requires read access to the draft document.
|
|
5715
5874
|
* @summary List a draft\'s documents
|
|
5716
5875
|
* @param {string} organizationName The unique identifier of the organization
|
|
5717
5876
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
5718
5877
|
* @param {string} draftId The draft package identifier
|
|
5719
5878
|
* @param {string} [path] Restrict the listing to this subtree, relative to the draft root.
|
|
5720
|
-
* @param {number} [depth] `1` lists only the
|
|
5721
|
-
* @param {
|
|
5879
|
+
* @param {number} [depth] `1` lists only the files directly under `path`, as a file browser would. Omitted returns every file in the subtree, which is what a section listing wants. A draft\'s paths are flat, so neither returns directory entries.
|
|
5880
|
+
* @param {boolean} [withContent] Carry each document\'s content on its entry, so a caller that wants the whole draft makes one request rather than one per file. A document\'s text comes as `content`. A data file the draft holds beside its documents (`kind` `data`) carries neither, as in any listing. The listing is whole-draft or refused: past the same file-count and byte limits a checkpoint collects under, it answers `413` `draft-listing-too-large` rather than a partial one, and `limit` and `offset` do not lower what is read, only what is returned. Read the files one at a time instead.
|
|
5722
5881
|
* @param {number} [limit] Maximum number of items to return. Use -1 or omit to return all results.
|
|
5723
5882
|
* @param {number} [offset] Number of items to skip before starting to return results
|
|
5724
5883
|
* @param {*} [options] Override http request option.
|
|
5725
5884
|
* @throws {RequiredError}
|
|
5726
5885
|
*/
|
|
5727
|
-
listDraftDocuments(organizationName, workspaceName, draftId, path, depth,
|
|
5728
|
-
return localVarFp.listDraftDocuments(organizationName, workspaceName, draftId, path, depth,
|
|
5886
|
+
listDraftDocuments(organizationName, workspaceName, draftId, path, depth, withContent, limit, offset, options) {
|
|
5887
|
+
return localVarFp.listDraftDocuments(organizationName, workspaceName, draftId, path, depth, withContent, limit, offset, options).then((request) => request(axios, basePath));
|
|
5729
5888
|
},
|
|
5730
5889
|
/**
|
|
5731
5890
|
* The workspace\'s drafts, each as the same `Draft` the item endpoint returns. **This is how a surface finds drafts.** Before it existed the only way was to list every document in the workspace and filter on type and path prefix, which meant the sidebar, the scope chips and the edit-package flow each pulled every file of every draft in the workspace to render a handful of rows. Composed server-side, one query against the checkpoint rows rather than one request per draft. **Authorization**: requires read access to the workspace, and each draft is filtered to those the caller can read — the same two-stage bar `listDocuments` applies, since a draft\'s authorization object is still its manifest document.
|
|
@@ -5742,7 +5901,7 @@ const DraftsApiFactory = function (configuration, basePath, axios) {
|
|
|
5742
5901
|
return localVarFp.listDrafts(organizationName, workspaceName, retired, limit, offset, options).then((request) => request(axios, basePath));
|
|
5743
5902
|
},
|
|
5744
5903
|
/**
|
|
5745
|
-
* Changes a draft\'s own fields. Every field is optional and an absent one is left alone. Its writers own different slices — a display name comes from a person, `publishedAs` from a publish
|
|
5904
|
+
* Changes a draft\'s own fields. Every field is optional and an absent one is left alone. Its writers own different slices — a display name comes from a person, `publishedAs` from a publish. The package name is not one of them once set: `targetPackageName` cannot change a draft\'s package (`409 draft-package-name-fixed`). A replacement would make each of them responsible for preserving the others\' fields. **A deleted or nonexistent draft answers 404 to a caller who can write its workspace**, and 403 to one who cannot, for the same reason `getDraft` does. **Authorization**: requires `can_update_document` on the draft document, and `can_create_package` on the environment it targets.
|
|
5746
5905
|
* @summary Update a draft package
|
|
5747
5906
|
* @param {string} organizationName The unique identifier of the organization
|
|
5748
5907
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
@@ -5755,32 +5914,7 @@ const DraftsApiFactory = function (configuration, basePath, axios) {
|
|
|
5755
5914
|
return localVarFp.updateDraft(organizationName, workspaceName, draftId, draftUpdate, options).then((request) => request(axios, basePath));
|
|
5756
5915
|
},
|
|
5757
5916
|
/**
|
|
5758
|
-
*
|
|
5759
|
-
* @summary Move the draft\'s branch
|
|
5760
|
-
* @param {string} organizationName The unique identifier of the organization
|
|
5761
|
-
* @param {string} workspaceName The unique identifier of the workspace
|
|
5762
|
-
* @param {string} draftId The draft package identifier
|
|
5763
|
-
* @param {*} [options] Override http request option.
|
|
5764
|
-
* @throws {RequiredError}
|
|
5765
|
-
*/
|
|
5766
|
-
updateDraftBranch(organizationName, workspaceName, draftId, options) {
|
|
5767
|
-
return localVarFp.updateDraftBranch(organizationName, workspaceName, draftId, options).then((request) => request(axios, basePath));
|
|
5768
|
-
},
|
|
5769
|
-
/**
|
|
5770
|
-
* Advances the pull request\'s state. Merging is a transition of the pull request, not an action filed under it — `PATCH` on the resource rather than a `/merge` verb in the path, which is what every other resource in this API does. Proxies the git-gateway\'s `mergeDraftPullRequest`. Squash-merges into the base branch and returns the merge commit SHA, which becomes the published version\'s `git_commit_sha` — the first provenance anchor reachable from the base branch. `expectedHeadSha` is required and pins what is merged to what the caller read, so a checkpoint that landed after the review cannot be merged silently. Read it from `getDraftPullRequest` and pass it straight back. A `409` means the head moved, the pull request is gone, `publisher.json` names a version that already exists, or the package is known not to compile at this head (`draft-compile-failed`); a `405` means GitHub says the branch is not mergeable — a conflict, or a required review that has not passed. The compile check is READ here, never run — it is started by `getDraftPullRequest` and can take minutes, so this call adds no compile latency. The consequence is that it refuses only a `failing` verdict already computed for this exact `expectedHeadSha`. `pending`, `unverified`, and a verdict this replica has not computed at all ALL allow the merge. Treat it as a guard against merging a known-broken package, not as a guarantee that a merged package compiled. **Authorization**: Requires the environment\'s `can_update_project` (enforced by the gateway) — a strictly higher bar than opening the pull request, because a merge changes what serves for the whole environment. **Git-backed drafts only.** A document-store draft answers `400` `draft-not-git-backed` before any call to the gateway: it has no branch, commits or pull request, so the operation does not apply to it. `409` `draft-provisioning` means the draft\'s branch is still being cut; retry.
|
|
5771
|
-
* @summary Merge the draft\'s pull request
|
|
5772
|
-
* @param {string} organizationName The unique identifier of the organization
|
|
5773
|
-
* @param {string} workspaceName The unique identifier of the workspace
|
|
5774
|
-
* @param {string} draftId The draft package identifier
|
|
5775
|
-
* @param {MergeDraftPullRequest} mergeDraftPullRequest
|
|
5776
|
-
* @param {*} [options] Override http request option.
|
|
5777
|
-
* @throws {RequiredError}
|
|
5778
|
-
*/
|
|
5779
|
-
updateDraftPullRequest(organizationName, workspaceName, draftId, mergeDraftPullRequest, options) {
|
|
5780
|
-
return localVarFp.updateDraftPullRequest(organizationName, workspaceName, draftId, mergeDraftPullRequest, options).then((request) => request(axios, basePath));
|
|
5781
|
-
},
|
|
5782
|
-
/**
|
|
5783
|
-
* Asks for a checkpoint of the draft\'s current content. A `POST` to the collection rather than a `PUT` on a singleton: this starts a job and answers `202`, and the checkpoints it appends to are a series (`1.0.N`), not one value being set. Sending it twice is still safe — see the coalescing note below — but that is a property of the nudge, not a claim that the request is idempotent in the `PUT` sense. The current checkpoint\'s status is a separate read: `GET` on `../checkpoint`. Records that the draft\'s current content should be published as the next checkpoint (`1.0.N`) of its environment draft package — an ordinary published package named `draft-{draftKey}` in the draft\'s target environment, served by the Publisher exactly like any other package there (docs/workspace-architecture-design.md §4). Always answers `202` with the current status: this call is a nudge, not the publish. The reconciler resolves the draft\'s current content itself when it collects the work — the git branch head for a git-backed draft, the doc-store tree otherwise — which is why the request carries no ref and no content: a caller-supplied ref would be both spoofable and racy against the agent\'s own commits, and a nudge that arrives late still publishes what the draft says NOW. Nudges coalesce: any number recorded between publishes produce one checkpoint of the newest content, and a nudge whose content is identical to the latest published checkpoint publishes nothing. That is this operation\'s own contract, not something the verb supplies — a `POST` to a collection is not idempotent, so a retry after a lost response would otherwise mint a second checkpoint of content that has not changed. A failed publish (the draft does not compile, most commonly) records `failed` with the compiler\'s message and leaves the previous checkpoint serving; the next nudge retries with the then-current content. **This is also how a reaped draft package comes back.** A draft whose package has been idle-reaped (24 hours without a checkpoint request) keeps its row as a witness, and a nudge clears the reap marker and re-queues the publish — the same row update that publishes anything else, so no separate verb is needed. `GET` on this path reports `resurrectable` so a client knows to send one. A merge reap comes back the same way, but a client with the draft page open asks automatically: the app\'s own `POST` rebuilds the package unless the reap\'s own tick wins the race first — at `1.0.0` after the reap, or cancelling the reap and republishing into it. A package a resurrect brought back is a live draft again from there, so the ordinary idle sweep (24 hours since the *last checkpoint request*, not tied to a viewer leaving) reclaims it if nobody keeps asking. Either way a draft that outlives its merge (its close was skipped or its publish failed) can be nudged again, and any later nudge rebuilds it the same way: at `1.0.0` once the reap is deleting the package, or as the next `1.0.N` when the nudge lands before the reap starts and keeps it. Only a deleted draft\'s reap is terminal — its content has no home left — and a nudge for one is refused rather than honoured. **Authorization**: requires `can_update_document` on the draft document AND the target environment\'s `can_create_package` — the same two bars every content-writing draft operation already takes, so anyone modeling in the draft holds both.
|
|
5917
|
+
* Asks for a checkpoint of the draft\'s current content. A `POST` to the collection rather than a `PUT` on a singleton: this starts a job and answers `202`, and the checkpoints it appends to are a series (`1.0.N`), not one value being set. Sending it twice is still safe — see the coalescing note below — but that is a property of the nudge, not a claim that the request is idempotent in the `PUT` sense. The current checkpoint\'s status is a separate read: `GET` on `../checkpoint`. Records that the draft\'s current content should be published as the next checkpoint (`1.0.N`) of its environment draft package — an ordinary published package named `draft-{draftKey}` in the draft\'s target environment, served by the Publisher exactly like any other package there (docs/workspace-architecture-design.md §4). Answers `202` with the current status: this call is a nudge, not the publish. A draft that is moving to the new store answers `409` `draft-converting` and records nothing; retry after a moment. The reconciler resolves the draft\'s current content itself when it collects the work — the draft\'s documents — which is why the request carries no ref and no content: a caller-supplied ref would be both spoofable and racy against the agent\'s own commits, and a nudge that arrives late still publishes what the draft says NOW. Nudges coalesce: any number recorded between publishes produce one checkpoint of the newest content, and a nudge whose content is identical to the latest published checkpoint publishes nothing. That is this operation\'s own contract, not something the verb supplies — a `POST` to a collection is not idempotent, so a retry after a lost response would otherwise mint a second checkpoint of content that has not changed. A failed publish (the draft does not compile, most commonly) records `failed` with the compiler\'s message and leaves the previous checkpoint serving; the next nudge retries with the then-current content. **This is also how a reaped draft package comes back.** A draft whose package has been idle-reaped (24 hours without a checkpoint request) keeps its row as a witness, and a nudge clears the reap marker and re-queues the publish — the same row update that publishes anything else, so no separate verb is needed. `GET` on this path reports `resurrectable` so a client knows to send one. A merge reap comes back the same way, but a client with the draft page open asks automatically: the app\'s own `POST` rebuilds the package unless the reap\'s own tick wins the race first — at `1.0.0` after the reap, or cancelling the reap and republishing into it. A package a resurrect brought back is a live draft again from there, so the ordinary idle sweep (24 hours since the *last checkpoint request*, not tied to a viewer leaving) reclaims it if nobody keeps asking. Either way a draft that outlives its merge (its close was skipped or its publish failed) can be nudged again, and any later nudge rebuilds it the same way: at `1.0.0` once the reap is deleting the package, or as the next `1.0.N` when the nudge lands before the reap starts and keeps it. Only a deleted draft\'s reap is terminal — its content has no home left — and a nudge for one is refused rather than honoured. **Authorization**: requires `can_update_document` on the draft document AND the target environment\'s `can_create_package` — the same two bars every content-writing draft operation already takes, so anyone modeling in the draft holds both.
|
|
5784
5918
|
* @summary Set the draft\'s checkpoint to its current content
|
|
5785
5919
|
* @param {string} organizationName The unique identifier of the organization
|
|
5786
5920
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
@@ -5792,7 +5926,7 @@ const DraftsApiFactory = function (configuration, basePath, axios) {
|
|
|
5792
5926
|
return localVarFp.writeDraftCheckpoint(organizationName, workspaceName, draftId, options).then((request) => request(axios, basePath));
|
|
5793
5927
|
},
|
|
5794
5928
|
/**
|
|
5795
|
-
* Creates or replaces a document
|
|
5929
|
+
* Creates or replaces a document. `PUT` rather than `POST` because the path is the identifier and the caller chooses it — there is no server-assigned id for a file, so a collection `POST` would have nothing to assign. **The precondition is per file.** `expectedSha` (the `sha` the writer read) replaces the document only if it still holds that version, and `createOnly` creates it only if no document is there. Of two writers holding the same `sha` exactly one wins and the other gets `409` `draft-document-stale`, except that a resent write that already landed is answered as applied (below). They are mutually exclusive (`400` when both are sent). With neither, the write is last-writer-wins, as a write through the documents API has always been. A retry whose change is already in place (the content is current, or the file to delete is gone) is answered as applied, not as a conflict, so a lost response can be resent. A deletion of a gone file with an `expectedSha` counts as applied only when no write in the same set is still to land: a move whose old path was deleted or moved by someone else is stale (`\"\"`), not a second copy. The server requests the draft\'s checkpoint after the write commits, so a client does not request one itself. **Authorization** — `can_update_document` on the draft document, **and** `can_create_package` on the draft\'s target environment. The second is not redundant: `can_update_document` on a draft is satisfied by bare workspace membership, while a file written here reaches the environment on the draft author\'s next checkpoint, carrying the checkpointer\'s bar rather than the writer\'s. The environment comes from the draft\'s own manifest and is never a request field; a draft that names none is refused, since it could not be published either. Refuses with `400` (`draft-notebook-read-only`) when a document path ends `.malloynb` and the write would change it or add a new one to a draft that already has files. A `.malloynb` notebook in a draft is read-only: convert it to a `.malloy` notebook (the same name with `.malloy`, beside it) and edit that, or delete it. Writing identical content, or seeding an empty draft, is allowed, and so is a deletion.
|
|
5796
5930
|
* @summary Write one of a draft\'s documents
|
|
5797
5931
|
* @param {string} organizationName The unique identifier of the organization
|
|
5798
5932
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
@@ -5806,7 +5940,7 @@ const DraftsApiFactory = function (configuration, basePath, axios) {
|
|
|
5806
5940
|
return localVarFp.writeDraftDocument(organizationName, workspaceName, draftId, documentPath, draftDocumentWrite, options).then((request) => request(axios, basePath));
|
|
5807
5941
|
},
|
|
5808
5942
|
/**
|
|
5809
|
-
* Writes a data file\'s bytes — a Parquet, CSV, JSON or Excel (`.xlsx`) file a model reads — into the draft, creating it or replacing the draft\'s earlier upload at the same path. A data file lives beside the draft\'s text documents
|
|
5943
|
+
* Writes a data file\'s bytes — a Parquet, CSV, JSON or Excel (`.xlsx`) file a model reads — into the draft, creating it or replacing the draft\'s earlier upload at the same path. A data file lives beside the draft\'s text documents (docs/draft-data-file-upload-design.md). The body is the file itself, `application/octet-stream`, with `Content-Length` set; a chunked body without one is refused before it is read. Uploading over a data file the package\'s published version serves replaces it in the draft: the draft\'s checkpoint and its next publish carry the upload, and the published version keeps its copy until then. A path the draft holds as a small text document (a CSV the published version shipped, which a draft holds as text) moves: the upload is stored and the text copy removed, so the path lives in one place. `DELETE` on the document path deletes a data file, or — for one the draft inherits — records that the draft no longer carries it; `DELETE` on its `change` restores it to the published copy. Refusals, each with its `code`: - `400` `draft-data-file-body-unreadable`: the request body ended or failed before it was read through (a dropped connection, a truncating proxy). Nothing was written; send it again. - `400` `draft-data-file-invalid`: the path holds a character outside Malloy\'s unquoted DuckDB path set `[A-Za-z0-9._~:/?#@!$&*+,=%-]`, such as a space, a bracket, a quote or an accented letter (a model can\'t name such a file in `duckdb.table(\'…\')`; the message names the path with accents dropped and each run of any other such character replaced by `_`, which the app uploads to instead), or ends in `.txt` (DuckDB has no reader for that extension; rename it `.csv` or `.tsv`), or ends in any other extension outside the formats a model reads as data: `.csv`, `.tsv`, `.parquet`, `.xlsx`, `.json`, `.jsonl`, `.ndjson`, and `.csv.gz`, `.tsv.gz`, `.json.gz`, `.jsonl.gz`, `.ndjson.gz` (an `.xls` is told to save as `.xlsx`). Decided by the path, before the body is read. - `409` `draft-content-not-data`: the path names a file the package treats as text (`publisher.json`, `.malloy`, `.malloynb`, `.md`, `.html`, or a `.json` at the package root). Those are written through `writeDraftDocument`. - `411` `draft-data-file-length-required`: the request declared no `Content-Length`. - `413` `draft-data-file-too-large`: over 32 MiB. - `413` `draft-data-files-over-quota`: the draft would hold more than 64 data files or 128 MiB of them. - `422` `draft-data-file-invalid`: a `.parquet` or `.xlsx` path whose bytes are not that format, or an empty body. - `429` `draft-data-file-rate-limited`: more than 30 uploads into this draft in the last minute, or more uploads in flight on the serving replica than it spools at once (8). Both are counted per replica. Retry after a moment. **Authorization** — the same pair `writeDraftDocument` takes: `can_update_document` on the draft document, and `can_create_package` on the draft\'s target environment.
|
|
5810
5944
|
* @summary Upload a data file into a draft
|
|
5811
5945
|
* @param {string} organizationName The unique identifier of the organization
|
|
5812
5946
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
@@ -5820,7 +5954,7 @@ const DraftsApiFactory = function (configuration, basePath, axios) {
|
|
|
5820
5954
|
return localVarFp.writeDraftDocumentContent(organizationName, workspaceName, draftId, documentPath, body, options).then((request) => request(axios, basePath));
|
|
5821
5955
|
},
|
|
5822
5956
|
/**
|
|
5823
|
-
* Writes a set of documents together
|
|
5957
|
+
* Writes a set of documents together, in one transaction: a seed, or a multi-file edit that must not be seen half applied. Ordinary editing uses the per-document `PUT`. This is for the cases that are atomic by nature. Each member may carry its own `expectedSha` or `createOnly` (see `writeDraftDocument`), so a move is one set: `createOnly` on the new path and a deletion with `expectedSha` on the old one. If any member\'s precondition fails, none is written and the `409` `draft-document-stale` names every conflicting path; a set already partly in place (a resent one) commits only what remains. **Authorization**: as `writeDraftDocument`. **Resolving conflicts.** A member carrying the `conflictSha` that `getDraftConflicts` gave its path resolves that one conflict: the path leaves the conflict list and its base moves to the incoming side, so the next sync does not raise it again. With no content and no `deleted` the member keeps the draft\'s file as it is (an uploaded data file too), and only the conflict is cleared. Members without a `conflictSha` write as usual, and a write may resolve any subset of the list. A `conflictSha` that no longer names the path\'s conflict (the incoming side moved, or it was resolved) is `409` `draft-conflict-changed`, and nothing is written. Once none remain, the draft moves on to what came in, and a submitted draft\'s push starts. A resolution never fails on an archive: when the published version the last conflicts came from cannot be read, the draft\'s next sync moves its base instead. **Fenced by a work item.** A caller executing a work item (one claimed through the controlplane\'s private work-item API) sends its claim in `Work-Item-Claim` (`{id}@{generation}`). The claim is checked first thing in the transaction that writes the document rows, and refused with `409` `draft-write-fenced` -- writing nothing -- when it is no longer the live one: released, cancelled, or swept after its holder stopped heartbeating. A malformed header is a `400`. Without the header the write is unfenced, as before. Only this operation honors the header. Refuses with `400` (`draft-notebook-read-only`) when a document path ends `.malloynb` and the write would change it or add a new one to a draft that already has files. A `.malloynb` notebook in a draft is read-only: convert it to a `.malloy` notebook (the same name with `.malloy`, beside it) and edit that, or delete it. Writing identical content, or seeding an empty draft, is allowed, and so is a deletion.
|
|
5824
5958
|
* @summary Write several of a draft\'s documents as one change
|
|
5825
5959
|
* @param {string} organizationName The unique identifier of the organization
|
|
5826
5960
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
@@ -5834,28 +5968,17 @@ const DraftsApiFactory = function (configuration, basePath, axios) {
|
|
|
5834
5968
|
return localVarFp.writeDraftDocuments(organizationName, workspaceName, draftId, draftDocumentsWrite, workItemClaim, options).then((request) => request(axios, basePath));
|
|
5835
5969
|
},
|
|
5836
5970
|
/**
|
|
5837
|
-
*
|
|
5838
|
-
* @summary Publish
|
|
5971
|
+
* The one way a draft ships, whether or not its environment reviews drafts on GitHub. Either the draft\'s package is published and this answers `200` with it, or nothing is published and it answers `409` `draft-not-ready` with `details.reason` saying what it waits on. Call it again once that clears: every step is safe to repeat, and a repeat after a publish answers with the version already published. `getDraftPublication` reads the same gates without acting on them. **A draft whose environment does not review on GitHub** is published from its own files, in this order: 1. `conflicts`: the draft has unresolved conflicts (`details.conflictCount`). 2. `stale`: the package has a newer version than the one the draft is synced to; the background sync brings it in. 3. `building` / `build-failed`: the draft\'s latest content has no passing build from the last hour. A missing, pending or stale build is requested here and answers `building`; a failing one answers `build-failed`, with the compiler\'s message. 4. The publish, `createOrUpdatePackage` naming this draft. The body\'s `description` is written into the published `publisher.json`. A package that moved under the draft while it published answers `stale`. **A draft whose environment reviews on GitHub** merges its pull request and publishes the merge commit: 1. A draft whose pull request merged, and which has not changed since, goes straight to the publish (8). One edited after its merge is a new pull request. While a rebuild of a merged draft is pending this answers `building`: the build says whether it holds an edit. A rebuild that failed on the merged content still publishes the merge. One whose content cannot be compared answers `build-failed` when it failed to compile, and `building` when it failed on Credible\'s side, which this call asks to rebuild. 2. A push GitHub refused for good answers `push-refused`, with the reason in `details.pushError`: `data_files_only`, `no_changes`, `content_refused`, `review_outside_package`, `repository_too_large` or `push_refused`, until the draft\'s content changes, which sends it again (`repository_too_large` only fails again: see `push-refused` below). Otherwise a push is owed when the draft has never been sent, has changed since its last push, or the body\'s `title` / `description` differ from the pull request\'s; this call submits it. 3. `conflicts` (the draft\'s own, `details.conflictCount`) and `stale` (as above). 4. `sending` until the owed push lands and the pull request is open at it. 5. The build at the pull request\'s head must be a pass from the last hour. Otherwise this call asks for one, which posts the head\'s check run once it settles, and answers `building`, or `build-failed` for a failing one. 6. GitHub\'s mergeable state, as last recorded: `dirty` answers `pull-request-conflicts` (the draft\'s own conflicts are step 3\'s `conflicts`, so this one is resolved on GitHub), `draft` is read once more, as a press may follow a pull request marked ready, and answers `pull-request-draft` if it still is (or if GitHub cannot be read), and a state GitHub has not computed is read once more and otherwise answers `sending`. `blocked` with a passing build re-posts the head\'s passing check run, since a check run left from an earlier answer can be what blocks it, and goes on to the merge. `behind` alone does not refuse: the merge itself refuses a base branch that changed the package. 7. The package at the head is listed once and refused for what a publish cannot carry: `draft-publish-unreadable-file`, `draft-publish-too-large`, or `draft-publish-manifest-missing` (no `publisher.json`). 8. The pull request is merged at that head, confined to the package and only while the base branch has not changed the package since the draft\'s base, and the merge commit is published. GitHub refusing the merge answers `pull-request-blocked` (a required review or check is outstanding), a base branch that changed the package `stale`, a head that moved `sending`, and a pull request that changes files outside the package `push-refused` with `details.pushError` `review_outside_package`: a merge here never carries them onto the base branch, so they are reconciled on GitHub. A refusal because the pull request already merged (a second Publish racing the first) publishes that merge. Until the merge\'s version exists this answers `publishing` (the webhook or the merge record holds it, or GitHub\'s merge time is not read yet); call again, which never merges twice. **A successful publish closes the draft**, as the publish of a draft always has: the draft and its branch are deleted unless it changed meanwhile, a pull request is open on its branch, the publish created the package without attaching it to the workspace (`workspaceAttached: false`), or an agent sandbox turn is live on it. The close never fails this call; `publishedVersion` names the version published, or the existing one that already carries this merge. **Authorization**: the draft\'s modeling bar (`can_create_document` on the workspace, `can_create_package` on its environment) and `can_update_package` on a package that already exists; the publish itself re-checks them. `409` `draft-converting` means the draft is moving to the new store; retry. A `400` is the publish refusing the package itself (an archive it cannot read, a name it does not accept).
|
|
5972
|
+
* @summary Publish the draft
|
|
5839
5973
|
* @param {string} organizationName The unique identifier of the organization
|
|
5840
5974
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
5841
5975
|
* @param {string} draftId The draft package identifier
|
|
5976
|
+
* @param {DraftPublicationRequest} [draftPublicationRequest]
|
|
5842
5977
|
* @param {*} [options] Override http request option.
|
|
5843
5978
|
* @throws {RequiredError}
|
|
5844
5979
|
*/
|
|
5845
|
-
writeDraftPublication(organizationName, workspaceName, draftId, options) {
|
|
5846
|
-
return localVarFp.writeDraftPublication(organizationName, workspaceName, draftId, options).then((request) => request(axios, basePath));
|
|
5847
|
-
},
|
|
5848
|
-
/**
|
|
5849
|
-
* Proxies the code-assist git-gateway\'s `createDraftPullRequest`, forwarding the caller\'s own bearer token exactly as the History operations do. The gateway remains the sole authorizer; this endpoint performs no authorization of its own. Idempotent — an already-open pull request for this draft comes back rather than a second one. **Not a pure proxy: this call can sync and retry on your behalf.** A draft whose package already exists on the base branch — most commonly because this draft\'s own earlier pull request already merged it — is refused `409 draft-behind-base` unless it can be shown to derive from the base branch\'s current tip. Rather than surfacing that refusal immediately, this endpoint calls `updateDraftBranch`\'s own implementation, which merges the base branch into the draft\'s branch and writes `metadata.git.package_base_sha` on the draft\'s manifest from what that sync proves, then retries the create exactly once. Only a second refusal (a real race, or a draft whose package belongs to another name entirely) reaches the caller as `409`. A `sync-conflict` or `sync-rejected` from that internal sync surfaces as its own clear refusal, naming the manual paths out (resolve on github.com, or start a fresh draft) — resolve it there, or call `updateDraftBranch` directly for the same outcome without going through this endpoint. **Authorization**: Requires the environment\'s `can_create_package` (enforced by the gateway) — proposing a change is the same authority as writing the draft. **Git-backed drafts only.** A document-store draft answers `400` `draft-not-git-backed` before any call to the gateway: it has no branch, commits or pull request, so the operation does not apply to it. `409` `draft-provisioning` means the draft\'s branch is still being cut; retry.
|
|
5850
|
-
* @summary Open a pull request for a git-backed draft
|
|
5851
|
-
* @param {string} organizationName The unique identifier of the organization
|
|
5852
|
-
* @param {string} workspaceName The unique identifier of the workspace
|
|
5853
|
-
* @param {string} draftId The draft package identifier
|
|
5854
|
-
* @param {*} [options] Override http request option.
|
|
5855
|
-
* @throws {RequiredError}
|
|
5856
|
-
*/
|
|
5857
|
-
writeDraftPullRequest(organizationName, workspaceName, draftId, options) {
|
|
5858
|
-
return localVarFp.writeDraftPullRequest(organizationName, workspaceName, draftId, options).then((request) => request(axios, basePath));
|
|
5980
|
+
writeDraftPublication(organizationName, workspaceName, draftId, draftPublicationRequest, options) {
|
|
5981
|
+
return localVarFp.writeDraftPublication(organizationName, workspaceName, draftId, draftPublicationRequest, options).then((request) => request(axios, basePath));
|
|
5859
5982
|
},
|
|
5860
5983
|
};
|
|
5861
5984
|
};
|
|
@@ -5868,7 +5991,7 @@ exports.DraftsApiFactory = DraftsApiFactory;
|
|
|
5868
5991
|
*/
|
|
5869
5992
|
class DraftsApi extends base_1.BaseAPI {
|
|
5870
5993
|
/**
|
|
5871
|
-
* Mints a draft in this workspace and returns it. **Always creates**: a package can hold any number of drafts, one per chat by default, so a second request for the same `targetPackageName` mints a second draft rather than returning the first. Callers that want an existing draft list the workspace\'s drafts and open one by id. What keeps two writers off one draft is the draft\'s work-item claim, not uniqueness here.
|
|
5994
|
+
* Mints a draft in this workspace and returns it. **Always creates**: a package can hold any number of drafts, one per chat by default, so a second request for the same `targetPackageName` mints a second draft rather than returning the first. Callers that want an existing draft list the workspace\'s drafts and open one by id. What keeps two writers off one draft is the draft\'s work-item claim, not uniqueness here. Every draft is a document-store draft, in a git-enrolled environment as in any other: the draft\'s files are workspace documents, and git is only where a pushed draft goes for review. **`seedFromPublished` returns the draft already holding a published version\'s files**, in this one call: what opening a published package for editing takes, without a chat. Its refusals all come before the draft exists, and a seed that fails afterwards removes the draft; see the field. `201` with the new draft. **Authorization**: `can_create_document` in the workspace, and on every create the target environment\'s modeling bar (`can_create_package`, modeler or admin): putting a package in draft mode, or starting a new package\'s draft, is modeling work in that environment, and in a git-enrolled one creating the branch is a write into its repository. It is taken before anything is created; refused, it answers `403 draft-modeling-permission-required`.
|
|
5872
5995
|
* @summary Create a draft package
|
|
5873
5996
|
* @param {string} organizationName The unique identifier of the organization
|
|
5874
5997
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
@@ -5881,7 +6004,7 @@ class DraftsApi extends base_1.BaseAPI {
|
|
|
5881
6004
|
return (0, exports.DraftsApiFp)(this.configuration).createDraft(organizationName, workspaceName, draftCreateRequest, options).then((request) => request(this.axios, this.basePath));
|
|
5882
6005
|
}
|
|
5883
6006
|
/**
|
|
5884
|
-
* Deletes the draft: its manifest and, for a document-store draft, its files. Its environment draft package is marked for the checkpoint reaper, so what was serving the draft is removed on the next tick. **The branch lives on.** Deleting a draft does not delete its git branch (docs/git-synced-modeling.md §7.2)
|
|
6007
|
+
* Deletes the draft: its manifest and, for a document-store draft, its files. Its environment draft package is marked for the checkpoint reaper, so what was serving the draft is removed on the next tick. **The branch usually lives on.** Deleting a draft does not delete its git branch (docs/git-synced-modeling.md §7.2), with one server-side exception: a draft that was never published and still sits at its seed commit has its branch deleted first, best-effort, so a draft minted from a misread intent leaves nothing behind. The delete is pinned to the seed commit, so a commit that landed since keeps the branch; the pin is not a compare-and-swap, so a commit landing in the instant between the gateway\'s tip re-read and its delete is lost. A failed branch delete never blocks the draft\'s delete, and retrying after a partial failure finds the branch already gone. Every other branch is removed by `DELETE .../drafts/{draftId}/branch`, or by the close after a successful publish (see `writeDraftPublication` and `createOrUpdatePackage`\'s `draftId`). **A second delete, or a read after this one, answers 404** to a caller who can use the workspace (403 to one who cannot): the gate is the workspace\'s, and the row is gone. **Authorization**: requires `can_delete_document` on the draft document, and `can_create_package` on the environment it targets.
|
|
5885
6008
|
* @summary Delete a draft package
|
|
5886
6009
|
* @param {string} organizationName The unique identifier of the organization
|
|
5887
6010
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
@@ -5894,7 +6017,7 @@ class DraftsApi extends base_1.BaseAPI {
|
|
|
5894
6017
|
return (0, exports.DraftsApiFp)(this.configuration).deleteDraft(organizationName, workspaceName, draftId, options).then((request) => request(this.axios, this.basePath));
|
|
5895
6018
|
}
|
|
5896
6019
|
/**
|
|
5897
|
-
* Thin proxy to the code-assist git-gateway\'s `deleteDraft` — deletes the draft\'s branch in the managed monorepo
|
|
6020
|
+
* Thin proxy to the code-assist git-gateway\'s `deleteDraft` — deletes the draft\'s branch in the managed monorepo, forwarding the caller\'s own bearer token. **This is branch removal only — it does not delete the draft.** Deleting the draft is `DELETE` on the draft itself. Stays as the primitive operator tooling needs: `deleteDraft` deletes an untouched draft\'s branch at its seed commit on the server (docs/git-synced-modeling.md §7.2), so neither the app nor the agent needs to call this. See docs/tenant-offboarding-playbook.md, which prefers it over a raw GitHub call precisely because it carries the FGA check below. The close after a successful publish also deletes a draft\'s branch, but through the gateway directly rather than through this endpoint. **Authorization**: Requires write access to the draft\'s workspace (`can_create_document`) and `can_create_package` on the environment the draft targets, as deleting the draft does. The gateway re-checks the workspace relation. Idempotent, and deliberately not gated on the draft being git-backed, so a provisioning draft\'s half-cut branch can still be cleaned up.
|
|
5898
6021
|
* @summary Delete a git-backed draft\'s branch
|
|
5899
6022
|
* @param {string} organizationName The unique identifier of the organization
|
|
5900
6023
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
@@ -5907,29 +6030,29 @@ class DraftsApi extends base_1.BaseAPI {
|
|
|
5907
6030
|
return (0, exports.DraftsApiFp)(this.configuration).deleteDraftBranch(organizationName, workspaceName, draftId, options).then((request) => request(this.axios, this.basePath));
|
|
5908
6031
|
}
|
|
5909
6032
|
/**
|
|
5910
|
-
* Removes a document from the draft
|
|
6033
|
+
* Removes a document from the draft: it deletes the document row, only if it still holds the `sha` in `expectedSha` when one is sent, and unconditionally (and idempotently) otherwise. **Authorization**: as `writeDraftDocument`.
|
|
5911
6034
|
* @summary Delete one of a draft\'s documents
|
|
5912
6035
|
* @param {string} organizationName The unique identifier of the organization
|
|
5913
6036
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
5914
6037
|
* @param {string} draftId The draft package identifier
|
|
5915
6038
|
* @param {string} documentPath The document\'s path relative to the draft root
|
|
5916
|
-
* @param {string} [
|
|
5917
|
-
* @param {string} [
|
|
6039
|
+
* @param {string} [expectedSha] The `sha` the caller read the document at: the delete applies only if the document still holds that version, else `409` `draft-document-stale`; a file already gone counts as deleted when this is the whole request, so a lost response can be resent.
|
|
6040
|
+
* @param {string} [expectedRef] Deprecated: use `expectedSha`. A git branch head, refused with `400` when set: a draft has no commits to compare it against, and a caller that sends a precondition believes it holds one. Kept one release, so a client from before the document store is refused rather than written unconditionally; removed in the release after.
|
|
5918
6041
|
* @param {*} [options] Override http request option.
|
|
5919
6042
|
* @throws {RequiredError}
|
|
5920
6043
|
* @memberof DraftsApi
|
|
5921
6044
|
*/
|
|
5922
|
-
deleteDraftDocument(organizationName, workspaceName, draftId, documentPath,
|
|
5923
|
-
return (0, exports.DraftsApiFp)(this.configuration).deleteDraftDocument(organizationName, workspaceName, draftId, documentPath,
|
|
6045
|
+
deleteDraftDocument(organizationName, workspaceName, draftId, documentPath, expectedSha, expectedRef, options) {
|
|
6046
|
+
return (0, exports.DraftsApiFp)(this.configuration).deleteDraftDocument(organizationName, workspaceName, draftId, documentPath, expectedSha, expectedRef, options).then((request) => request(this.axios, this.basePath));
|
|
5924
6047
|
}
|
|
5925
6048
|
/**
|
|
5926
|
-
* Discards the draft\'s change to one file, so the draft carries what its publication has at this path again. This is Restore, for any kind of file; after it the path has no `changeSincePublication` marker. `DELETE` on the document itself deletes the file instead — a different change, which this would undo. What it does follows the file\'s change marker, never whether a published copy can be read: - A data file: the draft\'s own upload or deletion is dropped. Where the draft\'s last publish shipped its own upload, the path returns to that upload; otherwise the published copy is inherited again, and a small UTF-8 file, which a draft holds as a document rather than inheriting, is written back as one.
|
|
6049
|
+
* Discards the draft\'s change to one file, so the draft carries what its publication has at this path again. This is Restore, for any kind of file; after it the path has no `changeSincePublication` marker. `DELETE` on the document itself deletes the file instead — a different change, which this would undo. What it does follows the file\'s change marker, never whether a published copy can be read: - A data file: the draft\'s own upload or deletion is dropped. Where the draft\'s last publish shipped its own upload, the path returns to that upload; otherwise the published copy is inherited again, and a small UTF-8 file, which a draft holds as a document rather than inheriting, is written back as one. - A text file the draft added: deleted. - A text file the draft edited or deleted: the published copy written back. Answers as `getDraftDocument` with `ref=publication` does when that copy cannot be read (`404` `draft-file-not-in-publication`, `409`, `413`, `503`), changing nothing. `404` `draft-document-unchanged` when the draft has no change at this path — a data file the draft\'s last publish shipped and has not touched since included. Before any change is found, the comparison itself can be refused, with the answers a read of the baseline gives: `403` when the caller cannot read the package the draft is measured against, `409` `draft-publication-baseline-missing` when that baseline cannot be measured (a corrupt archive), and `503` `draft-changes-unavailable` when it could not be read. **Authorization** — the same pair `writeDraftDocument` takes.
|
|
5927
6050
|
* @summary Restore one of a draft\'s files to its published copy
|
|
5928
6051
|
* @param {string} organizationName The unique identifier of the organization
|
|
5929
6052
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
5930
6053
|
* @param {string} draftId The draft package identifier
|
|
5931
6054
|
* @param {string} documentPath The file\'s path relative to the draft root
|
|
5932
|
-
* @param {string} [expectedRef]
|
|
6055
|
+
* @param {string} [expectedRef] Deprecated: a restore takes no precondition. A git branch head, refused with `400` when set: a draft has no commits to compare it against, and a caller that sends a precondition believes it holds one. Kept one release, so a client from before the document store is refused rather than written unconditionally; removed in the release after.
|
|
5933
6056
|
* @param {*} [options] Override http request option.
|
|
5934
6057
|
* @throws {RequiredError}
|
|
5935
6058
|
* @memberof DraftsApi
|
|
@@ -5951,8 +6074,8 @@ class DraftsApi extends base_1.BaseAPI {
|
|
|
5951
6074
|
return (0, exports.DraftsApiFp)(this.configuration).getDraft(organizationName, workspaceName, draftId, options).then((request) => request(this.axios, this.basePath));
|
|
5952
6075
|
}
|
|
5953
6076
|
/**
|
|
5954
|
-
* The
|
|
5955
|
-
* @summary
|
|
6077
|
+
* The draft\'s capabilities, derived by the server from its environment and what its package has published. The same value `getDraft` carries as `capabilities`, for a caller that does not need the rest of the draft: it reads the draft\'s manifest, its review state and one published-version lookup, not the checkpoint or the files. A draft that is moving to the new store answers `409` `draft-converting`: retry. **Authorization**: requires read access to the draft document.
|
|
6078
|
+
* @summary What the draft\'s storage can do
|
|
5956
6079
|
* @param {string} organizationName The unique identifier of the organization
|
|
5957
6080
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
5958
6081
|
* @param {string} draftId The draft package identifier
|
|
@@ -5960,8 +6083,8 @@ class DraftsApi extends base_1.BaseAPI {
|
|
|
5960
6083
|
* @throws {RequiredError}
|
|
5961
6084
|
* @memberof DraftsApi
|
|
5962
6085
|
*/
|
|
5963
|
-
|
|
5964
|
-
return (0, exports.DraftsApiFp)(this.configuration).
|
|
6086
|
+
getDraftCapabilities(organizationName, workspaceName, draftId, options) {
|
|
6087
|
+
return (0, exports.DraftsApiFp)(this.configuration).getDraftCapabilities(organizationName, workspaceName, draftId, options).then((request) => request(this.axios, this.basePath));
|
|
5965
6088
|
}
|
|
5966
6089
|
/**
|
|
5967
6090
|
* Reports where the draft\'s environment package stands. Always answers `200`; `status` is `none` before the first checkpoint is requested, so a polling client does not treat absence as an error. **A pure read**, and the cheap one: this is what a client polls while a checkpoint is unsettled. It performs no write and starts no publish. This is a pure read. Resurrecting an idle-reaped draft package is a `POST` to `../checkpoints`, so that a publish into a live environment follows from an explicit request rather than from whichever tab last refreshed. `resurrectable` on the response says whether such a request would rebuild anything. **Authorization**: requires read access to the draft document, the same bar as the other draft reads.
|
|
@@ -5977,24 +6100,36 @@ class DraftsApi extends base_1.BaseAPI {
|
|
|
5977
6100
|
return (0, exports.DraftsApiFp)(this.configuration).getDraftCheckpointStatus(organizationName, workspaceName, draftId, options).then((request) => request(this.axios, this.basePath));
|
|
5978
6101
|
}
|
|
5979
6102
|
/**
|
|
5980
|
-
*
|
|
5981
|
-
* @summary
|
|
6103
|
+
* One entry of `getDraftConflicts` with the incoming side\'s, the draft\'s and their common ancestor\'s version of the file, so the caller can reconcile them and write the result through `writeDraftDocuments` with the `conflictSha` this returns. **Authorization**: requires read access to the draft document, and `can_create_package` on the environment it targets: only a modeler can act on what this serves. `404` when the path has no conflict (it was resolved, or never conflicted).
|
|
6104
|
+
* @summary One conflicting file, with all three of its versions
|
|
5982
6105
|
* @param {string} organizationName The unique identifier of the organization
|
|
5983
6106
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
5984
6107
|
* @param {string} draftId The draft package identifier
|
|
5985
|
-
* @param {string}
|
|
5986
|
-
* @param {
|
|
5987
|
-
* @
|
|
6108
|
+
* @param {string} documentPath The conflicting file\'s path relative to the draft root, as `getDraftConflicts` lists it.
|
|
6109
|
+
* @param {*} [options] Override http request option.
|
|
6110
|
+
* @throws {RequiredError}
|
|
6111
|
+
* @memberof DraftsApi
|
|
6112
|
+
*/
|
|
6113
|
+
getDraftConflict(organizationName, workspaceName, draftId, documentPath, options) {
|
|
6114
|
+
return (0, exports.DraftsApiFp)(this.configuration).getDraftConflict(organizationName, workspaceName, draftId, documentPath, options).then((request) => request(this.axios, this.basePath));
|
|
6115
|
+
}
|
|
6116
|
+
/**
|
|
6117
|
+
* A page of the draft\'s conflicts: every path both the draft and what came in changed since their common ancestor, where what came in is a newer published version of its package (the base moved) or a commit someone pushed to its pull request. A superset of what cannot merge on its own, because nothing here runs a merge. Ordered by `relpath`. Each entry says where its incoming side came from, and carries the `conflictSha` a resolution sends back through `writeDraftDocuments`, a member per file. `getDraftConflict` returns one file\'s three versions. An empty list means nothing waits on the author: what only one side changed is absorbed in the background. Conflicts never block editing or a Submit; a submitted draft\'s push waits for the last one to be resolved and then starts on its own. Served from controlplane\'s record alone: no file content, no archive read and no GitHub call. **Authorization**: requires read access to the draft document. `409` `draft-converting` means the draft is moving to the new store; retry.
|
|
6118
|
+
* @summary The files the draft and what came in both changed
|
|
6119
|
+
* @param {string} organizationName The unique identifier of the organization
|
|
6120
|
+
* @param {string} workspaceName The unique identifier of the workspace
|
|
6121
|
+
* @param {string} draftId The draft package identifier
|
|
6122
|
+
* @param {number} [limit] Maximum number of items to return. Use -1 or omit to return all results. Valid values: -1 (all results) or 1–500.
|
|
5988
6123
|
* @param {number} [offset] Number of items to skip before starting to return results
|
|
5989
6124
|
* @param {*} [options] Override http request option.
|
|
5990
6125
|
* @throws {RequiredError}
|
|
5991
6126
|
* @memberof DraftsApi
|
|
5992
6127
|
*/
|
|
5993
|
-
|
|
5994
|
-
return (0, exports.DraftsApiFp)(this.configuration).
|
|
6128
|
+
getDraftConflicts(organizationName, workspaceName, draftId, limit, offset, options) {
|
|
6129
|
+
return (0, exports.DraftsApiFp)(this.configuration).getDraftConflicts(organizationName, workspaceName, draftId, limit, offset, options).then((request) => request(this.axios, this.basePath));
|
|
5995
6130
|
}
|
|
5996
6131
|
/**
|
|
5997
|
-
* The draft as it stands, as a package archive: its own files at its latest content, its uploaded data files, and the data files it inherits from the published version, minus any it deleted — the same layering its checkpoints and publishes use (docs/draft-data-file-upload-design.md §4.3), but built from the draft\'s current content rather than its last checkpoint, and with its own `publisher.json`. For working on the package locally. `409` `draft-
|
|
6132
|
+
* The draft as it stands, as a package archive: its own files at its latest content, its uploaded data files, and the data files it inherits from the published version, minus any it deleted — the same layering its checkpoints and publishes use (docs/draft-data-file-upload-design.md §4.3), but built from the draft\'s current content rather than its last checkpoint, and with its own `publisher.json`. For working on the package locally. `409` `draft-converting` while the draft is moving to the new store; `503` `draft-data-file-storage-unavailable` when an upload\'s object or the published archive could not be read. **Authorization**: requires read access to the draft document, and — when the draft\'s package has a published version, whose data files the zip would inherit — update access to the package, as downloading that version does (`getPackageVersionContent`). That check runs before the published archive is fetched, so a reader without it never causes that read.
|
|
5998
6133
|
* @summary Download a draft package as a zip
|
|
5999
6134
|
* @param {string} organizationName The unique identifier of the organization
|
|
6000
6135
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
@@ -6007,13 +6142,13 @@ class DraftsApi extends base_1.BaseAPI {
|
|
|
6007
6142
|
return (0, exports.DraftsApiFp)(this.configuration).getDraftContent(organizationName, workspaceName, draftId, options).then((request) => request(this.axios, this.basePath));
|
|
6008
6143
|
}
|
|
6009
6144
|
/**
|
|
6010
|
-
* One document\'s content
|
|
6145
|
+
* One document\'s content. `409` `draft-converting` while the draft is moving to the new store. Refuses with `413` (`draft-file-unreadable`) when the document is not readable as UTF-8 text under 1MB. That is a permanent refusal about the file\'s shape, not a transient failure: the same refusal stops a publish, so retrying achieves nothing until the file is removed or replaced. **`ref=publication`** reads the document as it is in the version the draft\'s `changeSincePublication` markers compare against. The baseline is resolved server-side, never taken from the caller: the stored archive of the draft\'s last published version, or — for one never published — of the version it was opened on. The answers, each distinct: - `200`: the file\'s content in that baseline. - `403`: the caller can read the draft but not the package whose stored archive is the baseline. Workspace access does not imply environment access, so this read also takes `can_read_package` on it. - `404` `draft-file-not-in-publication`: the baseline exists and does not hold this file. There is nothing to restore from it. - `409` `draft-publication-baseline-missing`: there is no baseline to read — a draft never published and opened on nothing, a publication recorded before baselines were, a published version with no stored archive, one whose archive is corrupt, or one that no longer holds what its publish recorded. Permanent until the draft publishes again. - `413` `draft-file-unreadable`: the baseline\'s copy is not UTF-8 text under 1MB. - `503` `draft-publication-unreadable`: the baseline exists but could not be read right now. Retryable. The content is the published archive\'s bytes decoded as UTF-8, so its SHA-256 is the hash the markers were computed from. A published file a draft cannot hold (binary, or 1 MiB and over) is inherited by the draft rather than held, so it is not in the baseline and answers `404`. **Authorization**: requires read access to the draft document.
|
|
6011
6146
|
* @summary Read one of a draft\'s documents
|
|
6012
6147
|
* @param {string} organizationName The unique identifier of the organization
|
|
6013
6148
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
6014
6149
|
* @param {string} draftId The draft package identifier
|
|
6015
6150
|
* @param {string} documentPath The document\'s path relative to the draft root
|
|
6016
|
-
* @param {string} [ref]
|
|
6151
|
+
* @param {string} [ref] The literal `publication` reads the file as it is in the draft\'s publication baseline — see the operation\'s description. It is matched exactly (lower case). Any other value is ignored: a draft keeps no commits to read at.
|
|
6017
6152
|
* @param {*} [options] Override http request option.
|
|
6018
6153
|
* @throws {RequiredError}
|
|
6019
6154
|
* @memberof DraftsApi
|
|
@@ -6022,7 +6157,7 @@ class DraftsApi extends base_1.BaseAPI {
|
|
|
6022
6157
|
return (0, exports.DraftsApiFp)(this.configuration).getDraftDocument(organizationName, workspaceName, draftId, documentPath, ref, options).then((request) => request(this.axios, this.basePath));
|
|
6023
6158
|
}
|
|
6024
6159
|
/**
|
|
6025
|
-
* The bytes of a file as the draft carries it: a text document\'s content, a data file\'s own upload, or otherwise the data file it inherits from the package\'s published version. So a download works the same on any file of the draft. A path the draft deleted answers `404`; `409` `draft-
|
|
6160
|
+
* The bytes of a file as the draft carries it: a text document\'s content, a data file\'s own upload, or otherwise the data file it inherits from the package\'s published version. So a download works the same on any file of the draft. A path the draft deleted answers `404`; `409` `draft-converting` while the draft is moving to the new store. A text document that cannot be served as text (1 MiB or more) answers `413` `draft-file-unreadable`, as `getDraftDocument` does. An uploaded data file never takes this path. **Authorization**: requires read access to the draft document. A data file the draft inherits also requires update access to the package, as downloading the published version does (`getPackageVersionContent`); the draft\'s own uploads do not. That check runs before the published archive is fetched, so a reader without it gets `403` for any path the draft itself does not hold, a missing one included.
|
|
6026
6161
|
* @summary Download one of a draft\'s files
|
|
6027
6162
|
* @param {string} organizationName The unique identifier of the organization
|
|
6028
6163
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
@@ -6036,8 +6171,8 @@ class DraftsApi extends base_1.BaseAPI {
|
|
|
6036
6171
|
return (0, exports.DraftsApiFp)(this.configuration).getDraftDocumentContent(organizationName, workspaceName, draftId, documentPath, options).then((request) => request(this.axios, this.basePath));
|
|
6037
6172
|
}
|
|
6038
6173
|
/**
|
|
6039
|
-
*
|
|
6040
|
-
* @summary
|
|
6174
|
+
* The gates `writeDraftPublication` applies, read without acting on any of them: no submit, no build request, no merge and no listing of the package on GitHub, so it costs database reads only. `ready` false comes with the `reason` the publish would answer now. `ready` true means every gate this read covers passed; the publish\'s own listing of the package at the pull request\'s head can still refuse it. `ready` says nothing about the caller: a reader who may not publish reads it too, and the publish refuses them `403`. A draft that is owed a push or a build reads `sending` or `building` here, and only `writeDraftPublication` starts them. A `blocked` pull request reads `pull-request-blocked` here even when the publish would re-post its check and merge. `warnings` are about what the publish would ship, not whether it can: today, that a first publish exposes every source (see `DraftPublicationWarning`). They are read only when `ready` is true, and are empty otherwise. **Authorization**: requires read access to the draft document. `409` `draft-converting` means the draft is moving to the new store; retry.
|
|
6175
|
+
* @summary Whether the draft can be published now
|
|
6041
6176
|
* @param {string} organizationName The unique identifier of the organization
|
|
6042
6177
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
6043
6178
|
* @param {string} draftId The draft package identifier
|
|
@@ -6045,41 +6180,39 @@ class DraftsApi extends base_1.BaseAPI {
|
|
|
6045
6180
|
* @throws {RequiredError}
|
|
6046
6181
|
* @memberof DraftsApi
|
|
6047
6182
|
*/
|
|
6048
|
-
|
|
6049
|
-
return (0, exports.DraftsApiFp)(this.configuration).
|
|
6183
|
+
getDraftPublication(organizationName, workspaceName, draftId, options) {
|
|
6184
|
+
return (0, exports.DraftsApiFp)(this.configuration).getDraftPublication(organizationName, workspaceName, draftId, options).then((request) => request(this.axios, this.basePath));
|
|
6050
6185
|
}
|
|
6051
6186
|
/**
|
|
6052
|
-
*
|
|
6053
|
-
* @summary
|
|
6187
|
+
* Served from controlplane\'s record of the draft and nothing else: no GitHub read and no side effect, so polling it costs controlplane\'s own reads only. Always answers `200` for a draft the caller can read. `state` is `none` when the draft has no pull request, and a draft whose environment does not review on GitHub answers `state: none`, `reviewState: notSubmitted`, so a polling client treats absence as an answer, not an error. `reviewState` says where the review stands and `nextAttemptAt` when it is next worked on; `unsubmittedChanges` says whether the draft has edits since its last push. Poll while `reviewState` is `sending` or a pull request is open, and stop otherwise. `mergeable` is GitHub\'s own verdict as last recorded and is `null` while GitHub is still computing it. Treat `null` as \"not yet known\" and re-read; never as \"not mergeable\". **Authorization**: requires read access to the draft document. `409` `draft-converting` means the draft is moving to the new store; retry.
|
|
6188
|
+
* @summary The draft\'s pull request and review state
|
|
6054
6189
|
* @param {string} organizationName The unique identifier of the organization
|
|
6055
6190
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
6056
6191
|
* @param {string} draftId The draft package identifier
|
|
6057
|
-
* @param {number} [limit]
|
|
6058
|
-
* @param {number} [offset]
|
|
6059
6192
|
* @param {*} [options] Override http request option.
|
|
6060
6193
|
* @throws {RequiredError}
|
|
6061
6194
|
* @memberof DraftsApi
|
|
6062
6195
|
*/
|
|
6063
|
-
|
|
6064
|
-
return (0, exports.DraftsApiFp)(this.configuration).
|
|
6196
|
+
getDraftPullRequest(organizationName, workspaceName, draftId, options) {
|
|
6197
|
+
return (0, exports.DraftsApiFp)(this.configuration).getDraftPullRequest(organizationName, workspaceName, draftId, options).then((request) => request(this.axios, this.basePath));
|
|
6065
6198
|
}
|
|
6066
6199
|
/**
|
|
6067
|
-
* The draft\'s files
|
|
6200
|
+
* The draft\'s files: the documents under `path` to `depth`, held as workspace documents. `409` `draft-converting` while the draft is moving to the new store. **Listed against the draft\'s last publication.** A draft is a package in draft mode, so a listing reports each document\'s `changeSincePublication` — added, modified, or unchanged — and includes the files the publication shipped that the draft has since deleted, as `removed` entries. A deletion is an edit like any other, and a page rendering the draft\'s files needs all of them from one read. A draft never published is measured against the published version it was opened on (the package\'s latest version when none was recorded), and only for a caller with read access to that package: the markers would otherwise name the package\'s published files, and their absence say which of them the draft leaves unchanged, to a reader who cannot read it. For such a caller the draft\'s own files are listed without markers, with `Changes-Unavailable`. A baseline that exists but cannot be measured or read (an archive that failed to download) is `Changes-Unavailable` too, never \"nothing to compare against\". A never-published draft of a package with no published version carries no markers and no removed entries. When the comparison cannot be made (a transient failure, or a publication recorded before its baseline existed), the listing is still returned, without markers, and says so with the `Changes-Unavailable` header rather than failing. Content is omitted from the listing unless `withContent=true`; otherwise read a document to get it. **Authorization**: requires read access to the draft document.
|
|
6068
6201
|
* @summary List a draft\'s documents
|
|
6069
6202
|
* @param {string} organizationName The unique identifier of the organization
|
|
6070
6203
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
6071
6204
|
* @param {string} draftId The draft package identifier
|
|
6072
6205
|
* @param {string} [path] Restrict the listing to this subtree, relative to the draft root.
|
|
6073
|
-
* @param {number} [depth] `1` lists only the
|
|
6074
|
-
* @param {
|
|
6206
|
+
* @param {number} [depth] `1` lists only the files directly under `path`, as a file browser would. Omitted returns every file in the subtree, which is what a section listing wants. A draft\'s paths are flat, so neither returns directory entries.
|
|
6207
|
+
* @param {boolean} [withContent] Carry each document\'s content on its entry, so a caller that wants the whole draft makes one request rather than one per file. A document\'s text comes as `content`. A data file the draft holds beside its documents (`kind` `data`) carries neither, as in any listing. The listing is whole-draft or refused: past the same file-count and byte limits a checkpoint collects under, it answers `413` `draft-listing-too-large` rather than a partial one, and `limit` and `offset` do not lower what is read, only what is returned. Read the files one at a time instead.
|
|
6075
6208
|
* @param {number} [limit] Maximum number of items to return. Use -1 or omit to return all results.
|
|
6076
6209
|
* @param {number} [offset] Number of items to skip before starting to return results
|
|
6077
6210
|
* @param {*} [options] Override http request option.
|
|
6078
6211
|
* @throws {RequiredError}
|
|
6079
6212
|
* @memberof DraftsApi
|
|
6080
6213
|
*/
|
|
6081
|
-
listDraftDocuments(organizationName, workspaceName, draftId, path, depth,
|
|
6082
|
-
return (0, exports.DraftsApiFp)(this.configuration).listDraftDocuments(organizationName, workspaceName, draftId, path, depth,
|
|
6214
|
+
listDraftDocuments(organizationName, workspaceName, draftId, path, depth, withContent, limit, offset, options) {
|
|
6215
|
+
return (0, exports.DraftsApiFp)(this.configuration).listDraftDocuments(organizationName, workspaceName, draftId, path, depth, withContent, limit, offset, options).then((request) => request(this.axios, this.basePath));
|
|
6083
6216
|
}
|
|
6084
6217
|
/**
|
|
6085
6218
|
* The workspace\'s drafts, each as the same `Draft` the item endpoint returns. **This is how a surface finds drafts.** Before it existed the only way was to list every document in the workspace and filter on type and path prefix, which meant the sidebar, the scope chips and the edit-package flow each pulled every file of every draft in the workspace to render a handful of rows. Composed server-side, one query against the checkpoint rows rather than one request per draft. **Authorization**: requires read access to the workspace, and each draft is filtered to those the caller can read — the same two-stage bar `listDocuments` applies, since a draft\'s authorization object is still its manifest document.
|
|
@@ -6097,7 +6230,7 @@ class DraftsApi extends base_1.BaseAPI {
|
|
|
6097
6230
|
return (0, exports.DraftsApiFp)(this.configuration).listDrafts(organizationName, workspaceName, retired, limit, offset, options).then((request) => request(this.axios, this.basePath));
|
|
6098
6231
|
}
|
|
6099
6232
|
/**
|
|
6100
|
-
* Changes a draft\'s own fields. Every field is optional and an absent one is left alone. Its writers own different slices — a display name comes from a person, `publishedAs` from a publish
|
|
6233
|
+
* Changes a draft\'s own fields. Every field is optional and an absent one is left alone. Its writers own different slices — a display name comes from a person, `publishedAs` from a publish. The package name is not one of them once set: `targetPackageName` cannot change a draft\'s package (`409 draft-package-name-fixed`). A replacement would make each of them responsible for preserving the others\' fields. **A deleted or nonexistent draft answers 404 to a caller who can write its workspace**, and 403 to one who cannot, for the same reason `getDraft` does. **Authorization**: requires `can_update_document` on the draft document, and `can_create_package` on the environment it targets.
|
|
6101
6234
|
* @summary Update a draft package
|
|
6102
6235
|
* @param {string} organizationName The unique identifier of the organization
|
|
6103
6236
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
@@ -6111,34 +6244,7 @@ class DraftsApi extends base_1.BaseAPI {
|
|
|
6111
6244
|
return (0, exports.DraftsApiFp)(this.configuration).updateDraft(organizationName, workspaceName, draftId, draftUpdate, options).then((request) => request(this.axios, this.basePath));
|
|
6112
6245
|
}
|
|
6113
6246
|
/**
|
|
6114
|
-
*
|
|
6115
|
-
* @summary Move the draft\'s branch
|
|
6116
|
-
* @param {string} organizationName The unique identifier of the organization
|
|
6117
|
-
* @param {string} workspaceName The unique identifier of the workspace
|
|
6118
|
-
* @param {string} draftId The draft package identifier
|
|
6119
|
-
* @param {*} [options] Override http request option.
|
|
6120
|
-
* @throws {RequiredError}
|
|
6121
|
-
* @memberof DraftsApi
|
|
6122
|
-
*/
|
|
6123
|
-
updateDraftBranch(organizationName, workspaceName, draftId, options) {
|
|
6124
|
-
return (0, exports.DraftsApiFp)(this.configuration).updateDraftBranch(organizationName, workspaceName, draftId, options).then((request) => request(this.axios, this.basePath));
|
|
6125
|
-
}
|
|
6126
|
-
/**
|
|
6127
|
-
* Advances the pull request\'s state. Merging is a transition of the pull request, not an action filed under it — `PATCH` on the resource rather than a `/merge` verb in the path, which is what every other resource in this API does. Proxies the git-gateway\'s `mergeDraftPullRequest`. Squash-merges into the base branch and returns the merge commit SHA, which becomes the published version\'s `git_commit_sha` — the first provenance anchor reachable from the base branch. `expectedHeadSha` is required and pins what is merged to what the caller read, so a checkpoint that landed after the review cannot be merged silently. Read it from `getDraftPullRequest` and pass it straight back. A `409` means the head moved, the pull request is gone, `publisher.json` names a version that already exists, or the package is known not to compile at this head (`draft-compile-failed`); a `405` means GitHub says the branch is not mergeable — a conflict, or a required review that has not passed. The compile check is READ here, never run — it is started by `getDraftPullRequest` and can take minutes, so this call adds no compile latency. The consequence is that it refuses only a `failing` verdict already computed for this exact `expectedHeadSha`. `pending`, `unverified`, and a verdict this replica has not computed at all ALL allow the merge. Treat it as a guard against merging a known-broken package, not as a guarantee that a merged package compiled. **Authorization**: Requires the environment\'s `can_update_project` (enforced by the gateway) — a strictly higher bar than opening the pull request, because a merge changes what serves for the whole environment. **Git-backed drafts only.** A document-store draft answers `400` `draft-not-git-backed` before any call to the gateway: it has no branch, commits or pull request, so the operation does not apply to it. `409` `draft-provisioning` means the draft\'s branch is still being cut; retry.
|
|
6128
|
-
* @summary Merge the draft\'s pull request
|
|
6129
|
-
* @param {string} organizationName The unique identifier of the organization
|
|
6130
|
-
* @param {string} workspaceName The unique identifier of the workspace
|
|
6131
|
-
* @param {string} draftId The draft package identifier
|
|
6132
|
-
* @param {MergeDraftPullRequest} mergeDraftPullRequest
|
|
6133
|
-
* @param {*} [options] Override http request option.
|
|
6134
|
-
* @throws {RequiredError}
|
|
6135
|
-
* @memberof DraftsApi
|
|
6136
|
-
*/
|
|
6137
|
-
updateDraftPullRequest(organizationName, workspaceName, draftId, mergeDraftPullRequest, options) {
|
|
6138
|
-
return (0, exports.DraftsApiFp)(this.configuration).updateDraftPullRequest(organizationName, workspaceName, draftId, mergeDraftPullRequest, options).then((request) => request(this.axios, this.basePath));
|
|
6139
|
-
}
|
|
6140
|
-
/**
|
|
6141
|
-
* Asks for a checkpoint of the draft\'s current content. A `POST` to the collection rather than a `PUT` on a singleton: this starts a job and answers `202`, and the checkpoints it appends to are a series (`1.0.N`), not one value being set. Sending it twice is still safe — see the coalescing note below — but that is a property of the nudge, not a claim that the request is idempotent in the `PUT` sense. The current checkpoint\'s status is a separate read: `GET` on `../checkpoint`. Records that the draft\'s current content should be published as the next checkpoint (`1.0.N`) of its environment draft package — an ordinary published package named `draft-{draftKey}` in the draft\'s target environment, served by the Publisher exactly like any other package there (docs/workspace-architecture-design.md §4). Always answers `202` with the current status: this call is a nudge, not the publish. The reconciler resolves the draft\'s current content itself when it collects the work — the git branch head for a git-backed draft, the doc-store tree otherwise — which is why the request carries no ref and no content: a caller-supplied ref would be both spoofable and racy against the agent\'s own commits, and a nudge that arrives late still publishes what the draft says NOW. Nudges coalesce: any number recorded between publishes produce one checkpoint of the newest content, and a nudge whose content is identical to the latest published checkpoint publishes nothing. That is this operation\'s own contract, not something the verb supplies — a `POST` to a collection is not idempotent, so a retry after a lost response would otherwise mint a second checkpoint of content that has not changed. A failed publish (the draft does not compile, most commonly) records `failed` with the compiler\'s message and leaves the previous checkpoint serving; the next nudge retries with the then-current content. **This is also how a reaped draft package comes back.** A draft whose package has been idle-reaped (24 hours without a checkpoint request) keeps its row as a witness, and a nudge clears the reap marker and re-queues the publish — the same row update that publishes anything else, so no separate verb is needed. `GET` on this path reports `resurrectable` so a client knows to send one. A merge reap comes back the same way, but a client with the draft page open asks automatically: the app\'s own `POST` rebuilds the package unless the reap\'s own tick wins the race first — at `1.0.0` after the reap, or cancelling the reap and republishing into it. A package a resurrect brought back is a live draft again from there, so the ordinary idle sweep (24 hours since the *last checkpoint request*, not tied to a viewer leaving) reclaims it if nobody keeps asking. Either way a draft that outlives its merge (its close was skipped or its publish failed) can be nudged again, and any later nudge rebuilds it the same way: at `1.0.0` once the reap is deleting the package, or as the next `1.0.N` when the nudge lands before the reap starts and keeps it. Only a deleted draft\'s reap is terminal — its content has no home left — and a nudge for one is refused rather than honoured. **Authorization**: requires `can_update_document` on the draft document AND the target environment\'s `can_create_package` — the same two bars every content-writing draft operation already takes, so anyone modeling in the draft holds both.
|
|
6247
|
+
* Asks for a checkpoint of the draft\'s current content. A `POST` to the collection rather than a `PUT` on a singleton: this starts a job and answers `202`, and the checkpoints it appends to are a series (`1.0.N`), not one value being set. Sending it twice is still safe — see the coalescing note below — but that is a property of the nudge, not a claim that the request is idempotent in the `PUT` sense. The current checkpoint\'s status is a separate read: `GET` on `../checkpoint`. Records that the draft\'s current content should be published as the next checkpoint (`1.0.N`) of its environment draft package — an ordinary published package named `draft-{draftKey}` in the draft\'s target environment, served by the Publisher exactly like any other package there (docs/workspace-architecture-design.md §4). Answers `202` with the current status: this call is a nudge, not the publish. A draft that is moving to the new store answers `409` `draft-converting` and records nothing; retry after a moment. The reconciler resolves the draft\'s current content itself when it collects the work — the draft\'s documents — which is why the request carries no ref and no content: a caller-supplied ref would be both spoofable and racy against the agent\'s own commits, and a nudge that arrives late still publishes what the draft says NOW. Nudges coalesce: any number recorded between publishes produce one checkpoint of the newest content, and a nudge whose content is identical to the latest published checkpoint publishes nothing. That is this operation\'s own contract, not something the verb supplies — a `POST` to a collection is not idempotent, so a retry after a lost response would otherwise mint a second checkpoint of content that has not changed. A failed publish (the draft does not compile, most commonly) records `failed` with the compiler\'s message and leaves the previous checkpoint serving; the next nudge retries with the then-current content. **This is also how a reaped draft package comes back.** A draft whose package has been idle-reaped (24 hours without a checkpoint request) keeps its row as a witness, and a nudge clears the reap marker and re-queues the publish — the same row update that publishes anything else, so no separate verb is needed. `GET` on this path reports `resurrectable` so a client knows to send one. A merge reap comes back the same way, but a client with the draft page open asks automatically: the app\'s own `POST` rebuilds the package unless the reap\'s own tick wins the race first — at `1.0.0` after the reap, or cancelling the reap and republishing into it. A package a resurrect brought back is a live draft again from there, so the ordinary idle sweep (24 hours since the *last checkpoint request*, not tied to a viewer leaving) reclaims it if nobody keeps asking. Either way a draft that outlives its merge (its close was skipped or its publish failed) can be nudged again, and any later nudge rebuilds it the same way: at `1.0.0` once the reap is deleting the package, or as the next `1.0.N` when the nudge lands before the reap starts and keeps it. Only a deleted draft\'s reap is terminal — its content has no home left — and a nudge for one is refused rather than honoured. **Authorization**: requires `can_update_document` on the draft document AND the target environment\'s `can_create_package` — the same two bars every content-writing draft operation already takes, so anyone modeling in the draft holds both.
|
|
6142
6248
|
* @summary Set the draft\'s checkpoint to its current content
|
|
6143
6249
|
* @param {string} organizationName The unique identifier of the organization
|
|
6144
6250
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
@@ -6151,7 +6257,7 @@ class DraftsApi extends base_1.BaseAPI {
|
|
|
6151
6257
|
return (0, exports.DraftsApiFp)(this.configuration).writeDraftCheckpoint(organizationName, workspaceName, draftId, options).then((request) => request(this.axios, this.basePath));
|
|
6152
6258
|
}
|
|
6153
6259
|
/**
|
|
6154
|
-
* Creates or replaces a document
|
|
6260
|
+
* Creates or replaces a document. `PUT` rather than `POST` because the path is the identifier and the caller chooses it — there is no server-assigned id for a file, so a collection `POST` would have nothing to assign. **The precondition is per file.** `expectedSha` (the `sha` the writer read) replaces the document only if it still holds that version, and `createOnly` creates it only if no document is there. Of two writers holding the same `sha` exactly one wins and the other gets `409` `draft-document-stale`, except that a resent write that already landed is answered as applied (below). They are mutually exclusive (`400` when both are sent). With neither, the write is last-writer-wins, as a write through the documents API has always been. A retry whose change is already in place (the content is current, or the file to delete is gone) is answered as applied, not as a conflict, so a lost response can be resent. A deletion of a gone file with an `expectedSha` counts as applied only when no write in the same set is still to land: a move whose old path was deleted or moved by someone else is stale (`\"\"`), not a second copy. The server requests the draft\'s checkpoint after the write commits, so a client does not request one itself. **Authorization** — `can_update_document` on the draft document, **and** `can_create_package` on the draft\'s target environment. The second is not redundant: `can_update_document` on a draft is satisfied by bare workspace membership, while a file written here reaches the environment on the draft author\'s next checkpoint, carrying the checkpointer\'s bar rather than the writer\'s. The environment comes from the draft\'s own manifest and is never a request field; a draft that names none is refused, since it could not be published either. Refuses with `400` (`draft-notebook-read-only`) when a document path ends `.malloynb` and the write would change it or add a new one to a draft that already has files. A `.malloynb` notebook in a draft is read-only: convert it to a `.malloy` notebook (the same name with `.malloy`, beside it) and edit that, or delete it. Writing identical content, or seeding an empty draft, is allowed, and so is a deletion.
|
|
6155
6261
|
* @summary Write one of a draft\'s documents
|
|
6156
6262
|
* @param {string} organizationName The unique identifier of the organization
|
|
6157
6263
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
@@ -6166,7 +6272,7 @@ class DraftsApi extends base_1.BaseAPI {
|
|
|
6166
6272
|
return (0, exports.DraftsApiFp)(this.configuration).writeDraftDocument(organizationName, workspaceName, draftId, documentPath, draftDocumentWrite, options).then((request) => request(this.axios, this.basePath));
|
|
6167
6273
|
}
|
|
6168
6274
|
/**
|
|
6169
|
-
* Writes a data file\'s bytes — a Parquet, CSV, JSON or Excel (`.xlsx`) file a model reads — into the draft, creating it or replacing the draft\'s earlier upload at the same path. A data file lives beside the draft\'s text documents
|
|
6275
|
+
* Writes a data file\'s bytes — a Parquet, CSV, JSON or Excel (`.xlsx`) file a model reads — into the draft, creating it or replacing the draft\'s earlier upload at the same path. A data file lives beside the draft\'s text documents (docs/draft-data-file-upload-design.md). The body is the file itself, `application/octet-stream`, with `Content-Length` set; a chunked body without one is refused before it is read. Uploading over a data file the package\'s published version serves replaces it in the draft: the draft\'s checkpoint and its next publish carry the upload, and the published version keeps its copy until then. A path the draft holds as a small text document (a CSV the published version shipped, which a draft holds as text) moves: the upload is stored and the text copy removed, so the path lives in one place. `DELETE` on the document path deletes a data file, or — for one the draft inherits — records that the draft no longer carries it; `DELETE` on its `change` restores it to the published copy. Refusals, each with its `code`: - `400` `draft-data-file-body-unreadable`: the request body ended or failed before it was read through (a dropped connection, a truncating proxy). Nothing was written; send it again. - `400` `draft-data-file-invalid`: the path holds a character outside Malloy\'s unquoted DuckDB path set `[A-Za-z0-9._~:/?#@!$&*+,=%-]`, such as a space, a bracket, a quote or an accented letter (a model can\'t name such a file in `duckdb.table(\'…\')`; the message names the path with accents dropped and each run of any other such character replaced by `_`, which the app uploads to instead), or ends in `.txt` (DuckDB has no reader for that extension; rename it `.csv` or `.tsv`), or ends in any other extension outside the formats a model reads as data: `.csv`, `.tsv`, `.parquet`, `.xlsx`, `.json`, `.jsonl`, `.ndjson`, and `.csv.gz`, `.tsv.gz`, `.json.gz`, `.jsonl.gz`, `.ndjson.gz` (an `.xls` is told to save as `.xlsx`). Decided by the path, before the body is read. - `409` `draft-content-not-data`: the path names a file the package treats as text (`publisher.json`, `.malloy`, `.malloynb`, `.md`, `.html`, or a `.json` at the package root). Those are written through `writeDraftDocument`. - `411` `draft-data-file-length-required`: the request declared no `Content-Length`. - `413` `draft-data-file-too-large`: over 32 MiB. - `413` `draft-data-files-over-quota`: the draft would hold more than 64 data files or 128 MiB of them. - `422` `draft-data-file-invalid`: a `.parquet` or `.xlsx` path whose bytes are not that format, or an empty body. - `429` `draft-data-file-rate-limited`: more than 30 uploads into this draft in the last minute, or more uploads in flight on the serving replica than it spools at once (8). Both are counted per replica. Retry after a moment. **Authorization** — the same pair `writeDraftDocument` takes: `can_update_document` on the draft document, and `can_create_package` on the draft\'s target environment.
|
|
6170
6276
|
* @summary Upload a data file into a draft
|
|
6171
6277
|
* @param {string} organizationName The unique identifier of the organization
|
|
6172
6278
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
@@ -6181,7 +6287,7 @@ class DraftsApi extends base_1.BaseAPI {
|
|
|
6181
6287
|
return (0, exports.DraftsApiFp)(this.configuration).writeDraftDocumentContent(organizationName, workspaceName, draftId, documentPath, body, options).then((request) => request(this.axios, this.basePath));
|
|
6182
6288
|
}
|
|
6183
6289
|
/**
|
|
6184
|
-
* Writes a set of documents together
|
|
6290
|
+
* Writes a set of documents together, in one transaction: a seed, or a multi-file edit that must not be seen half applied. Ordinary editing uses the per-document `PUT`. This is for the cases that are atomic by nature. Each member may carry its own `expectedSha` or `createOnly` (see `writeDraftDocument`), so a move is one set: `createOnly` on the new path and a deletion with `expectedSha` on the old one. If any member\'s precondition fails, none is written and the `409` `draft-document-stale` names every conflicting path; a set already partly in place (a resent one) commits only what remains. **Authorization**: as `writeDraftDocument`. **Resolving conflicts.** A member carrying the `conflictSha` that `getDraftConflicts` gave its path resolves that one conflict: the path leaves the conflict list and its base moves to the incoming side, so the next sync does not raise it again. With no content and no `deleted` the member keeps the draft\'s file as it is (an uploaded data file too), and only the conflict is cleared. Members without a `conflictSha` write as usual, and a write may resolve any subset of the list. A `conflictSha` that no longer names the path\'s conflict (the incoming side moved, or it was resolved) is `409` `draft-conflict-changed`, and nothing is written. Once none remain, the draft moves on to what came in, and a submitted draft\'s push starts. A resolution never fails on an archive: when the published version the last conflicts came from cannot be read, the draft\'s next sync moves its base instead. **Fenced by a work item.** A caller executing a work item (one claimed through the controlplane\'s private work-item API) sends its claim in `Work-Item-Claim` (`{id}@{generation}`). The claim is checked first thing in the transaction that writes the document rows, and refused with `409` `draft-write-fenced` -- writing nothing -- when it is no longer the live one: released, cancelled, or swept after its holder stopped heartbeating. A malformed header is a `400`. Without the header the write is unfenced, as before. Only this operation honors the header. Refuses with `400` (`draft-notebook-read-only`) when a document path ends `.malloynb` and the write would change it or add a new one to a draft that already has files. A `.malloynb` notebook in a draft is read-only: convert it to a `.malloy` notebook (the same name with `.malloy`, beside it) and edit that, or delete it. Writing identical content, or seeding an empty draft, is allowed, and so is a deletion.
|
|
6185
6291
|
* @summary Write several of a draft\'s documents as one change
|
|
6186
6292
|
* @param {string} organizationName The unique identifier of the organization
|
|
6187
6293
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
@@ -6196,30 +6302,18 @@ class DraftsApi extends base_1.BaseAPI {
|
|
|
6196
6302
|
return (0, exports.DraftsApiFp)(this.configuration).writeDraftDocuments(organizationName, workspaceName, draftId, draftDocumentsWrite, workItemClaim, options).then((request) => request(this.axios, this.basePath));
|
|
6197
6303
|
}
|
|
6198
6304
|
/**
|
|
6199
|
-
*
|
|
6200
|
-
* @summary Publish
|
|
6201
|
-
* @param {string} organizationName The unique identifier of the organization
|
|
6202
|
-
* @param {string} workspaceName The unique identifier of the workspace
|
|
6203
|
-
* @param {string} draftId The draft package identifier
|
|
6204
|
-
* @param {*} [options] Override http request option.
|
|
6205
|
-
* @throws {RequiredError}
|
|
6206
|
-
* @memberof DraftsApi
|
|
6207
|
-
*/
|
|
6208
|
-
writeDraftPublication(organizationName, workspaceName, draftId, options) {
|
|
6209
|
-
return (0, exports.DraftsApiFp)(this.configuration).writeDraftPublication(organizationName, workspaceName, draftId, options).then((request) => request(this.axios, this.basePath));
|
|
6210
|
-
}
|
|
6211
|
-
/**
|
|
6212
|
-
* Proxies the code-assist git-gateway\'s `createDraftPullRequest`, forwarding the caller\'s own bearer token exactly as the History operations do. The gateway remains the sole authorizer; this endpoint performs no authorization of its own. Idempotent — an already-open pull request for this draft comes back rather than a second one. **Not a pure proxy: this call can sync and retry on your behalf.** A draft whose package already exists on the base branch — most commonly because this draft\'s own earlier pull request already merged it — is refused `409 draft-behind-base` unless it can be shown to derive from the base branch\'s current tip. Rather than surfacing that refusal immediately, this endpoint calls `updateDraftBranch`\'s own implementation, which merges the base branch into the draft\'s branch and writes `metadata.git.package_base_sha` on the draft\'s manifest from what that sync proves, then retries the create exactly once. Only a second refusal (a real race, or a draft whose package belongs to another name entirely) reaches the caller as `409`. A `sync-conflict` or `sync-rejected` from that internal sync surfaces as its own clear refusal, naming the manual paths out (resolve on github.com, or start a fresh draft) — resolve it there, or call `updateDraftBranch` directly for the same outcome without going through this endpoint. **Authorization**: Requires the environment\'s `can_create_package` (enforced by the gateway) — proposing a change is the same authority as writing the draft. **Git-backed drafts only.** A document-store draft answers `400` `draft-not-git-backed` before any call to the gateway: it has no branch, commits or pull request, so the operation does not apply to it. `409` `draft-provisioning` means the draft\'s branch is still being cut; retry.
|
|
6213
|
-
* @summary Open a pull request for a git-backed draft
|
|
6305
|
+
* The one way a draft ships, whether or not its environment reviews drafts on GitHub. Either the draft\'s package is published and this answers `200` with it, or nothing is published and it answers `409` `draft-not-ready` with `details.reason` saying what it waits on. Call it again once that clears: every step is safe to repeat, and a repeat after a publish answers with the version already published. `getDraftPublication` reads the same gates without acting on them. **A draft whose environment does not review on GitHub** is published from its own files, in this order: 1. `conflicts`: the draft has unresolved conflicts (`details.conflictCount`). 2. `stale`: the package has a newer version than the one the draft is synced to; the background sync brings it in. 3. `building` / `build-failed`: the draft\'s latest content has no passing build from the last hour. A missing, pending or stale build is requested here and answers `building`; a failing one answers `build-failed`, with the compiler\'s message. 4. The publish, `createOrUpdatePackage` naming this draft. The body\'s `description` is written into the published `publisher.json`. A package that moved under the draft while it published answers `stale`. **A draft whose environment reviews on GitHub** merges its pull request and publishes the merge commit: 1. A draft whose pull request merged, and which has not changed since, goes straight to the publish (8). One edited after its merge is a new pull request. While a rebuild of a merged draft is pending this answers `building`: the build says whether it holds an edit. A rebuild that failed on the merged content still publishes the merge. One whose content cannot be compared answers `build-failed` when it failed to compile, and `building` when it failed on Credible\'s side, which this call asks to rebuild. 2. A push GitHub refused for good answers `push-refused`, with the reason in `details.pushError`: `data_files_only`, `no_changes`, `content_refused`, `review_outside_package`, `repository_too_large` or `push_refused`, until the draft\'s content changes, which sends it again (`repository_too_large` only fails again: see `push-refused` below). Otherwise a push is owed when the draft has never been sent, has changed since its last push, or the body\'s `title` / `description` differ from the pull request\'s; this call submits it. 3. `conflicts` (the draft\'s own, `details.conflictCount`) and `stale` (as above). 4. `sending` until the owed push lands and the pull request is open at it. 5. The build at the pull request\'s head must be a pass from the last hour. Otherwise this call asks for one, which posts the head\'s check run once it settles, and answers `building`, or `build-failed` for a failing one. 6. GitHub\'s mergeable state, as last recorded: `dirty` answers `pull-request-conflicts` (the draft\'s own conflicts are step 3\'s `conflicts`, so this one is resolved on GitHub), `draft` is read once more, as a press may follow a pull request marked ready, and answers `pull-request-draft` if it still is (or if GitHub cannot be read), and a state GitHub has not computed is read once more and otherwise answers `sending`. `blocked` with a passing build re-posts the head\'s passing check run, since a check run left from an earlier answer can be what blocks it, and goes on to the merge. `behind` alone does not refuse: the merge itself refuses a base branch that changed the package. 7. The package at the head is listed once and refused for what a publish cannot carry: `draft-publish-unreadable-file`, `draft-publish-too-large`, or `draft-publish-manifest-missing` (no `publisher.json`). 8. The pull request is merged at that head, confined to the package and only while the base branch has not changed the package since the draft\'s base, and the merge commit is published. GitHub refusing the merge answers `pull-request-blocked` (a required review or check is outstanding), a base branch that changed the package `stale`, a head that moved `sending`, and a pull request that changes files outside the package `push-refused` with `details.pushError` `review_outside_package`: a merge here never carries them onto the base branch, so they are reconciled on GitHub. A refusal because the pull request already merged (a second Publish racing the first) publishes that merge. Until the merge\'s version exists this answers `publishing` (the webhook or the merge record holds it, or GitHub\'s merge time is not read yet); call again, which never merges twice. **A successful publish closes the draft**, as the publish of a draft always has: the draft and its branch are deleted unless it changed meanwhile, a pull request is open on its branch, the publish created the package without attaching it to the workspace (`workspaceAttached: false`), or an agent sandbox turn is live on it. The close never fails this call; `publishedVersion` names the version published, or the existing one that already carries this merge. **Authorization**: the draft\'s modeling bar (`can_create_document` on the workspace, `can_create_package` on its environment) and `can_update_package` on a package that already exists; the publish itself re-checks them. `409` `draft-converting` means the draft is moving to the new store; retry. A `400` is the publish refusing the package itself (an archive it cannot read, a name it does not accept).
|
|
6306
|
+
* @summary Publish the draft
|
|
6214
6307
|
* @param {string} organizationName The unique identifier of the organization
|
|
6215
6308
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
6216
6309
|
* @param {string} draftId The draft package identifier
|
|
6310
|
+
* @param {DraftPublicationRequest} [draftPublicationRequest]
|
|
6217
6311
|
* @param {*} [options] Override http request option.
|
|
6218
6312
|
* @throws {RequiredError}
|
|
6219
6313
|
* @memberof DraftsApi
|
|
6220
6314
|
*/
|
|
6221
|
-
|
|
6222
|
-
return (0, exports.DraftsApiFp)(this.configuration).
|
|
6315
|
+
writeDraftPublication(organizationName, workspaceName, draftId, draftPublicationRequest, options) {
|
|
6316
|
+
return (0, exports.DraftsApiFp)(this.configuration).writeDraftPublication(organizationName, workspaceName, draftId, draftPublicationRequest, options).then((request) => request(this.axios, this.basePath));
|
|
6223
6317
|
}
|
|
6224
6318
|
}
|
|
6225
6319
|
exports.DraftsApi = DraftsApi;
|
|
@@ -6230,7 +6324,7 @@ exports.DraftsApi = DraftsApi;
|
|
|
6230
6324
|
const EntitiesApiAxiosParamCreator = function (configuration) {
|
|
6231
6325
|
return {
|
|
6232
6326
|
/**
|
|
6233
|
-
* Lists the field-level entities (dimensions, measures, views, joins) of one model in this version, each carrying the Malloy `code` that defines it. This is a read of the version\'s entities artifact —
|
|
6327
|
+
* Lists the field-level entities (dimensions, measures, views, joins) of one model in this version, each carrying the Malloy `code` that defines it. This is a read of the version\'s entities artifact — reported by the Publisher when the version is published — never a recompilation, so it is available the moment the version exists. `versionId` accepts the literal `latest`, resolved to the package\'s pinned latest version. Filters: `modelPath` (required) selects one model file; `source` optionally narrows to one source\'s entities. Entities of sources outside the package\'s declared query surface (publisher #833 — not manifest-declared, or not in the model\'s `export {}` closure) are never returned: the serving plane hides those sources, so this endpoint must not leak their definitions. A version published before entities artifacts existed returns an empty list. **Authorization**: Requires read access to the package (`can_read_package`). Deliberately weaker than `getPackageSource`\'s `can_update_package`: per-field definitions of *queryable* sources are viewer-facing documentation (the retrieval `/get_context` API already serves the same `code` under read access), unlike a raw source dump, which stays edit-gated.
|
|
6234
6328
|
* @summary List a version\'s field entities with their Malloy definitions
|
|
6235
6329
|
* @param {string} organizationName The unique identifier of the organization
|
|
6236
6330
|
* @param {string} environmentName The unique identifier of the environment
|
|
@@ -6299,7 +6393,7 @@ const EntitiesApiFp = function (configuration) {
|
|
|
6299
6393
|
const localVarAxiosParamCreator = (0, exports.EntitiesApiAxiosParamCreator)(configuration);
|
|
6300
6394
|
return {
|
|
6301
6395
|
/**
|
|
6302
|
-
* Lists the field-level entities (dimensions, measures, views, joins) of one model in this version, each carrying the Malloy `code` that defines it. This is a read of the version\'s entities artifact —
|
|
6396
|
+
* Lists the field-level entities (dimensions, measures, views, joins) of one model in this version, each carrying the Malloy `code` that defines it. This is a read of the version\'s entities artifact — reported by the Publisher when the version is published — never a recompilation, so it is available the moment the version exists. `versionId` accepts the literal `latest`, resolved to the package\'s pinned latest version. Filters: `modelPath` (required) selects one model file; `source` optionally narrows to one source\'s entities. Entities of sources outside the package\'s declared query surface (publisher #833 — not manifest-declared, or not in the model\'s `export {}` closure) are never returned: the serving plane hides those sources, so this endpoint must not leak their definitions. A version published before entities artifacts existed returns an empty list. **Authorization**: Requires read access to the package (`can_read_package`). Deliberately weaker than `getPackageSource`\'s `can_update_package`: per-field definitions of *queryable* sources are viewer-facing documentation (the retrieval `/get_context` API already serves the same `code` under read access), unlike a raw source dump, which stays edit-gated.
|
|
6303
6397
|
* @summary List a version\'s field entities with their Malloy definitions
|
|
6304
6398
|
* @param {string} organizationName The unique identifier of the organization
|
|
6305
6399
|
* @param {string} environmentName The unique identifier of the environment
|
|
@@ -6332,7 +6426,7 @@ const EntitiesApiFactory = function (configuration, basePath, axios) {
|
|
|
6332
6426
|
const localVarFp = (0, exports.EntitiesApiFp)(configuration);
|
|
6333
6427
|
return {
|
|
6334
6428
|
/**
|
|
6335
|
-
* Lists the field-level entities (dimensions, measures, views, joins) of one model in this version, each carrying the Malloy `code` that defines it. This is a read of the version\'s entities artifact —
|
|
6429
|
+
* Lists the field-level entities (dimensions, measures, views, joins) of one model in this version, each carrying the Malloy `code` that defines it. This is a read of the version\'s entities artifact — reported by the Publisher when the version is published — never a recompilation, so it is available the moment the version exists. `versionId` accepts the literal `latest`, resolved to the package\'s pinned latest version. Filters: `modelPath` (required) selects one model file; `source` optionally narrows to one source\'s entities. Entities of sources outside the package\'s declared query surface (publisher #833 — not manifest-declared, or not in the model\'s `export {}` closure) are never returned: the serving plane hides those sources, so this endpoint must not leak their definitions. A version published before entities artifacts existed returns an empty list. **Authorization**: Requires read access to the package (`can_read_package`). Deliberately weaker than `getPackageSource`\'s `can_update_package`: per-field definitions of *queryable* sources are viewer-facing documentation (the retrieval `/get_context` API already serves the same `code` under read access), unlike a raw source dump, which stays edit-gated.
|
|
6336
6430
|
* @summary List a version\'s field entities with their Malloy definitions
|
|
6337
6431
|
* @param {string} organizationName The unique identifier of the organization
|
|
6338
6432
|
* @param {string} environmentName The unique identifier of the environment
|
|
@@ -6359,7 +6453,7 @@ exports.EntitiesApiFactory = EntitiesApiFactory;
|
|
|
6359
6453
|
*/
|
|
6360
6454
|
class EntitiesApi extends base_1.BaseAPI {
|
|
6361
6455
|
/**
|
|
6362
|
-
* Lists the field-level entities (dimensions, measures, views, joins) of one model in this version, each carrying the Malloy `code` that defines it. This is a read of the version\'s entities artifact —
|
|
6456
|
+
* Lists the field-level entities (dimensions, measures, views, joins) of one model in this version, each carrying the Malloy `code` that defines it. This is a read of the version\'s entities artifact — reported by the Publisher when the version is published — never a recompilation, so it is available the moment the version exists. `versionId` accepts the literal `latest`, resolved to the package\'s pinned latest version. Filters: `modelPath` (required) selects one model file; `source` optionally narrows to one source\'s entities. Entities of sources outside the package\'s declared query surface (publisher #833 — not manifest-declared, or not in the model\'s `export {}` closure) are never returned: the serving plane hides those sources, so this endpoint must not leak their definitions. A version published before entities artifacts existed returns an empty list. **Authorization**: Requires read access to the package (`can_read_package`). Deliberately weaker than `getPackageSource`\'s `can_update_package`: per-field definitions of *queryable* sources are viewer-facing documentation (the retrieval `/get_context` API already serves the same `code` under read access), unlike a raw source dump, which stays edit-gated.
|
|
6363
6457
|
* @summary List a version\'s field entities with their Malloy definitions
|
|
6364
6458
|
* @param {string} organizationName The unique identifier of the organization
|
|
6365
6459
|
* @param {string} environmentName The unique identifier of the environment
|
|
@@ -9280,6 +9374,291 @@ class InvitesApi extends base_1.BaseAPI {
|
|
|
9280
9374
|
}
|
|
9281
9375
|
}
|
|
9282
9376
|
exports.InvitesApi = InvitesApi;
|
|
9377
|
+
/**
|
|
9378
|
+
* MarketplaceSignupsApi - axios parameter creator
|
|
9379
|
+
* @export
|
|
9380
|
+
*/
|
|
9381
|
+
const MarketplaceSignupsApiAxiosParamCreator = function (configuration) {
|
|
9382
|
+
return {
|
|
9383
|
+
/**
|
|
9384
|
+
* The signup URL a marketplace listing names. GCP Marketplace posts the buyer\'s browser here with `x-gcp-marketplace-token`, a JWT that expires five minutes after it is sent, so the request is forwarded to billing (`POST /private/marketplace-signups`) at once. The buyer is not signed in yet, so this path takes the POST unauthenticated; billing checks the token. The answer is a `303` to the signup app\'s `/marketplace` page, because the caller is a browser: with `#signup=<signupId>.<claim>&provider=<provider>` in the fragment when billing records the signup (`provider` is the marketplace, `gcp`), or `#error=<code>` when it refuses it (`SIGNUP_USED` for a token already used, where a cell consumes each once) or cannot be reached (`BILLING_UNAVAILABLE`). A fragment is never sent to a server, so the claim stays out of every log. A deployment with no signup page configured answers `503 MARKETPLACE_OFF` instead. Only `x-gcp-marketplace-token` is read, and only up to 8 KB: a missing or longer token is `#error=INVALID_SIGNUP` without a call to billing. Any other field the form carries is ignored.
|
|
9385
|
+
* @summary Receive a buyer sent by a cloud marketplace
|
|
9386
|
+
* @param {string} [xGcpMarketplaceToken] GCP Marketplace\\\'s signed signup token.
|
|
9387
|
+
* @param {*} [options] Override http request option.
|
|
9388
|
+
* @throws {RequiredError}
|
|
9389
|
+
*/
|
|
9390
|
+
createMarketplaceSignup: (xGcpMarketplaceToken_1, ...args_1) => __awaiter(this, [xGcpMarketplaceToken_1, ...args_1], void 0, function* (xGcpMarketplaceToken, options = {}) {
|
|
9391
|
+
const localVarPath = `/marketplace-signups`;
|
|
9392
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
9393
|
+
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
9394
|
+
let baseOptions;
|
|
9395
|
+
if (configuration) {
|
|
9396
|
+
baseOptions = configuration.baseOptions;
|
|
9397
|
+
}
|
|
9398
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
|
|
9399
|
+
const localVarHeaderParameter = {};
|
|
9400
|
+
const localVarQueryParameter = {};
|
|
9401
|
+
const localVarFormParams = new URLSearchParams();
|
|
9402
|
+
if (xGcpMarketplaceToken !== undefined) {
|
|
9403
|
+
localVarFormParams.set('x-gcp-marketplace-token', xGcpMarketplaceToken);
|
|
9404
|
+
}
|
|
9405
|
+
localVarHeaderParameter['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
9406
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
9407
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
9408
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
9409
|
+
localVarRequestOptions.data = localVarFormParams.toString();
|
|
9410
|
+
return {
|
|
9411
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
9412
|
+
options: localVarRequestOptions,
|
|
9413
|
+
};
|
|
9414
|
+
}),
|
|
9415
|
+
};
|
|
9416
|
+
};
|
|
9417
|
+
exports.MarketplaceSignupsApiAxiosParamCreator = MarketplaceSignupsApiAxiosParamCreator;
|
|
9418
|
+
/**
|
|
9419
|
+
* MarketplaceSignupsApi - functional programming interface
|
|
9420
|
+
* @export
|
|
9421
|
+
*/
|
|
9422
|
+
const MarketplaceSignupsApiFp = function (configuration) {
|
|
9423
|
+
const localVarAxiosParamCreator = (0, exports.MarketplaceSignupsApiAxiosParamCreator)(configuration);
|
|
9424
|
+
return {
|
|
9425
|
+
/**
|
|
9426
|
+
* The signup URL a marketplace listing names. GCP Marketplace posts the buyer\'s browser here with `x-gcp-marketplace-token`, a JWT that expires five minutes after it is sent, so the request is forwarded to billing (`POST /private/marketplace-signups`) at once. The buyer is not signed in yet, so this path takes the POST unauthenticated; billing checks the token. The answer is a `303` to the signup app\'s `/marketplace` page, because the caller is a browser: with `#signup=<signupId>.<claim>&provider=<provider>` in the fragment when billing records the signup (`provider` is the marketplace, `gcp`), or `#error=<code>` when it refuses it (`SIGNUP_USED` for a token already used, where a cell consumes each once) or cannot be reached (`BILLING_UNAVAILABLE`). A fragment is never sent to a server, so the claim stays out of every log. A deployment with no signup page configured answers `503 MARKETPLACE_OFF` instead. Only `x-gcp-marketplace-token` is read, and only up to 8 KB: a missing or longer token is `#error=INVALID_SIGNUP` without a call to billing. Any other field the form carries is ignored.
|
|
9427
|
+
* @summary Receive a buyer sent by a cloud marketplace
|
|
9428
|
+
* @param {string} [xGcpMarketplaceToken] GCP Marketplace\\\'s signed signup token.
|
|
9429
|
+
* @param {*} [options] Override http request option.
|
|
9430
|
+
* @throws {RequiredError}
|
|
9431
|
+
*/
|
|
9432
|
+
createMarketplaceSignup(xGcpMarketplaceToken, options) {
|
|
9433
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
9434
|
+
var _a, _b, _c;
|
|
9435
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.createMarketplaceSignup(xGcpMarketplaceToken, options);
|
|
9436
|
+
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
9437
|
+
const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['MarketplaceSignupsApi.createMarketplaceSignup']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
|
|
9438
|
+
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
9439
|
+
});
|
|
9440
|
+
},
|
|
9441
|
+
};
|
|
9442
|
+
};
|
|
9443
|
+
exports.MarketplaceSignupsApiFp = MarketplaceSignupsApiFp;
|
|
9444
|
+
/**
|
|
9445
|
+
* MarketplaceSignupsApi - factory interface
|
|
9446
|
+
* @export
|
|
9447
|
+
*/
|
|
9448
|
+
const MarketplaceSignupsApiFactory = function (configuration, basePath, axios) {
|
|
9449
|
+
const localVarFp = (0, exports.MarketplaceSignupsApiFp)(configuration);
|
|
9450
|
+
return {
|
|
9451
|
+
/**
|
|
9452
|
+
* The signup URL a marketplace listing names. GCP Marketplace posts the buyer\'s browser here with `x-gcp-marketplace-token`, a JWT that expires five minutes after it is sent, so the request is forwarded to billing (`POST /private/marketplace-signups`) at once. The buyer is not signed in yet, so this path takes the POST unauthenticated; billing checks the token. The answer is a `303` to the signup app\'s `/marketplace` page, because the caller is a browser: with `#signup=<signupId>.<claim>&provider=<provider>` in the fragment when billing records the signup (`provider` is the marketplace, `gcp`), or `#error=<code>` when it refuses it (`SIGNUP_USED` for a token already used, where a cell consumes each once) or cannot be reached (`BILLING_UNAVAILABLE`). A fragment is never sent to a server, so the claim stays out of every log. A deployment with no signup page configured answers `503 MARKETPLACE_OFF` instead. Only `x-gcp-marketplace-token` is read, and only up to 8 KB: a missing or longer token is `#error=INVALID_SIGNUP` without a call to billing. Any other field the form carries is ignored.
|
|
9453
|
+
* @summary Receive a buyer sent by a cloud marketplace
|
|
9454
|
+
* @param {string} [xGcpMarketplaceToken] GCP Marketplace\\\'s signed signup token.
|
|
9455
|
+
* @param {*} [options] Override http request option.
|
|
9456
|
+
* @throws {RequiredError}
|
|
9457
|
+
*/
|
|
9458
|
+
createMarketplaceSignup(xGcpMarketplaceToken, options) {
|
|
9459
|
+
return localVarFp.createMarketplaceSignup(xGcpMarketplaceToken, options).then((request) => request(axios, basePath));
|
|
9460
|
+
},
|
|
9461
|
+
};
|
|
9462
|
+
};
|
|
9463
|
+
exports.MarketplaceSignupsApiFactory = MarketplaceSignupsApiFactory;
|
|
9464
|
+
/**
|
|
9465
|
+
* MarketplaceSignupsApi - object-oriented interface
|
|
9466
|
+
* @export
|
|
9467
|
+
* @class MarketplaceSignupsApi
|
|
9468
|
+
* @extends {BaseAPI}
|
|
9469
|
+
*/
|
|
9470
|
+
class MarketplaceSignupsApi extends base_1.BaseAPI {
|
|
9471
|
+
/**
|
|
9472
|
+
* The signup URL a marketplace listing names. GCP Marketplace posts the buyer\'s browser here with `x-gcp-marketplace-token`, a JWT that expires five minutes after it is sent, so the request is forwarded to billing (`POST /private/marketplace-signups`) at once. The buyer is not signed in yet, so this path takes the POST unauthenticated; billing checks the token. The answer is a `303` to the signup app\'s `/marketplace` page, because the caller is a browser: with `#signup=<signupId>.<claim>&provider=<provider>` in the fragment when billing records the signup (`provider` is the marketplace, `gcp`), or `#error=<code>` when it refuses it (`SIGNUP_USED` for a token already used, where a cell consumes each once) or cannot be reached (`BILLING_UNAVAILABLE`). A fragment is never sent to a server, so the claim stays out of every log. A deployment with no signup page configured answers `503 MARKETPLACE_OFF` instead. Only `x-gcp-marketplace-token` is read, and only up to 8 KB: a missing or longer token is `#error=INVALID_SIGNUP` without a call to billing. Any other field the form carries is ignored.
|
|
9473
|
+
* @summary Receive a buyer sent by a cloud marketplace
|
|
9474
|
+
* @param {string} [xGcpMarketplaceToken] GCP Marketplace\\\'s signed signup token.
|
|
9475
|
+
* @param {*} [options] Override http request option.
|
|
9476
|
+
* @throws {RequiredError}
|
|
9477
|
+
* @memberof MarketplaceSignupsApi
|
|
9478
|
+
*/
|
|
9479
|
+
createMarketplaceSignup(xGcpMarketplaceToken, options) {
|
|
9480
|
+
return (0, exports.MarketplaceSignupsApiFp)(this.configuration).createMarketplaceSignup(xGcpMarketplaceToken, options).then((request) => request(this.axios, this.basePath));
|
|
9481
|
+
}
|
|
9482
|
+
}
|
|
9483
|
+
exports.MarketplaceSignupsApi = MarketplaceSignupsApi;
|
|
9484
|
+
/**
|
|
9485
|
+
* MarketplaceSubscriptionsApi - axios parameter creator
|
|
9486
|
+
* @export
|
|
9487
|
+
*/
|
|
9488
|
+
const MarketplaceSubscriptionsApiAxiosParamCreator = function (configuration) {
|
|
9489
|
+
return {
|
|
9490
|
+
/**
|
|
9491
|
+
* The organization\'s latest purchase through a cloud marketplace, as billing has it. 404 when the organization is not billed through a marketplace. **Authorization**: `can_read_organization`.
|
|
9492
|
+
* @summary The organization\'s marketplace subscription
|
|
9493
|
+
* @param {string} organizationName The organization\'s name
|
|
9494
|
+
* @param {*} [options] Override http request option.
|
|
9495
|
+
* @throws {RequiredError}
|
|
9496
|
+
*/
|
|
9497
|
+
getOrganizationMarketplaceSubscription: (organizationName_1, ...args_1) => __awaiter(this, [organizationName_1, ...args_1], void 0, function* (organizationName, options = {}) {
|
|
9498
|
+
// verify required parameter 'organizationName' is not null or undefined
|
|
9499
|
+
(0, common_1.assertParamExists)('getOrganizationMarketplaceSubscription', 'organizationName', organizationName);
|
|
9500
|
+
const localVarPath = `/organizations/{organizationName}/marketplace-subscription`
|
|
9501
|
+
.replace(`{${"organizationName"}}`, encodeURIComponent(String(organizationName)));
|
|
9502
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
9503
|
+
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
9504
|
+
let baseOptions;
|
|
9505
|
+
if (configuration) {
|
|
9506
|
+
baseOptions = configuration.baseOptions;
|
|
9507
|
+
}
|
|
9508
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
|
|
9509
|
+
const localVarHeaderParameter = {};
|
|
9510
|
+
const localVarQueryParameter = {};
|
|
9511
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
9512
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
9513
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
9514
|
+
return {
|
|
9515
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
9516
|
+
options: localVarRequestOptions,
|
|
9517
|
+
};
|
|
9518
|
+
}),
|
|
9519
|
+
/**
|
|
9520
|
+
* For a buyer who already administers an organization: attaches the marketplace signup they came with (the `signupId` and `claim` from the signup app\'s fragment) to this organization. Billing consumes the claim and approves the purchase; once the subscription is ACTIVE the organization is billed through the marketplace, without the self-serve limits or an LLM spend cap. Until then it keeps how it is billed, self-serve cap included. A purchase that is already suspended or ended records nothing, and one that is suspended or ends before it was ever ACTIVE puts the organization back to how it was billed: an attached organization is never frozen for a subscription that never started. **Authorization**: `active_admin` on the organization.
|
|
9521
|
+
* @summary Bill an existing organization through the buyer\'s marketplace purchase
|
|
9522
|
+
* @param {string} organizationName The organization\'s name
|
|
9523
|
+
* @param {MarketplaceSubscriptionLink} marketplaceSubscriptionLink
|
|
9524
|
+
* @param {*} [options] Override http request option.
|
|
9525
|
+
* @throws {RequiredError}
|
|
9526
|
+
*/
|
|
9527
|
+
putOrganizationMarketplaceSubscription: (organizationName_1, marketplaceSubscriptionLink_1, ...args_1) => __awaiter(this, [organizationName_1, marketplaceSubscriptionLink_1, ...args_1], void 0, function* (organizationName, marketplaceSubscriptionLink, options = {}) {
|
|
9528
|
+
// verify required parameter 'organizationName' is not null or undefined
|
|
9529
|
+
(0, common_1.assertParamExists)('putOrganizationMarketplaceSubscription', 'organizationName', organizationName);
|
|
9530
|
+
// verify required parameter 'marketplaceSubscriptionLink' is not null or undefined
|
|
9531
|
+
(0, common_1.assertParamExists)('putOrganizationMarketplaceSubscription', 'marketplaceSubscriptionLink', marketplaceSubscriptionLink);
|
|
9532
|
+
const localVarPath = `/organizations/{organizationName}/marketplace-subscription`
|
|
9533
|
+
.replace(`{${"organizationName"}}`, encodeURIComponent(String(organizationName)));
|
|
9534
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
9535
|
+
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
9536
|
+
let baseOptions;
|
|
9537
|
+
if (configuration) {
|
|
9538
|
+
baseOptions = configuration.baseOptions;
|
|
9539
|
+
}
|
|
9540
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'PUT' }, baseOptions), options);
|
|
9541
|
+
const localVarHeaderParameter = {};
|
|
9542
|
+
const localVarQueryParameter = {};
|
|
9543
|
+
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
9544
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
9545
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
9546
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
9547
|
+
localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(marketplaceSubscriptionLink, localVarRequestOptions, configuration);
|
|
9548
|
+
return {
|
|
9549
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
9550
|
+
options: localVarRequestOptions,
|
|
9551
|
+
};
|
|
9552
|
+
}),
|
|
9553
|
+
};
|
|
9554
|
+
};
|
|
9555
|
+
exports.MarketplaceSubscriptionsApiAxiosParamCreator = MarketplaceSubscriptionsApiAxiosParamCreator;
|
|
9556
|
+
/**
|
|
9557
|
+
* MarketplaceSubscriptionsApi - functional programming interface
|
|
9558
|
+
* @export
|
|
9559
|
+
*/
|
|
9560
|
+
const MarketplaceSubscriptionsApiFp = function (configuration) {
|
|
9561
|
+
const localVarAxiosParamCreator = (0, exports.MarketplaceSubscriptionsApiAxiosParamCreator)(configuration);
|
|
9562
|
+
return {
|
|
9563
|
+
/**
|
|
9564
|
+
* The organization\'s latest purchase through a cloud marketplace, as billing has it. 404 when the organization is not billed through a marketplace. **Authorization**: `can_read_organization`.
|
|
9565
|
+
* @summary The organization\'s marketplace subscription
|
|
9566
|
+
* @param {string} organizationName The organization\'s name
|
|
9567
|
+
* @param {*} [options] Override http request option.
|
|
9568
|
+
* @throws {RequiredError}
|
|
9569
|
+
*/
|
|
9570
|
+
getOrganizationMarketplaceSubscription(organizationName, options) {
|
|
9571
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
9572
|
+
var _a, _b, _c;
|
|
9573
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.getOrganizationMarketplaceSubscription(organizationName, options);
|
|
9574
|
+
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
9575
|
+
const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['MarketplaceSubscriptionsApi.getOrganizationMarketplaceSubscription']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
|
|
9576
|
+
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
9577
|
+
});
|
|
9578
|
+
},
|
|
9579
|
+
/**
|
|
9580
|
+
* For a buyer who already administers an organization: attaches the marketplace signup they came with (the `signupId` and `claim` from the signup app\'s fragment) to this organization. Billing consumes the claim and approves the purchase; once the subscription is ACTIVE the organization is billed through the marketplace, without the self-serve limits or an LLM spend cap. Until then it keeps how it is billed, self-serve cap included. A purchase that is already suspended or ended records nothing, and one that is suspended or ends before it was ever ACTIVE puts the organization back to how it was billed: an attached organization is never frozen for a subscription that never started. **Authorization**: `active_admin` on the organization.
|
|
9581
|
+
* @summary Bill an existing organization through the buyer\'s marketplace purchase
|
|
9582
|
+
* @param {string} organizationName The organization\'s name
|
|
9583
|
+
* @param {MarketplaceSubscriptionLink} marketplaceSubscriptionLink
|
|
9584
|
+
* @param {*} [options] Override http request option.
|
|
9585
|
+
* @throws {RequiredError}
|
|
9586
|
+
*/
|
|
9587
|
+
putOrganizationMarketplaceSubscription(organizationName, marketplaceSubscriptionLink, options) {
|
|
9588
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
9589
|
+
var _a, _b, _c;
|
|
9590
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.putOrganizationMarketplaceSubscription(organizationName, marketplaceSubscriptionLink, options);
|
|
9591
|
+
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
9592
|
+
const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['MarketplaceSubscriptionsApi.putOrganizationMarketplaceSubscription']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
|
|
9593
|
+
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
9594
|
+
});
|
|
9595
|
+
},
|
|
9596
|
+
};
|
|
9597
|
+
};
|
|
9598
|
+
exports.MarketplaceSubscriptionsApiFp = MarketplaceSubscriptionsApiFp;
|
|
9599
|
+
/**
|
|
9600
|
+
* MarketplaceSubscriptionsApi - factory interface
|
|
9601
|
+
* @export
|
|
9602
|
+
*/
|
|
9603
|
+
const MarketplaceSubscriptionsApiFactory = function (configuration, basePath, axios) {
|
|
9604
|
+
const localVarFp = (0, exports.MarketplaceSubscriptionsApiFp)(configuration);
|
|
9605
|
+
return {
|
|
9606
|
+
/**
|
|
9607
|
+
* The organization\'s latest purchase through a cloud marketplace, as billing has it. 404 when the organization is not billed through a marketplace. **Authorization**: `can_read_organization`.
|
|
9608
|
+
* @summary The organization\'s marketplace subscription
|
|
9609
|
+
* @param {string} organizationName The organization\'s name
|
|
9610
|
+
* @param {*} [options] Override http request option.
|
|
9611
|
+
* @throws {RequiredError}
|
|
9612
|
+
*/
|
|
9613
|
+
getOrganizationMarketplaceSubscription(organizationName, options) {
|
|
9614
|
+
return localVarFp.getOrganizationMarketplaceSubscription(organizationName, options).then((request) => request(axios, basePath));
|
|
9615
|
+
},
|
|
9616
|
+
/**
|
|
9617
|
+
* For a buyer who already administers an organization: attaches the marketplace signup they came with (the `signupId` and `claim` from the signup app\'s fragment) to this organization. Billing consumes the claim and approves the purchase; once the subscription is ACTIVE the organization is billed through the marketplace, without the self-serve limits or an LLM spend cap. Until then it keeps how it is billed, self-serve cap included. A purchase that is already suspended or ended records nothing, and one that is suspended or ends before it was ever ACTIVE puts the organization back to how it was billed: an attached organization is never frozen for a subscription that never started. **Authorization**: `active_admin` on the organization.
|
|
9618
|
+
* @summary Bill an existing organization through the buyer\'s marketplace purchase
|
|
9619
|
+
* @param {string} organizationName The organization\'s name
|
|
9620
|
+
* @param {MarketplaceSubscriptionLink} marketplaceSubscriptionLink
|
|
9621
|
+
* @param {*} [options] Override http request option.
|
|
9622
|
+
* @throws {RequiredError}
|
|
9623
|
+
*/
|
|
9624
|
+
putOrganizationMarketplaceSubscription(organizationName, marketplaceSubscriptionLink, options) {
|
|
9625
|
+
return localVarFp.putOrganizationMarketplaceSubscription(organizationName, marketplaceSubscriptionLink, options).then((request) => request(axios, basePath));
|
|
9626
|
+
},
|
|
9627
|
+
};
|
|
9628
|
+
};
|
|
9629
|
+
exports.MarketplaceSubscriptionsApiFactory = MarketplaceSubscriptionsApiFactory;
|
|
9630
|
+
/**
|
|
9631
|
+
* MarketplaceSubscriptionsApi - object-oriented interface
|
|
9632
|
+
* @export
|
|
9633
|
+
* @class MarketplaceSubscriptionsApi
|
|
9634
|
+
* @extends {BaseAPI}
|
|
9635
|
+
*/
|
|
9636
|
+
class MarketplaceSubscriptionsApi extends base_1.BaseAPI {
|
|
9637
|
+
/**
|
|
9638
|
+
* The organization\'s latest purchase through a cloud marketplace, as billing has it. 404 when the organization is not billed through a marketplace. **Authorization**: `can_read_organization`.
|
|
9639
|
+
* @summary The organization\'s marketplace subscription
|
|
9640
|
+
* @param {string} organizationName The organization\'s name
|
|
9641
|
+
* @param {*} [options] Override http request option.
|
|
9642
|
+
* @throws {RequiredError}
|
|
9643
|
+
* @memberof MarketplaceSubscriptionsApi
|
|
9644
|
+
*/
|
|
9645
|
+
getOrganizationMarketplaceSubscription(organizationName, options) {
|
|
9646
|
+
return (0, exports.MarketplaceSubscriptionsApiFp)(this.configuration).getOrganizationMarketplaceSubscription(organizationName, options).then((request) => request(this.axios, this.basePath));
|
|
9647
|
+
}
|
|
9648
|
+
/**
|
|
9649
|
+
* For a buyer who already administers an organization: attaches the marketplace signup they came with (the `signupId` and `claim` from the signup app\'s fragment) to this organization. Billing consumes the claim and approves the purchase; once the subscription is ACTIVE the organization is billed through the marketplace, without the self-serve limits or an LLM spend cap. Until then it keeps how it is billed, self-serve cap included. A purchase that is already suspended or ended records nothing, and one that is suspended or ends before it was ever ACTIVE puts the organization back to how it was billed: an attached organization is never frozen for a subscription that never started. **Authorization**: `active_admin` on the organization.
|
|
9650
|
+
* @summary Bill an existing organization through the buyer\'s marketplace purchase
|
|
9651
|
+
* @param {string} organizationName The organization\'s name
|
|
9652
|
+
* @param {MarketplaceSubscriptionLink} marketplaceSubscriptionLink
|
|
9653
|
+
* @param {*} [options] Override http request option.
|
|
9654
|
+
* @throws {RequiredError}
|
|
9655
|
+
* @memberof MarketplaceSubscriptionsApi
|
|
9656
|
+
*/
|
|
9657
|
+
putOrganizationMarketplaceSubscription(organizationName, marketplaceSubscriptionLink, options) {
|
|
9658
|
+
return (0, exports.MarketplaceSubscriptionsApiFp)(this.configuration).putOrganizationMarketplaceSubscription(organizationName, marketplaceSubscriptionLink, options).then((request) => request(this.axios, this.basePath));
|
|
9659
|
+
}
|
|
9660
|
+
}
|
|
9661
|
+
exports.MarketplaceSubscriptionsApi = MarketplaceSubscriptionsApi;
|
|
9283
9662
|
/**
|
|
9284
9663
|
* MaterializationsApi - axios parameter creator
|
|
9285
9664
|
* @export
|
|
@@ -10087,7 +10466,7 @@ const OrganizationsApiAxiosParamCreator = function (configuration) {
|
|
|
10087
10466
|
};
|
|
10088
10467
|
}),
|
|
10089
10468
|
/**
|
|
10090
|
-
* Retrieves a comprehensive list of all organizations accessible to the authenticated user. This endpoint returns organization metadata including names, display names, and timestamps. **Authorization**: Requires appropriate permissions to view organizations. **Outside the organization**: an organization the caller is not a member of is listed when a package in it is shared with them and it allows sharing outside it. Its row carries `external: true` and only `name`, `displayName`, `createdAt` and `updatedAt`. **Rate Limiting**: Standard rate limits apply. **Pagination**: Supports offset-based pagination with limit and offset parameters.
|
|
10469
|
+
* Retrieves a comprehensive list of all organizations accessible to the authenticated user. This endpoint returns organization metadata including names, display names, and timestamps. A group access token always lists the organization it belongs to, even when its group holds grants only on single packages there and cannot read the organization itself. It never lists that organization under `userPermission=admin` unless the group is an admin of it. **Authorization**: Requires appropriate permissions to view organizations. **Outside the organization**: an organization the caller is not a member of is listed when a package in it is shared with them and it allows sharing outside it. Its row carries `external: true` and only `name`, `displayName`, `createdAt` and `updatedAt`. **Rate Limiting**: Standard rate limits apply. **Pagination**: Supports offset-based pagination with limit and offset parameters.
|
|
10091
10470
|
* @summary List all organizations
|
|
10092
10471
|
* @param {number} [limit] Maximum number of items to return. Use -1 or omit to return all results. Valid values: -1 (all results) or 1–100.
|
|
10093
10472
|
* @param {number} [offset] Number of items to skip before starting to return results
|
|
@@ -10291,7 +10670,7 @@ const OrganizationsApiFp = function (configuration) {
|
|
|
10291
10670
|
});
|
|
10292
10671
|
},
|
|
10293
10672
|
/**
|
|
10294
|
-
* Retrieves a comprehensive list of all organizations accessible to the authenticated user. This endpoint returns organization metadata including names, display names, and timestamps. **Authorization**: Requires appropriate permissions to view organizations. **Outside the organization**: an organization the caller is not a member of is listed when a package in it is shared with them and it allows sharing outside it. Its row carries `external: true` and only `name`, `displayName`, `createdAt` and `updatedAt`. **Rate Limiting**: Standard rate limits apply. **Pagination**: Supports offset-based pagination with limit and offset parameters.
|
|
10673
|
+
* Retrieves a comprehensive list of all organizations accessible to the authenticated user. This endpoint returns organization metadata including names, display names, and timestamps. A group access token always lists the organization it belongs to, even when its group holds grants only on single packages there and cannot read the organization itself. It never lists that organization under `userPermission=admin` unless the group is an admin of it. **Authorization**: Requires appropriate permissions to view organizations. **Outside the organization**: an organization the caller is not a member of is listed when a package in it is shared with them and it allows sharing outside it. Its row carries `external: true` and only `name`, `displayName`, `createdAt` and `updatedAt`. **Rate Limiting**: Standard rate limits apply. **Pagination**: Supports offset-based pagination with limit and offset parameters.
|
|
10295
10674
|
* @summary List all organizations
|
|
10296
10675
|
* @param {number} [limit] Maximum number of items to return. Use -1 or omit to return all results. Valid values: -1 (all results) or 1–100.
|
|
10297
10676
|
* @param {number} [offset] Number of items to skip before starting to return results
|
|
@@ -10409,7 +10788,7 @@ const OrganizationsApiFactory = function (configuration, basePath, axios) {
|
|
|
10409
10788
|
return localVarFp.listOrganizationUsers(organizationName, blocked, limit, offset, options).then((request) => request(axios, basePath));
|
|
10410
10789
|
},
|
|
10411
10790
|
/**
|
|
10412
|
-
* Retrieves a comprehensive list of all organizations accessible to the authenticated user. This endpoint returns organization metadata including names, display names, and timestamps. **Authorization**: Requires appropriate permissions to view organizations. **Outside the organization**: an organization the caller is not a member of is listed when a package in it is shared with them and it allows sharing outside it. Its row carries `external: true` and only `name`, `displayName`, `createdAt` and `updatedAt`. **Rate Limiting**: Standard rate limits apply. **Pagination**: Supports offset-based pagination with limit and offset parameters.
|
|
10791
|
+
* Retrieves a comprehensive list of all organizations accessible to the authenticated user. This endpoint returns organization metadata including names, display names, and timestamps. A group access token always lists the organization it belongs to, even when its group holds grants only on single packages there and cannot read the organization itself. It never lists that organization under `userPermission=admin` unless the group is an admin of it. **Authorization**: Requires appropriate permissions to view organizations. **Outside the organization**: an organization the caller is not a member of is listed when a package in it is shared with them and it allows sharing outside it. Its row carries `external: true` and only `name`, `displayName`, `createdAt` and `updatedAt`. **Rate Limiting**: Standard rate limits apply. **Pagination**: Supports offset-based pagination with limit and offset parameters.
|
|
10413
10792
|
* @summary List all organizations
|
|
10414
10793
|
* @param {number} [limit] Maximum number of items to return. Use -1 or omit to return all results. Valid values: -1 (all results) or 1–100.
|
|
10415
10794
|
* @param {number} [offset] Number of items to skip before starting to return results
|
|
@@ -10514,7 +10893,7 @@ class OrganizationsApi extends base_1.BaseAPI {
|
|
|
10514
10893
|
return (0, exports.OrganizationsApiFp)(this.configuration).listOrganizationUsers(organizationName, blocked, limit, offset, options).then((request) => request(this.axios, this.basePath));
|
|
10515
10894
|
}
|
|
10516
10895
|
/**
|
|
10517
|
-
* Retrieves a comprehensive list of all organizations accessible to the authenticated user. This endpoint returns organization metadata including names, display names, and timestamps. **Authorization**: Requires appropriate permissions to view organizations. **Outside the organization**: an organization the caller is not a member of is listed when a package in it is shared with them and it allows sharing outside it. Its row carries `external: true` and only `name`, `displayName`, `createdAt` and `updatedAt`. **Rate Limiting**: Standard rate limits apply. **Pagination**: Supports offset-based pagination with limit and offset parameters.
|
|
10896
|
+
* Retrieves a comprehensive list of all organizations accessible to the authenticated user. This endpoint returns organization metadata including names, display names, and timestamps. A group access token always lists the organization it belongs to, even when its group holds grants only on single packages there and cannot read the organization itself. It never lists that organization under `userPermission=admin` unless the group is an admin of it. **Authorization**: Requires appropriate permissions to view organizations. **Outside the organization**: an organization the caller is not a member of is listed when a package in it is shared with them and it allows sharing outside it. Its row carries `external: true` and only `name`, `displayName`, `createdAt` and `updatedAt`. **Rate Limiting**: Standard rate limits apply. **Pagination**: Supports offset-based pagination with limit and offset parameters.
|
|
10518
10897
|
* @summary List all organizations
|
|
10519
10898
|
* @param {number} [limit] Maximum number of items to return. Use -1 or omit to return all results. Valid values: -1 (all results) or 1–100.
|
|
10520
10899
|
* @param {number} [offset] Number of items to skip before starting to return results
|
|
@@ -11051,7 +11430,7 @@ exports.PackagePermissionsApi = PackagePermissionsApi;
|
|
|
11051
11430
|
const PackagesApiAxiosParamCreator = function (configuration) {
|
|
11052
11431
|
return {
|
|
11053
11432
|
/**
|
|
11054
|
-
* Creates a new package or updates an existing one with a new version. This endpoint handles both package metadata and file uploads for package content. **Authorization**: Requires package admin or modeler permissions. **Content**: Accepts multipart form data with package metadata and binary file content. **Validation**: Validates package structure and file integrity using MD5 hash.
|
|
11433
|
+
* Creates a new package or updates an existing one with a new version. This endpoint handles both package metadata and file uploads for package content. **A `version` part without an `id` is assigned.** The server picks the version under the package\'s lock and writes it into the stored archive\'s `publisher.json`: the version `publisher.json` names when it is free and newer than every published version (a floor, so `\"2.0.0\"` written once starts the 2.x line), otherwise the highest published version with its patch bumped, or `1.0.0` for a first publish. The response\'s `publishedVersion` names it, and the package serves it at once (becomes its `latestVersion`), whatever its `autoPromote`: the caller asked to publish, not to stage. A `version` part WITH an `id` publishes exactly that id, and `409`s when it is taken; it serves at once when the request also names it as the package\'s `latestVersion` or creates the package, otherwise when `autoPromote` promotes it. No `version` part updates package metadata only (and a create without one is a `400`). An upload whose `publisher.json` must be rewritten to name its version is a `400` past 512 MiB inflated. **Authorization**: Requires package admin or modeler permissions. **Content**: Accepts multipart form data with package metadata and binary file content. **Validation**: Validates package structure and file integrity using MD5 hash.
|
|
11055
11434
|
* @summary Create or update package
|
|
11056
11435
|
* @param {string} organizationName The unique identifier of the organization
|
|
11057
11436
|
* @param {string} environmentName The unique identifier of the environment
|
|
@@ -11321,7 +11700,7 @@ const PackagesApiAxiosParamCreator = function (configuration) {
|
|
|
11321
11700
|
};
|
|
11322
11701
|
}),
|
|
11323
11702
|
/**
|
|
11324
|
-
* Returns a list of package resource identifiers under the given organization that the current user has access to. By default returns only packages the user can share (admin/modeler role). Set `onlyShareable=false` to include all readable packages (including viewer access), and `public` to filter by whether a package is public. **Note**: This endpoint provides cross-environment package visibility. It aggregates packages from all environments within the organization that the user has access to. **Authorization**: Requires read
|
|
11703
|
+
* Returns a list of package resource identifiers under the given organization that the current user has access to. By default returns only packages the user can share (admin/modeler role). Set `onlyShareable=false` to include all readable packages (including viewer access), and `public` to filter by whether a package is public. **Note**: This endpoint provides cross-environment package visibility. It aggregates packages from all environments within the organization that the user has access to. **Authorization**: Requires that the caller can enter the organization (a member, or a person outside it holding an outside grant on one of its packages), or an API key issued for this organization. Such a key lists the packages its group can read even when the group holds grants only on single packages and cannot read the organization. Any other caller gets 403. `public` requires organization admin permissions. The list holds only packages the caller can read (or share). **Response**: Returns array of package resource identifiers.
|
|
11325
11704
|
* @summary List accessible packages by organization
|
|
11326
11705
|
* @param {string} organizationName The unique identifier of the organization
|
|
11327
11706
|
* @param {boolean} [onlyShareable] When true, returns only packages the user can share (admin/modeler). When false, returns all readable packages.
|
|
@@ -11451,7 +11830,7 @@ const PackagesApiFp = function (configuration) {
|
|
|
11451
11830
|
const localVarAxiosParamCreator = (0, exports.PackagesApiAxiosParamCreator)(configuration);
|
|
11452
11831
|
return {
|
|
11453
11832
|
/**
|
|
11454
|
-
* Creates a new package or updates an existing one with a new version. This endpoint handles both package metadata and file uploads for package content. **Authorization**: Requires package admin or modeler permissions. **Content**: Accepts multipart form data with package metadata and binary file content. **Validation**: Validates package structure and file integrity using MD5 hash.
|
|
11833
|
+
* Creates a new package or updates an existing one with a new version. This endpoint handles both package metadata and file uploads for package content. **A `version` part without an `id` is assigned.** The server picks the version under the package\'s lock and writes it into the stored archive\'s `publisher.json`: the version `publisher.json` names when it is free and newer than every published version (a floor, so `\"2.0.0\"` written once starts the 2.x line), otherwise the highest published version with its patch bumped, or `1.0.0` for a first publish. The response\'s `publishedVersion` names it, and the package serves it at once (becomes its `latestVersion`), whatever its `autoPromote`: the caller asked to publish, not to stage. A `version` part WITH an `id` publishes exactly that id, and `409`s when it is taken; it serves at once when the request also names it as the package\'s `latestVersion` or creates the package, otherwise when `autoPromote` promotes it. No `version` part updates package metadata only (and a create without one is a `400`). An upload whose `publisher.json` must be rewritten to name its version is a `400` past 512 MiB inflated. **Authorization**: Requires package admin or modeler permissions. **Content**: Accepts multipart form data with package metadata and binary file content. **Validation**: Validates package structure and file integrity using MD5 hash.
|
|
11455
11834
|
* @summary Create or update package
|
|
11456
11835
|
* @param {string} organizationName The unique identifier of the organization
|
|
11457
11836
|
* @param {string} environmentName The unique identifier of the environment
|
|
@@ -11571,7 +11950,7 @@ const PackagesApiFp = function (configuration) {
|
|
|
11571
11950
|
});
|
|
11572
11951
|
},
|
|
11573
11952
|
/**
|
|
11574
|
-
* Returns a list of package resource identifiers under the given organization that the current user has access to. By default returns only packages the user can share (admin/modeler role). Set `onlyShareable=false` to include all readable packages (including viewer access), and `public` to filter by whether a package is public. **Note**: This endpoint provides cross-environment package visibility. It aggregates packages from all environments within the organization that the user has access to. **Authorization**: Requires read
|
|
11953
|
+
* Returns a list of package resource identifiers under the given organization that the current user has access to. By default returns only packages the user can share (admin/modeler role). Set `onlyShareable=false` to include all readable packages (including viewer access), and `public` to filter by whether a package is public. **Note**: This endpoint provides cross-environment package visibility. It aggregates packages from all environments within the organization that the user has access to. **Authorization**: Requires that the caller can enter the organization (a member, or a person outside it holding an outside grant on one of its packages), or an API key issued for this organization. Such a key lists the packages its group can read even when the group holds grants only on single packages and cannot read the organization. Any other caller gets 403. `public` requires organization admin permissions. The list holds only packages the caller can read (or share). **Response**: Returns array of package resource identifiers.
|
|
11575
11954
|
* @summary List accessible packages by organization
|
|
11576
11955
|
* @param {string} organizationName The unique identifier of the organization
|
|
11577
11956
|
* @param {boolean} [onlyShareable] When true, returns only packages the user can share (admin/modeler). When false, returns all readable packages.
|
|
@@ -11637,7 +12016,7 @@ const PackagesApiFactory = function (configuration, basePath, axios) {
|
|
|
11637
12016
|
const localVarFp = (0, exports.PackagesApiFp)(configuration);
|
|
11638
12017
|
return {
|
|
11639
12018
|
/**
|
|
11640
|
-
* Creates a new package or updates an existing one with a new version. This endpoint handles both package metadata and file uploads for package content. **Authorization**: Requires package admin or modeler permissions. **Content**: Accepts multipart form data with package metadata and binary file content. **Validation**: Validates package structure and file integrity using MD5 hash.
|
|
12019
|
+
* Creates a new package or updates an existing one with a new version. This endpoint handles both package metadata and file uploads for package content. **A `version` part without an `id` is assigned.** The server picks the version under the package\'s lock and writes it into the stored archive\'s `publisher.json`: the version `publisher.json` names when it is free and newer than every published version (a floor, so `\"2.0.0\"` written once starts the 2.x line), otherwise the highest published version with its patch bumped, or `1.0.0` for a first publish. The response\'s `publishedVersion` names it, and the package serves it at once (becomes its `latestVersion`), whatever its `autoPromote`: the caller asked to publish, not to stage. A `version` part WITH an `id` publishes exactly that id, and `409`s when it is taken; it serves at once when the request also names it as the package\'s `latestVersion` or creates the package, otherwise when `autoPromote` promotes it. No `version` part updates package metadata only (and a create without one is a `400`). An upload whose `publisher.json` must be rewritten to name its version is a `400` past 512 MiB inflated. **Authorization**: Requires package admin or modeler permissions. **Content**: Accepts multipart form data with package metadata and binary file content. **Validation**: Validates package structure and file integrity using MD5 hash.
|
|
11641
12020
|
* @summary Create or update package
|
|
11642
12021
|
* @param {string} organizationName The unique identifier of the organization
|
|
11643
12022
|
* @param {string} environmentName The unique identifier of the environment
|
|
@@ -11721,7 +12100,7 @@ const PackagesApiFactory = function (configuration, basePath, axios) {
|
|
|
11721
12100
|
return localVarFp.getPackageVersionFileContent(organizationName, environmentName, packageName, versionId, documentPath, options).then((request) => request(axios, basePath));
|
|
11722
12101
|
},
|
|
11723
12102
|
/**
|
|
11724
|
-
* Returns a list of package resource identifiers under the given organization that the current user has access to. By default returns only packages the user can share (admin/modeler role). Set `onlyShareable=false` to include all readable packages (including viewer access), and `public` to filter by whether a package is public. **Note**: This endpoint provides cross-environment package visibility. It aggregates packages from all environments within the organization that the user has access to. **Authorization**: Requires read
|
|
12103
|
+
* Returns a list of package resource identifiers under the given organization that the current user has access to. By default returns only packages the user can share (admin/modeler role). Set `onlyShareable=false` to include all readable packages (including viewer access), and `public` to filter by whether a package is public. **Note**: This endpoint provides cross-environment package visibility. It aggregates packages from all environments within the organization that the user has access to. **Authorization**: Requires that the caller can enter the organization (a member, or a person outside it holding an outside grant on one of its packages), or an API key issued for this organization. Such a key lists the packages its group can read even when the group holds grants only on single packages and cannot read the organization. Any other caller gets 403. `public` requires organization admin permissions. The list holds only packages the caller can read (or share). **Response**: Returns array of package resource identifiers.
|
|
11725
12104
|
* @summary List accessible packages by organization
|
|
11726
12105
|
* @param {string} organizationName The unique identifier of the organization
|
|
11727
12106
|
* @param {boolean} [onlyShareable] When true, returns only packages the user can share (admin/modeler). When false, returns all readable packages.
|
|
@@ -11769,7 +12148,7 @@ exports.PackagesApiFactory = PackagesApiFactory;
|
|
|
11769
12148
|
*/
|
|
11770
12149
|
class PackagesApi extends base_1.BaseAPI {
|
|
11771
12150
|
/**
|
|
11772
|
-
* Creates a new package or updates an existing one with a new version. This endpoint handles both package metadata and file uploads for package content. **Authorization**: Requires package admin or modeler permissions. **Content**: Accepts multipart form data with package metadata and binary file content. **Validation**: Validates package structure and file integrity using MD5 hash.
|
|
12151
|
+
* Creates a new package or updates an existing one with a new version. This endpoint handles both package metadata and file uploads for package content. **A `version` part without an `id` is assigned.** The server picks the version under the package\'s lock and writes it into the stored archive\'s `publisher.json`: the version `publisher.json` names when it is free and newer than every published version (a floor, so `\"2.0.0\"` written once starts the 2.x line), otherwise the highest published version with its patch bumped, or `1.0.0` for a first publish. The response\'s `publishedVersion` names it, and the package serves it at once (becomes its `latestVersion`), whatever its `autoPromote`: the caller asked to publish, not to stage. A `version` part WITH an `id` publishes exactly that id, and `409`s when it is taken; it serves at once when the request also names it as the package\'s `latestVersion` or creates the package, otherwise when `autoPromote` promotes it. No `version` part updates package metadata only (and a create without one is a `400`). An upload whose `publisher.json` must be rewritten to name its version is a `400` past 512 MiB inflated. **Authorization**: Requires package admin or modeler permissions. **Content**: Accepts multipart form data with package metadata and binary file content. **Validation**: Validates package structure and file integrity using MD5 hash.
|
|
11773
12152
|
* @summary Create or update package
|
|
11774
12153
|
* @param {string} organizationName The unique identifier of the organization
|
|
11775
12154
|
* @param {string} environmentName The unique identifier of the environment
|
|
@@ -11859,7 +12238,7 @@ class PackagesApi extends base_1.BaseAPI {
|
|
|
11859
12238
|
return (0, exports.PackagesApiFp)(this.configuration).getPackageVersionFileContent(organizationName, environmentName, packageName, versionId, documentPath, options).then((request) => request(this.axios, this.basePath));
|
|
11860
12239
|
}
|
|
11861
12240
|
/**
|
|
11862
|
-
* Returns a list of package resource identifiers under the given organization that the current user has access to. By default returns only packages the user can share (admin/modeler role). Set `onlyShareable=false` to include all readable packages (including viewer access), and `public` to filter by whether a package is public. **Note**: This endpoint provides cross-environment package visibility. It aggregates packages from all environments within the organization that the user has access to. **Authorization**: Requires read
|
|
12241
|
+
* Returns a list of package resource identifiers under the given organization that the current user has access to. By default returns only packages the user can share (admin/modeler role). Set `onlyShareable=false` to include all readable packages (including viewer access), and `public` to filter by whether a package is public. **Note**: This endpoint provides cross-environment package visibility. It aggregates packages from all environments within the organization that the user has access to. **Authorization**: Requires that the caller can enter the organization (a member, or a person outside it holding an outside grant on one of its packages), or an API key issued for this organization. Such a key lists the packages its group can read even when the group holds grants only on single packages and cannot read the organization. Any other caller gets 403. `public` requires organization admin permissions. The list holds only packages the caller can read (or share). **Response**: Returns array of package resource identifiers.
|
|
11863
12242
|
* @summary List accessible packages by organization
|
|
11864
12243
|
* @param {string} organizationName The unique identifier of the organization
|
|
11865
12244
|
* @param {boolean} [onlyShareable] When true, returns only packages the user can share (admin/modeler). When false, returns all readable packages.
|