@credibledata/cred-cli 0.0.105 → 0.0.106
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 +454 -66
- 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.
|
|
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.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.DraftTreeEntryTypeEnum = exports.DraftPullRequestStateEnum = exports.DraftFileDiffStatusEnum = exports.DraftDocumentChangeStatusEnum = exports.DraftDocumentChangeSincePublicationEnum = exports.DraftDocumentStatusEnum = exports.DraftDocumentKindEnum = exports.DraftDocumentTypeEnum = exports.DraftCompileVerdictStatusEnum = exports.DraftCheckpointStatusEnum = exports.DraftCapabilitiesPublishModesEnum = exports.DraftCapabilitiesWriteTimingEnum = 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.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 = exports.PreaggregateStatusEnum = exports.PackageWarningSeverityEnum = exports.PackagePermissionInheritedPermissionEnum = exports.PackagePermissionPermissionEnum = void 0;
|
|
30
|
+
exports.OrganizationsApiAxiosParamCreator = exports.OrganizationPermissionsApi = exports.OrganizationPermissionsApiFactory = exports.OrganizationPermissionsApiFp = exports.OrganizationPermissionsApiAxiosParamCreator = exports.MaterializationsApi = exports.MaterializationsApiFactory = exports.MaterializationsApiFp = exports.MaterializationsApiAxiosParamCreator = 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 = exports.DocumentsApi = exports.DocumentsApiFactory = exports.DocumentsApiFp = exports.DocumentsApiAxiosParamCreator = 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 = 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,14 @@ exports.DraftBackingEnum = {
|
|
|
179
179
|
Git: 'git',
|
|
180
180
|
Provisioning: 'provisioning'
|
|
181
181
|
};
|
|
182
|
+
exports.DraftCapabilitiesWriteTimingEnum = {
|
|
183
|
+
PerEdit: 'perEdit',
|
|
184
|
+
PerTurn: 'perTurn'
|
|
185
|
+
};
|
|
186
|
+
exports.DraftCapabilitiesPublishModesEnum = {
|
|
187
|
+
Direct: 'direct',
|
|
188
|
+
PullRequest: 'pullRequest'
|
|
189
|
+
};
|
|
182
190
|
exports.DraftCheckpointStatusEnum = {
|
|
183
191
|
None: 'none',
|
|
184
192
|
Pending: 'pending',
|
|
@@ -428,6 +436,292 @@ exports.WorkspacePermissionPermissionEnum = {
|
|
|
428
436
|
Manager: 'manager',
|
|
429
437
|
Viewer: 'viewer'
|
|
430
438
|
};
|
|
439
|
+
/**
|
|
440
|
+
* AgentSchedulesApi - axios parameter creator
|
|
441
|
+
* @export
|
|
442
|
+
*/
|
|
443
|
+
const AgentSchedulesApiAxiosParamCreator = function (configuration) {
|
|
444
|
+
return {
|
|
445
|
+
/**
|
|
446
|
+
* 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.
|
|
447
|
+
* @summary Schedule a package agent\'s task in a workspace
|
|
448
|
+
* @param {string} organizationName The unique identifier of the organization
|
|
449
|
+
* @param {string} workspaceName The unique identifier of the workspace
|
|
450
|
+
* @param {CreateAgentScheduleRequest} createAgentScheduleRequest
|
|
451
|
+
* @param {*} [options] Override http request option.
|
|
452
|
+
* @throws {RequiredError}
|
|
453
|
+
*/
|
|
454
|
+
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 = {}) {
|
|
455
|
+
// verify required parameter 'organizationName' is not null or undefined
|
|
456
|
+
(0, common_1.assertParamExists)('createAgentSchedule', 'organizationName', organizationName);
|
|
457
|
+
// verify required parameter 'workspaceName' is not null or undefined
|
|
458
|
+
(0, common_1.assertParamExists)('createAgentSchedule', 'workspaceName', workspaceName);
|
|
459
|
+
// verify required parameter 'createAgentScheduleRequest' is not null or undefined
|
|
460
|
+
(0, common_1.assertParamExists)('createAgentSchedule', 'createAgentScheduleRequest', createAgentScheduleRequest);
|
|
461
|
+
const localVarPath = `/organizations/{organizationName}/workspaces/{workspaceName}/agent-schedules`
|
|
462
|
+
.replace(`{${"organizationName"}}`, encodeURIComponent(String(organizationName)))
|
|
463
|
+
.replace(`{${"workspaceName"}}`, encodeURIComponent(String(workspaceName)));
|
|
464
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
465
|
+
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
466
|
+
let baseOptions;
|
|
467
|
+
if (configuration) {
|
|
468
|
+
baseOptions = configuration.baseOptions;
|
|
469
|
+
}
|
|
470
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
|
|
471
|
+
const localVarHeaderParameter = {};
|
|
472
|
+
const localVarQueryParameter = {};
|
|
473
|
+
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
474
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
475
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
476
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
477
|
+
localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(createAgentScheduleRequest, localVarRequestOptions, configuration);
|
|
478
|
+
return {
|
|
479
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
480
|
+
options: localVarRequestOptions,
|
|
481
|
+
};
|
|
482
|
+
}),
|
|
483
|
+
/**
|
|
484
|
+
* 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`).
|
|
485
|
+
* @summary Delete an agent schedule
|
|
486
|
+
* @param {string} organizationName The unique identifier of the organization
|
|
487
|
+
* @param {string} workspaceName The unique identifier of the workspace
|
|
488
|
+
* @param {string} scheduleId The unique identifier of the schedule
|
|
489
|
+
* @param {*} [options] Override http request option.
|
|
490
|
+
* @throws {RequiredError}
|
|
491
|
+
*/
|
|
492
|
+
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 = {}) {
|
|
493
|
+
// verify required parameter 'organizationName' is not null or undefined
|
|
494
|
+
(0, common_1.assertParamExists)('deleteAgentSchedule', 'organizationName', organizationName);
|
|
495
|
+
// verify required parameter 'workspaceName' is not null or undefined
|
|
496
|
+
(0, common_1.assertParamExists)('deleteAgentSchedule', 'workspaceName', workspaceName);
|
|
497
|
+
// verify required parameter 'scheduleId' is not null or undefined
|
|
498
|
+
(0, common_1.assertParamExists)('deleteAgentSchedule', 'scheduleId', scheduleId);
|
|
499
|
+
const localVarPath = `/organizations/{organizationName}/workspaces/{workspaceName}/agent-schedules/{scheduleId}`
|
|
500
|
+
.replace(`{${"organizationName"}}`, encodeURIComponent(String(organizationName)))
|
|
501
|
+
.replace(`{${"workspaceName"}}`, encodeURIComponent(String(workspaceName)))
|
|
502
|
+
.replace(`{${"scheduleId"}}`, encodeURIComponent(String(scheduleId)));
|
|
503
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
504
|
+
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
505
|
+
let baseOptions;
|
|
506
|
+
if (configuration) {
|
|
507
|
+
baseOptions = configuration.baseOptions;
|
|
508
|
+
}
|
|
509
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'DELETE' }, baseOptions), options);
|
|
510
|
+
const localVarHeaderParameter = {};
|
|
511
|
+
const localVarQueryParameter = {};
|
|
512
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
513
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
514
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
515
|
+
return {
|
|
516
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
517
|
+
options: localVarRequestOptions,
|
|
518
|
+
};
|
|
519
|
+
}),
|
|
520
|
+
/**
|
|
521
|
+
* 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`.
|
|
522
|
+
* @summary List a workspace\'s agent schedules
|
|
523
|
+
* @param {string} organizationName The unique identifier of the organization
|
|
524
|
+
* @param {string} workspaceName The unique identifier of the workspace
|
|
525
|
+
* @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.
|
|
526
|
+
* @param {number} [offset] Number of items to skip before starting to return results
|
|
527
|
+
* @param {*} [options] Override http request option.
|
|
528
|
+
* @throws {RequiredError}
|
|
529
|
+
*/
|
|
530
|
+
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 = {}) {
|
|
531
|
+
// verify required parameter 'organizationName' is not null or undefined
|
|
532
|
+
(0, common_1.assertParamExists)('listAgentSchedules', 'organizationName', organizationName);
|
|
533
|
+
// verify required parameter 'workspaceName' is not null or undefined
|
|
534
|
+
(0, common_1.assertParamExists)('listAgentSchedules', 'workspaceName', workspaceName);
|
|
535
|
+
const localVarPath = `/organizations/{organizationName}/workspaces/{workspaceName}/agent-schedules`
|
|
536
|
+
.replace(`{${"organizationName"}}`, encodeURIComponent(String(organizationName)))
|
|
537
|
+
.replace(`{${"workspaceName"}}`, encodeURIComponent(String(workspaceName)));
|
|
538
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
539
|
+
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
540
|
+
let baseOptions;
|
|
541
|
+
if (configuration) {
|
|
542
|
+
baseOptions = configuration.baseOptions;
|
|
543
|
+
}
|
|
544
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
|
|
545
|
+
const localVarHeaderParameter = {};
|
|
546
|
+
const localVarQueryParameter = {};
|
|
547
|
+
if (limit !== undefined) {
|
|
548
|
+
localVarQueryParameter['limit'] = limit;
|
|
549
|
+
}
|
|
550
|
+
if (offset !== undefined) {
|
|
551
|
+
localVarQueryParameter['offset'] = offset;
|
|
552
|
+
}
|
|
553
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
554
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
555
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
556
|
+
return {
|
|
557
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
558
|
+
options: localVarRequestOptions,
|
|
559
|
+
};
|
|
560
|
+
}),
|
|
561
|
+
};
|
|
562
|
+
};
|
|
563
|
+
exports.AgentSchedulesApiAxiosParamCreator = AgentSchedulesApiAxiosParamCreator;
|
|
564
|
+
/**
|
|
565
|
+
* AgentSchedulesApi - functional programming interface
|
|
566
|
+
* @export
|
|
567
|
+
*/
|
|
568
|
+
const AgentSchedulesApiFp = function (configuration) {
|
|
569
|
+
const localVarAxiosParamCreator = (0, exports.AgentSchedulesApiAxiosParamCreator)(configuration);
|
|
570
|
+
return {
|
|
571
|
+
/**
|
|
572
|
+
* 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.
|
|
573
|
+
* @summary Schedule a package agent\'s task in a workspace
|
|
574
|
+
* @param {string} organizationName The unique identifier of the organization
|
|
575
|
+
* @param {string} workspaceName The unique identifier of the workspace
|
|
576
|
+
* @param {CreateAgentScheduleRequest} createAgentScheduleRequest
|
|
577
|
+
* @param {*} [options] Override http request option.
|
|
578
|
+
* @throws {RequiredError}
|
|
579
|
+
*/
|
|
580
|
+
createAgentSchedule(organizationName, workspaceName, createAgentScheduleRequest, options) {
|
|
581
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
582
|
+
var _a, _b, _c;
|
|
583
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.createAgentSchedule(organizationName, workspaceName, createAgentScheduleRequest, options);
|
|
584
|
+
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
585
|
+
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;
|
|
586
|
+
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
587
|
+
});
|
|
588
|
+
},
|
|
589
|
+
/**
|
|
590
|
+
* 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`).
|
|
591
|
+
* @summary Delete an agent schedule
|
|
592
|
+
* @param {string} organizationName The unique identifier of the organization
|
|
593
|
+
* @param {string} workspaceName The unique identifier of the workspace
|
|
594
|
+
* @param {string} scheduleId The unique identifier of the schedule
|
|
595
|
+
* @param {*} [options] Override http request option.
|
|
596
|
+
* @throws {RequiredError}
|
|
597
|
+
*/
|
|
598
|
+
deleteAgentSchedule(organizationName, workspaceName, scheduleId, options) {
|
|
599
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
600
|
+
var _a, _b, _c;
|
|
601
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.deleteAgentSchedule(organizationName, workspaceName, scheduleId, options);
|
|
602
|
+
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
603
|
+
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;
|
|
604
|
+
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
605
|
+
});
|
|
606
|
+
},
|
|
607
|
+
/**
|
|
608
|
+
* 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`.
|
|
609
|
+
* @summary List a workspace\'s agent schedules
|
|
610
|
+
* @param {string} organizationName The unique identifier of the organization
|
|
611
|
+
* @param {string} workspaceName The unique identifier of the workspace
|
|
612
|
+
* @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.
|
|
613
|
+
* @param {number} [offset] Number of items to skip before starting to return results
|
|
614
|
+
* @param {*} [options] Override http request option.
|
|
615
|
+
* @throws {RequiredError}
|
|
616
|
+
*/
|
|
617
|
+
listAgentSchedules(organizationName, workspaceName, limit, offset, options) {
|
|
618
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
619
|
+
var _a, _b, _c;
|
|
620
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.listAgentSchedules(organizationName, workspaceName, limit, offset, options);
|
|
621
|
+
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
622
|
+
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;
|
|
623
|
+
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
624
|
+
});
|
|
625
|
+
},
|
|
626
|
+
};
|
|
627
|
+
};
|
|
628
|
+
exports.AgentSchedulesApiFp = AgentSchedulesApiFp;
|
|
629
|
+
/**
|
|
630
|
+
* AgentSchedulesApi - factory interface
|
|
631
|
+
* @export
|
|
632
|
+
*/
|
|
633
|
+
const AgentSchedulesApiFactory = function (configuration, basePath, axios) {
|
|
634
|
+
const localVarFp = (0, exports.AgentSchedulesApiFp)(configuration);
|
|
635
|
+
return {
|
|
636
|
+
/**
|
|
637
|
+
* 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.
|
|
638
|
+
* @summary Schedule a package agent\'s task in a workspace
|
|
639
|
+
* @param {string} organizationName The unique identifier of the organization
|
|
640
|
+
* @param {string} workspaceName The unique identifier of the workspace
|
|
641
|
+
* @param {CreateAgentScheduleRequest} createAgentScheduleRequest
|
|
642
|
+
* @param {*} [options] Override http request option.
|
|
643
|
+
* @throws {RequiredError}
|
|
644
|
+
*/
|
|
645
|
+
createAgentSchedule(organizationName, workspaceName, createAgentScheduleRequest, options) {
|
|
646
|
+
return localVarFp.createAgentSchedule(organizationName, workspaceName, createAgentScheduleRequest, options).then((request) => request(axios, basePath));
|
|
647
|
+
},
|
|
648
|
+
/**
|
|
649
|
+
* 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`).
|
|
650
|
+
* @summary Delete an agent schedule
|
|
651
|
+
* @param {string} organizationName The unique identifier of the organization
|
|
652
|
+
* @param {string} workspaceName The unique identifier of the workspace
|
|
653
|
+
* @param {string} scheduleId The unique identifier of the schedule
|
|
654
|
+
* @param {*} [options] Override http request option.
|
|
655
|
+
* @throws {RequiredError}
|
|
656
|
+
*/
|
|
657
|
+
deleteAgentSchedule(organizationName, workspaceName, scheduleId, options) {
|
|
658
|
+
return localVarFp.deleteAgentSchedule(organizationName, workspaceName, scheduleId, options).then((request) => request(axios, basePath));
|
|
659
|
+
},
|
|
660
|
+
/**
|
|
661
|
+
* 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`.
|
|
662
|
+
* @summary List a workspace\'s agent schedules
|
|
663
|
+
* @param {string} organizationName The unique identifier of the organization
|
|
664
|
+
* @param {string} workspaceName The unique identifier of the workspace
|
|
665
|
+
* @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.
|
|
666
|
+
* @param {number} [offset] Number of items to skip before starting to return results
|
|
667
|
+
* @param {*} [options] Override http request option.
|
|
668
|
+
* @throws {RequiredError}
|
|
669
|
+
*/
|
|
670
|
+
listAgentSchedules(organizationName, workspaceName, limit, offset, options) {
|
|
671
|
+
return localVarFp.listAgentSchedules(organizationName, workspaceName, limit, offset, options).then((request) => request(axios, basePath));
|
|
672
|
+
},
|
|
673
|
+
};
|
|
674
|
+
};
|
|
675
|
+
exports.AgentSchedulesApiFactory = AgentSchedulesApiFactory;
|
|
676
|
+
/**
|
|
677
|
+
* AgentSchedulesApi - object-oriented interface
|
|
678
|
+
* @export
|
|
679
|
+
* @class AgentSchedulesApi
|
|
680
|
+
* @extends {BaseAPI}
|
|
681
|
+
*/
|
|
682
|
+
class AgentSchedulesApi extends base_1.BaseAPI {
|
|
683
|
+
/**
|
|
684
|
+
* 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.
|
|
685
|
+
* @summary Schedule a package agent\'s task in a workspace
|
|
686
|
+
* @param {string} organizationName The unique identifier of the organization
|
|
687
|
+
* @param {string} workspaceName The unique identifier of the workspace
|
|
688
|
+
* @param {CreateAgentScheduleRequest} createAgentScheduleRequest
|
|
689
|
+
* @param {*} [options] Override http request option.
|
|
690
|
+
* @throws {RequiredError}
|
|
691
|
+
* @memberof AgentSchedulesApi
|
|
692
|
+
*/
|
|
693
|
+
createAgentSchedule(organizationName, workspaceName, createAgentScheduleRequest, options) {
|
|
694
|
+
return (0, exports.AgentSchedulesApiFp)(this.configuration).createAgentSchedule(organizationName, workspaceName, createAgentScheduleRequest, options).then((request) => request(this.axios, this.basePath));
|
|
695
|
+
}
|
|
696
|
+
/**
|
|
697
|
+
* 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`).
|
|
698
|
+
* @summary Delete an agent schedule
|
|
699
|
+
* @param {string} organizationName The unique identifier of the organization
|
|
700
|
+
* @param {string} workspaceName The unique identifier of the workspace
|
|
701
|
+
* @param {string} scheduleId The unique identifier of the schedule
|
|
702
|
+
* @param {*} [options] Override http request option.
|
|
703
|
+
* @throws {RequiredError}
|
|
704
|
+
* @memberof AgentSchedulesApi
|
|
705
|
+
*/
|
|
706
|
+
deleteAgentSchedule(organizationName, workspaceName, scheduleId, options) {
|
|
707
|
+
return (0, exports.AgentSchedulesApiFp)(this.configuration).deleteAgentSchedule(organizationName, workspaceName, scheduleId, options).then((request) => request(this.axios, this.basePath));
|
|
708
|
+
}
|
|
709
|
+
/**
|
|
710
|
+
* 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`.
|
|
711
|
+
* @summary List a workspace\'s agent schedules
|
|
712
|
+
* @param {string} organizationName The unique identifier of the organization
|
|
713
|
+
* @param {string} workspaceName The unique identifier of the workspace
|
|
714
|
+
* @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.
|
|
715
|
+
* @param {number} [offset] Number of items to skip before starting to return results
|
|
716
|
+
* @param {*} [options] Override http request option.
|
|
717
|
+
* @throws {RequiredError}
|
|
718
|
+
* @memberof AgentSchedulesApi
|
|
719
|
+
*/
|
|
720
|
+
listAgentSchedules(organizationName, workspaceName, limit, offset, options) {
|
|
721
|
+
return (0, exports.AgentSchedulesApiFp)(this.configuration).listAgentSchedules(organizationName, workspaceName, limit, offset, options).then((request) => request(this.axios, this.basePath));
|
|
722
|
+
}
|
|
723
|
+
}
|
|
724
|
+
exports.AgentSchedulesApi = AgentSchedulesApi;
|
|
431
725
|
/**
|
|
432
726
|
* AttributesApi - axios parameter creator
|
|
433
727
|
* @export
|
|
@@ -3617,10 +3911,11 @@ const DocumentsApiAxiosParamCreator = function (configuration) {
|
|
|
3617
3911
|
* @param {string} organizationName The unique identifier of the organization
|
|
3618
3912
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
3619
3913
|
* @param {boolean} [retrieveContent] If true, include the document content in the response. Defaults to false.
|
|
3914
|
+
* @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
3915
|
* @param {*} [options] Override http request option.
|
|
3621
3916
|
* @throws {RequiredError}
|
|
3622
3917
|
*/
|
|
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 = {}) {
|
|
3918
|
+
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
3919
|
// verify required parameter 'organizationName' is not null or undefined
|
|
3625
3920
|
(0, common_1.assertParamExists)('listDocuments', 'organizationName', organizationName);
|
|
3626
3921
|
// verify required parameter 'workspaceName' is not null or undefined
|
|
@@ -3640,6 +3935,9 @@ const DocumentsApiAxiosParamCreator = function (configuration) {
|
|
|
3640
3935
|
if (retrieveContent !== undefined) {
|
|
3641
3936
|
localVarQueryParameter['retrieveContent'] = retrieveContent;
|
|
3642
3937
|
}
|
|
3938
|
+
if (pathPrefix !== undefined) {
|
|
3939
|
+
localVarQueryParameter['pathPrefix'] = pathPrefix;
|
|
3940
|
+
}
|
|
3643
3941
|
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
3644
3942
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
3645
3943
|
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
@@ -3772,13 +4070,14 @@ const DocumentsApiFp = function (configuration) {
|
|
|
3772
4070
|
* @param {string} organizationName The unique identifier of the organization
|
|
3773
4071
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
3774
4072
|
* @param {boolean} [retrieveContent] If true, include the document content in the response. Defaults to false.
|
|
4073
|
+
* @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
4074
|
* @param {*} [options] Override http request option.
|
|
3776
4075
|
* @throws {RequiredError}
|
|
3777
4076
|
*/
|
|
3778
|
-
listDocuments(organizationName, workspaceName, retrieveContent, options) {
|
|
4077
|
+
listDocuments(organizationName, workspaceName, retrieveContent, pathPrefix, options) {
|
|
3779
4078
|
return __awaiter(this, void 0, void 0, function* () {
|
|
3780
4079
|
var _a, _b, _c;
|
|
3781
|
-
const localVarAxiosArgs = yield localVarAxiosParamCreator.listDocuments(organizationName, workspaceName, retrieveContent, options);
|
|
4080
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.listDocuments(organizationName, workspaceName, retrieveContent, pathPrefix, options);
|
|
3782
4081
|
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
3783
4082
|
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
4083
|
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
@@ -3861,11 +4160,12 @@ const DocumentsApiFactory = function (configuration, basePath, axios) {
|
|
|
3861
4160
|
* @param {string} organizationName The unique identifier of the organization
|
|
3862
4161
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
3863
4162
|
* @param {boolean} [retrieveContent] If true, include the document content in the response. Defaults to false.
|
|
4163
|
+
* @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
4164
|
* @param {*} [options] Override http request option.
|
|
3865
4165
|
* @throws {RequiredError}
|
|
3866
4166
|
*/
|
|
3867
|
-
listDocuments(organizationName, workspaceName, retrieveContent, options) {
|
|
3868
|
-
return localVarFp.listDocuments(organizationName, workspaceName, retrieveContent, options).then((request) => request(axios, basePath));
|
|
4167
|
+
listDocuments(organizationName, workspaceName, retrieveContent, pathPrefix, options) {
|
|
4168
|
+
return localVarFp.listDocuments(organizationName, workspaceName, retrieveContent, pathPrefix, options).then((request) => request(axios, basePath));
|
|
3869
4169
|
},
|
|
3870
4170
|
/**
|
|
3871
4171
|
* 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 +4241,13 @@ class DocumentsApi extends base_1.BaseAPI {
|
|
|
3941
4241
|
* @param {string} organizationName The unique identifier of the organization
|
|
3942
4242
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
3943
4243
|
* @param {boolean} [retrieveContent] If true, include the document content in the response. Defaults to false.
|
|
4244
|
+
* @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
4245
|
* @param {*} [options] Override http request option.
|
|
3945
4246
|
* @throws {RequiredError}
|
|
3946
4247
|
* @memberof DocumentsApi
|
|
3947
4248
|
*/
|
|
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));
|
|
4249
|
+
listDocuments(organizationName, workspaceName, retrieveContent, pathPrefix, options) {
|
|
4250
|
+
return (0, exports.DocumentsApiFp)(this.configuration).listDocuments(organizationName, workspaceName, retrieveContent, pathPrefix, options).then((request) => request(this.axios, this.basePath));
|
|
3950
4251
|
}
|
|
3951
4252
|
/**
|
|
3952
4253
|
* 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.
|
|
@@ -4017,7 +4318,7 @@ const DraftsApiAxiosParamCreator = function (configuration) {
|
|
|
4017
4318
|
};
|
|
4018
4319
|
}),
|
|
4019
4320
|
/**
|
|
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)
|
|
4321
|
+
* 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
4322
|
* @summary Delete a draft package
|
|
4022
4323
|
* @param {string} organizationName The unique identifier of the organization
|
|
4023
4324
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
@@ -4054,7 +4355,7 @@ const DraftsApiAxiosParamCreator = function (configuration) {
|
|
|
4054
4355
|
};
|
|
4055
4356
|
}),
|
|
4056
4357
|
/**
|
|
4057
|
-
* Thin proxy to the code-assist git-gateway\'s `deleteDraft` — deletes the draft\'s branch in the managed monorepo. See `listDraftCommits` for the auth-forwarding notes. **This is branch removal only — it does not delete the draft.** Deleting the draft is `DELETE` on the draft itself.
|
|
4358
|
+
* Thin proxy to the code-assist git-gateway\'s `deleteDraft` — deletes the draft\'s branch in the managed monorepo. See `listDraftCommits` for the auth-forwarding notes. **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
4359
|
* @summary Delete a git-backed draft\'s branch
|
|
4059
4360
|
* @param {string} organizationName The unique identifier of the organization
|
|
4060
4361
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
@@ -4097,8 +4398,8 @@ const DraftsApiAxiosParamCreator = function (configuration) {
|
|
|
4097
4398
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
4098
4399
|
* @param {string} draftId The draft package identifier
|
|
4099
4400
|
* @param {string} documentPath The document\'s path relative to the draft root
|
|
4100
|
-
* @param {string} [expectedRef] The branch head the caller read at
|
|
4101
|
-
* @param {string} [expectedSha] The `sha` the caller read the document at
|
|
4401
|
+
* @param {string} [expectedRef] Deprecated, git-only: use `expectedSha`. The branch head the caller read at; for a data file it is ignored, since a data file\'s delete is not a commit. Refused with `expectedSha`, and refused for a document-store draft, data file or not — there is no commit to compare it against.
|
|
4402
|
+
* @param {string} [expectedSha] The `sha` the caller read the document at, on either backing: 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.
|
|
4102
4403
|
* @param {*} [options] Override http request option.
|
|
4103
4404
|
* @throws {RequiredError}
|
|
4104
4405
|
*/
|
|
@@ -4140,13 +4441,13 @@ const DraftsApiAxiosParamCreator = function (configuration) {
|
|
|
4140
4441
|
};
|
|
4141
4442
|
}),
|
|
4142
4443
|
/**
|
|
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. `expectedRef`
|
|
4444
|
+
* 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. The deprecated `expectedRef` is optional here, as it is absent on a data file\'s delete: when given on a git-backed draft, the commit that writes a small published copy back builds on it (`409 draft-file-stale-head` if the branch has moved since), and on the branch\'s current head when it is not given. - 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 (past a git-backed draft\'s seed bounds, or a corrupt archive), and `503` `draft-changes-unavailable` when it could not be read. **Authorization** — the same pair `writeDraftDocument` takes.
|
|
4144
4445
|
* @summary Restore one of a draft\'s files to its published copy
|
|
4145
4446
|
* @param {string} organizationName The unique identifier of the organization
|
|
4146
4447
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
4147
4448
|
* @param {string} draftId The draft package identifier
|
|
4148
4449
|
* @param {string} documentPath The file\'s path relative to the draft root
|
|
4149
|
-
* @param {string} [expectedRef] The branch head the caller read at, for a git-backed draft where the restore is a commit
|
|
4450
|
+
* @param {string} [expectedRef] Deprecated: the restore builds on the branch\'s current head without it. The branch head the caller read at, for a git-backed draft where the restore is a commit (used as the compare-and-swap base); refused for a document-store draft.
|
|
4150
4451
|
* @param {*} [options] Override http request option.
|
|
4151
4452
|
* @throws {RequiredError}
|
|
4152
4453
|
*/
|
|
@@ -4258,6 +4559,43 @@ const DraftsApiAxiosParamCreator = function (configuration) {
|
|
|
4258
4559
|
options: localVarRequestOptions,
|
|
4259
4560
|
};
|
|
4260
4561
|
}),
|
|
4562
|
+
/**
|
|
4563
|
+
* The draft\'s capabilities, derived by the server from where its files live and what its package has published, so a client asks this rather than branching on `backing`. The same value `getDraft` carries as `capabilities`, for a caller that does not need the rest of the draft: it reads the draft\'s location and one published-version lookup, not the checkpoint, the files or the git gateway. A draft whose branch is still being cut answers `200` with `ready: false` and nothing else, never a refusal: the answer is \"not yet\", and it changes by itself. **Authorization**: requires read access to the draft document.
|
|
4564
|
+
* @summary What the draft\'s storage can do
|
|
4565
|
+
* @param {string} organizationName The unique identifier of the organization
|
|
4566
|
+
* @param {string} workspaceName The unique identifier of the workspace
|
|
4567
|
+
* @param {string} draftId The draft package identifier
|
|
4568
|
+
* @param {*} [options] Override http request option.
|
|
4569
|
+
* @throws {RequiredError}
|
|
4570
|
+
*/
|
|
4571
|
+
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 = {}) {
|
|
4572
|
+
// verify required parameter 'organizationName' is not null or undefined
|
|
4573
|
+
(0, common_1.assertParamExists)('getDraftCapabilities', 'organizationName', organizationName);
|
|
4574
|
+
// verify required parameter 'workspaceName' is not null or undefined
|
|
4575
|
+
(0, common_1.assertParamExists)('getDraftCapabilities', 'workspaceName', workspaceName);
|
|
4576
|
+
// verify required parameter 'draftId' is not null or undefined
|
|
4577
|
+
(0, common_1.assertParamExists)('getDraftCapabilities', 'draftId', draftId);
|
|
4578
|
+
const localVarPath = `/organizations/{organizationName}/workspaces/{workspaceName}/drafts/{draftId}/capabilities`
|
|
4579
|
+
.replace(`{${"organizationName"}}`, encodeURIComponent(String(organizationName)))
|
|
4580
|
+
.replace(`{${"workspaceName"}}`, encodeURIComponent(String(workspaceName)))
|
|
4581
|
+
.replace(`{${"draftId"}}`, encodeURIComponent(String(draftId)));
|
|
4582
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
4583
|
+
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
4584
|
+
let baseOptions;
|
|
4585
|
+
if (configuration) {
|
|
4586
|
+
baseOptions = configuration.baseOptions;
|
|
4587
|
+
}
|
|
4588
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
|
|
4589
|
+
const localVarHeaderParameter = {};
|
|
4590
|
+
const localVarQueryParameter = {};
|
|
4591
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
4592
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
4593
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
4594
|
+
return {
|
|
4595
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
4596
|
+
options: localVarRequestOptions,
|
|
4597
|
+
};
|
|
4598
|
+
}),
|
|
4261
4599
|
/**
|
|
4262
4600
|
* 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.
|
|
4263
4601
|
* @summary The draft\'s checkpoint status
|
|
@@ -4390,7 +4728,7 @@ const DraftsApiAxiosParamCreator = function (configuration) {
|
|
|
4390
4728
|
};
|
|
4391
4729
|
}),
|
|
4392
4730
|
/**
|
|
4393
|
-
* One document\'s content, whichever storage backs the draft. See `listDraftDocuments` for why the backing is not the caller\'s concern. 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: for a git-backed draft, the draft-branch commit its last publish shipped (`publishedAs.commitSha`); for a document-store draft, the stored archive of its 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`:
|
|
4731
|
+
* One document\'s content, whichever storage backs the draft. See `listDraftDocuments` for why the backing is not the caller\'s concern. 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: for a git-backed draft, the draft-branch commit its last publish shipped (`publishedAs.commitSha`); for a document-store draft, the stored archive of its 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 baseline is the package\'s stored archive (a document-store draft\'s, or a git-backed draft\'s never published) and the caller can read the draft but not the package. Workspace access does not imply environment access, so this read also takes `can_read_package` on it. A published git-backed draft\'s baseline is its own branch at `publishedAs.commitSha`, readable by that sha at the draft\'s bar, so it takes no package bar. - `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, or a published commit no longer on the draft\'s branch. 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. On a document-store draft 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`. `ref` is null on a document-store answer; on a git answer it names the published commit, which is NOT a head a compare-and-swap write can build on — read the head separately before writing. **Authorization**: requires read access to the draft document.
|
|
4394
4732
|
* @summary Read one of a draft\'s documents
|
|
4395
4733
|
* @param {string} organizationName The unique identifier of the organization
|
|
4396
4734
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
@@ -4558,7 +4896,7 @@ const DraftsApiAxiosParamCreator = function (configuration) {
|
|
|
4558
4896
|
};
|
|
4559
4897
|
}),
|
|
4560
4898
|
/**
|
|
4561
|
-
* The draft\'s files, **whichever storage backs them**. A git-backed draft\'s files live on its branch and a document-store draft\'s live as workspace documents; this answers for both, so a client never branches on the backing to read a draft\'s contents. That branch is the reason a draft\'s backing had to be known before its files could be fetched, which put an unrelated read on the critical path of every draft page. Two shapes, both listings: the documents under `path` to `depth`, or — with `ref` — that same listing as of a commit. Git-backed drafts only for `ref`; a document-store draft has no history to address and ignores it. **Listed against the draft\'s last publication.** A draft is a package in draft mode, so a listing of the draft as it stands (no `ref`) 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
|
|
4899
|
+
* The draft\'s files, **whichever storage backs them**. A git-backed draft\'s files live on its branch and a document-store draft\'s live as workspace documents; this answers for both, so a client never branches on the backing to read a draft\'s contents. That branch is the reason a draft\'s backing had to be known before its files could be fetched, which put an unrelated read on the critical path of every draft page. Two shapes, both listings: the documents under `path` to `depth`, or — with `ref` — that same listing as of a commit. Git-backed drafts only for `ref`; a document-store draft has no history to address and ignores it. **Listed against the draft\'s last publication.** A draft is a package in draft mode, so a listing of the draft as it stands (no `ref`) 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, on either backing, 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 (a git-backed draft\'s version past the seed\'s bounds, or 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, or a listing at a `ref`, carries no markers and no removed entries. When the comparison cannot be made (a git compare over the gateway\'s size limit, 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. What changed between two COMMITS is a different question — the History tab\'s — and has its own endpoint: `GET ../comparison`. 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
4900
|
* @summary List a draft\'s documents
|
|
4563
4901
|
* @param {string} organizationName The unique identifier of the organization
|
|
4564
4902
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
@@ -4566,12 +4904,13 @@ const DraftsApiAxiosParamCreator = function (configuration) {
|
|
|
4566
4904
|
* @param {string} [path] Restrict the listing to this subtree, relative to the draft root.
|
|
4567
4905
|
* @param {number} [depth] `1` lists only the immediate children of `path`, as a file browser would. Omitted returns the whole subtree, which is what a section listing wants. The two are answered by different reads, so they differ in two ways a caller can see. A bounded depth returns directory entries as well as files; the whole subtree returns files only, since a directory is not a document and every caller of the depth-less listing filters to files anyway. And the whole subtree is refused with `413` for a draft holding a symlink or submodule, where a bounded depth lists around it.
|
|
4568
4906
|
* @param {string} [ref] Read the listing at this commit rather than at the branch tip. Accepts only a full 40-character sha reachable from the draft\'s branch. Ignored by a document-store draft, which has no commits.
|
|
4907
|
+
* @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 file that is not UTF-8 text comes as `contentBase64`. 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
4908
|
* @param {number} [limit] Maximum number of items to return. Use -1 or omit to return all results.
|
|
4570
4909
|
* @param {number} [offset] Number of items to skip before starting to return results
|
|
4571
4910
|
* @param {*} [options] Override http request option.
|
|
4572
4911
|
* @throws {RequiredError}
|
|
4573
4912
|
*/
|
|
4574
|
-
listDraftDocuments: (organizationName_1, workspaceName_1, draftId_1, path_1, depth_1, ref_1, limit_1, offset_1, ...args_1) => __awaiter(this, [organizationName_1, workspaceName_1, draftId_1, path_1, depth_1, ref_1, limit_1, offset_1, ...args_1], void 0, function* (organizationName, workspaceName, draftId, path, depth, ref, limit, offset, options = {}) {
|
|
4913
|
+
listDraftDocuments: (organizationName_1, workspaceName_1, draftId_1, path_1, depth_1, ref_1, withContent_1, limit_1, offset_1, ...args_1) => __awaiter(this, [organizationName_1, workspaceName_1, draftId_1, path_1, depth_1, ref_1, withContent_1, limit_1, offset_1, ...args_1], void 0, function* (organizationName, workspaceName, draftId, path, depth, ref, withContent, limit, offset, options = {}) {
|
|
4575
4914
|
// verify required parameter 'organizationName' is not null or undefined
|
|
4576
4915
|
(0, common_1.assertParamExists)('listDraftDocuments', 'organizationName', organizationName);
|
|
4577
4916
|
// verify required parameter 'workspaceName' is not null or undefined
|
|
@@ -4600,6 +4939,9 @@ const DraftsApiAxiosParamCreator = function (configuration) {
|
|
|
4600
4939
|
if (ref !== undefined) {
|
|
4601
4940
|
localVarQueryParameter['ref'] = ref;
|
|
4602
4941
|
}
|
|
4942
|
+
if (withContent !== undefined) {
|
|
4943
|
+
localVarQueryParameter['withContent'] = withContent;
|
|
4944
|
+
}
|
|
4603
4945
|
if (limit !== undefined) {
|
|
4604
4946
|
localVarQueryParameter['limit'] = limit;
|
|
4605
4947
|
}
|
|
@@ -4781,7 +5123,7 @@ const DraftsApiAxiosParamCreator = function (configuration) {
|
|
|
4781
5123
|
};
|
|
4782
5124
|
}),
|
|
4783
5125
|
/**
|
|
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).
|
|
5126
|
+
* 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 whose branch is still being cut answers `409` `draft-provisioning` and records nothing; retry after a moment. 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.
|
|
4785
5127
|
* @summary Set the draft\'s checkpoint to its current content
|
|
4786
5128
|
* @param {string} organizationName The unique identifier of the organization
|
|
4787
5129
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
@@ -4818,7 +5160,7 @@ const DraftsApiAxiosParamCreator = function (configuration) {
|
|
|
4818
5160
|
};
|
|
4819
5161
|
}),
|
|
4820
5162
|
/**
|
|
4821
|
-
* Creates or replaces a document, whichever storage backs the draft. `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
|
|
5163
|
+
* Creates or replaces a document, whichever storage backs the draft. `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, on either backing.** `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. On either backing 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. On a git-backed draft the check is made against the branch\'s current files, so a commit that touched only OTHER files does not fail the write: the server re-sends it once on the new tip, and answers `409` `draft-write-contended` if the tip kept moving. `expectedRef` is deprecated and git-only: the BRANCH HEAD the writer read at, which any commit to any file makes stale (`409` `draft-file-stale-head`). It is refused together with `expectedSha` or `createOnly`, and refused on a document-store draft rather than ignored: a caller that sends a precondition believes it holds a guarantee. On a document-store draft 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, on either backing. 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. A git-backed write also commits into that environment\'s repository. 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. Refuses with `400` and a distinct code when a git-backed checkpoint\'s own content is refused: `checkpoint-over-size-cap` (the draft\'s total content is over the cap; split the change across commits; this code was `draft-file-too-large` before) or `checkpoint-content-not-base64` (a file\'s content is not valid base64).
|
|
4822
5164
|
* @summary Write one of a draft\'s documents
|
|
4823
5165
|
* @param {string} organizationName The unique identifier of the organization
|
|
4824
5166
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
@@ -4910,7 +5252,7 @@ const DraftsApiAxiosParamCreator = function (configuration) {
|
|
|
4910
5252
|
};
|
|
4911
5253
|
}),
|
|
4912
5254
|
/**
|
|
4913
|
-
* Writes a set of documents together. On a git-backed draft they land as **one commit**, which is the reason this exists beside the per-document `PUT`: seeding a draft from a package is a single logical change, and writing its files one at a time would put N commits in the History tab for one action — and leave a reader of any intermediate commit looking at half a package. Ordinary editing uses the per-document `PUT`. This is for the cases that are atomic by nature: the seed, and a multi-file edit that should be reviewable as one diff. `
|
|
5255
|
+
* Writes a set of documents together. On a git-backed draft they land as **one commit**, which is the reason this exists beside the per-document `PUT`: seeding a draft from a package is a single logical change, and writing its files one at a time would put N commits in the History tab for one action — and leave a reader of any intermediate commit looking at half a package. Ordinary editing uses the per-document `PUT`. This is for the cases that are atomic by nature: the seed, and a multi-file edit that should be reviewable as one diff. Each member may carry its own `expectedSha` or `createOnly` on either backing (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. `expectedRef` is deprecated: it applies to the whole set, is git-only, and is refused together with a member\'s `expectedSha` or `createOnly`. A client-minted `intentTimestamp` resent byte-identical makes a retried write a replay rather than a second commit — which matters more here than for one document, since a lost response after an N-file commit is otherwise indistinguishable from a write that never landed. **Authorization**: as `writeDraftDocument`. **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. On a branch-backed draft the commit is made by the gateway, so the claim is checked just before it: a cancel that lands during that one commit can let it through, and the commit\'s `Turn-Work-Item` trailer records which item wrote it. 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. Refuses with `400` and a distinct code when a git-backed checkpoint\'s own content is refused: `checkpoint-over-size-cap` (the draft\'s total content is over the cap; split the change across commits; this code was `draft-file-too-large` before) or `checkpoint-content-not-base64` (a file\'s content is not valid base64).
|
|
4914
5256
|
* @summary Write several of a draft\'s documents as one change
|
|
4915
5257
|
* @param {string} organizationName The unique identifier of the organization
|
|
4916
5258
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
@@ -5058,7 +5400,7 @@ const DraftsApiFp = function (configuration) {
|
|
|
5058
5400
|
});
|
|
5059
5401
|
},
|
|
5060
5402
|
/**
|
|
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)
|
|
5403
|
+
* 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
5404
|
* @summary Delete a draft package
|
|
5063
5405
|
* @param {string} organizationName The unique identifier of the organization
|
|
5064
5406
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
@@ -5076,7 +5418,7 @@ const DraftsApiFp = function (configuration) {
|
|
|
5076
5418
|
});
|
|
5077
5419
|
},
|
|
5078
5420
|
/**
|
|
5079
|
-
* Thin proxy to the code-assist git-gateway\'s `deleteDraft` — deletes the draft\'s branch in the managed monorepo. See `listDraftCommits` for the auth-forwarding notes. **This is branch removal only — it does not delete the draft.** Deleting the draft is `DELETE` on the draft itself.
|
|
5421
|
+
* Thin proxy to the code-assist git-gateway\'s `deleteDraft` — deletes the draft\'s branch in the managed monorepo. See `listDraftCommits` for the auth-forwarding notes. **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
5422
|
* @summary Delete a git-backed draft\'s branch
|
|
5081
5423
|
* @param {string} organizationName The unique identifier of the organization
|
|
5082
5424
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
@@ -5100,8 +5442,8 @@ const DraftsApiFp = function (configuration) {
|
|
|
5100
5442
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
5101
5443
|
* @param {string} draftId The draft package identifier
|
|
5102
5444
|
* @param {string} documentPath The document\'s path relative to the draft root
|
|
5103
|
-
* @param {string} [expectedRef] The branch head the caller read at
|
|
5104
|
-
* @param {string} [expectedSha] The `sha` the caller read the document at
|
|
5445
|
+
* @param {string} [expectedRef] Deprecated, git-only: use `expectedSha`. The branch head the caller read at; for a data file it is ignored, since a data file\'s delete is not a commit. Refused with `expectedSha`, and refused for a document-store draft, data file or not — there is no commit to compare it against.
|
|
5446
|
+
* @param {string} [expectedSha] The `sha` the caller read the document at, on either backing: 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.
|
|
5105
5447
|
* @param {*} [options] Override http request option.
|
|
5106
5448
|
* @throws {RequiredError}
|
|
5107
5449
|
*/
|
|
@@ -5115,13 +5457,13 @@ const DraftsApiFp = function (configuration) {
|
|
|
5115
5457
|
});
|
|
5116
5458
|
},
|
|
5117
5459
|
/**
|
|
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. `expectedRef`
|
|
5460
|
+
* 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. The deprecated `expectedRef` is optional here, as it is absent on a data file\'s delete: when given on a git-backed draft, the commit that writes a small published copy back builds on it (`409 draft-file-stale-head` if the branch has moved since), and on the branch\'s current head when it is not given. - 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 (past a git-backed draft\'s seed bounds, or a corrupt archive), and `503` `draft-changes-unavailable` when it could not be read. **Authorization** — the same pair `writeDraftDocument` takes.
|
|
5119
5461
|
* @summary Restore one of a draft\'s files to its published copy
|
|
5120
5462
|
* @param {string} organizationName The unique identifier of the organization
|
|
5121
5463
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
5122
5464
|
* @param {string} draftId The draft package identifier
|
|
5123
5465
|
* @param {string} documentPath The file\'s path relative to the draft root
|
|
5124
|
-
* @param {string} [expectedRef] The branch head the caller read at, for a git-backed draft where the restore is a commit
|
|
5466
|
+
* @param {string} [expectedRef] Deprecated: the restore builds on the branch\'s current head without it. The branch head the caller read at, for a git-backed draft where the restore is a commit (used as the compare-and-swap base); refused for a document-store draft.
|
|
5125
5467
|
* @param {*} [options] Override http request option.
|
|
5126
5468
|
* @throws {RequiredError}
|
|
5127
5469
|
*/
|
|
@@ -5170,6 +5512,24 @@ const DraftsApiFp = function (configuration) {
|
|
|
5170
5512
|
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
5171
5513
|
});
|
|
5172
5514
|
},
|
|
5515
|
+
/**
|
|
5516
|
+
* The draft\'s capabilities, derived by the server from where its files live and what its package has published, so a client asks this rather than branching on `backing`. The same value `getDraft` carries as `capabilities`, for a caller that does not need the rest of the draft: it reads the draft\'s location and one published-version lookup, not the checkpoint, the files or the git gateway. A draft whose branch is still being cut answers `200` with `ready: false` and nothing else, never a refusal: the answer is \"not yet\", and it changes by itself. **Authorization**: requires read access to the draft document.
|
|
5517
|
+
* @summary What the draft\'s storage can do
|
|
5518
|
+
* @param {string} organizationName The unique identifier of the organization
|
|
5519
|
+
* @param {string} workspaceName The unique identifier of the workspace
|
|
5520
|
+
* @param {string} draftId The draft package identifier
|
|
5521
|
+
* @param {*} [options] Override http request option.
|
|
5522
|
+
* @throws {RequiredError}
|
|
5523
|
+
*/
|
|
5524
|
+
getDraftCapabilities(organizationName, workspaceName, draftId, options) {
|
|
5525
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
5526
|
+
var _a, _b, _c;
|
|
5527
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.getDraftCapabilities(organizationName, workspaceName, draftId, options);
|
|
5528
|
+
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
5529
|
+
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;
|
|
5530
|
+
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
5531
|
+
});
|
|
5532
|
+
},
|
|
5173
5533
|
/**
|
|
5174
5534
|
* 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.
|
|
5175
5535
|
* @summary The draft\'s checkpoint status
|
|
@@ -5229,7 +5589,7 @@ const DraftsApiFp = function (configuration) {
|
|
|
5229
5589
|
});
|
|
5230
5590
|
},
|
|
5231
5591
|
/**
|
|
5232
|
-
* One document\'s content, whichever storage backs the draft. See `listDraftDocuments` for why the backing is not the caller\'s concern. 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: for a git-backed draft, the draft-branch commit its last publish shipped (`publishedAs.commitSha`); for a document-store draft, the stored archive of its 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`:
|
|
5592
|
+
* One document\'s content, whichever storage backs the draft. See `listDraftDocuments` for why the backing is not the caller\'s concern. 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: for a git-backed draft, the draft-branch commit its last publish shipped (`publishedAs.commitSha`); for a document-store draft, the stored archive of its 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 baseline is the package\'s stored archive (a document-store draft\'s, or a git-backed draft\'s never published) and the caller can read the draft but not the package. Workspace access does not imply environment access, so this read also takes `can_read_package` on it. A published git-backed draft\'s baseline is its own branch at `publishedAs.commitSha`, readable by that sha at the draft\'s bar, so it takes no package bar. - `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, or a published commit no longer on the draft\'s branch. 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. On a document-store draft 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`. `ref` is null on a document-store answer; on a git answer it names the published commit, which is NOT a head a compare-and-swap write can build on — read the head separately before writing. **Authorization**: requires read access to the draft document.
|
|
5233
5593
|
* @summary Read one of a draft\'s documents
|
|
5234
5594
|
* @param {string} organizationName The unique identifier of the organization
|
|
5235
5595
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
@@ -5306,7 +5666,7 @@ const DraftsApiFp = function (configuration) {
|
|
|
5306
5666
|
});
|
|
5307
5667
|
},
|
|
5308
5668
|
/**
|
|
5309
|
-
* The draft\'s files, **whichever storage backs them**. A git-backed draft\'s files live on its branch and a document-store draft\'s live as workspace documents; this answers for both, so a client never branches on the backing to read a draft\'s contents. That branch is the reason a draft\'s backing had to be known before its files could be fetched, which put an unrelated read on the critical path of every draft page. Two shapes, both listings: the documents under `path` to `depth`, or — with `ref` — that same listing as of a commit. Git-backed drafts only for `ref`; a document-store draft has no history to address and ignores it. **Listed against the draft\'s last publication.** A draft is a package in draft mode, so a listing of the draft as it stands (no `ref`) 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
|
|
5669
|
+
* The draft\'s files, **whichever storage backs them**. A git-backed draft\'s files live on its branch and a document-store draft\'s live as workspace documents; this answers for both, so a client never branches on the backing to read a draft\'s contents. That branch is the reason a draft\'s backing had to be known before its files could be fetched, which put an unrelated read on the critical path of every draft page. Two shapes, both listings: the documents under `path` to `depth`, or — with `ref` — that same listing as of a commit. Git-backed drafts only for `ref`; a document-store draft has no history to address and ignores it. **Listed against the draft\'s last publication.** A draft is a package in draft mode, so a listing of the draft as it stands (no `ref`) 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, on either backing, 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 (a git-backed draft\'s version past the seed\'s bounds, or 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, or a listing at a `ref`, carries no markers and no removed entries. When the comparison cannot be made (a git compare over the gateway\'s size limit, 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. What changed between two COMMITS is a different question — the History tab\'s — and has its own endpoint: `GET ../comparison`. 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
5670
|
* @summary List a draft\'s documents
|
|
5311
5671
|
* @param {string} organizationName The unique identifier of the organization
|
|
5312
5672
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
@@ -5314,15 +5674,16 @@ const DraftsApiFp = function (configuration) {
|
|
|
5314
5674
|
* @param {string} [path] Restrict the listing to this subtree, relative to the draft root.
|
|
5315
5675
|
* @param {number} [depth] `1` lists only the immediate children of `path`, as a file browser would. Omitted returns the whole subtree, which is what a section listing wants. The two are answered by different reads, so they differ in two ways a caller can see. A bounded depth returns directory entries as well as files; the whole subtree returns files only, since a directory is not a document and every caller of the depth-less listing filters to files anyway. And the whole subtree is refused with `413` for a draft holding a symlink or submodule, where a bounded depth lists around it.
|
|
5316
5676
|
* @param {string} [ref] Read the listing at this commit rather than at the branch tip. Accepts only a full 40-character sha reachable from the draft\'s branch. Ignored by a document-store draft, which has no commits.
|
|
5677
|
+
* @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 file that is not UTF-8 text comes as `contentBase64`. 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
5678
|
* @param {number} [limit] Maximum number of items to return. Use -1 or omit to return all results.
|
|
5318
5679
|
* @param {number} [offset] Number of items to skip before starting to return results
|
|
5319
5680
|
* @param {*} [options] Override http request option.
|
|
5320
5681
|
* @throws {RequiredError}
|
|
5321
5682
|
*/
|
|
5322
|
-
listDraftDocuments(organizationName, workspaceName, draftId, path, depth, ref, limit, offset, options) {
|
|
5683
|
+
listDraftDocuments(organizationName, workspaceName, draftId, path, depth, ref, withContent, limit, offset, options) {
|
|
5323
5684
|
return __awaiter(this, void 0, void 0, function* () {
|
|
5324
5685
|
var _a, _b, _c;
|
|
5325
|
-
const localVarAxiosArgs = yield localVarAxiosParamCreator.listDraftDocuments(organizationName, workspaceName, draftId, path, depth, ref, limit, offset, options);
|
|
5686
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.listDraftDocuments(organizationName, workspaceName, draftId, path, depth, ref, withContent, limit, offset, options);
|
|
5326
5687
|
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
5327
5688
|
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
5689
|
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
@@ -5405,7 +5766,7 @@ const DraftsApiFp = function (configuration) {
|
|
|
5405
5766
|
});
|
|
5406
5767
|
},
|
|
5407
5768
|
/**
|
|
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).
|
|
5769
|
+
* 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 whose branch is still being cut answers `409` `draft-provisioning` and records nothing; retry after a moment. 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.
|
|
5409
5770
|
* @summary Set the draft\'s checkpoint to its current content
|
|
5410
5771
|
* @param {string} organizationName The unique identifier of the organization
|
|
5411
5772
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
@@ -5423,7 +5784,7 @@ const DraftsApiFp = function (configuration) {
|
|
|
5423
5784
|
});
|
|
5424
5785
|
},
|
|
5425
5786
|
/**
|
|
5426
|
-
* Creates or replaces a document, whichever storage backs the draft. `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
|
|
5787
|
+
* Creates or replaces a document, whichever storage backs the draft. `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, on either backing.** `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. On either backing 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. On a git-backed draft the check is made against the branch\'s current files, so a commit that touched only OTHER files does not fail the write: the server re-sends it once on the new tip, and answers `409` `draft-write-contended` if the tip kept moving. `expectedRef` is deprecated and git-only: the BRANCH HEAD the writer read at, which any commit to any file makes stale (`409` `draft-file-stale-head`). It is refused together with `expectedSha` or `createOnly`, and refused on a document-store draft rather than ignored: a caller that sends a precondition believes it holds a guarantee. On a document-store draft 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, on either backing. 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. A git-backed write also commits into that environment\'s repository. 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. Refuses with `400` and a distinct code when a git-backed checkpoint\'s own content is refused: `checkpoint-over-size-cap` (the draft\'s total content is over the cap; split the change across commits; this code was `draft-file-too-large` before) or `checkpoint-content-not-base64` (a file\'s content is not valid base64).
|
|
5427
5788
|
* @summary Write one of a draft\'s documents
|
|
5428
5789
|
* @param {string} organizationName The unique identifier of the organization
|
|
5429
5790
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
@@ -5463,7 +5824,7 @@ const DraftsApiFp = function (configuration) {
|
|
|
5463
5824
|
});
|
|
5464
5825
|
},
|
|
5465
5826
|
/**
|
|
5466
|
-
* Writes a set of documents together. On a git-backed draft they land as **one commit**, which is the reason this exists beside the per-document `PUT`: seeding a draft from a package is a single logical change, and writing its files one at a time would put N commits in the History tab for one action — and leave a reader of any intermediate commit looking at half a package. Ordinary editing uses the per-document `PUT`. This is for the cases that are atomic by nature: the seed, and a multi-file edit that should be reviewable as one diff. `
|
|
5827
|
+
* Writes a set of documents together. On a git-backed draft they land as **one commit**, which is the reason this exists beside the per-document `PUT`: seeding a draft from a package is a single logical change, and writing its files one at a time would put N commits in the History tab for one action — and leave a reader of any intermediate commit looking at half a package. Ordinary editing uses the per-document `PUT`. This is for the cases that are atomic by nature: the seed, and a multi-file edit that should be reviewable as one diff. Each member may carry its own `expectedSha` or `createOnly` on either backing (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. `expectedRef` is deprecated: it applies to the whole set, is git-only, and is refused together with a member\'s `expectedSha` or `createOnly`. A client-minted `intentTimestamp` resent byte-identical makes a retried write a replay rather than a second commit — which matters more here than for one document, since a lost response after an N-file commit is otherwise indistinguishable from a write that never landed. **Authorization**: as `writeDraftDocument`. **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. On a branch-backed draft the commit is made by the gateway, so the claim is checked just before it: a cancel that lands during that one commit can let it through, and the commit\'s `Turn-Work-Item` trailer records which item wrote it. 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. Refuses with `400` and a distinct code when a git-backed checkpoint\'s own content is refused: `checkpoint-over-size-cap` (the draft\'s total content is over the cap; split the change across commits; this code was `draft-file-too-large` before) or `checkpoint-content-not-base64` (a file\'s content is not valid base64).
|
|
5467
5828
|
* @summary Write several of a draft\'s documents as one change
|
|
5468
5829
|
* @param {string} organizationName The unique identifier of the organization
|
|
5469
5830
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
@@ -5541,7 +5902,7 @@ const DraftsApiFactory = function (configuration, basePath, axios) {
|
|
|
5541
5902
|
return localVarFp.createDraft(organizationName, workspaceName, draftCreateRequest, options).then((request) => request(axios, basePath));
|
|
5542
5903
|
},
|
|
5543
5904
|
/**
|
|
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)
|
|
5905
|
+
* 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
5906
|
* @summary Delete a draft package
|
|
5546
5907
|
* @param {string} organizationName The unique identifier of the organization
|
|
5547
5908
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
@@ -5553,7 +5914,7 @@ const DraftsApiFactory = function (configuration, basePath, axios) {
|
|
|
5553
5914
|
return localVarFp.deleteDraft(organizationName, workspaceName, draftId, options).then((request) => request(axios, basePath));
|
|
5554
5915
|
},
|
|
5555
5916
|
/**
|
|
5556
|
-
* Thin proxy to the code-assist git-gateway\'s `deleteDraft` — deletes the draft\'s branch in the managed monorepo. See `listDraftCommits` for the auth-forwarding notes. **This is branch removal only — it does not delete the draft.** Deleting the draft is `DELETE` on the draft itself.
|
|
5917
|
+
* Thin proxy to the code-assist git-gateway\'s `deleteDraft` — deletes the draft\'s branch in the managed monorepo. See `listDraftCommits` for the auth-forwarding notes. **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
5918
|
* @summary Delete a git-backed draft\'s branch
|
|
5558
5919
|
* @param {string} organizationName The unique identifier of the organization
|
|
5559
5920
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
@@ -5571,8 +5932,8 @@ const DraftsApiFactory = function (configuration, basePath, axios) {
|
|
|
5571
5932
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
5572
5933
|
* @param {string} draftId The draft package identifier
|
|
5573
5934
|
* @param {string} documentPath The document\'s path relative to the draft root
|
|
5574
|
-
* @param {string} [expectedRef] The branch head the caller read at
|
|
5575
|
-
* @param {string} [expectedSha] The `sha` the caller read the document at
|
|
5935
|
+
* @param {string} [expectedRef] Deprecated, git-only: use `expectedSha`. The branch head the caller read at; for a data file it is ignored, since a data file\'s delete is not a commit. Refused with `expectedSha`, and refused for a document-store draft, data file or not — there is no commit to compare it against.
|
|
5936
|
+
* @param {string} [expectedSha] The `sha` the caller read the document at, on either backing: 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.
|
|
5576
5937
|
* @param {*} [options] Override http request option.
|
|
5577
5938
|
* @throws {RequiredError}
|
|
5578
5939
|
*/
|
|
@@ -5580,13 +5941,13 @@ const DraftsApiFactory = function (configuration, basePath, axios) {
|
|
|
5580
5941
|
return localVarFp.deleteDraftDocument(organizationName, workspaceName, draftId, documentPath, expectedRef, expectedSha, options).then((request) => request(axios, basePath));
|
|
5581
5942
|
},
|
|
5582
5943
|
/**
|
|
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. `expectedRef`
|
|
5944
|
+
* 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. The deprecated `expectedRef` is optional here, as it is absent on a data file\'s delete: when given on a git-backed draft, the commit that writes a small published copy back builds on it (`409 draft-file-stale-head` if the branch has moved since), and on the branch\'s current head when it is not given. - 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 (past a git-backed draft\'s seed bounds, or a corrupt archive), and `503` `draft-changes-unavailable` when it could not be read. **Authorization** — the same pair `writeDraftDocument` takes.
|
|
5584
5945
|
* @summary Restore one of a draft\'s files to its published copy
|
|
5585
5946
|
* @param {string} organizationName The unique identifier of the organization
|
|
5586
5947
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
5587
5948
|
* @param {string} draftId The draft package identifier
|
|
5588
5949
|
* @param {string} documentPath The file\'s path relative to the draft root
|
|
5589
|
-
* @param {string} [expectedRef] The branch head the caller read at, for a git-backed draft where the restore is a commit
|
|
5950
|
+
* @param {string} [expectedRef] Deprecated: the restore builds on the branch\'s current head without it. The branch head the caller read at, for a git-backed draft where the restore is a commit (used as the compare-and-swap base); refused for a document-store draft.
|
|
5590
5951
|
* @param {*} [options] Override http request option.
|
|
5591
5952
|
* @throws {RequiredError}
|
|
5592
5953
|
*/
|
|
@@ -5617,6 +5978,18 @@ const DraftsApiFactory = function (configuration, basePath, axios) {
|
|
|
5617
5978
|
getDraftBranch(organizationName, workspaceName, draftId, options) {
|
|
5618
5979
|
return localVarFp.getDraftBranch(organizationName, workspaceName, draftId, options).then((request) => request(axios, basePath));
|
|
5619
5980
|
},
|
|
5981
|
+
/**
|
|
5982
|
+
* The draft\'s capabilities, derived by the server from where its files live and what its package has published, so a client asks this rather than branching on `backing`. The same value `getDraft` carries as `capabilities`, for a caller that does not need the rest of the draft: it reads the draft\'s location and one published-version lookup, not the checkpoint, the files or the git gateway. A draft whose branch is still being cut answers `200` with `ready: false` and nothing else, never a refusal: the answer is \"not yet\", and it changes by itself. **Authorization**: requires read access to the draft document.
|
|
5983
|
+
* @summary What the draft\'s storage can do
|
|
5984
|
+
* @param {string} organizationName The unique identifier of the organization
|
|
5985
|
+
* @param {string} workspaceName The unique identifier of the workspace
|
|
5986
|
+
* @param {string} draftId The draft package identifier
|
|
5987
|
+
* @param {*} [options] Override http request option.
|
|
5988
|
+
* @throws {RequiredError}
|
|
5989
|
+
*/
|
|
5990
|
+
getDraftCapabilities(organizationName, workspaceName, draftId, options) {
|
|
5991
|
+
return localVarFp.getDraftCapabilities(organizationName, workspaceName, draftId, options).then((request) => request(axios, basePath));
|
|
5992
|
+
},
|
|
5620
5993
|
/**
|
|
5621
5994
|
* 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.
|
|
5622
5995
|
* @summary The draft\'s checkpoint status
|
|
@@ -5658,7 +6031,7 @@ const DraftsApiFactory = function (configuration, basePath, axios) {
|
|
|
5658
6031
|
return localVarFp.getDraftContent(organizationName, workspaceName, draftId, options).then((request) => request(axios, basePath));
|
|
5659
6032
|
},
|
|
5660
6033
|
/**
|
|
5661
|
-
* One document\'s content, whichever storage backs the draft. See `listDraftDocuments` for why the backing is not the caller\'s concern. 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: for a git-backed draft, the draft-branch commit its last publish shipped (`publishedAs.commitSha`); for a document-store draft, the stored archive of its 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`:
|
|
6034
|
+
* One document\'s content, whichever storage backs the draft. See `listDraftDocuments` for why the backing is not the caller\'s concern. 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: for a git-backed draft, the draft-branch commit its last publish shipped (`publishedAs.commitSha`); for a document-store draft, the stored archive of its 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 baseline is the package\'s stored archive (a document-store draft\'s, or a git-backed draft\'s never published) and the caller can read the draft but not the package. Workspace access does not imply environment access, so this read also takes `can_read_package` on it. A published git-backed draft\'s baseline is its own branch at `publishedAs.commitSha`, readable by that sha at the draft\'s bar, so it takes no package bar. - `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, or a published commit no longer on the draft\'s branch. 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. On a document-store draft 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`. `ref` is null on a document-store answer; on a git answer it names the published commit, which is NOT a head a compare-and-swap write can build on — read the head separately before writing. **Authorization**: requires read access to the draft document.
|
|
5662
6035
|
* @summary Read one of a draft\'s documents
|
|
5663
6036
|
* @param {string} organizationName The unique identifier of the organization
|
|
5664
6037
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
@@ -5711,7 +6084,7 @@ const DraftsApiFactory = function (configuration, basePath, axios) {
|
|
|
5711
6084
|
return localVarFp.listDraftCommits(organizationName, workspaceName, draftId, limit, offset, options).then((request) => request(axios, basePath));
|
|
5712
6085
|
},
|
|
5713
6086
|
/**
|
|
5714
|
-
* The draft\'s files, **whichever storage backs them**. A git-backed draft\'s files live on its branch and a document-store draft\'s live as workspace documents; this answers for both, so a client never branches on the backing to read a draft\'s contents. That branch is the reason a draft\'s backing had to be known before its files could be fetched, which put an unrelated read on the critical path of every draft page. Two shapes, both listings: the documents under `path` to `depth`, or — with `ref` — that same listing as of a commit. Git-backed drafts only for `ref`; a document-store draft has no history to address and ignores it. **Listed against the draft\'s last publication.** A draft is a package in draft mode, so a listing of the draft as it stands (no `ref`) 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
|
|
6087
|
+
* The draft\'s files, **whichever storage backs them**. A git-backed draft\'s files live on its branch and a document-store draft\'s live as workspace documents; this answers for both, so a client never branches on the backing to read a draft\'s contents. That branch is the reason a draft\'s backing had to be known before its files could be fetched, which put an unrelated read on the critical path of every draft page. Two shapes, both listings: the documents under `path` to `depth`, or — with `ref` — that same listing as of a commit. Git-backed drafts only for `ref`; a document-store draft has no history to address and ignores it. **Listed against the draft\'s last publication.** A draft is a package in draft mode, so a listing of the draft as it stands (no `ref`) 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, on either backing, 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 (a git-backed draft\'s version past the seed\'s bounds, or 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, or a listing at a `ref`, carries no markers and no removed entries. When the comparison cannot be made (a git compare over the gateway\'s size limit, 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. What changed between two COMMITS is a different question — the History tab\'s — and has its own endpoint: `GET ../comparison`. 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
6088
|
* @summary List a draft\'s documents
|
|
5716
6089
|
* @param {string} organizationName The unique identifier of the organization
|
|
5717
6090
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
@@ -5719,13 +6092,14 @@ const DraftsApiFactory = function (configuration, basePath, axios) {
|
|
|
5719
6092
|
* @param {string} [path] Restrict the listing to this subtree, relative to the draft root.
|
|
5720
6093
|
* @param {number} [depth] `1` lists only the immediate children of `path`, as a file browser would. Omitted returns the whole subtree, which is what a section listing wants. The two are answered by different reads, so they differ in two ways a caller can see. A bounded depth returns directory entries as well as files; the whole subtree returns files only, since a directory is not a document and every caller of the depth-less listing filters to files anyway. And the whole subtree is refused with `413` for a draft holding a symlink or submodule, where a bounded depth lists around it.
|
|
5721
6094
|
* @param {string} [ref] Read the listing at this commit rather than at the branch tip. Accepts only a full 40-character sha reachable from the draft\'s branch. Ignored by a document-store draft, which has no commits.
|
|
6095
|
+
* @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 file that is not UTF-8 text comes as `contentBase64`. 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
6096
|
* @param {number} [limit] Maximum number of items to return. Use -1 or omit to return all results.
|
|
5723
6097
|
* @param {number} [offset] Number of items to skip before starting to return results
|
|
5724
6098
|
* @param {*} [options] Override http request option.
|
|
5725
6099
|
* @throws {RequiredError}
|
|
5726
6100
|
*/
|
|
5727
|
-
listDraftDocuments(organizationName, workspaceName, draftId, path, depth, ref, limit, offset, options) {
|
|
5728
|
-
return localVarFp.listDraftDocuments(organizationName, workspaceName, draftId, path, depth, ref, limit, offset, options).then((request) => request(axios, basePath));
|
|
6101
|
+
listDraftDocuments(organizationName, workspaceName, draftId, path, depth, ref, withContent, limit, offset, options) {
|
|
6102
|
+
return localVarFp.listDraftDocuments(organizationName, workspaceName, draftId, path, depth, ref, withContent, limit, offset, options).then((request) => request(axios, basePath));
|
|
5729
6103
|
},
|
|
5730
6104
|
/**
|
|
5731
6105
|
* 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.
|
|
@@ -5780,7 +6154,7 @@ const DraftsApiFactory = function (configuration, basePath, axios) {
|
|
|
5780
6154
|
return localVarFp.updateDraftPullRequest(organizationName, workspaceName, draftId, mergeDraftPullRequest, options).then((request) => request(axios, basePath));
|
|
5781
6155
|
},
|
|
5782
6156
|
/**
|
|
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).
|
|
6157
|
+
* 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 whose branch is still being cut answers `409` `draft-provisioning` and records nothing; retry after a moment. 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.
|
|
5784
6158
|
* @summary Set the draft\'s checkpoint to its current content
|
|
5785
6159
|
* @param {string} organizationName The unique identifier of the organization
|
|
5786
6160
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
@@ -5792,7 +6166,7 @@ const DraftsApiFactory = function (configuration, basePath, axios) {
|
|
|
5792
6166
|
return localVarFp.writeDraftCheckpoint(organizationName, workspaceName, draftId, options).then((request) => request(axios, basePath));
|
|
5793
6167
|
},
|
|
5794
6168
|
/**
|
|
5795
|
-
* Creates or replaces a document, whichever storage backs the draft. `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
|
|
6169
|
+
* Creates or replaces a document, whichever storage backs the draft. `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, on either backing.** `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. On either backing 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. On a git-backed draft the check is made against the branch\'s current files, so a commit that touched only OTHER files does not fail the write: the server re-sends it once on the new tip, and answers `409` `draft-write-contended` if the tip kept moving. `expectedRef` is deprecated and git-only: the BRANCH HEAD the writer read at, which any commit to any file makes stale (`409` `draft-file-stale-head`). It is refused together with `expectedSha` or `createOnly`, and refused on a document-store draft rather than ignored: a caller that sends a precondition believes it holds a guarantee. On a document-store draft 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, on either backing. 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. A git-backed write also commits into that environment\'s repository. 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. Refuses with `400` and a distinct code when a git-backed checkpoint\'s own content is refused: `checkpoint-over-size-cap` (the draft\'s total content is over the cap; split the change across commits; this code was `draft-file-too-large` before) or `checkpoint-content-not-base64` (a file\'s content is not valid base64).
|
|
5796
6170
|
* @summary Write one of a draft\'s documents
|
|
5797
6171
|
* @param {string} organizationName The unique identifier of the organization
|
|
5798
6172
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
@@ -5820,7 +6194,7 @@ const DraftsApiFactory = function (configuration, basePath, axios) {
|
|
|
5820
6194
|
return localVarFp.writeDraftDocumentContent(organizationName, workspaceName, draftId, documentPath, body, options).then((request) => request(axios, basePath));
|
|
5821
6195
|
},
|
|
5822
6196
|
/**
|
|
5823
|
-
* Writes a set of documents together. On a git-backed draft they land as **one commit**, which is the reason this exists beside the per-document `PUT`: seeding a draft from a package is a single logical change, and writing its files one at a time would put N commits in the History tab for one action — and leave a reader of any intermediate commit looking at half a package. Ordinary editing uses the per-document `PUT`. This is for the cases that are atomic by nature: the seed, and a multi-file edit that should be reviewable as one diff. `
|
|
6197
|
+
* Writes a set of documents together. On a git-backed draft they land as **one commit**, which is the reason this exists beside the per-document `PUT`: seeding a draft from a package is a single logical change, and writing its files one at a time would put N commits in the History tab for one action — and leave a reader of any intermediate commit looking at half a package. Ordinary editing uses the per-document `PUT`. This is for the cases that are atomic by nature: the seed, and a multi-file edit that should be reviewable as one diff. Each member may carry its own `expectedSha` or `createOnly` on either backing (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. `expectedRef` is deprecated: it applies to the whole set, is git-only, and is refused together with a member\'s `expectedSha` or `createOnly`. A client-minted `intentTimestamp` resent byte-identical makes a retried write a replay rather than a second commit — which matters more here than for one document, since a lost response after an N-file commit is otherwise indistinguishable from a write that never landed. **Authorization**: as `writeDraftDocument`. **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. On a branch-backed draft the commit is made by the gateway, so the claim is checked just before it: a cancel that lands during that one commit can let it through, and the commit\'s `Turn-Work-Item` trailer records which item wrote it. 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. Refuses with `400` and a distinct code when a git-backed checkpoint\'s own content is refused: `checkpoint-over-size-cap` (the draft\'s total content is over the cap; split the change across commits; this code was `draft-file-too-large` before) or `checkpoint-content-not-base64` (a file\'s content is not valid base64).
|
|
5824
6198
|
* @summary Write several of a draft\'s documents as one change
|
|
5825
6199
|
* @param {string} organizationName The unique identifier of the organization
|
|
5826
6200
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
@@ -5881,7 +6255,7 @@ class DraftsApi extends base_1.BaseAPI {
|
|
|
5881
6255
|
return (0, exports.DraftsApiFp)(this.configuration).createDraft(organizationName, workspaceName, draftCreateRequest, options).then((request) => request(this.axios, this.basePath));
|
|
5882
6256
|
}
|
|
5883
6257
|
/**
|
|
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)
|
|
6258
|
+
* 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
6259
|
* @summary Delete a draft package
|
|
5886
6260
|
* @param {string} organizationName The unique identifier of the organization
|
|
5887
6261
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
@@ -5894,7 +6268,7 @@ class DraftsApi extends base_1.BaseAPI {
|
|
|
5894
6268
|
return (0, exports.DraftsApiFp)(this.configuration).deleteDraft(organizationName, workspaceName, draftId, options).then((request) => request(this.axios, this.basePath));
|
|
5895
6269
|
}
|
|
5896
6270
|
/**
|
|
5897
|
-
* Thin proxy to the code-assist git-gateway\'s `deleteDraft` — deletes the draft\'s branch in the managed monorepo. See `listDraftCommits` for the auth-forwarding notes. **This is branch removal only — it does not delete the draft.** Deleting the draft is `DELETE` on the draft itself.
|
|
6271
|
+
* Thin proxy to the code-assist git-gateway\'s `deleteDraft` — deletes the draft\'s branch in the managed monorepo. See `listDraftCommits` for the auth-forwarding notes. **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
6272
|
* @summary Delete a git-backed draft\'s branch
|
|
5899
6273
|
* @param {string} organizationName The unique identifier of the organization
|
|
5900
6274
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
@@ -5913,8 +6287,8 @@ class DraftsApi extends base_1.BaseAPI {
|
|
|
5913
6287
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
5914
6288
|
* @param {string} draftId The draft package identifier
|
|
5915
6289
|
* @param {string} documentPath The document\'s path relative to the draft root
|
|
5916
|
-
* @param {string} [expectedRef] The branch head the caller read at
|
|
5917
|
-
* @param {string} [expectedSha] The `sha` the caller read the document at
|
|
6290
|
+
* @param {string} [expectedRef] Deprecated, git-only: use `expectedSha`. The branch head the caller read at; for a data file it is ignored, since a data file\'s delete is not a commit. Refused with `expectedSha`, and refused for a document-store draft, data file or not — there is no commit to compare it against.
|
|
6291
|
+
* @param {string} [expectedSha] The `sha` the caller read the document at, on either backing: 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.
|
|
5918
6292
|
* @param {*} [options] Override http request option.
|
|
5919
6293
|
* @throws {RequiredError}
|
|
5920
6294
|
* @memberof DraftsApi
|
|
@@ -5923,13 +6297,13 @@ class DraftsApi extends base_1.BaseAPI {
|
|
|
5923
6297
|
return (0, exports.DraftsApiFp)(this.configuration).deleteDraftDocument(organizationName, workspaceName, draftId, documentPath, expectedRef, expectedSha, options).then((request) => request(this.axios, this.basePath));
|
|
5924
6298
|
}
|
|
5925
6299
|
/**
|
|
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. `expectedRef`
|
|
6300
|
+
* 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. The deprecated `expectedRef` is optional here, as it is absent on a data file\'s delete: when given on a git-backed draft, the commit that writes a small published copy back builds on it (`409 draft-file-stale-head` if the branch has moved since), and on the branch\'s current head when it is not given. - 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 (past a git-backed draft\'s seed bounds, or a corrupt archive), and `503` `draft-changes-unavailable` when it could not be read. **Authorization** — the same pair `writeDraftDocument` takes.
|
|
5927
6301
|
* @summary Restore one of a draft\'s files to its published copy
|
|
5928
6302
|
* @param {string} organizationName The unique identifier of the organization
|
|
5929
6303
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
5930
6304
|
* @param {string} draftId The draft package identifier
|
|
5931
6305
|
* @param {string} documentPath The file\'s path relative to the draft root
|
|
5932
|
-
* @param {string} [expectedRef] The branch head the caller read at, for a git-backed draft where the restore is a commit
|
|
6306
|
+
* @param {string} [expectedRef] Deprecated: the restore builds on the branch\'s current head without it. The branch head the caller read at, for a git-backed draft where the restore is a commit (used as the compare-and-swap base); refused for a document-store draft.
|
|
5933
6307
|
* @param {*} [options] Override http request option.
|
|
5934
6308
|
* @throws {RequiredError}
|
|
5935
6309
|
* @memberof DraftsApi
|
|
@@ -5963,6 +6337,19 @@ class DraftsApi extends base_1.BaseAPI {
|
|
|
5963
6337
|
getDraftBranch(organizationName, workspaceName, draftId, options) {
|
|
5964
6338
|
return (0, exports.DraftsApiFp)(this.configuration).getDraftBranch(organizationName, workspaceName, draftId, options).then((request) => request(this.axios, this.basePath));
|
|
5965
6339
|
}
|
|
6340
|
+
/**
|
|
6341
|
+
* The draft\'s capabilities, derived by the server from where its files live and what its package has published, so a client asks this rather than branching on `backing`. The same value `getDraft` carries as `capabilities`, for a caller that does not need the rest of the draft: it reads the draft\'s location and one published-version lookup, not the checkpoint, the files or the git gateway. A draft whose branch is still being cut answers `200` with `ready: false` and nothing else, never a refusal: the answer is \"not yet\", and it changes by itself. **Authorization**: requires read access to the draft document.
|
|
6342
|
+
* @summary What the draft\'s storage can do
|
|
6343
|
+
* @param {string} organizationName The unique identifier of the organization
|
|
6344
|
+
* @param {string} workspaceName The unique identifier of the workspace
|
|
6345
|
+
* @param {string} draftId The draft package identifier
|
|
6346
|
+
* @param {*} [options] Override http request option.
|
|
6347
|
+
* @throws {RequiredError}
|
|
6348
|
+
* @memberof DraftsApi
|
|
6349
|
+
*/
|
|
6350
|
+
getDraftCapabilities(organizationName, workspaceName, draftId, options) {
|
|
6351
|
+
return (0, exports.DraftsApiFp)(this.configuration).getDraftCapabilities(organizationName, workspaceName, draftId, options).then((request) => request(this.axios, this.basePath));
|
|
6352
|
+
}
|
|
5966
6353
|
/**
|
|
5967
6354
|
* 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.
|
|
5968
6355
|
* @summary The draft\'s checkpoint status
|
|
@@ -6007,7 +6394,7 @@ class DraftsApi extends base_1.BaseAPI {
|
|
|
6007
6394
|
return (0, exports.DraftsApiFp)(this.configuration).getDraftContent(organizationName, workspaceName, draftId, options).then((request) => request(this.axios, this.basePath));
|
|
6008
6395
|
}
|
|
6009
6396
|
/**
|
|
6010
|
-
* One document\'s content, whichever storage backs the draft. See `listDraftDocuments` for why the backing is not the caller\'s concern. 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: for a git-backed draft, the draft-branch commit its last publish shipped (`publishedAs.commitSha`); for a document-store draft, the stored archive of its 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`:
|
|
6397
|
+
* One document\'s content, whichever storage backs the draft. See `listDraftDocuments` for why the backing is not the caller\'s concern. 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: for a git-backed draft, the draft-branch commit its last publish shipped (`publishedAs.commitSha`); for a document-store draft, the stored archive of its 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 baseline is the package\'s stored archive (a document-store draft\'s, or a git-backed draft\'s never published) and the caller can read the draft but not the package. Workspace access does not imply environment access, so this read also takes `can_read_package` on it. A published git-backed draft\'s baseline is its own branch at `publishedAs.commitSha`, readable by that sha at the draft\'s bar, so it takes no package bar. - `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, or a published commit no longer on the draft\'s branch. 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. On a document-store draft 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`. `ref` is null on a document-store answer; on a git answer it names the published commit, which is NOT a head a compare-and-swap write can build on — read the head separately before writing. **Authorization**: requires read access to the draft document.
|
|
6011
6398
|
* @summary Read one of a draft\'s documents
|
|
6012
6399
|
* @param {string} organizationName The unique identifier of the organization
|
|
6013
6400
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
@@ -6064,7 +6451,7 @@ class DraftsApi extends base_1.BaseAPI {
|
|
|
6064
6451
|
return (0, exports.DraftsApiFp)(this.configuration).listDraftCommits(organizationName, workspaceName, draftId, limit, offset, options).then((request) => request(this.axios, this.basePath));
|
|
6065
6452
|
}
|
|
6066
6453
|
/**
|
|
6067
|
-
* The draft\'s files, **whichever storage backs them**. A git-backed draft\'s files live on its branch and a document-store draft\'s live as workspace documents; this answers for both, so a client never branches on the backing to read a draft\'s contents. That branch is the reason a draft\'s backing had to be known before its files could be fetched, which put an unrelated read on the critical path of every draft page. Two shapes, both listings: the documents under `path` to `depth`, or — with `ref` — that same listing as of a commit. Git-backed drafts only for `ref`; a document-store draft has no history to address and ignores it. **Listed against the draft\'s last publication.** A draft is a package in draft mode, so a listing of the draft as it stands (no `ref`) 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
|
|
6454
|
+
* The draft\'s files, **whichever storage backs them**. A git-backed draft\'s files live on its branch and a document-store draft\'s live as workspace documents; this answers for both, so a client never branches on the backing to read a draft\'s contents. That branch is the reason a draft\'s backing had to be known before its files could be fetched, which put an unrelated read on the critical path of every draft page. Two shapes, both listings: the documents under `path` to `depth`, or — with `ref` — that same listing as of a commit. Git-backed drafts only for `ref`; a document-store draft has no history to address and ignores it. **Listed against the draft\'s last publication.** A draft is a package in draft mode, so a listing of the draft as it stands (no `ref`) 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, on either backing, 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 (a git-backed draft\'s version past the seed\'s bounds, or 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, or a listing at a `ref`, carries no markers and no removed entries. When the comparison cannot be made (a git compare over the gateway\'s size limit, 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. What changed between two COMMITS is a different question — the History tab\'s — and has its own endpoint: `GET ../comparison`. 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
6455
|
* @summary List a draft\'s documents
|
|
6069
6456
|
* @param {string} organizationName The unique identifier of the organization
|
|
6070
6457
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
@@ -6072,14 +6459,15 @@ class DraftsApi extends base_1.BaseAPI {
|
|
|
6072
6459
|
* @param {string} [path] Restrict the listing to this subtree, relative to the draft root.
|
|
6073
6460
|
* @param {number} [depth] `1` lists only the immediate children of `path`, as a file browser would. Omitted returns the whole subtree, which is what a section listing wants. The two are answered by different reads, so they differ in two ways a caller can see. A bounded depth returns directory entries as well as files; the whole subtree returns files only, since a directory is not a document and every caller of the depth-less listing filters to files anyway. And the whole subtree is refused with `413` for a draft holding a symlink or submodule, where a bounded depth lists around it.
|
|
6074
6461
|
* @param {string} [ref] Read the listing at this commit rather than at the branch tip. Accepts only a full 40-character sha reachable from the draft\'s branch. Ignored by a document-store draft, which has no commits.
|
|
6462
|
+
* @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 file that is not UTF-8 text comes as `contentBase64`. 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
6463
|
* @param {number} [limit] Maximum number of items to return. Use -1 or omit to return all results.
|
|
6076
6464
|
* @param {number} [offset] Number of items to skip before starting to return results
|
|
6077
6465
|
* @param {*} [options] Override http request option.
|
|
6078
6466
|
* @throws {RequiredError}
|
|
6079
6467
|
* @memberof DraftsApi
|
|
6080
6468
|
*/
|
|
6081
|
-
listDraftDocuments(organizationName, workspaceName, draftId, path, depth, ref, limit, offset, options) {
|
|
6082
|
-
return (0, exports.DraftsApiFp)(this.configuration).listDraftDocuments(organizationName, workspaceName, draftId, path, depth, ref, limit, offset, options).then((request) => request(this.axios, this.basePath));
|
|
6469
|
+
listDraftDocuments(organizationName, workspaceName, draftId, path, depth, ref, withContent, limit, offset, options) {
|
|
6470
|
+
return (0, exports.DraftsApiFp)(this.configuration).listDraftDocuments(organizationName, workspaceName, draftId, path, depth, ref, withContent, limit, offset, options).then((request) => request(this.axios, this.basePath));
|
|
6083
6471
|
}
|
|
6084
6472
|
/**
|
|
6085
6473
|
* 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.
|
|
@@ -6138,7 +6526,7 @@ class DraftsApi extends base_1.BaseAPI {
|
|
|
6138
6526
|
return (0, exports.DraftsApiFp)(this.configuration).updateDraftPullRequest(organizationName, workspaceName, draftId, mergeDraftPullRequest, options).then((request) => request(this.axios, this.basePath));
|
|
6139
6527
|
}
|
|
6140
6528
|
/**
|
|
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).
|
|
6529
|
+
* 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 whose branch is still being cut answers `409` `draft-provisioning` and records nothing; retry after a moment. 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.
|
|
6142
6530
|
* @summary Set the draft\'s checkpoint to its current content
|
|
6143
6531
|
* @param {string} organizationName The unique identifier of the organization
|
|
6144
6532
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
@@ -6151,7 +6539,7 @@ class DraftsApi extends base_1.BaseAPI {
|
|
|
6151
6539
|
return (0, exports.DraftsApiFp)(this.configuration).writeDraftCheckpoint(organizationName, workspaceName, draftId, options).then((request) => request(this.axios, this.basePath));
|
|
6152
6540
|
}
|
|
6153
6541
|
/**
|
|
6154
|
-
* Creates or replaces a document, whichever storage backs the draft. `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
|
|
6542
|
+
* Creates or replaces a document, whichever storage backs the draft. `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, on either backing.** `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. On either backing 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. On a git-backed draft the check is made against the branch\'s current files, so a commit that touched only OTHER files does not fail the write: the server re-sends it once on the new tip, and answers `409` `draft-write-contended` if the tip kept moving. `expectedRef` is deprecated and git-only: the BRANCH HEAD the writer read at, which any commit to any file makes stale (`409` `draft-file-stale-head`). It is refused together with `expectedSha` or `createOnly`, and refused on a document-store draft rather than ignored: a caller that sends a precondition believes it holds a guarantee. On a document-store draft 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, on either backing. 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. A git-backed write also commits into that environment\'s repository. 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. Refuses with `400` and a distinct code when a git-backed checkpoint\'s own content is refused: `checkpoint-over-size-cap` (the draft\'s total content is over the cap; split the change across commits; this code was `draft-file-too-large` before) or `checkpoint-content-not-base64` (a file\'s content is not valid base64).
|
|
6155
6543
|
* @summary Write one of a draft\'s documents
|
|
6156
6544
|
* @param {string} organizationName The unique identifier of the organization
|
|
6157
6545
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
@@ -6181,7 +6569,7 @@ class DraftsApi extends base_1.BaseAPI {
|
|
|
6181
6569
|
return (0, exports.DraftsApiFp)(this.configuration).writeDraftDocumentContent(organizationName, workspaceName, draftId, documentPath, body, options).then((request) => request(this.axios, this.basePath));
|
|
6182
6570
|
}
|
|
6183
6571
|
/**
|
|
6184
|
-
* Writes a set of documents together. On a git-backed draft they land as **one commit**, which is the reason this exists beside the per-document `PUT`: seeding a draft from a package is a single logical change, and writing its files one at a time would put N commits in the History tab for one action — and leave a reader of any intermediate commit looking at half a package. Ordinary editing uses the per-document `PUT`. This is for the cases that are atomic by nature: the seed, and a multi-file edit that should be reviewable as one diff. `
|
|
6572
|
+
* Writes a set of documents together. On a git-backed draft they land as **one commit**, which is the reason this exists beside the per-document `PUT`: seeding a draft from a package is a single logical change, and writing its files one at a time would put N commits in the History tab for one action — and leave a reader of any intermediate commit looking at half a package. Ordinary editing uses the per-document `PUT`. This is for the cases that are atomic by nature: the seed, and a multi-file edit that should be reviewable as one diff. Each member may carry its own `expectedSha` or `createOnly` on either backing (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. `expectedRef` is deprecated: it applies to the whole set, is git-only, and is refused together with a member\'s `expectedSha` or `createOnly`. A client-minted `intentTimestamp` resent byte-identical makes a retried write a replay rather than a second commit — which matters more here than for one document, since a lost response after an N-file commit is otherwise indistinguishable from a write that never landed. **Authorization**: as `writeDraftDocument`. **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. On a branch-backed draft the commit is made by the gateway, so the claim is checked just before it: a cancel that lands during that one commit can let it through, and the commit\'s `Turn-Work-Item` trailer records which item wrote it. 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. Refuses with `400` and a distinct code when a git-backed checkpoint\'s own content is refused: `checkpoint-over-size-cap` (the draft\'s total content is over the cap; split the change across commits; this code was `draft-file-too-large` before) or `checkpoint-content-not-base64` (a file\'s content is not valid base64).
|
|
6185
6573
|
* @summary Write several of a draft\'s documents as one change
|
|
6186
6574
|
* @param {string} organizationName The unique identifier of the organization
|
|
6187
6575
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
@@ -6230,7 +6618,7 @@ exports.DraftsApi = DraftsApi;
|
|
|
6230
6618
|
const EntitiesApiAxiosParamCreator = function (configuration) {
|
|
6231
6619
|
return {
|
|
6232
6620
|
/**
|
|
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 —
|
|
6621
|
+
* 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
6622
|
* @summary List a version\'s field entities with their Malloy definitions
|
|
6235
6623
|
* @param {string} organizationName The unique identifier of the organization
|
|
6236
6624
|
* @param {string} environmentName The unique identifier of the environment
|
|
@@ -6299,7 +6687,7 @@ const EntitiesApiFp = function (configuration) {
|
|
|
6299
6687
|
const localVarAxiosParamCreator = (0, exports.EntitiesApiAxiosParamCreator)(configuration);
|
|
6300
6688
|
return {
|
|
6301
6689
|
/**
|
|
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 —
|
|
6690
|
+
* 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
6691
|
* @summary List a version\'s field entities with their Malloy definitions
|
|
6304
6692
|
* @param {string} organizationName The unique identifier of the organization
|
|
6305
6693
|
* @param {string} environmentName The unique identifier of the environment
|
|
@@ -6332,7 +6720,7 @@ const EntitiesApiFactory = function (configuration, basePath, axios) {
|
|
|
6332
6720
|
const localVarFp = (0, exports.EntitiesApiFp)(configuration);
|
|
6333
6721
|
return {
|
|
6334
6722
|
/**
|
|
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 —
|
|
6723
|
+
* 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
6724
|
* @summary List a version\'s field entities with their Malloy definitions
|
|
6337
6725
|
* @param {string} organizationName The unique identifier of the organization
|
|
6338
6726
|
* @param {string} environmentName The unique identifier of the environment
|
|
@@ -6359,7 +6747,7 @@ exports.EntitiesApiFactory = EntitiesApiFactory;
|
|
|
6359
6747
|
*/
|
|
6360
6748
|
class EntitiesApi extends base_1.BaseAPI {
|
|
6361
6749
|
/**
|
|
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 —
|
|
6750
|
+
* 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
6751
|
* @summary List a version\'s field entities with their Malloy definitions
|
|
6364
6752
|
* @param {string} organizationName The unique identifier of the organization
|
|
6365
6753
|
* @param {string} environmentName The unique identifier of the environment
|