@credibledata/cred-cli 0.0.106 → 0.0.107
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/api.js +547 -556
- package/dist/client/api.js.map +1 -1
- package/package.json +1 -1
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.OrganizationPermissionPermissionEnum = exports.MaterializationFreshnessFallbackEnum = exports.MaterializationScopeEnum = exports.MaterializationStatusEnum = exports.MaterializationOriginEnum = exports.LiveWorkItemStatusEnum = exports.IntegrationTemplateAuthEnum = exports.IntegrationSecretFieldShapeEnum = exports.IndexStatus = exports.IndexFreshnessFallbackEnum = exports.IndexScopeEnum = exports.IndexStatusEnum = exports.GroupMemberStatusEnum = exports.GetOrganizationResponseUserPermissionEnum = exports.EnvironmentPermissionPermissionEnum = exports.EnvironmentUserPermissionEnum = exports.
|
|
29
|
-
exports.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 =
|
|
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 = exports.PackagePermissionsApiFp = exports.PackagePermissionsApiAxiosParamCreator = exports.ListOrganizationsUserPermissionEnum = exports.OrganizationsApi = exports.OrganizationsApiFactory = exports.OrganizationsApiFp = void 0;
|
|
28
|
+
exports.PreaggregateStatusEnum = exports.PackageWarningSeverityEnum = exports.PackagePermissionInheritedPermissionEnum = exports.PackagePermissionPermissionEnum = exports.OrganizationPermissionPermissionEnum = exports.MaterializationFreshnessFallbackEnum = exports.MaterializationScopeEnum = exports.MaterializationStatusEnum = exports.MaterializationOriginEnum = exports.LiveWorkItemStatusEnum = exports.IntegrationTemplateAuthEnum = exports.IntegrationSecretFieldShapeEnum = exports.IndexStatus = exports.IndexFreshnessFallbackEnum = exports.IndexScopeEnum = exports.IndexStatusEnum = exports.GroupMemberStatusEnum = exports.GetOrganizationResponseUserPermissionEnum = exports.EnvironmentPermissionPermissionEnum = exports.EnvironmentUserPermissionEnum = exports.DraftPullRequestStateEnum = exports.DraftDocumentChangeSincePublicationEnum = exports.DraftDocumentStatusEnum = exports.DraftDocumentKindEnum = exports.DraftDocumentTypeEnum = exports.DraftCompileVerdictStatusEnum = exports.DraftCheckpointStatusEnum = exports.DraftCapabilitiesPublishModesEnum = exports.DraftBackingEnum = exports.DocumentTypeEnum = exports.DatabaseTableUploadMethodEnum = exports.DatabaseTableSourceKindEnum = exports.DatabaseTableFileFormatEnum = exports.DatabaseTableStatusEnum = exports.DatabaseTableSchemaEnum = exports.DatabaseIndexingStatusEnum = exports.DatabaseStatusEnum = exports.CredentialCheckOutcome = exports.ConnectionS3ConnectionProviderEnum = exports.ConnectionPostgresConnectionSslmodeEnum = exports.ConnectionAllOfProxyTypeEnum = exports.ConnectionAllOfDucklakeConnectionStorageS3ConnectionProviderEnum = exports.ConnectionAllOfDuckdbConnectionPostgresConnectionSslmodeEnum = exports.ConnectionAllOfDuckdbConnectionAzureConnectionAuthTypeEnum = exports.ConnectionAllOfDuckdbConnectionAttachedDatabasesTypeEnum = exports.ConnectionIndexingStatusEnum = exports.ConnectionTemplateEnum = exports.ConnectionTypeEnum = exports.BookmarkType = exports.AttributeValueEntryScopeEnum = void 0;
|
|
29
|
+
exports.DocumentsApi = exports.DocumentsApiFactory = exports.DocumentsApiFp = exports.DocumentsApiAxiosParamCreator = exports.DemoApi = exports.DemoApiFactory = exports.DemoApiFp = exports.DemoApiAxiosParamCreator = exports.DatabasesApi = exports.DatabasesApiFactory = exports.DatabasesApiFp = exports.DatabasesApiAxiosParamCreator = exports.CredentialsApi = exports.CredentialsApiFactory = exports.CredentialsApiFp = exports.CredentialsApiAxiosParamCreator = exports.ConnectionsApi = exports.ConnectionsApiFactory = exports.ConnectionsApiFp = exports.ConnectionsApiAxiosParamCreator = exports.BookmarksApi = exports.BookmarksApiFactory = exports.BookmarksApiFp = exports.BookmarksApiAxiosParamCreator = exports.AttributesApi = exports.AttributesApiFactory = exports.AttributesApiFp = exports.AttributesApiAxiosParamCreator = exports.AgentSchedulesApi = exports.AgentSchedulesApiFactory = exports.AgentSchedulesApiFp = exports.AgentSchedulesApiAxiosParamCreator = exports.WorkspacePermissionPermissionEnum = exports.WorkspaceWorkspaceTypeEnum = exports.VersionScopeEnum = exports.VersionBuildStatusEnum = exports.VersionArchiveStatusEnum = exports.UpdateGroupMemberStatusRequestStatusEnum = exports.UpdateDatabaseTableRequestUploadStatusEnum = exports.SystemPermissionPermissionEnum = exports.StalenessReason = exports.SourceEntityFieldTypeEnum = exports.SharedItemTypeEnum = exports.RunBuildPlanNodeArtifactEnum = exports.RunBuildPlanNodeStatusEnum = exports.RunBuildPlanNodeNodeTypeEnum = exports.RunStatusEnum = exports.RunTriggerEnum = exports.PreaggregateFreshnessFallbackEnum = exports.PreaggregateScopeEnum = void 0;
|
|
30
|
+
exports.OrganizationPermissionsApiAxiosParamCreator = exports.MaterializationsApi = exports.MaterializationsApiFactory = exports.MaterializationsApiFp = exports.MaterializationsApiAxiosParamCreator = exports.MarketplaceSubscriptionsApi = exports.MarketplaceSubscriptionsApiFactory = exports.MarketplaceSubscriptionsApiFp = exports.MarketplaceSubscriptionsApiAxiosParamCreator = exports.MarketplaceSignupsApi = exports.MarketplaceSignupsApiFactory = exports.MarketplaceSignupsApiFp = exports.MarketplaceSignupsApiAxiosParamCreator = exports.InvitesApi = exports.InvitesApiFactory = exports.InvitesApiFp = exports.InvitesApiAxiosParamCreator = exports.IntegrationTemplatesApi = exports.IntegrationTemplatesApiFactory = exports.IntegrationTemplatesApiFp = exports.IntegrationTemplatesApiAxiosParamCreator = exports.IndexesApi = exports.IndexesApiFactory = exports.IndexesApiFp = exports.IndexesApiAxiosParamCreator = exports.GroupsApi = exports.GroupsApiFactory = exports.GroupsApiFp = exports.GroupsApiAxiosParamCreator = exports.GitRepositoryRegistrationsApi = exports.GitRepositoryRegistrationsApiFactory = exports.GitRepositoryRegistrationsApiFp = exports.GitRepositoryRegistrationsApiAxiosParamCreator = exports.EnvironmentsApi = exports.EnvironmentsApiFactory = exports.EnvironmentsApiFp = exports.EnvironmentsApiAxiosParamCreator = exports.EnvironmentPermissionsApi = exports.EnvironmentPermissionsApiFactory = exports.EnvironmentPermissionsApiFp = exports.EnvironmentPermissionsApiAxiosParamCreator = exports.EntitiesApi = exports.EntitiesApiFactory = exports.EntitiesApiFp = exports.EntitiesApiAxiosParamCreator = exports.DraftsApi = exports.DraftsApiFactory = exports.DraftsApiFp = exports.DraftsApiAxiosParamCreator = exports.UpdateDocumentUpdateMaskEnum = void 0;
|
|
31
|
+
exports.WorkspacesApi = exports.WorkspacesApiFactory = exports.WorkspacesApiFp = exports.WorkspacesApiAxiosParamCreator = exports.WorkspacePermissionsApi = exports.WorkspacePermissionsApiFactory = exports.WorkspacePermissionsApiFp = exports.WorkspacePermissionsApiAxiosParamCreator = exports.WebhooksApi = exports.WebhooksApiFactory = exports.WebhooksApiFp = exports.WebhooksApiAxiosParamCreator = exports.VersionsApi = exports.VersionsApiFactory = exports.VersionsApiFp = exports.VersionsApiAxiosParamCreator = exports.UsersApi = exports.UsersApiFactory = exports.UsersApiFp = exports.UsersApiAxiosParamCreator = exports.RunActionActionEnum = exports.RunsApi = exports.RunsApiFactory = exports.RunsApiFp = exports.RunsApiAxiosParamCreator = exports.PreaggregatesApi = exports.PreaggregatesApiFactory = exports.PreaggregatesApiFp = exports.PreaggregatesApiAxiosParamCreator = exports.PermissionsApi = exports.PermissionsApiFactory = exports.PermissionsApiFp = exports.PermissionsApiAxiosParamCreator = exports.PackagesApi = exports.PackagesApiFactory = exports.PackagesApiFp = exports.PackagesApiAxiosParamCreator = exports.PackagePermissionsApi = exports.PackagePermissionsApiFactory = exports.PackagePermissionsApiFp = exports.PackagePermissionsApiAxiosParamCreator = exports.ListOrganizationsUserPermissionEnum = exports.OrganizationsApi = exports.OrganizationsApiFactory = exports.OrganizationsApiFp = exports.OrganizationsApiAxiosParamCreator = exports.OrganizationPermissionsApi = exports.OrganizationPermissionsApiFactory = exports.OrganizationPermissionsApiFp = void 0;
|
|
32
32
|
const axios_1 = __importDefault(require("axios"));
|
|
33
33
|
// Some imports not used depending on template conditions
|
|
34
34
|
// @ts-ignore
|
|
@@ -179,10 +179,6 @@ exports.DraftBackingEnum = {
|
|
|
179
179
|
Git: 'git',
|
|
180
180
|
Provisioning: 'provisioning'
|
|
181
181
|
};
|
|
182
|
-
exports.DraftCapabilitiesWriteTimingEnum = {
|
|
183
|
-
PerEdit: 'perEdit',
|
|
184
|
-
PerTurn: 'perTurn'
|
|
185
|
-
};
|
|
186
182
|
exports.DraftCapabilitiesPublishModesEnum = {
|
|
187
183
|
Direct: 'direct',
|
|
188
184
|
PullRequest: 'pullRequest'
|
|
@@ -219,28 +215,12 @@ exports.DraftDocumentChangeSincePublicationEnum = {
|
|
|
219
215
|
Modified: 'modified',
|
|
220
216
|
Removed: 'removed'
|
|
221
217
|
};
|
|
222
|
-
exports.DraftDocumentChangeStatusEnum = {
|
|
223
|
-
Added: 'added',
|
|
224
|
-
Modified: 'modified',
|
|
225
|
-
Removed: 'removed',
|
|
226
|
-
Renamed: 'renamed'
|
|
227
|
-
};
|
|
228
|
-
exports.DraftFileDiffStatusEnum = {
|
|
229
|
-
Added: 'added',
|
|
230
|
-
Modified: 'modified',
|
|
231
|
-
Removed: 'removed',
|
|
232
|
-
Renamed: 'renamed'
|
|
233
|
-
};
|
|
234
218
|
exports.DraftPullRequestStateEnum = {
|
|
235
219
|
None: 'none',
|
|
236
220
|
Open: 'open',
|
|
237
221
|
Closed: 'closed',
|
|
238
222
|
Merged: 'merged'
|
|
239
223
|
};
|
|
240
|
-
exports.DraftTreeEntryTypeEnum = {
|
|
241
|
-
Blob: 'blob',
|
|
242
|
-
Tree: 'tree'
|
|
243
|
-
};
|
|
244
224
|
exports.EnvironmentUserPermissionEnum = {
|
|
245
225
|
Admin: 'admin',
|
|
246
226
|
Modeler: 'modeler',
|
|
@@ -4280,7 +4260,7 @@ exports.UpdateDocumentUpdateMaskEnum = {
|
|
|
4280
4260
|
const DraftsApiAxiosParamCreator = function (configuration) {
|
|
4281
4261
|
return {
|
|
4282
4262
|
/**
|
|
4283
|
-
* Mints a draft in this workspace and returns it. **Always creates**: a package can hold any number of drafts, one per chat by default, so a second request for the same `targetPackageName` mints a second draft rather than returning the first. Callers that want an existing draft list the workspace\'s drafts and open one by id. What keeps two writers off one draft is the draft\'s work-item claim, not uniqueness here.
|
|
4263
|
+
* Mints a draft in this workspace and returns it. **Always creates**: a package can hold any number of drafts, one per chat by default, so a second request for the same `targetPackageName` mints a second draft rather than returning the first. Callers that want an existing draft list the workspace\'s drafts and open one by id. What keeps two writers off one draft is the draft\'s work-item claim, not uniqueness here. Every draft is a document-store draft, in a git-enrolled environment as in any other: the draft\'s files are workspace documents, and git is only where a pushed draft goes for review. **`seedFromPublished` returns the draft already holding a published version\'s files**, in this one call: what opening a published package for editing takes, without a chat. Its refusals all come before the draft exists, and a seed that fails afterwards removes the draft; see the field. `201` with the new draft. **Authorization**: `can_create_document` in the workspace, and on every create the target environment\'s modeling bar (`can_create_package`, modeler or admin): putting a package in draft mode, or starting a new package\'s draft, is modeling work in that environment, and in a git-enrolled one creating the branch is a write into its repository. It is taken before anything is created; refused, it answers `403 draft-modeling-permission-required`.
|
|
4284
4264
|
* @summary Create a draft package
|
|
4285
4265
|
* @param {string} organizationName The unique identifier of the organization
|
|
4286
4266
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
@@ -4355,7 +4335,7 @@ const DraftsApiAxiosParamCreator = function (configuration) {
|
|
|
4355
4335
|
};
|
|
4356
4336
|
}),
|
|
4357
4337
|
/**
|
|
4358
|
-
* Thin proxy to the code-assist git-gateway\'s `deleteDraft` — deletes the draft\'s branch in the managed monorepo
|
|
4338
|
+
* Thin proxy to the code-assist git-gateway\'s `deleteDraft` — deletes the draft\'s branch in the managed monorepo, forwarding the caller\'s own bearer token. **This is branch removal only — it does not delete the draft.** Deleting the draft is `DELETE` on the draft itself. Stays as the primitive operator tooling needs: `deleteDraft` deletes an untouched draft\'s branch at its seed commit on the server (docs/git-synced-modeling.md §7.2), so neither the app nor the agent needs to call this. See docs/tenant-offboarding-playbook.md, which prefers it over a raw GitHub call precisely because it carries the FGA check below. The close after a successful publish also deletes a draft\'s branch, but through the gateway directly rather than through this endpoint. **Authorization**: Requires write access to the draft\'s workspace (`can_create_document`) and `can_create_package` on the environment the draft targets, as deleting the draft does. The gateway re-checks the workspace relation. Idempotent, and deliberately not gated on the draft being git-backed, so a provisioning draft\'s half-cut branch can still be cleaned up.
|
|
4359
4339
|
* @summary Delete a git-backed draft\'s branch
|
|
4360
4340
|
* @param {string} organizationName The unique identifier of the organization
|
|
4361
4341
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
@@ -4392,18 +4372,18 @@ const DraftsApiAxiosParamCreator = function (configuration) {
|
|
|
4392
4372
|
};
|
|
4393
4373
|
}),
|
|
4394
4374
|
/**
|
|
4395
|
-
* Removes a document from the draft
|
|
4375
|
+
* Removes a document from the draft: it deletes the document row, only if it still holds the `sha` in `expectedSha` when one is sent, and unconditionally (and idempotently) otherwise. **Authorization**: as `writeDraftDocument`.
|
|
4396
4376
|
* @summary Delete one of a draft\'s documents
|
|
4397
4377
|
* @param {string} organizationName The unique identifier of the organization
|
|
4398
4378
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
4399
4379
|
* @param {string} draftId The draft package identifier
|
|
4400
4380
|
* @param {string} documentPath The document\'s path relative to the draft root
|
|
4401
|
-
* @param {string} [
|
|
4402
|
-
* @param {string} [
|
|
4381
|
+
* @param {string} [expectedSha] The `sha` the caller read the document at: the delete applies only if the document still holds that version, else `409` `draft-document-stale`; a file already gone counts as deleted when this is the whole request, so a lost response can be resent.
|
|
4382
|
+
* @param {string} [expectedRef] Deprecated: use `expectedSha`. A git branch head, refused with `400` when set: a draft has no commits to compare it against, and a caller that sends a precondition believes it holds one. Kept one release, so a client from before the document store is refused rather than written unconditionally; removed in the release after.
|
|
4403
4383
|
* @param {*} [options] Override http request option.
|
|
4404
4384
|
* @throws {RequiredError}
|
|
4405
4385
|
*/
|
|
4406
|
-
deleteDraftDocument: (organizationName_1, workspaceName_1, draftId_1, documentPath_1,
|
|
4386
|
+
deleteDraftDocument: (organizationName_1, workspaceName_1, draftId_1, documentPath_1, expectedSha_1, expectedRef_1, ...args_1) => __awaiter(this, [organizationName_1, workspaceName_1, draftId_1, documentPath_1, expectedSha_1, expectedRef_1, ...args_1], void 0, function* (organizationName, workspaceName, draftId, documentPath, expectedSha, expectedRef, options = {}) {
|
|
4407
4387
|
// verify required parameter 'organizationName' is not null or undefined
|
|
4408
4388
|
(0, common_1.assertParamExists)('deleteDraftDocument', 'organizationName', organizationName);
|
|
4409
4389
|
// verify required parameter 'workspaceName' is not null or undefined
|
|
@@ -4426,12 +4406,12 @@ const DraftsApiAxiosParamCreator = function (configuration) {
|
|
|
4426
4406
|
const localVarRequestOptions = Object.assign(Object.assign({ method: 'DELETE' }, baseOptions), options);
|
|
4427
4407
|
const localVarHeaderParameter = {};
|
|
4428
4408
|
const localVarQueryParameter = {};
|
|
4429
|
-
if (expectedRef !== undefined) {
|
|
4430
|
-
localVarQueryParameter['expectedRef'] = expectedRef;
|
|
4431
|
-
}
|
|
4432
4409
|
if (expectedSha !== undefined) {
|
|
4433
4410
|
localVarQueryParameter['expectedSha'] = expectedSha;
|
|
4434
4411
|
}
|
|
4412
|
+
if (expectedRef !== undefined) {
|
|
4413
|
+
localVarQueryParameter['expectedRef'] = expectedRef;
|
|
4414
|
+
}
|
|
4435
4415
|
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
4436
4416
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
4437
4417
|
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
@@ -4441,13 +4421,13 @@ const DraftsApiAxiosParamCreator = function (configuration) {
|
|
|
4441
4421
|
};
|
|
4442
4422
|
}),
|
|
4443
4423
|
/**
|
|
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.
|
|
4424
|
+
* Discards the draft\'s change to one file, so the draft carries what its publication has at this path again. This is Restore, for any kind of file; after it the path has no `changeSincePublication` marker. `DELETE` on the document itself deletes the file instead — a different change, which this would undo. What it does follows the file\'s change marker, never whether a published copy can be read: - A data file: the draft\'s own upload or deletion is dropped. Where the draft\'s last publish shipped its own upload, the path returns to that upload; otherwise the published copy is inherited again, and a small UTF-8 file, which a draft holds as a document rather than inheriting, is written back as one. - A text file the draft added: deleted. - A text file the draft edited or deleted: the published copy written back. Answers as `getDraftDocument` with `ref=publication` does when that copy cannot be read (`404` `draft-file-not-in-publication`, `409`, `413`, `503`), changing nothing. `404` `draft-document-unchanged` when the draft has no change at this path — a data file the draft\'s last publish shipped and has not touched since included. Before any change is found, the comparison itself can be refused, with the answers a read of the baseline gives: `403` when the caller cannot read the package the draft is measured against, `409` `draft-publication-baseline-missing` when that baseline cannot be measured (a corrupt archive), and `503` `draft-changes-unavailable` when it could not be read. **Authorization** — the same pair `writeDraftDocument` takes.
|
|
4445
4425
|
* @summary Restore one of a draft\'s files to its published copy
|
|
4446
4426
|
* @param {string} organizationName The unique identifier of the organization
|
|
4447
4427
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
4448
4428
|
* @param {string} draftId The draft package identifier
|
|
4449
4429
|
* @param {string} documentPath The file\'s path relative to the draft root
|
|
4450
|
-
* @param {string} [expectedRef] Deprecated:
|
|
4430
|
+
* @param {string} [expectedRef] Deprecated: a restore takes no precondition. A git branch head, refused with `400` when set: a draft has no commits to compare it against, and a caller that sends a precondition believes it holds one. Kept one release, so a client from before the document store is refused rather than written unconditionally; removed in the release after.
|
|
4451
4431
|
* @param {*} [options] Override http request option.
|
|
4452
4432
|
* @throws {RequiredError}
|
|
4453
4433
|
*/
|
|
@@ -4523,22 +4503,22 @@ const DraftsApiAxiosParamCreator = function (configuration) {
|
|
|
4523
4503
|
};
|
|
4524
4504
|
}),
|
|
4525
4505
|
/**
|
|
4526
|
-
* The
|
|
4527
|
-
* @summary
|
|
4506
|
+
* The draft\'s capabilities, derived by the server from its environment and what its package has published. The same value `getDraft` carries as `capabilities`, for a caller that does not need the rest of the draft: it reads the draft\'s manifest, its review state and one published-version lookup, not the checkpoint or the files. A draft that is moving to the new store answers `409` `draft-converting`: retry. **Authorization**: requires read access to the draft document.
|
|
4507
|
+
* @summary What the draft\'s storage can do
|
|
4528
4508
|
* @param {string} organizationName The unique identifier of the organization
|
|
4529
4509
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
4530
4510
|
* @param {string} draftId The draft package identifier
|
|
4531
4511
|
* @param {*} [options] Override http request option.
|
|
4532
4512
|
* @throws {RequiredError}
|
|
4533
4513
|
*/
|
|
4534
|
-
|
|
4514
|
+
getDraftCapabilities: (organizationName_1, workspaceName_1, draftId_1, ...args_1) => __awaiter(this, [organizationName_1, workspaceName_1, draftId_1, ...args_1], void 0, function* (organizationName, workspaceName, draftId, options = {}) {
|
|
4535
4515
|
// verify required parameter 'organizationName' is not null or undefined
|
|
4536
|
-
(0, common_1.assertParamExists)('
|
|
4516
|
+
(0, common_1.assertParamExists)('getDraftCapabilities', 'organizationName', organizationName);
|
|
4537
4517
|
// verify required parameter 'workspaceName' is not null or undefined
|
|
4538
|
-
(0, common_1.assertParamExists)('
|
|
4518
|
+
(0, common_1.assertParamExists)('getDraftCapabilities', 'workspaceName', workspaceName);
|
|
4539
4519
|
// verify required parameter 'draftId' is not null or undefined
|
|
4540
|
-
(0, common_1.assertParamExists)('
|
|
4541
|
-
const localVarPath = `/organizations/{organizationName}/workspaces/{workspaceName}/drafts/{draftId}/
|
|
4520
|
+
(0, common_1.assertParamExists)('getDraftCapabilities', 'draftId', draftId);
|
|
4521
|
+
const localVarPath = `/organizations/{organizationName}/workspaces/{workspaceName}/drafts/{draftId}/capabilities`
|
|
4542
4522
|
.replace(`{${"organizationName"}}`, encodeURIComponent(String(organizationName)))
|
|
4543
4523
|
.replace(`{${"workspaceName"}}`, encodeURIComponent(String(workspaceName)))
|
|
4544
4524
|
.replace(`{${"draftId"}}`, encodeURIComponent(String(draftId)));
|
|
@@ -4560,22 +4540,22 @@ const DraftsApiAxiosParamCreator = function (configuration) {
|
|
|
4560
4540
|
};
|
|
4561
4541
|
}),
|
|
4562
4542
|
/**
|
|
4563
|
-
*
|
|
4564
|
-
* @summary
|
|
4543
|
+
* 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.
|
|
4544
|
+
* @summary The draft\'s checkpoint status
|
|
4565
4545
|
* @param {string} organizationName The unique identifier of the organization
|
|
4566
4546
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
4567
4547
|
* @param {string} draftId The draft package identifier
|
|
4568
4548
|
* @param {*} [options] Override http request option.
|
|
4569
4549
|
* @throws {RequiredError}
|
|
4570
4550
|
*/
|
|
4571
|
-
|
|
4551
|
+
getDraftCheckpointStatus: (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
4552
|
// verify required parameter 'organizationName' is not null or undefined
|
|
4573
|
-
(0, common_1.assertParamExists)('
|
|
4553
|
+
(0, common_1.assertParamExists)('getDraftCheckpointStatus', 'organizationName', organizationName);
|
|
4574
4554
|
// verify required parameter 'workspaceName' is not null or undefined
|
|
4575
|
-
(0, common_1.assertParamExists)('
|
|
4555
|
+
(0, common_1.assertParamExists)('getDraftCheckpointStatus', 'workspaceName', workspaceName);
|
|
4576
4556
|
// verify required parameter 'draftId' is not null or undefined
|
|
4577
|
-
(0, common_1.assertParamExists)('
|
|
4578
|
-
const localVarPath = `/organizations/{organizationName}/workspaces/{workspaceName}/drafts/{draftId}/
|
|
4557
|
+
(0, common_1.assertParamExists)('getDraftCheckpointStatus', 'draftId', draftId);
|
|
4558
|
+
const localVarPath = `/organizations/{organizationName}/workspaces/{workspaceName}/drafts/{draftId}/checkpoint`
|
|
4579
4559
|
.replace(`{${"organizationName"}}`, encodeURIComponent(String(organizationName)))
|
|
4580
4560
|
.replace(`{${"workspaceName"}}`, encodeURIComponent(String(workspaceName)))
|
|
4581
4561
|
.replace(`{${"draftId"}}`, encodeURIComponent(String(draftId)));
|
|
@@ -4597,25 +4577,29 @@ const DraftsApiAxiosParamCreator = function (configuration) {
|
|
|
4597
4577
|
};
|
|
4598
4578
|
}),
|
|
4599
4579
|
/**
|
|
4600
|
-
*
|
|
4601
|
-
* @summary
|
|
4580
|
+
* One entry of `getDraftConflicts` with the incoming side\'s, the draft\'s and their common ancestor\'s version of the file, so the caller can reconcile them and write the result through `writeDraftDocuments` with the `conflictSha` this returns. **Authorization**: requires read access to the draft document, and `can_create_package` on the environment it targets: only a modeler can act on what this serves. `404` when the path has no conflict (it was resolved, or never conflicted).
|
|
4581
|
+
* @summary One conflicting file, with all three of its versions
|
|
4602
4582
|
* @param {string} organizationName The unique identifier of the organization
|
|
4603
4583
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
4604
4584
|
* @param {string} draftId The draft package identifier
|
|
4585
|
+
* @param {string} documentPath The conflicting file\'s path relative to the draft root, as `getDraftConflicts` lists it.
|
|
4605
4586
|
* @param {*} [options] Override http request option.
|
|
4606
4587
|
* @throws {RequiredError}
|
|
4607
4588
|
*/
|
|
4608
|
-
|
|
4589
|
+
getDraftConflict: (organizationName_1, workspaceName_1, draftId_1, documentPath_1, ...args_1) => __awaiter(this, [organizationName_1, workspaceName_1, draftId_1, documentPath_1, ...args_1], void 0, function* (organizationName, workspaceName, draftId, documentPath, options = {}) {
|
|
4609
4590
|
// verify required parameter 'organizationName' is not null or undefined
|
|
4610
|
-
(0, common_1.assertParamExists)('
|
|
4591
|
+
(0, common_1.assertParamExists)('getDraftConflict', 'organizationName', organizationName);
|
|
4611
4592
|
// verify required parameter 'workspaceName' is not null or undefined
|
|
4612
|
-
(0, common_1.assertParamExists)('
|
|
4593
|
+
(0, common_1.assertParamExists)('getDraftConflict', 'workspaceName', workspaceName);
|
|
4613
4594
|
// verify required parameter 'draftId' is not null or undefined
|
|
4614
|
-
(0, common_1.assertParamExists)('
|
|
4615
|
-
|
|
4595
|
+
(0, common_1.assertParamExists)('getDraftConflict', 'draftId', draftId);
|
|
4596
|
+
// verify required parameter 'documentPath' is not null or undefined
|
|
4597
|
+
(0, common_1.assertParamExists)('getDraftConflict', 'documentPath', documentPath);
|
|
4598
|
+
const localVarPath = `/organizations/{organizationName}/workspaces/{workspaceName}/drafts/{draftId}/conflicts/{documentPath}`
|
|
4616
4599
|
.replace(`{${"organizationName"}}`, encodeURIComponent(String(organizationName)))
|
|
4617
4600
|
.replace(`{${"workspaceName"}}`, encodeURIComponent(String(workspaceName)))
|
|
4618
|
-
.replace(`{${"draftId"}}`, encodeURIComponent(String(draftId)))
|
|
4601
|
+
.replace(`{${"draftId"}}`, encodeURIComponent(String(draftId)))
|
|
4602
|
+
.replace(`{${"documentPath"}}`, encodeURIComponent(String(documentPath)));
|
|
4619
4603
|
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
4620
4604
|
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
4621
4605
|
let baseOptions;
|
|
@@ -4634,30 +4618,24 @@ const DraftsApiAxiosParamCreator = function (configuration) {
|
|
|
4634
4618
|
};
|
|
4635
4619
|
}),
|
|
4636
4620
|
/**
|
|
4637
|
-
*
|
|
4638
|
-
* @summary
|
|
4621
|
+
* A page of the draft\'s conflicts: every path both the draft and what came in changed since their common ancestor, where what came in is a newer published version of its package (the base moved) or a commit someone pushed to its pull request. A superset of what cannot merge on its own, because nothing here runs a merge. Ordered by `relpath`. Each entry says where its incoming side came from, and carries the `conflictSha` a resolution sends back through `writeDraftDocuments`, a member per file. `getDraftConflict` returns one file\'s three versions. An empty list means nothing waits on the author: what only one side changed is absorbed in the background. Conflicts never block editing or a Submit; a submitted draft\'s push waits for the last one to be resolved and then starts on its own. Served from controlplane\'s record alone: no file content, no archive read and no GitHub call. **Authorization**: requires read access to the draft document. `409` `draft-converting` means the draft is moving to the new store; retry.
|
|
4622
|
+
* @summary The files the draft and what came in both changed
|
|
4639
4623
|
* @param {string} organizationName The unique identifier of the organization
|
|
4640
4624
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
4641
4625
|
* @param {string} draftId The draft package identifier
|
|
4642
|
-
* @param {
|
|
4643
|
-
* @param {string} head The commit to compare TO. Same form as `base`.
|
|
4644
|
-
* @param {number} [limit] Maximum number of items to return. Use -1 or omit to return all results.
|
|
4626
|
+
* @param {number} [limit] Maximum number of items to return. Use -1 or omit to return all results. Valid values: -1 (all results) or 1–500.
|
|
4645
4627
|
* @param {number} [offset] Number of items to skip before starting to return results
|
|
4646
4628
|
* @param {*} [options] Override http request option.
|
|
4647
4629
|
* @throws {RequiredError}
|
|
4648
4630
|
*/
|
|
4649
|
-
|
|
4631
|
+
getDraftConflicts: (organizationName_1, workspaceName_1, draftId_1, limit_1, offset_1, ...args_1) => __awaiter(this, [organizationName_1, workspaceName_1, draftId_1, limit_1, offset_1, ...args_1], void 0, function* (organizationName, workspaceName, draftId, limit, offset, options = {}) {
|
|
4650
4632
|
// verify required parameter 'organizationName' is not null or undefined
|
|
4651
|
-
(0, common_1.assertParamExists)('
|
|
4633
|
+
(0, common_1.assertParamExists)('getDraftConflicts', 'organizationName', organizationName);
|
|
4652
4634
|
// verify required parameter 'workspaceName' is not null or undefined
|
|
4653
|
-
(0, common_1.assertParamExists)('
|
|
4635
|
+
(0, common_1.assertParamExists)('getDraftConflicts', 'workspaceName', workspaceName);
|
|
4654
4636
|
// verify required parameter 'draftId' is not null or undefined
|
|
4655
|
-
(0, common_1.assertParamExists)('
|
|
4656
|
-
|
|
4657
|
-
(0, common_1.assertParamExists)('getDraftComparison', 'base', base);
|
|
4658
|
-
// verify required parameter 'head' is not null or undefined
|
|
4659
|
-
(0, common_1.assertParamExists)('getDraftComparison', 'head', head);
|
|
4660
|
-
const localVarPath = `/organizations/{organizationName}/workspaces/{workspaceName}/drafts/{draftId}/comparison`
|
|
4637
|
+
(0, common_1.assertParamExists)('getDraftConflicts', 'draftId', draftId);
|
|
4638
|
+
const localVarPath = `/organizations/{organizationName}/workspaces/{workspaceName}/drafts/{draftId}/conflicts`
|
|
4661
4639
|
.replace(`{${"organizationName"}}`, encodeURIComponent(String(organizationName)))
|
|
4662
4640
|
.replace(`{${"workspaceName"}}`, encodeURIComponent(String(workspaceName)))
|
|
4663
4641
|
.replace(`{${"draftId"}}`, encodeURIComponent(String(draftId)));
|
|
@@ -4670,12 +4648,6 @@ const DraftsApiAxiosParamCreator = function (configuration) {
|
|
|
4670
4648
|
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
|
|
4671
4649
|
const localVarHeaderParameter = {};
|
|
4672
4650
|
const localVarQueryParameter = {};
|
|
4673
|
-
if (base !== undefined) {
|
|
4674
|
-
localVarQueryParameter['base'] = base;
|
|
4675
|
-
}
|
|
4676
|
-
if (head !== undefined) {
|
|
4677
|
-
localVarQueryParameter['head'] = head;
|
|
4678
|
-
}
|
|
4679
4651
|
if (limit !== undefined) {
|
|
4680
4652
|
localVarQueryParameter['limit'] = limit;
|
|
4681
4653
|
}
|
|
@@ -4691,7 +4663,7 @@ const DraftsApiAxiosParamCreator = function (configuration) {
|
|
|
4691
4663
|
};
|
|
4692
4664
|
}),
|
|
4693
4665
|
/**
|
|
4694
|
-
* The draft as it stands, as a package archive: its own files at its latest content, its uploaded data files, and the data files it inherits from the published version, minus any it deleted — the same layering its checkpoints and publishes use (docs/draft-data-file-upload-design.md §4.3), but built from the draft\'s current content rather than its last checkpoint, and with its own `publisher.json`. For working on the package locally. `409` `draft-
|
|
4666
|
+
* The draft as it stands, as a package archive: its own files at its latest content, its uploaded data files, and the data files it inherits from the published version, minus any it deleted — the same layering its checkpoints and publishes use (docs/draft-data-file-upload-design.md §4.3), but built from the draft\'s current content rather than its last checkpoint, and with its own `publisher.json`. For working on the package locally. `409` `draft-converting` while the draft is moving to the new store; `503` `draft-data-file-storage-unavailable` when an upload\'s object or the published archive could not be read. **Authorization**: requires read access to the draft document, and — when the draft\'s package has a published version, whose data files the zip would inherit — update access to the package, as downloading that version does (`getPackageVersionContent`). That check runs before the published archive is fetched, so a reader without it never causes that read.
|
|
4695
4667
|
* @summary Download a draft package as a zip
|
|
4696
4668
|
* @param {string} organizationName The unique identifier of the organization
|
|
4697
4669
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
@@ -4728,13 +4700,13 @@ const DraftsApiAxiosParamCreator = function (configuration) {
|
|
|
4728
4700
|
};
|
|
4729
4701
|
}),
|
|
4730
4702
|
/**
|
|
4731
|
-
* One document\'s content
|
|
4703
|
+
* One document\'s content. `409` `draft-converting` while the draft is moving to the new store. Refuses with `413` (`draft-file-unreadable`) when the document is not readable as UTF-8 text under 1MB. That is a permanent refusal about the file\'s shape, not a transient failure: the same refusal stops a publish, so retrying achieves nothing until the file is removed or replaced. **`ref=publication`** reads the document as it is in the version the draft\'s `changeSincePublication` markers compare against. The baseline is resolved server-side, never taken from the caller: the stored archive of the draft\'s last published version, or — for one never published — of the version it was opened on. The answers, each distinct: - `200`: the file\'s content in that baseline. - `403`: the caller can read the draft but not the package whose stored archive is the baseline. Workspace access does not imply environment access, so this read also takes `can_read_package` on it. - `404` `draft-file-not-in-publication`: the baseline exists and does not hold this file. There is nothing to restore from it. - `409` `draft-publication-baseline-missing`: there is no baseline to read — a draft never published and opened on nothing, a publication recorded before baselines were, a published version with no stored archive, one whose archive is corrupt, or one that no longer holds what its publish recorded. Permanent until the draft publishes again. - `413` `draft-file-unreadable`: the baseline\'s copy is not UTF-8 text under 1MB. - `503` `draft-publication-unreadable`: the baseline exists but could not be read right now. Retryable. The content is the published archive\'s bytes decoded as UTF-8, so its SHA-256 is the hash the markers were computed from. A published file a draft cannot hold (binary, or 1 MiB and over) is inherited by the draft rather than held, so it is not in the baseline and answers `404`. **Authorization**: requires read access to the draft document.
|
|
4732
4704
|
* @summary Read one of a draft\'s documents
|
|
4733
4705
|
* @param {string} organizationName The unique identifier of the organization
|
|
4734
4706
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
4735
4707
|
* @param {string} draftId The draft package identifier
|
|
4736
4708
|
* @param {string} documentPath The document\'s path relative to the draft root
|
|
4737
|
-
* @param {string} [ref]
|
|
4709
|
+
* @param {string} [ref] The literal `publication` reads the file as it is in the draft\'s publication baseline — see the operation\'s description. It is matched exactly (lower case). Any other value is ignored: a draft keeps no commits to read at.
|
|
4738
4710
|
* @param {*} [options] Override http request option.
|
|
4739
4711
|
* @throws {RequiredError}
|
|
4740
4712
|
*/
|
|
@@ -4773,7 +4745,7 @@ const DraftsApiAxiosParamCreator = function (configuration) {
|
|
|
4773
4745
|
};
|
|
4774
4746
|
}),
|
|
4775
4747
|
/**
|
|
4776
|
-
* The bytes of a file as the draft carries it: a text document\'s content, a data file\'s own upload, or otherwise the data file it inherits from the package\'s published version. So a download works the same on any file of the draft. A path the draft deleted answers `404`; `409` `draft-
|
|
4748
|
+
* The bytes of a file as the draft carries it: a text document\'s content, a data file\'s own upload, or otherwise the data file it inherits from the package\'s published version. So a download works the same on any file of the draft. A path the draft deleted answers `404`; `409` `draft-converting` while the draft is moving to the new store. A text document that cannot be served as text (1 MiB or more) answers `413` `draft-file-unreadable`, as `getDraftDocument` does. An uploaded data file never takes this path. **Authorization**: requires read access to the draft document. A data file the draft inherits also requires update access to the package, as downloading the published version does (`getPackageVersionContent`); the draft\'s own uploads do not. That check runs before the published archive is fetched, so a reader without it gets `403` for any path the draft itself does not hold, a missing one included.
|
|
4777
4749
|
* @summary Download one of a draft\'s files
|
|
4778
4750
|
* @param {string} organizationName The unique identifier of the organization
|
|
4779
4751
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
@@ -4814,22 +4786,22 @@ const DraftsApiAxiosParamCreator = function (configuration) {
|
|
|
4814
4786
|
};
|
|
4815
4787
|
}),
|
|
4816
4788
|
/**
|
|
4817
|
-
*
|
|
4818
|
-
* @summary
|
|
4789
|
+
* The gates `writeDraftPublication` applies, read without acting on any of them: no submit, no build request, no merge and no listing of the package on GitHub, so it costs database reads only. `ready` false comes with the `reason` the publish would answer now. `ready` true means every gate this read covers passed; the publish\'s own listing of the package at the pull request\'s head can still refuse it. `ready` says nothing about the caller: a reader who may not publish reads it too, and the publish refuses them `403`. A draft that is owed a push or a build reads `sending` or `building` here, and only `writeDraftPublication` starts them. A `blocked` pull request reads `pull-request-blocked` here even when the publish would re-post its check and merge. `warnings` are about what the publish would ship, not whether it can: today, that a first publish exposes every source (see `DraftPublicationWarning`). They are read only when `ready` is true, and are empty otherwise. **Authorization**: requires read access to the draft document. `409` `draft-converting` means the draft is moving to the new store; retry.
|
|
4790
|
+
* @summary Whether the draft can be published now
|
|
4819
4791
|
* @param {string} organizationName The unique identifier of the organization
|
|
4820
4792
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
4821
4793
|
* @param {string} draftId The draft package identifier
|
|
4822
4794
|
* @param {*} [options] Override http request option.
|
|
4823
4795
|
* @throws {RequiredError}
|
|
4824
4796
|
*/
|
|
4825
|
-
|
|
4797
|
+
getDraftPublication: (organizationName_1, workspaceName_1, draftId_1, ...args_1) => __awaiter(this, [organizationName_1, workspaceName_1, draftId_1, ...args_1], void 0, function* (organizationName, workspaceName, draftId, options = {}) {
|
|
4826
4798
|
// verify required parameter 'organizationName' is not null or undefined
|
|
4827
|
-
(0, common_1.assertParamExists)('
|
|
4799
|
+
(0, common_1.assertParamExists)('getDraftPublication', 'organizationName', organizationName);
|
|
4828
4800
|
// verify required parameter 'workspaceName' is not null or undefined
|
|
4829
|
-
(0, common_1.assertParamExists)('
|
|
4801
|
+
(0, common_1.assertParamExists)('getDraftPublication', 'workspaceName', workspaceName);
|
|
4830
4802
|
// verify required parameter 'draftId' is not null or undefined
|
|
4831
|
-
(0, common_1.assertParamExists)('
|
|
4832
|
-
const localVarPath = `/organizations/{organizationName}/workspaces/{workspaceName}/drafts/{draftId}/
|
|
4803
|
+
(0, common_1.assertParamExists)('getDraftPublication', 'draftId', draftId);
|
|
4804
|
+
const localVarPath = `/organizations/{organizationName}/workspaces/{workspaceName}/drafts/{draftId}/publication`
|
|
4833
4805
|
.replace(`{${"organizationName"}}`, encodeURIComponent(String(organizationName)))
|
|
4834
4806
|
.replace(`{${"workspaceName"}}`, encodeURIComponent(String(workspaceName)))
|
|
4835
4807
|
.replace(`{${"draftId"}}`, encodeURIComponent(String(draftId)));
|
|
@@ -4851,24 +4823,22 @@ const DraftsApiAxiosParamCreator = function (configuration) {
|
|
|
4851
4823
|
};
|
|
4852
4824
|
}),
|
|
4853
4825
|
/**
|
|
4854
|
-
*
|
|
4855
|
-
* @summary
|
|
4826
|
+
* Served from controlplane\'s record of the draft and nothing else: no GitHub read and no side effect, so polling it costs controlplane\'s own reads only. Always answers `200` for a draft the caller can read. `state` is `none` when the draft has no pull request, and a draft whose environment does not review on GitHub answers `state: none`, `reviewState: notSubmitted`, so a polling client treats absence as an answer, not an error. `reviewState` says where the review stands and `nextAttemptAt` when it is next worked on; `unsubmittedChanges` says whether the draft has edits since its last push. Poll while `reviewState` is `sending` or a pull request is open, and stop otherwise. `mergeable` is GitHub\'s own verdict as last recorded and is `null` while GitHub is still computing it. Treat `null` as \"not yet known\" and re-read; never as \"not mergeable\". **Authorization**: requires read access to the draft document. `409` `draft-converting` means the draft is moving to the new store; retry.
|
|
4827
|
+
* @summary The draft\'s pull request and review state
|
|
4856
4828
|
* @param {string} organizationName The unique identifier of the organization
|
|
4857
4829
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
4858
4830
|
* @param {string} draftId The draft package identifier
|
|
4859
|
-
* @param {number} [limit]
|
|
4860
|
-
* @param {number} [offset]
|
|
4861
4831
|
* @param {*} [options] Override http request option.
|
|
4862
4832
|
* @throws {RequiredError}
|
|
4863
4833
|
*/
|
|
4864
|
-
|
|
4834
|
+
getDraftPullRequest: (organizationName_1, workspaceName_1, draftId_1, ...args_1) => __awaiter(this, [organizationName_1, workspaceName_1, draftId_1, ...args_1], void 0, function* (organizationName, workspaceName, draftId, options = {}) {
|
|
4865
4835
|
// verify required parameter 'organizationName' is not null or undefined
|
|
4866
|
-
(0, common_1.assertParamExists)('
|
|
4836
|
+
(0, common_1.assertParamExists)('getDraftPullRequest', 'organizationName', organizationName);
|
|
4867
4837
|
// verify required parameter 'workspaceName' is not null or undefined
|
|
4868
|
-
(0, common_1.assertParamExists)('
|
|
4838
|
+
(0, common_1.assertParamExists)('getDraftPullRequest', 'workspaceName', workspaceName);
|
|
4869
4839
|
// verify required parameter 'draftId' is not null or undefined
|
|
4870
|
-
(0, common_1.assertParamExists)('
|
|
4871
|
-
const localVarPath = `/organizations/{organizationName}/workspaces/{workspaceName}/drafts/{draftId}/
|
|
4840
|
+
(0, common_1.assertParamExists)('getDraftPullRequest', 'draftId', draftId);
|
|
4841
|
+
const localVarPath = `/organizations/{organizationName}/workspaces/{workspaceName}/drafts/{draftId}/pull-request`
|
|
4872
4842
|
.replace(`{${"organizationName"}}`, encodeURIComponent(String(organizationName)))
|
|
4873
4843
|
.replace(`{${"workspaceName"}}`, encodeURIComponent(String(workspaceName)))
|
|
4874
4844
|
.replace(`{${"draftId"}}`, encodeURIComponent(String(draftId)));
|
|
@@ -4881,12 +4851,6 @@ const DraftsApiAxiosParamCreator = function (configuration) {
|
|
|
4881
4851
|
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
|
|
4882
4852
|
const localVarHeaderParameter = {};
|
|
4883
4853
|
const localVarQueryParameter = {};
|
|
4884
|
-
if (limit !== undefined) {
|
|
4885
|
-
localVarQueryParameter['limit'] = limit;
|
|
4886
|
-
}
|
|
4887
|
-
if (offset !== undefined) {
|
|
4888
|
-
localVarQueryParameter['offset'] = offset;
|
|
4889
|
-
}
|
|
4890
4854
|
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
4891
4855
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
4892
4856
|
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
@@ -4896,21 +4860,20 @@ const DraftsApiAxiosParamCreator = function (configuration) {
|
|
|
4896
4860
|
};
|
|
4897
4861
|
}),
|
|
4898
4862
|
/**
|
|
4899
|
-
* The draft\'s files
|
|
4863
|
+
* The draft\'s files: the documents under `path` to `depth`, held as workspace documents. `409` `draft-converting` while the draft is moving to the new store. **Listed against the draft\'s last publication.** A draft is a package in draft mode, so a listing reports each document\'s `changeSincePublication` — added, modified, or unchanged — and includes the files the publication shipped that the draft has since deleted, as `removed` entries. A deletion is an edit like any other, and a page rendering the draft\'s files needs all of them from one read. A draft never published is measured against the published version it was opened on (the package\'s latest version when none was recorded), and only for a caller with read access to that package: the markers would otherwise name the package\'s published files, and their absence say which of them the draft leaves unchanged, to a reader who cannot read it. For such a caller the draft\'s own files are listed without markers, with `Changes-Unavailable`. A baseline that exists but cannot be measured or read (an archive that failed to download) is `Changes-Unavailable` too, never \"nothing to compare against\". A never-published draft of a package with no published version carries no markers and no removed entries. When the comparison cannot be made (a transient failure, or a publication recorded before its baseline existed), the listing is still returned, without markers, and says so with the `Changes-Unavailable` header rather than failing. Content is omitted from the listing unless `withContent=true`; otherwise read a document to get it. **Authorization**: requires read access to the draft document.
|
|
4900
4864
|
* @summary List a draft\'s documents
|
|
4901
4865
|
* @param {string} organizationName The unique identifier of the organization
|
|
4902
4866
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
4903
4867
|
* @param {string} draftId The draft package identifier
|
|
4904
4868
|
* @param {string} [path] Restrict the listing to this subtree, relative to the draft root.
|
|
4905
|
-
* @param {number} [depth] `1` lists only the
|
|
4906
|
-
* @param {
|
|
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.
|
|
4869
|
+
* @param {number} [depth] `1` lists only the files directly under `path`, as a file browser would. Omitted returns every file in the subtree, which is what a section listing wants. A draft\'s paths are flat, so neither returns directory entries.
|
|
4870
|
+
* @param {boolean} [withContent] Carry each document\'s content on its entry, so a caller that wants the whole draft makes one request rather than one per file. A document\'s text comes as `content`. A data file the draft holds beside its documents (`kind` `data`) carries neither, as in any listing. The listing is whole-draft or refused: past the same file-count and byte limits a checkpoint collects under, it answers `413` `draft-listing-too-large` rather than a partial one, and `limit` and `offset` do not lower what is read, only what is returned. Read the files one at a time instead.
|
|
4908
4871
|
* @param {number} [limit] Maximum number of items to return. Use -1 or omit to return all results.
|
|
4909
4872
|
* @param {number} [offset] Number of items to skip before starting to return results
|
|
4910
4873
|
* @param {*} [options] Override http request option.
|
|
4911
4874
|
* @throws {RequiredError}
|
|
4912
4875
|
*/
|
|
4913
|
-
listDraftDocuments: (organizationName_1, workspaceName_1, draftId_1, path_1, depth_1,
|
|
4876
|
+
listDraftDocuments: (organizationName_1, workspaceName_1, draftId_1, path_1, depth_1, withContent_1, limit_1, offset_1, ...args_1) => __awaiter(this, [organizationName_1, workspaceName_1, draftId_1, path_1, depth_1, withContent_1, limit_1, offset_1, ...args_1], void 0, function* (organizationName, workspaceName, draftId, path, depth, withContent, limit, offset, options = {}) {
|
|
4914
4877
|
// verify required parameter 'organizationName' is not null or undefined
|
|
4915
4878
|
(0, common_1.assertParamExists)('listDraftDocuments', 'organizationName', organizationName);
|
|
4916
4879
|
// verify required parameter 'workspaceName' is not null or undefined
|
|
@@ -4936,9 +4899,6 @@ const DraftsApiAxiosParamCreator = function (configuration) {
|
|
|
4936
4899
|
if (depth !== undefined) {
|
|
4937
4900
|
localVarQueryParameter['depth'] = depth;
|
|
4938
4901
|
}
|
|
4939
|
-
if (ref !== undefined) {
|
|
4940
|
-
localVarQueryParameter['ref'] = ref;
|
|
4941
|
-
}
|
|
4942
4902
|
if (withContent !== undefined) {
|
|
4943
4903
|
localVarQueryParameter['withContent'] = withContent;
|
|
4944
4904
|
}
|
|
@@ -5002,7 +4962,7 @@ const DraftsApiAxiosParamCreator = function (configuration) {
|
|
|
5002
4962
|
};
|
|
5003
4963
|
}),
|
|
5004
4964
|
/**
|
|
5005
|
-
* Changes a draft\'s own fields. Every field is optional and an absent one is left alone. Its writers own different slices — a display name comes from a person, `publishedAs` from a publish
|
|
4965
|
+
* Changes a draft\'s own fields. Every field is optional and an absent one is left alone. Its writers own different slices — a display name comes from a person, `publishedAs` from a publish. The package name is not one of them once set: `targetPackageName` cannot change a draft\'s package (`409 draft-package-name-fixed`). A replacement would make each of them responsible for preserving the others\' fields. **A deleted or nonexistent draft answers 404 to a caller who can write its workspace**, and 403 to one who cannot, for the same reason `getDraft` does. **Authorization**: requires `can_update_document` on the draft document, and `can_create_package` on the environment it targets.
|
|
5006
4966
|
* @summary Update a draft package
|
|
5007
4967
|
* @param {string} organizationName The unique identifier of the organization
|
|
5008
4968
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
@@ -5044,86 +5004,7 @@ const DraftsApiAxiosParamCreator = function (configuration) {
|
|
|
5044
5004
|
};
|
|
5045
5005
|
}),
|
|
5046
5006
|
/**
|
|
5047
|
-
*
|
|
5048
|
-
* @summary Move the draft\'s branch
|
|
5049
|
-
* @param {string} organizationName The unique identifier of the organization
|
|
5050
|
-
* @param {string} workspaceName The unique identifier of the workspace
|
|
5051
|
-
* @param {string} draftId The draft package identifier
|
|
5052
|
-
* @param {*} [options] Override http request option.
|
|
5053
|
-
* @throws {RequiredError}
|
|
5054
|
-
*/
|
|
5055
|
-
updateDraftBranch: (organizationName_1, workspaceName_1, draftId_1, ...args_1) => __awaiter(this, [organizationName_1, workspaceName_1, draftId_1, ...args_1], void 0, function* (organizationName, workspaceName, draftId, options = {}) {
|
|
5056
|
-
// verify required parameter 'organizationName' is not null or undefined
|
|
5057
|
-
(0, common_1.assertParamExists)('updateDraftBranch', 'organizationName', organizationName);
|
|
5058
|
-
// verify required parameter 'workspaceName' is not null or undefined
|
|
5059
|
-
(0, common_1.assertParamExists)('updateDraftBranch', 'workspaceName', workspaceName);
|
|
5060
|
-
// verify required parameter 'draftId' is not null or undefined
|
|
5061
|
-
(0, common_1.assertParamExists)('updateDraftBranch', 'draftId', draftId);
|
|
5062
|
-
const localVarPath = `/organizations/{organizationName}/workspaces/{workspaceName}/drafts/{draftId}/branch`
|
|
5063
|
-
.replace(`{${"organizationName"}}`, encodeURIComponent(String(organizationName)))
|
|
5064
|
-
.replace(`{${"workspaceName"}}`, encodeURIComponent(String(workspaceName)))
|
|
5065
|
-
.replace(`{${"draftId"}}`, encodeURIComponent(String(draftId)));
|
|
5066
|
-
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
5067
|
-
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
5068
|
-
let baseOptions;
|
|
5069
|
-
if (configuration) {
|
|
5070
|
-
baseOptions = configuration.baseOptions;
|
|
5071
|
-
}
|
|
5072
|
-
const localVarRequestOptions = Object.assign(Object.assign({ method: 'PATCH' }, baseOptions), options);
|
|
5073
|
-
const localVarHeaderParameter = {};
|
|
5074
|
-
const localVarQueryParameter = {};
|
|
5075
|
-
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
5076
|
-
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
5077
|
-
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
5078
|
-
return {
|
|
5079
|
-
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
5080
|
-
options: localVarRequestOptions,
|
|
5081
|
-
};
|
|
5082
|
-
}),
|
|
5083
|
-
/**
|
|
5084
|
-
* Advances the pull request\'s state. Merging is a transition of the pull request, not an action filed under it — `PATCH` on the resource rather than a `/merge` verb in the path, which is what every other resource in this API does. Proxies the git-gateway\'s `mergeDraftPullRequest`. Squash-merges into the base branch and returns the merge commit SHA, which becomes the published version\'s `git_commit_sha` — the first provenance anchor reachable from the base branch. `expectedHeadSha` is required and pins what is merged to what the caller read, so a checkpoint that landed after the review cannot be merged silently. Read it from `getDraftPullRequest` and pass it straight back. A `409` means the head moved, the pull request is gone, `publisher.json` names a version that already exists, or the package is known not to compile at this head (`draft-compile-failed`); a `405` means GitHub says the branch is not mergeable — a conflict, or a required review that has not passed. The compile check is READ here, never run — it is started by `getDraftPullRequest` and can take minutes, so this call adds no compile latency. The consequence is that it refuses only a `failing` verdict already computed for this exact `expectedHeadSha`. `pending`, `unverified`, and a verdict this replica has not computed at all ALL allow the merge. Treat it as a guard against merging a known-broken package, not as a guarantee that a merged package compiled. **Authorization**: Requires the environment\'s `can_update_project` (enforced by the gateway) — a strictly higher bar than opening the pull request, because a merge changes what serves for the whole environment. **Git-backed drafts only.** A document-store draft answers `400` `draft-not-git-backed` before any call to the gateway: it has no branch, commits or pull request, so the operation does not apply to it. `409` `draft-provisioning` means the draft\'s branch is still being cut; retry.
|
|
5085
|
-
* @summary Merge the draft\'s pull request
|
|
5086
|
-
* @param {string} organizationName The unique identifier of the organization
|
|
5087
|
-
* @param {string} workspaceName The unique identifier of the workspace
|
|
5088
|
-
* @param {string} draftId The draft package identifier
|
|
5089
|
-
* @param {MergeDraftPullRequest} mergeDraftPullRequest
|
|
5090
|
-
* @param {*} [options] Override http request option.
|
|
5091
|
-
* @throws {RequiredError}
|
|
5092
|
-
*/
|
|
5093
|
-
updateDraftPullRequest: (organizationName_1, workspaceName_1, draftId_1, mergeDraftPullRequest_1, ...args_1) => __awaiter(this, [organizationName_1, workspaceName_1, draftId_1, mergeDraftPullRequest_1, ...args_1], void 0, function* (organizationName, workspaceName, draftId, mergeDraftPullRequest, options = {}) {
|
|
5094
|
-
// verify required parameter 'organizationName' is not null or undefined
|
|
5095
|
-
(0, common_1.assertParamExists)('updateDraftPullRequest', 'organizationName', organizationName);
|
|
5096
|
-
// verify required parameter 'workspaceName' is not null or undefined
|
|
5097
|
-
(0, common_1.assertParamExists)('updateDraftPullRequest', 'workspaceName', workspaceName);
|
|
5098
|
-
// verify required parameter 'draftId' is not null or undefined
|
|
5099
|
-
(0, common_1.assertParamExists)('updateDraftPullRequest', 'draftId', draftId);
|
|
5100
|
-
// verify required parameter 'mergeDraftPullRequest' is not null or undefined
|
|
5101
|
-
(0, common_1.assertParamExists)('updateDraftPullRequest', 'mergeDraftPullRequest', mergeDraftPullRequest);
|
|
5102
|
-
const localVarPath = `/organizations/{organizationName}/workspaces/{workspaceName}/drafts/{draftId}/pull-request`
|
|
5103
|
-
.replace(`{${"organizationName"}}`, encodeURIComponent(String(organizationName)))
|
|
5104
|
-
.replace(`{${"workspaceName"}}`, encodeURIComponent(String(workspaceName)))
|
|
5105
|
-
.replace(`{${"draftId"}}`, encodeURIComponent(String(draftId)));
|
|
5106
|
-
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
5107
|
-
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
5108
|
-
let baseOptions;
|
|
5109
|
-
if (configuration) {
|
|
5110
|
-
baseOptions = configuration.baseOptions;
|
|
5111
|
-
}
|
|
5112
|
-
const localVarRequestOptions = Object.assign(Object.assign({ method: 'PATCH' }, baseOptions), options);
|
|
5113
|
-
const localVarHeaderParameter = {};
|
|
5114
|
-
const localVarQueryParameter = {};
|
|
5115
|
-
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
5116
|
-
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
5117
|
-
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
5118
|
-
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
5119
|
-
localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(mergeDraftPullRequest, localVarRequestOptions, configuration);
|
|
5120
|
-
return {
|
|
5121
|
-
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
5122
|
-
options: localVarRequestOptions,
|
|
5123
|
-
};
|
|
5124
|
-
}),
|
|
5125
|
-
/**
|
|
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.
|
|
5007
|
+
* Asks for a checkpoint of the draft\'s current content. A `POST` to the collection rather than a `PUT` on a singleton: this starts a job and answers `202`, and the checkpoints it appends to are a series (`1.0.N`), not one value being set. Sending it twice is still safe — see the coalescing note below — but that is a property of the nudge, not a claim that the request is idempotent in the `PUT` sense. The current checkpoint\'s status is a separate read: `GET` on `../checkpoint`. Records that the draft\'s current content should be published as the next checkpoint (`1.0.N`) of its environment draft package — an ordinary published package named `draft-{draftKey}` in the draft\'s target environment, served by the Publisher exactly like any other package there (docs/workspace-architecture-design.md §4). Answers `202` with the current status: this call is a nudge, not the publish. A draft that is moving to the new store answers `409` `draft-converting` and records nothing; retry after a moment. The reconciler resolves the draft\'s current content itself when it collects the work — the draft\'s documents — which is why the request carries no ref and no content: a caller-supplied ref would be both spoofable and racy against the agent\'s own commits, and a nudge that arrives late still publishes what the draft says NOW. Nudges coalesce: any number recorded between publishes produce one checkpoint of the newest content, and a nudge whose content is identical to the latest published checkpoint publishes nothing. That is this operation\'s own contract, not something the verb supplies — a `POST` to a collection is not idempotent, so a retry after a lost response would otherwise mint a second checkpoint of content that has not changed. A failed publish (the draft does not compile, most commonly) records `failed` with the compiler\'s message and leaves the previous checkpoint serving; the next nudge retries with the then-current content. **This is also how a reaped draft package comes back.** A draft whose package has been idle-reaped (24 hours without a checkpoint request) keeps its row as a witness, and a nudge clears the reap marker and re-queues the publish — the same row update that publishes anything else, so no separate verb is needed. `GET` on this path reports `resurrectable` so a client knows to send one. A merge reap comes back the same way, but a client with the draft page open asks automatically: the app\'s own `POST` rebuilds the package unless the reap\'s own tick wins the race first — at `1.0.0` after the reap, or cancelling the reap and republishing into it. A package a resurrect brought back is a live draft again from there, so the ordinary idle sweep (24 hours since the *last checkpoint request*, not tied to a viewer leaving) reclaims it if nobody keeps asking. Either way a draft that outlives its merge (its close was skipped or its publish failed) can be nudged again, and any later nudge rebuilds it the same way: at `1.0.0` once the reap is deleting the package, or as the next `1.0.N` when the nudge lands before the reap starts and keeps it. Only a deleted draft\'s reap is terminal — its content has no home left — and a nudge for one is refused rather than honoured. **Authorization**: requires `can_update_document` on the draft document AND the target environment\'s `can_create_package` — the same two bars every content-writing draft operation already takes, so anyone modeling in the draft holds both.
|
|
5127
5008
|
* @summary Set the draft\'s checkpoint to its current content
|
|
5128
5009
|
* @param {string} organizationName The unique identifier of the organization
|
|
5129
5010
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
@@ -5160,7 +5041,7 @@ const DraftsApiAxiosParamCreator = function (configuration) {
|
|
|
5160
5041
|
};
|
|
5161
5042
|
}),
|
|
5162
5043
|
/**
|
|
5163
|
-
* Creates or replaces a document
|
|
5044
|
+
* Creates or replaces a document. `PUT` rather than `POST` because the path is the identifier and the caller chooses it — there is no server-assigned id for a file, so a collection `POST` would have nothing to assign. **The precondition is per file.** `expectedSha` (the `sha` the writer read) replaces the document only if it still holds that version, and `createOnly` creates it only if no document is there. Of two writers holding the same `sha` exactly one wins and the other gets `409` `draft-document-stale`, except that a resent write that already landed is answered as applied (below). They are mutually exclusive (`400` when both are sent). With neither, the write is last-writer-wins, as a write through the documents API has always been. A retry whose change is already in place (the content is current, or the file to delete is gone) is answered as applied, not as a conflict, so a lost response can be resent. A deletion of a gone file with an `expectedSha` counts as applied only when no write in the same set is still to land: a move whose old path was deleted or moved by someone else is stale (`\"\"`), not a second copy. The server requests the draft\'s checkpoint after the write commits, so a client does not request one itself. **Authorization** — `can_update_document` on the draft document, **and** `can_create_package` on the draft\'s target environment. The second is not redundant: `can_update_document` on a draft is satisfied by bare workspace membership, while a file written here reaches the environment on the draft author\'s next checkpoint, carrying the checkpointer\'s bar rather than the writer\'s. The environment comes from the draft\'s own manifest and is never a request field; a draft that names none is refused, since it could not be published either. Refuses with `400` (`draft-notebook-read-only`) when a document path ends `.malloynb` and the write would change it or add a new one to a draft that already has files. A `.malloynb` notebook in a draft is read-only: convert it to a `.malloy` notebook (the same name with `.malloy`, beside it) and edit that, or delete it. Writing identical content, or seeding an empty draft, is allowed, and so is a deletion.
|
|
5164
5045
|
* @summary Write one of a draft\'s documents
|
|
5165
5046
|
* @param {string} organizationName The unique identifier of the organization
|
|
5166
5047
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
@@ -5206,7 +5087,7 @@ const DraftsApiAxiosParamCreator = function (configuration) {
|
|
|
5206
5087
|
};
|
|
5207
5088
|
}),
|
|
5208
5089
|
/**
|
|
5209
|
-
* Writes a data file\'s bytes — a Parquet, CSV, JSON or Excel (`.xlsx`) file a model reads — into the draft, creating it or replacing the draft\'s earlier upload at the same path. A data file lives beside the draft\'s text documents
|
|
5090
|
+
* Writes a data file\'s bytes — a Parquet, CSV, JSON or Excel (`.xlsx`) file a model reads — into the draft, creating it or replacing the draft\'s earlier upload at the same path. A data file lives beside the draft\'s text documents (docs/draft-data-file-upload-design.md). The body is the file itself, `application/octet-stream`, with `Content-Length` set; a chunked body without one is refused before it is read. Uploading over a data file the package\'s published version serves replaces it in the draft: the draft\'s checkpoint and its next publish carry the upload, and the published version keeps its copy until then. A path the draft holds as a small text document (a CSV the published version shipped, which a draft holds as text) moves: the upload is stored and the text copy removed, so the path lives in one place. `DELETE` on the document path deletes a data file, or — for one the draft inherits — records that the draft no longer carries it; `DELETE` on its `change` restores it to the published copy. Refusals, each with its `code`: - `400` `draft-data-file-body-unreadable`: the request body ended or failed before it was read through (a dropped connection, a truncating proxy). Nothing was written; send it again. - `400` `draft-data-file-invalid`: the path holds a character outside Malloy\'s unquoted DuckDB path set `[A-Za-z0-9._~:/?#@!$&*+,=%-]`, such as a space, a bracket, a quote or an accented letter (a model can\'t name such a file in `duckdb.table(\'…\')`; the message names the path with accents dropped and each run of any other such character replaced by `_`, which the app uploads to instead), or ends in `.txt` (DuckDB has no reader for that extension; rename it `.csv` or `.tsv`), or ends in any other extension outside the formats a model reads as data: `.csv`, `.tsv`, `.parquet`, `.xlsx`, `.json`, `.jsonl`, `.ndjson`, and `.csv.gz`, `.tsv.gz`, `.json.gz`, `.jsonl.gz`, `.ndjson.gz` (an `.xls` is told to save as `.xlsx`). Decided by the path, before the body is read. - `409` `draft-content-not-data`: the path names a file the package treats as text (`publisher.json`, `.malloy`, `.malloynb`, `.md`, `.html`, or a `.json` at the package root). Those are written through `writeDraftDocument`. - `411` `draft-data-file-length-required`: the request declared no `Content-Length`. - `413` `draft-data-file-too-large`: over 32 MiB. - `413` `draft-data-files-over-quota`: the draft would hold more than 64 data files or 128 MiB of them. - `422` `draft-data-file-invalid`: a `.parquet` or `.xlsx` path whose bytes are not that format, or an empty body. - `429` `draft-data-file-rate-limited`: more than 30 uploads into this draft in the last minute, or more uploads in flight on the serving replica than it spools at once (8). Both are counted per replica. Retry after a moment. **Authorization** — the same pair `writeDraftDocument` takes: `can_update_document` on the draft document, and `can_create_package` on the draft\'s target environment.
|
|
5210
5091
|
* @summary Upload a data file into a draft
|
|
5211
5092
|
* @param {string} organizationName The unique identifier of the organization
|
|
5212
5093
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
@@ -5252,7 +5133,7 @@ const DraftsApiAxiosParamCreator = function (configuration) {
|
|
|
5252
5133
|
};
|
|
5253
5134
|
}),
|
|
5254
5135
|
/**
|
|
5255
|
-
* Writes a set of documents together
|
|
5136
|
+
* Writes a set of documents together, in one transaction: a seed, or a multi-file edit that must not be seen half applied. Ordinary editing uses the per-document `PUT`. This is for the cases that are atomic by nature. Each member may carry its own `expectedSha` or `createOnly` (see `writeDraftDocument`), so a move is one set: `createOnly` on the new path and a deletion with `expectedSha` on the old one. If any member\'s precondition fails, none is written and the `409` `draft-document-stale` names every conflicting path; a set already partly in place (a resent one) commits only what remains. **Authorization**: as `writeDraftDocument`. **Resolving conflicts.** A member carrying the `conflictSha` that `getDraftConflicts` gave its path resolves that one conflict: the path leaves the conflict list and its base moves to the incoming side, so the next sync does not raise it again. With no content and no `deleted` the member keeps the draft\'s file as it is (an uploaded data file too), and only the conflict is cleared. Members without a `conflictSha` write as usual, and a write may resolve any subset of the list. A `conflictSha` that no longer names the path\'s conflict (the incoming side moved, or it was resolved) is `409` `draft-conflict-changed`, and nothing is written. Once none remain, the draft moves on to what came in, and a submitted draft\'s push starts. A resolution never fails on an archive: when the published version the last conflicts came from cannot be read, the draft\'s next sync moves its base instead. **Fenced by a work item.** A caller executing a work item (one claimed through the controlplane\'s private work-item API) sends its claim in `Work-Item-Claim` (`{id}@{generation}`). The claim is checked first thing in the transaction that writes the document rows, and refused with `409` `draft-write-fenced` -- writing nothing -- when it is no longer the live one: released, cancelled, or swept after its holder stopped heartbeating. A malformed header is a `400`. Without the header the write is unfenced, as before. Only this operation honors the header. Refuses with `400` (`draft-notebook-read-only`) when a document path ends `.malloynb` and the write would change it or add a new one to a draft that already has files. A `.malloynb` notebook in a draft is read-only: convert it to a `.malloy` notebook (the same name with `.malloy`, beside it) and edit that, or delete it. Writing identical content, or seeding an empty draft, is allowed, and so is a deletion.
|
|
5256
5137
|
* @summary Write several of a draft\'s documents as one change
|
|
5257
5138
|
* @param {string} organizationName The unique identifier of the organization
|
|
5258
5139
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
@@ -5298,15 +5179,16 @@ const DraftsApiAxiosParamCreator = function (configuration) {
|
|
|
5298
5179
|
};
|
|
5299
5180
|
}),
|
|
5300
5181
|
/**
|
|
5301
|
-
*
|
|
5302
|
-
* @summary Publish
|
|
5182
|
+
* The one way a draft ships, whether or not its environment reviews drafts on GitHub. Either the draft\'s package is published and this answers `200` with it, or nothing is published and it answers `409` `draft-not-ready` with `details.reason` saying what it waits on. Call it again once that clears: every step is safe to repeat, and a repeat after a publish answers with the version already published. `getDraftPublication` reads the same gates without acting on them. **A draft whose environment does not review on GitHub** is published from its own files, in this order: 1. `conflicts`: the draft has unresolved conflicts (`details.conflictCount`). 2. `stale`: the package has a newer version than the one the draft is synced to; the background sync brings it in. 3. `building` / `build-failed`: the draft\'s latest content has no passing build from the last hour. A missing, pending or stale build is requested here and answers `building`; a failing one answers `build-failed`, with the compiler\'s message. 4. The publish, `createOrUpdatePackage` naming this draft. The body\'s `description` is written into the published `publisher.json`. A package that moved under the draft while it published answers `stale`. **A draft whose environment reviews on GitHub** merges its pull request and publishes the merge commit: 1. A draft whose pull request merged, and which has not changed since, goes straight to the publish (8). One edited after its merge is a new pull request. While a rebuild of a merged draft is pending this answers `building`: the build says whether it holds an edit. A rebuild that failed on the merged content still publishes the merge. One whose content cannot be compared answers `build-failed` when it failed to compile, and `building` when it failed on Credible\'s side, which this call asks to rebuild. 2. A push GitHub refused for good answers `push-refused`, with the reason in `details.pushError`: `data_files_only`, `no_changes`, `content_refused`, `review_outside_package`, `repository_too_large` or `push_refused`, until the draft\'s content changes, which sends it again (`repository_too_large` only fails again: see `push-refused` below). Otherwise a push is owed when the draft has never been sent, has changed since its last push, or the body\'s `title` / `description` differ from the pull request\'s; this call submits it. 3. `conflicts` (the draft\'s own, `details.conflictCount`) and `stale` (as above). 4. `sending` until the owed push lands and the pull request is open at it. 5. The build at the pull request\'s head must be a pass from the last hour. Otherwise this call asks for one, which posts the head\'s check run once it settles, and answers `building`, or `build-failed` for a failing one. 6. GitHub\'s mergeable state, as last recorded: `dirty` answers `pull-request-conflicts` (the draft\'s own conflicts are step 3\'s `conflicts`, so this one is resolved on GitHub), `draft` is read once more, as a press may follow a pull request marked ready, and answers `pull-request-draft` if it still is (or if GitHub cannot be read), and a state GitHub has not computed is read once more and otherwise answers `sending`. `blocked` with a passing build re-posts the head\'s passing check run, since a check run left from an earlier answer can be what blocks it, and goes on to the merge. `behind` alone does not refuse: the merge itself refuses a base branch that changed the package. 7. The package at the head is listed once and refused for what a publish cannot carry: `draft-publish-unreadable-file`, `draft-publish-too-large`, or `draft-publish-manifest-missing` (no `publisher.json`). 8. The pull request is merged at that head, confined to the package and only while the base branch has not changed the package since the draft\'s base, and the merge commit is published. GitHub refusing the merge answers `pull-request-blocked` (a required review or check is outstanding), a base branch that changed the package `stale`, a head that moved `sending`, and a pull request that changes files outside the package `push-refused` with `details.pushError` `review_outside_package`: a merge here never carries them onto the base branch, so they are reconciled on GitHub. A refusal because the pull request already merged (a second Publish racing the first) publishes that merge. Until the merge\'s version exists this answers `publishing` (the webhook or the merge record holds it, or GitHub\'s merge time is not read yet); call again, which never merges twice. **A successful publish closes the draft**, as the publish of a draft always has: the draft and its branch are deleted unless it changed meanwhile, a pull request is open on its branch, the publish created the package without attaching it to the workspace (`workspaceAttached: false`), or an agent sandbox turn is live on it. The close never fails this call; `publishedVersion` names the version published, or the existing one that already carries this merge. **Authorization**: the draft\'s modeling bar (`can_create_document` on the workspace, `can_create_package` on its environment) and `can_update_package` on a package that already exists; the publish itself re-checks them. `409` `draft-converting` means the draft is moving to the new store; retry. A `400` is the publish refusing the package itself (an archive it cannot read, a name it does not accept).
|
|
5183
|
+
* @summary Publish the draft
|
|
5303
5184
|
* @param {string} organizationName The unique identifier of the organization
|
|
5304
5185
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
5305
5186
|
* @param {string} draftId The draft package identifier
|
|
5187
|
+
* @param {DraftPublicationRequest} [draftPublicationRequest]
|
|
5306
5188
|
* @param {*} [options] Override http request option.
|
|
5307
5189
|
* @throws {RequiredError}
|
|
5308
5190
|
*/
|
|
5309
|
-
writeDraftPublication: (organizationName_1, workspaceName_1, draftId_1, ...args_1) => __awaiter(this, [organizationName_1, workspaceName_1, draftId_1, ...args_1], void 0, function* (organizationName, workspaceName, draftId, options = {}) {
|
|
5191
|
+
writeDraftPublication: (organizationName_1, workspaceName_1, draftId_1, draftPublicationRequest_1, ...args_1) => __awaiter(this, [organizationName_1, workspaceName_1, draftId_1, draftPublicationRequest_1, ...args_1], void 0, function* (organizationName, workspaceName, draftId, draftPublicationRequest, options = {}) {
|
|
5310
5192
|
// verify required parameter 'organizationName' is not null or undefined
|
|
5311
5193
|
(0, common_1.assertParamExists)('writeDraftPublication', 'organizationName', organizationName);
|
|
5312
5194
|
// verify required parameter 'workspaceName' is not null or undefined
|
|
@@ -5326,46 +5208,11 @@ const DraftsApiAxiosParamCreator = function (configuration) {
|
|
|
5326
5208
|
const localVarRequestOptions = Object.assign(Object.assign({ method: 'PUT' }, baseOptions), options);
|
|
5327
5209
|
const localVarHeaderParameter = {};
|
|
5328
5210
|
const localVarQueryParameter = {};
|
|
5211
|
+
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
5329
5212
|
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
5330
5213
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
5331
5214
|
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
5332
|
-
|
|
5333
|
-
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
5334
|
-
options: localVarRequestOptions,
|
|
5335
|
-
};
|
|
5336
|
-
}),
|
|
5337
|
-
/**
|
|
5338
|
-
* Proxies the code-assist git-gateway\'s `createDraftPullRequest`, forwarding the caller\'s own bearer token exactly as the History operations do. The gateway remains the sole authorizer; this endpoint performs no authorization of its own. Idempotent — an already-open pull request for this draft comes back rather than a second one. **Not a pure proxy: this call can sync and retry on your behalf.** A draft whose package already exists on the base branch — most commonly because this draft\'s own earlier pull request already merged it — is refused `409 draft-behind-base` unless it can be shown to derive from the base branch\'s current tip. Rather than surfacing that refusal immediately, this endpoint calls `updateDraftBranch`\'s own implementation, which merges the base branch into the draft\'s branch and writes `metadata.git.package_base_sha` on the draft\'s manifest from what that sync proves, then retries the create exactly once. Only a second refusal (a real race, or a draft whose package belongs to another name entirely) reaches the caller as `409`. A `sync-conflict` or `sync-rejected` from that internal sync surfaces as its own clear refusal, naming the manual paths out (resolve on github.com, or start a fresh draft) — resolve it there, or call `updateDraftBranch` directly for the same outcome without going through this endpoint. **Authorization**: Requires the environment\'s `can_create_package` (enforced by the gateway) — proposing a change is the same authority as writing the draft. **Git-backed drafts only.** A document-store draft answers `400` `draft-not-git-backed` before any call to the gateway: it has no branch, commits or pull request, so the operation does not apply to it. `409` `draft-provisioning` means the draft\'s branch is still being cut; retry.
|
|
5339
|
-
* @summary Open a pull request for a git-backed draft
|
|
5340
|
-
* @param {string} organizationName The unique identifier of the organization
|
|
5341
|
-
* @param {string} workspaceName The unique identifier of the workspace
|
|
5342
|
-
* @param {string} draftId The draft package identifier
|
|
5343
|
-
* @param {*} [options] Override http request option.
|
|
5344
|
-
* @throws {RequiredError}
|
|
5345
|
-
*/
|
|
5346
|
-
writeDraftPullRequest: (organizationName_1, workspaceName_1, draftId_1, ...args_1) => __awaiter(this, [organizationName_1, workspaceName_1, draftId_1, ...args_1], void 0, function* (organizationName, workspaceName, draftId, options = {}) {
|
|
5347
|
-
// verify required parameter 'organizationName' is not null or undefined
|
|
5348
|
-
(0, common_1.assertParamExists)('writeDraftPullRequest', 'organizationName', organizationName);
|
|
5349
|
-
// verify required parameter 'workspaceName' is not null or undefined
|
|
5350
|
-
(0, common_1.assertParamExists)('writeDraftPullRequest', 'workspaceName', workspaceName);
|
|
5351
|
-
// verify required parameter 'draftId' is not null or undefined
|
|
5352
|
-
(0, common_1.assertParamExists)('writeDraftPullRequest', 'draftId', draftId);
|
|
5353
|
-
const localVarPath = `/organizations/{organizationName}/workspaces/{workspaceName}/drafts/{draftId}/pull-request`
|
|
5354
|
-
.replace(`{${"organizationName"}}`, encodeURIComponent(String(organizationName)))
|
|
5355
|
-
.replace(`{${"workspaceName"}}`, encodeURIComponent(String(workspaceName)))
|
|
5356
|
-
.replace(`{${"draftId"}}`, encodeURIComponent(String(draftId)));
|
|
5357
|
-
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
5358
|
-
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
5359
|
-
let baseOptions;
|
|
5360
|
-
if (configuration) {
|
|
5361
|
-
baseOptions = configuration.baseOptions;
|
|
5362
|
-
}
|
|
5363
|
-
const localVarRequestOptions = Object.assign(Object.assign({ method: 'PUT' }, baseOptions), options);
|
|
5364
|
-
const localVarHeaderParameter = {};
|
|
5365
|
-
const localVarQueryParameter = {};
|
|
5366
|
-
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
5367
|
-
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
5368
|
-
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
5215
|
+
localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(draftPublicationRequest, localVarRequestOptions, configuration);
|
|
5369
5216
|
return {
|
|
5370
5217
|
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
5371
5218
|
options: localVarRequestOptions,
|
|
@@ -5382,7 +5229,7 @@ const DraftsApiFp = function (configuration) {
|
|
|
5382
5229
|
const localVarAxiosParamCreator = (0, exports.DraftsApiAxiosParamCreator)(configuration);
|
|
5383
5230
|
return {
|
|
5384
5231
|
/**
|
|
5385
|
-
* Mints a draft in this workspace and returns it. **Always creates**: a package can hold any number of drafts, one per chat by default, so a second request for the same `targetPackageName` mints a second draft rather than returning the first. Callers that want an existing draft list the workspace\'s drafts and open one by id. What keeps two writers off one draft is the draft\'s work-item claim, not uniqueness here.
|
|
5232
|
+
* Mints a draft in this workspace and returns it. **Always creates**: a package can hold any number of drafts, one per chat by default, so a second request for the same `targetPackageName` mints a second draft rather than returning the first. Callers that want an existing draft list the workspace\'s drafts and open one by id. What keeps two writers off one draft is the draft\'s work-item claim, not uniqueness here. Every draft is a document-store draft, in a git-enrolled environment as in any other: the draft\'s files are workspace documents, and git is only where a pushed draft goes for review. **`seedFromPublished` returns the draft already holding a published version\'s files**, in this one call: what opening a published package for editing takes, without a chat. Its refusals all come before the draft exists, and a seed that fails afterwards removes the draft; see the field. `201` with the new draft. **Authorization**: `can_create_document` in the workspace, and on every create the target environment\'s modeling bar (`can_create_package`, modeler or admin): putting a package in draft mode, or starting a new package\'s draft, is modeling work in that environment, and in a git-enrolled one creating the branch is a write into its repository. It is taken before anything is created; refused, it answers `403 draft-modeling-permission-required`.
|
|
5386
5233
|
* @summary Create a draft package
|
|
5387
5234
|
* @param {string} organizationName The unique identifier of the organization
|
|
5388
5235
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
@@ -5418,7 +5265,7 @@ const DraftsApiFp = function (configuration) {
|
|
|
5418
5265
|
});
|
|
5419
5266
|
},
|
|
5420
5267
|
/**
|
|
5421
|
-
* Thin proxy to the code-assist git-gateway\'s `deleteDraft` — deletes the draft\'s branch in the managed monorepo
|
|
5268
|
+
* Thin proxy to the code-assist git-gateway\'s `deleteDraft` — deletes the draft\'s branch in the managed monorepo, forwarding the caller\'s own bearer token. **This is branch removal only — it does not delete the draft.** Deleting the draft is `DELETE` on the draft itself. Stays as the primitive operator tooling needs: `deleteDraft` deletes an untouched draft\'s branch at its seed commit on the server (docs/git-synced-modeling.md §7.2), so neither the app nor the agent needs to call this. See docs/tenant-offboarding-playbook.md, which prefers it over a raw GitHub call precisely because it carries the FGA check below. The close after a successful publish also deletes a draft\'s branch, but through the gateway directly rather than through this endpoint. **Authorization**: Requires write access to the draft\'s workspace (`can_create_document`) and `can_create_package` on the environment the draft targets, as deleting the draft does. The gateway re-checks the workspace relation. Idempotent, and deliberately not gated on the draft being git-backed, so a provisioning draft\'s half-cut branch can still be cleaned up.
|
|
5422
5269
|
* @summary Delete a git-backed draft\'s branch
|
|
5423
5270
|
* @param {string} organizationName The unique identifier of the organization
|
|
5424
5271
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
@@ -5436,34 +5283,34 @@ const DraftsApiFp = function (configuration) {
|
|
|
5436
5283
|
});
|
|
5437
5284
|
},
|
|
5438
5285
|
/**
|
|
5439
|
-
* Removes a document from the draft
|
|
5286
|
+
* Removes a document from the draft: it deletes the document row, only if it still holds the `sha` in `expectedSha` when one is sent, and unconditionally (and idempotently) otherwise. **Authorization**: as `writeDraftDocument`.
|
|
5440
5287
|
* @summary Delete one of a draft\'s documents
|
|
5441
5288
|
* @param {string} organizationName The unique identifier of the organization
|
|
5442
5289
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
5443
5290
|
* @param {string} draftId The draft package identifier
|
|
5444
5291
|
* @param {string} documentPath The document\'s path relative to the draft root
|
|
5445
|
-
* @param {string} [
|
|
5446
|
-
* @param {string} [
|
|
5292
|
+
* @param {string} [expectedSha] The `sha` the caller read the document at: the delete applies only if the document still holds that version, else `409` `draft-document-stale`; a file already gone counts as deleted when this is the whole request, so a lost response can be resent.
|
|
5293
|
+
* @param {string} [expectedRef] Deprecated: use `expectedSha`. A git branch head, refused with `400` when set: a draft has no commits to compare it against, and a caller that sends a precondition believes it holds one. Kept one release, so a client from before the document store is refused rather than written unconditionally; removed in the release after.
|
|
5447
5294
|
* @param {*} [options] Override http request option.
|
|
5448
5295
|
* @throws {RequiredError}
|
|
5449
5296
|
*/
|
|
5450
|
-
deleteDraftDocument(organizationName, workspaceName, draftId, documentPath,
|
|
5297
|
+
deleteDraftDocument(organizationName, workspaceName, draftId, documentPath, expectedSha, expectedRef, options) {
|
|
5451
5298
|
return __awaiter(this, void 0, void 0, function* () {
|
|
5452
5299
|
var _a, _b, _c;
|
|
5453
|
-
const localVarAxiosArgs = yield localVarAxiosParamCreator.deleteDraftDocument(organizationName, workspaceName, draftId, documentPath,
|
|
5300
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.deleteDraftDocument(organizationName, workspaceName, draftId, documentPath, expectedSha, expectedRef, options);
|
|
5454
5301
|
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
5455
5302
|
const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['DraftsApi.deleteDraftDocument']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
|
|
5456
5303
|
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
5457
5304
|
});
|
|
5458
5305
|
},
|
|
5459
5306
|
/**
|
|
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.
|
|
5307
|
+
* Discards the draft\'s change to one file, so the draft carries what its publication has at this path again. This is Restore, for any kind of file; after it the path has no `changeSincePublication` marker. `DELETE` on the document itself deletes the file instead — a different change, which this would undo. What it does follows the file\'s change marker, never whether a published copy can be read: - A data file: the draft\'s own upload or deletion is dropped. Where the draft\'s last publish shipped its own upload, the path returns to that upload; otherwise the published copy is inherited again, and a small UTF-8 file, which a draft holds as a document rather than inheriting, is written back as one. - A text file the draft added: deleted. - A text file the draft edited or deleted: the published copy written back. Answers as `getDraftDocument` with `ref=publication` does when that copy cannot be read (`404` `draft-file-not-in-publication`, `409`, `413`, `503`), changing nothing. `404` `draft-document-unchanged` when the draft has no change at this path — a data file the draft\'s last publish shipped and has not touched since included. Before any change is found, the comparison itself can be refused, with the answers a read of the baseline gives: `403` when the caller cannot read the package the draft is measured against, `409` `draft-publication-baseline-missing` when that baseline cannot be measured (a corrupt archive), and `503` `draft-changes-unavailable` when it could not be read. **Authorization** — the same pair `writeDraftDocument` takes.
|
|
5461
5308
|
* @summary Restore one of a draft\'s files to its published copy
|
|
5462
5309
|
* @param {string} organizationName The unique identifier of the organization
|
|
5463
5310
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
5464
5311
|
* @param {string} draftId The draft package identifier
|
|
5465
5312
|
* @param {string} documentPath The file\'s path relative to the draft root
|
|
5466
|
-
* @param {string} [expectedRef] Deprecated:
|
|
5313
|
+
* @param {string} [expectedRef] Deprecated: a restore takes no precondition. A git branch head, refused with `400` when set: a draft has no commits to compare it against, and a caller that sends a precondition believes it holds one. Kept one release, so a client from before the document store is refused rather than written unconditionally; removed in the release after.
|
|
5467
5314
|
* @param {*} [options] Override http request option.
|
|
5468
5315
|
* @throws {RequiredError}
|
|
5469
5316
|
*/
|
|
@@ -5495,83 +5342,82 @@ const DraftsApiFp = function (configuration) {
|
|
|
5495
5342
|
});
|
|
5496
5343
|
},
|
|
5497
5344
|
/**
|
|
5498
|
-
* The
|
|
5499
|
-
* @summary
|
|
5345
|
+
* The draft\'s capabilities, derived by the server from its environment and what its package has published. The same value `getDraft` carries as `capabilities`, for a caller that does not need the rest of the draft: it reads the draft\'s manifest, its review state and one published-version lookup, not the checkpoint or the files. A draft that is moving to the new store answers `409` `draft-converting`: retry. **Authorization**: requires read access to the draft document.
|
|
5346
|
+
* @summary What the draft\'s storage can do
|
|
5500
5347
|
* @param {string} organizationName The unique identifier of the organization
|
|
5501
5348
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
5502
5349
|
* @param {string} draftId The draft package identifier
|
|
5503
5350
|
* @param {*} [options] Override http request option.
|
|
5504
5351
|
* @throws {RequiredError}
|
|
5505
5352
|
*/
|
|
5506
|
-
|
|
5353
|
+
getDraftCapabilities(organizationName, workspaceName, draftId, options) {
|
|
5507
5354
|
return __awaiter(this, void 0, void 0, function* () {
|
|
5508
5355
|
var _a, _b, _c;
|
|
5509
|
-
const localVarAxiosArgs = yield localVarAxiosParamCreator.
|
|
5356
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.getDraftCapabilities(organizationName, workspaceName, draftId, options);
|
|
5510
5357
|
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
5511
|
-
const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['DraftsApi.
|
|
5358
|
+
const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['DraftsApi.getDraftCapabilities']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
|
|
5512
5359
|
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
5513
5360
|
});
|
|
5514
5361
|
},
|
|
5515
5362
|
/**
|
|
5516
|
-
*
|
|
5517
|
-
* @summary
|
|
5363
|
+
* 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.
|
|
5364
|
+
* @summary The draft\'s checkpoint status
|
|
5518
5365
|
* @param {string} organizationName The unique identifier of the organization
|
|
5519
5366
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
5520
5367
|
* @param {string} draftId The draft package identifier
|
|
5521
5368
|
* @param {*} [options] Override http request option.
|
|
5522
5369
|
* @throws {RequiredError}
|
|
5523
5370
|
*/
|
|
5524
|
-
|
|
5371
|
+
getDraftCheckpointStatus(organizationName, workspaceName, draftId, options) {
|
|
5525
5372
|
return __awaiter(this, void 0, void 0, function* () {
|
|
5526
5373
|
var _a, _b, _c;
|
|
5527
|
-
const localVarAxiosArgs = yield localVarAxiosParamCreator.
|
|
5374
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.getDraftCheckpointStatus(organizationName, workspaceName, draftId, options);
|
|
5528
5375
|
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.
|
|
5376
|
+
const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['DraftsApi.getDraftCheckpointStatus']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
|
|
5530
5377
|
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
5531
5378
|
});
|
|
5532
5379
|
},
|
|
5533
5380
|
/**
|
|
5534
|
-
*
|
|
5535
|
-
* @summary
|
|
5381
|
+
* One entry of `getDraftConflicts` with the incoming side\'s, the draft\'s and their common ancestor\'s version of the file, so the caller can reconcile them and write the result through `writeDraftDocuments` with the `conflictSha` this returns. **Authorization**: requires read access to the draft document, and `can_create_package` on the environment it targets: only a modeler can act on what this serves. `404` when the path has no conflict (it was resolved, or never conflicted).
|
|
5382
|
+
* @summary One conflicting file, with all three of its versions
|
|
5536
5383
|
* @param {string} organizationName The unique identifier of the organization
|
|
5537
5384
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
5538
5385
|
* @param {string} draftId The draft package identifier
|
|
5386
|
+
* @param {string} documentPath The conflicting file\'s path relative to the draft root, as `getDraftConflicts` lists it.
|
|
5539
5387
|
* @param {*} [options] Override http request option.
|
|
5540
5388
|
* @throws {RequiredError}
|
|
5541
5389
|
*/
|
|
5542
|
-
|
|
5390
|
+
getDraftConflict(organizationName, workspaceName, draftId, documentPath, options) {
|
|
5543
5391
|
return __awaiter(this, void 0, void 0, function* () {
|
|
5544
5392
|
var _a, _b, _c;
|
|
5545
|
-
const localVarAxiosArgs = yield localVarAxiosParamCreator.
|
|
5393
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.getDraftConflict(organizationName, workspaceName, draftId, documentPath, options);
|
|
5546
5394
|
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
5547
|
-
const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['DraftsApi.
|
|
5395
|
+
const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['DraftsApi.getDraftConflict']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
|
|
5548
5396
|
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
5549
5397
|
});
|
|
5550
5398
|
},
|
|
5551
5399
|
/**
|
|
5552
|
-
*
|
|
5553
|
-
* @summary
|
|
5400
|
+
* A page of the draft\'s conflicts: every path both the draft and what came in changed since their common ancestor, where what came in is a newer published version of its package (the base moved) or a commit someone pushed to its pull request. A superset of what cannot merge on its own, because nothing here runs a merge. Ordered by `relpath`. Each entry says where its incoming side came from, and carries the `conflictSha` a resolution sends back through `writeDraftDocuments`, a member per file. `getDraftConflict` returns one file\'s three versions. An empty list means nothing waits on the author: what only one side changed is absorbed in the background. Conflicts never block editing or a Submit; a submitted draft\'s push waits for the last one to be resolved and then starts on its own. Served from controlplane\'s record alone: no file content, no archive read and no GitHub call. **Authorization**: requires read access to the draft document. `409` `draft-converting` means the draft is moving to the new store; retry.
|
|
5401
|
+
* @summary The files the draft and what came in both changed
|
|
5554
5402
|
* @param {string} organizationName The unique identifier of the organization
|
|
5555
5403
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
5556
5404
|
* @param {string} draftId The draft package identifier
|
|
5557
|
-
* @param {
|
|
5558
|
-
* @param {string} head The commit to compare TO. Same form as `base`.
|
|
5559
|
-
* @param {number} [limit] Maximum number of items to return. Use -1 or omit to return all results.
|
|
5405
|
+
* @param {number} [limit] Maximum number of items to return. Use -1 or omit to return all results. Valid values: -1 (all results) or 1–500.
|
|
5560
5406
|
* @param {number} [offset] Number of items to skip before starting to return results
|
|
5561
5407
|
* @param {*} [options] Override http request option.
|
|
5562
5408
|
* @throws {RequiredError}
|
|
5563
5409
|
*/
|
|
5564
|
-
|
|
5410
|
+
getDraftConflicts(organizationName, workspaceName, draftId, limit, offset, options) {
|
|
5565
5411
|
return __awaiter(this, void 0, void 0, function* () {
|
|
5566
5412
|
var _a, _b, _c;
|
|
5567
|
-
const localVarAxiosArgs = yield localVarAxiosParamCreator.
|
|
5413
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.getDraftConflicts(organizationName, workspaceName, draftId, limit, offset, options);
|
|
5568
5414
|
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
5569
|
-
const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['DraftsApi.
|
|
5415
|
+
const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['DraftsApi.getDraftConflicts']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
|
|
5570
5416
|
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
5571
5417
|
});
|
|
5572
5418
|
},
|
|
5573
5419
|
/**
|
|
5574
|
-
* The draft as it stands, as a package archive: its own files at its latest content, its uploaded data files, and the data files it inherits from the published version, minus any it deleted — the same layering its checkpoints and publishes use (docs/draft-data-file-upload-design.md §4.3), but built from the draft\'s current content rather than its last checkpoint, and with its own `publisher.json`. For working on the package locally. `409` `draft-
|
|
5420
|
+
* The draft as it stands, as a package archive: its own files at its latest content, its uploaded data files, and the data files it inherits from the published version, minus any it deleted — the same layering its checkpoints and publishes use (docs/draft-data-file-upload-design.md §4.3), but built from the draft\'s current content rather than its last checkpoint, and with its own `publisher.json`. For working on the package locally. `409` `draft-converting` while the draft is moving to the new store; `503` `draft-data-file-storage-unavailable` when an upload\'s object or the published archive could not be read. **Authorization**: requires read access to the draft document, and — when the draft\'s package has a published version, whose data files the zip would inherit — update access to the package, as downloading that version does (`getPackageVersionContent`). That check runs before the published archive is fetched, so a reader without it never causes that read.
|
|
5575
5421
|
* @summary Download a draft package as a zip
|
|
5576
5422
|
* @param {string} organizationName The unique identifier of the organization
|
|
5577
5423
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
@@ -5589,13 +5435,13 @@ const DraftsApiFp = function (configuration) {
|
|
|
5589
5435
|
});
|
|
5590
5436
|
},
|
|
5591
5437
|
/**
|
|
5592
|
-
* One document\'s content
|
|
5438
|
+
* One document\'s content. `409` `draft-converting` while the draft is moving to the new store. Refuses with `413` (`draft-file-unreadable`) when the document is not readable as UTF-8 text under 1MB. That is a permanent refusal about the file\'s shape, not a transient failure: the same refusal stops a publish, so retrying achieves nothing until the file is removed or replaced. **`ref=publication`** reads the document as it is in the version the draft\'s `changeSincePublication` markers compare against. The baseline is resolved server-side, never taken from the caller: the stored archive of the draft\'s last published version, or — for one never published — of the version it was opened on. The answers, each distinct: - `200`: the file\'s content in that baseline. - `403`: the caller can read the draft but not the package whose stored archive is the baseline. Workspace access does not imply environment access, so this read also takes `can_read_package` on it. - `404` `draft-file-not-in-publication`: the baseline exists and does not hold this file. There is nothing to restore from it. - `409` `draft-publication-baseline-missing`: there is no baseline to read — a draft never published and opened on nothing, a publication recorded before baselines were, a published version with no stored archive, one whose archive is corrupt, or one that no longer holds what its publish recorded. Permanent until the draft publishes again. - `413` `draft-file-unreadable`: the baseline\'s copy is not UTF-8 text under 1MB. - `503` `draft-publication-unreadable`: the baseline exists but could not be read right now. Retryable. The content is the published archive\'s bytes decoded as UTF-8, so its SHA-256 is the hash the markers were computed from. A published file a draft cannot hold (binary, or 1 MiB and over) is inherited by the draft rather than held, so it is not in the baseline and answers `404`. **Authorization**: requires read access to the draft document.
|
|
5593
5439
|
* @summary Read one of a draft\'s documents
|
|
5594
5440
|
* @param {string} organizationName The unique identifier of the organization
|
|
5595
5441
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
5596
5442
|
* @param {string} draftId The draft package identifier
|
|
5597
5443
|
* @param {string} documentPath The document\'s path relative to the draft root
|
|
5598
|
-
* @param {string} [ref]
|
|
5444
|
+
* @param {string} [ref] The literal `publication` reads the file as it is in the draft\'s publication baseline — see the operation\'s description. It is matched exactly (lower case). Any other value is ignored: a draft keeps no commits to read at.
|
|
5599
5445
|
* @param {*} [options] Override http request option.
|
|
5600
5446
|
* @throws {RequiredError}
|
|
5601
5447
|
*/
|
|
@@ -5609,7 +5455,7 @@ const DraftsApiFp = function (configuration) {
|
|
|
5609
5455
|
});
|
|
5610
5456
|
},
|
|
5611
5457
|
/**
|
|
5612
|
-
* The bytes of a file as the draft carries it: a text document\'s content, a data file\'s own upload, or otherwise the data file it inherits from the package\'s published version. So a download works the same on any file of the draft. A path the draft deleted answers `404`; `409` `draft-
|
|
5458
|
+
* The bytes of a file as the draft carries it: a text document\'s content, a data file\'s own upload, or otherwise the data file it inherits from the package\'s published version. So a download works the same on any file of the draft. A path the draft deleted answers `404`; `409` `draft-converting` while the draft is moving to the new store. A text document that cannot be served as text (1 MiB or more) answers `413` `draft-file-unreadable`, as `getDraftDocument` does. An uploaded data file never takes this path. **Authorization**: requires read access to the draft document. A data file the draft inherits also requires update access to the package, as downloading the published version does (`getPackageVersionContent`); the draft\'s own uploads do not. That check runs before the published archive is fetched, so a reader without it gets `403` for any path the draft itself does not hold, a missing one included.
|
|
5613
5459
|
* @summary Download one of a draft\'s files
|
|
5614
5460
|
* @param {string} organizationName The unique identifier of the organization
|
|
5615
5461
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
@@ -5628,62 +5474,59 @@ const DraftsApiFp = function (configuration) {
|
|
|
5628
5474
|
});
|
|
5629
5475
|
},
|
|
5630
5476
|
/**
|
|
5631
|
-
*
|
|
5632
|
-
* @summary
|
|
5477
|
+
* The gates `writeDraftPublication` applies, read without acting on any of them: no submit, no build request, no merge and no listing of the package on GitHub, so it costs database reads only. `ready` false comes with the `reason` the publish would answer now. `ready` true means every gate this read covers passed; the publish\'s own listing of the package at the pull request\'s head can still refuse it. `ready` says nothing about the caller: a reader who may not publish reads it too, and the publish refuses them `403`. A draft that is owed a push or a build reads `sending` or `building` here, and only `writeDraftPublication` starts them. A `blocked` pull request reads `pull-request-blocked` here even when the publish would re-post its check and merge. `warnings` are about what the publish would ship, not whether it can: today, that a first publish exposes every source (see `DraftPublicationWarning`). They are read only when `ready` is true, and are empty otherwise. **Authorization**: requires read access to the draft document. `409` `draft-converting` means the draft is moving to the new store; retry.
|
|
5478
|
+
* @summary Whether the draft can be published now
|
|
5633
5479
|
* @param {string} organizationName The unique identifier of the organization
|
|
5634
5480
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
5635
5481
|
* @param {string} draftId The draft package identifier
|
|
5636
5482
|
* @param {*} [options] Override http request option.
|
|
5637
5483
|
* @throws {RequiredError}
|
|
5638
5484
|
*/
|
|
5639
|
-
|
|
5485
|
+
getDraftPublication(organizationName, workspaceName, draftId, options) {
|
|
5640
5486
|
return __awaiter(this, void 0, void 0, function* () {
|
|
5641
5487
|
var _a, _b, _c;
|
|
5642
|
-
const localVarAxiosArgs = yield localVarAxiosParamCreator.
|
|
5488
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.getDraftPublication(organizationName, workspaceName, draftId, options);
|
|
5643
5489
|
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
5644
|
-
const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['DraftsApi.
|
|
5490
|
+
const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['DraftsApi.getDraftPublication']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
|
|
5645
5491
|
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
5646
5492
|
});
|
|
5647
5493
|
},
|
|
5648
5494
|
/**
|
|
5649
|
-
*
|
|
5650
|
-
* @summary
|
|
5495
|
+
* Served from controlplane\'s record of the draft and nothing else: no GitHub read and no side effect, so polling it costs controlplane\'s own reads only. Always answers `200` for a draft the caller can read. `state` is `none` when the draft has no pull request, and a draft whose environment does not review on GitHub answers `state: none`, `reviewState: notSubmitted`, so a polling client treats absence as an answer, not an error. `reviewState` says where the review stands and `nextAttemptAt` when it is next worked on; `unsubmittedChanges` says whether the draft has edits since its last push. Poll while `reviewState` is `sending` or a pull request is open, and stop otherwise. `mergeable` is GitHub\'s own verdict as last recorded and is `null` while GitHub is still computing it. Treat `null` as \"not yet known\" and re-read; never as \"not mergeable\". **Authorization**: requires read access to the draft document. `409` `draft-converting` means the draft is moving to the new store; retry.
|
|
5496
|
+
* @summary The draft\'s pull request and review state
|
|
5651
5497
|
* @param {string} organizationName The unique identifier of the organization
|
|
5652
5498
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
5653
5499
|
* @param {string} draftId The draft package identifier
|
|
5654
|
-
* @param {number} [limit]
|
|
5655
|
-
* @param {number} [offset]
|
|
5656
5500
|
* @param {*} [options] Override http request option.
|
|
5657
5501
|
* @throws {RequiredError}
|
|
5658
5502
|
*/
|
|
5659
|
-
|
|
5503
|
+
getDraftPullRequest(organizationName, workspaceName, draftId, options) {
|
|
5660
5504
|
return __awaiter(this, void 0, void 0, function* () {
|
|
5661
5505
|
var _a, _b, _c;
|
|
5662
|
-
const localVarAxiosArgs = yield localVarAxiosParamCreator.
|
|
5506
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.getDraftPullRequest(organizationName, workspaceName, draftId, options);
|
|
5663
5507
|
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
5664
|
-
const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['DraftsApi.
|
|
5508
|
+
const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['DraftsApi.getDraftPullRequest']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
|
|
5665
5509
|
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
5666
5510
|
});
|
|
5667
5511
|
},
|
|
5668
5512
|
/**
|
|
5669
|
-
* The draft\'s files
|
|
5513
|
+
* The draft\'s files: the documents under `path` to `depth`, held as workspace documents. `409` `draft-converting` while the draft is moving to the new store. **Listed against the draft\'s last publication.** A draft is a package in draft mode, so a listing reports each document\'s `changeSincePublication` — added, modified, or unchanged — and includes the files the publication shipped that the draft has since deleted, as `removed` entries. A deletion is an edit like any other, and a page rendering the draft\'s files needs all of them from one read. A draft never published is measured against the published version it was opened on (the package\'s latest version when none was recorded), and only for a caller with read access to that package: the markers would otherwise name the package\'s published files, and their absence say which of them the draft leaves unchanged, to a reader who cannot read it. For such a caller the draft\'s own files are listed without markers, with `Changes-Unavailable`. A baseline that exists but cannot be measured or read (an archive that failed to download) is `Changes-Unavailable` too, never \"nothing to compare against\". A never-published draft of a package with no published version carries no markers and no removed entries. When the comparison cannot be made (a transient failure, or a publication recorded before its baseline existed), the listing is still returned, without markers, and says so with the `Changes-Unavailable` header rather than failing. Content is omitted from the listing unless `withContent=true`; otherwise read a document to get it. **Authorization**: requires read access to the draft document.
|
|
5670
5514
|
* @summary List a draft\'s documents
|
|
5671
5515
|
* @param {string} organizationName The unique identifier of the organization
|
|
5672
5516
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
5673
5517
|
* @param {string} draftId The draft package identifier
|
|
5674
5518
|
* @param {string} [path] Restrict the listing to this subtree, relative to the draft root.
|
|
5675
|
-
* @param {number} [depth] `1` lists only the
|
|
5676
|
-
* @param {
|
|
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.
|
|
5519
|
+
* @param {number} [depth] `1` lists only the files directly under `path`, as a file browser would. Omitted returns every file in the subtree, which is what a section listing wants. A draft\'s paths are flat, so neither returns directory entries.
|
|
5520
|
+
* @param {boolean} [withContent] Carry each document\'s content on its entry, so a caller that wants the whole draft makes one request rather than one per file. A document\'s text comes as `content`. A data file the draft holds beside its documents (`kind` `data`) carries neither, as in any listing. The listing is whole-draft or refused: past the same file-count and byte limits a checkpoint collects under, it answers `413` `draft-listing-too-large` rather than a partial one, and `limit` and `offset` do not lower what is read, only what is returned. Read the files one at a time instead.
|
|
5678
5521
|
* @param {number} [limit] Maximum number of items to return. Use -1 or omit to return all results.
|
|
5679
5522
|
* @param {number} [offset] Number of items to skip before starting to return results
|
|
5680
5523
|
* @param {*} [options] Override http request option.
|
|
5681
5524
|
* @throws {RequiredError}
|
|
5682
5525
|
*/
|
|
5683
|
-
listDraftDocuments(organizationName, workspaceName, draftId, path, depth,
|
|
5526
|
+
listDraftDocuments(organizationName, workspaceName, draftId, path, depth, withContent, limit, offset, options) {
|
|
5684
5527
|
return __awaiter(this, void 0, void 0, function* () {
|
|
5685
5528
|
var _a, _b, _c;
|
|
5686
|
-
const localVarAxiosArgs = yield localVarAxiosParamCreator.listDraftDocuments(organizationName, workspaceName, draftId, path, depth,
|
|
5529
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.listDraftDocuments(organizationName, workspaceName, draftId, path, depth, withContent, limit, offset, options);
|
|
5687
5530
|
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
5688
5531
|
const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['DraftsApi.listDraftDocuments']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
|
|
5689
5532
|
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
@@ -5710,7 +5553,7 @@ const DraftsApiFp = function (configuration) {
|
|
|
5710
5553
|
});
|
|
5711
5554
|
},
|
|
5712
5555
|
/**
|
|
5713
|
-
* Changes a draft\'s own fields. Every field is optional and an absent one is left alone. Its writers own different slices — a display name comes from a person, `publishedAs` from a publish
|
|
5556
|
+
* Changes a draft\'s own fields. Every field is optional and an absent one is left alone. Its writers own different slices — a display name comes from a person, `publishedAs` from a publish. The package name is not one of them once set: `targetPackageName` cannot change a draft\'s package (`409 draft-package-name-fixed`). A replacement would make each of them responsible for preserving the others\' fields. **A deleted or nonexistent draft answers 404 to a caller who can write its workspace**, and 403 to one who cannot, for the same reason `getDraft` does. **Authorization**: requires `can_update_document` on the draft document, and `can_create_package` on the environment it targets.
|
|
5714
5557
|
* @summary Update a draft package
|
|
5715
5558
|
* @param {string} organizationName The unique identifier of the organization
|
|
5716
5559
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
@@ -5729,44 +5572,7 @@ const DraftsApiFp = function (configuration) {
|
|
|
5729
5572
|
});
|
|
5730
5573
|
},
|
|
5731
5574
|
/**
|
|
5732
|
-
*
|
|
5733
|
-
* @summary Move the draft\'s branch
|
|
5734
|
-
* @param {string} organizationName The unique identifier of the organization
|
|
5735
|
-
* @param {string} workspaceName The unique identifier of the workspace
|
|
5736
|
-
* @param {string} draftId The draft package identifier
|
|
5737
|
-
* @param {*} [options] Override http request option.
|
|
5738
|
-
* @throws {RequiredError}
|
|
5739
|
-
*/
|
|
5740
|
-
updateDraftBranch(organizationName, workspaceName, draftId, options) {
|
|
5741
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
5742
|
-
var _a, _b, _c;
|
|
5743
|
-
const localVarAxiosArgs = yield localVarAxiosParamCreator.updateDraftBranch(organizationName, workspaceName, draftId, options);
|
|
5744
|
-
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
5745
|
-
const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['DraftsApi.updateDraftBranch']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
|
|
5746
|
-
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
5747
|
-
});
|
|
5748
|
-
},
|
|
5749
|
-
/**
|
|
5750
|
-
* Advances the pull request\'s state. Merging is a transition of the pull request, not an action filed under it — `PATCH` on the resource rather than a `/merge` verb in the path, which is what every other resource in this API does. Proxies the git-gateway\'s `mergeDraftPullRequest`. Squash-merges into the base branch and returns the merge commit SHA, which becomes the published version\'s `git_commit_sha` — the first provenance anchor reachable from the base branch. `expectedHeadSha` is required and pins what is merged to what the caller read, so a checkpoint that landed after the review cannot be merged silently. Read it from `getDraftPullRequest` and pass it straight back. A `409` means the head moved, the pull request is gone, `publisher.json` names a version that already exists, or the package is known not to compile at this head (`draft-compile-failed`); a `405` means GitHub says the branch is not mergeable — a conflict, or a required review that has not passed. The compile check is READ here, never run — it is started by `getDraftPullRequest` and can take minutes, so this call adds no compile latency. The consequence is that it refuses only a `failing` verdict already computed for this exact `expectedHeadSha`. `pending`, `unverified`, and a verdict this replica has not computed at all ALL allow the merge. Treat it as a guard against merging a known-broken package, not as a guarantee that a merged package compiled. **Authorization**: Requires the environment\'s `can_update_project` (enforced by the gateway) — a strictly higher bar than opening the pull request, because a merge changes what serves for the whole environment. **Git-backed drafts only.** A document-store draft answers `400` `draft-not-git-backed` before any call to the gateway: it has no branch, commits or pull request, so the operation does not apply to it. `409` `draft-provisioning` means the draft\'s branch is still being cut; retry.
|
|
5751
|
-
* @summary Merge the draft\'s pull request
|
|
5752
|
-
* @param {string} organizationName The unique identifier of the organization
|
|
5753
|
-
* @param {string} workspaceName The unique identifier of the workspace
|
|
5754
|
-
* @param {string} draftId The draft package identifier
|
|
5755
|
-
* @param {MergeDraftPullRequest} mergeDraftPullRequest
|
|
5756
|
-
* @param {*} [options] Override http request option.
|
|
5757
|
-
* @throws {RequiredError}
|
|
5758
|
-
*/
|
|
5759
|
-
updateDraftPullRequest(organizationName, workspaceName, draftId, mergeDraftPullRequest, options) {
|
|
5760
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
5761
|
-
var _a, _b, _c;
|
|
5762
|
-
const localVarAxiosArgs = yield localVarAxiosParamCreator.updateDraftPullRequest(organizationName, workspaceName, draftId, mergeDraftPullRequest, options);
|
|
5763
|
-
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
5764
|
-
const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['DraftsApi.updateDraftPullRequest']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
|
|
5765
|
-
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
5766
|
-
});
|
|
5767
|
-
},
|
|
5768
|
-
/**
|
|
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.
|
|
5575
|
+
* Asks for a checkpoint of the draft\'s current content. A `POST` to the collection rather than a `PUT` on a singleton: this starts a job and answers `202`, and the checkpoints it appends to are a series (`1.0.N`), not one value being set. Sending it twice is still safe — see the coalescing note below — but that is a property of the nudge, not a claim that the request is idempotent in the `PUT` sense. The current checkpoint\'s status is a separate read: `GET` on `../checkpoint`. Records that the draft\'s current content should be published as the next checkpoint (`1.0.N`) of its environment draft package — an ordinary published package named `draft-{draftKey}` in the draft\'s target environment, served by the Publisher exactly like any other package there (docs/workspace-architecture-design.md §4). Answers `202` with the current status: this call is a nudge, not the publish. A draft that is moving to the new store answers `409` `draft-converting` and records nothing; retry after a moment. The reconciler resolves the draft\'s current content itself when it collects the work — the draft\'s documents — which is why the request carries no ref and no content: a caller-supplied ref would be both spoofable and racy against the agent\'s own commits, and a nudge that arrives late still publishes what the draft says NOW. Nudges coalesce: any number recorded between publishes produce one checkpoint of the newest content, and a nudge whose content is identical to the latest published checkpoint publishes nothing. That is this operation\'s own contract, not something the verb supplies — a `POST` to a collection is not idempotent, so a retry after a lost response would otherwise mint a second checkpoint of content that has not changed. A failed publish (the draft does not compile, most commonly) records `failed` with the compiler\'s message and leaves the previous checkpoint serving; the next nudge retries with the then-current content. **This is also how a reaped draft package comes back.** A draft whose package has been idle-reaped (24 hours without a checkpoint request) keeps its row as a witness, and a nudge clears the reap marker and re-queues the publish — the same row update that publishes anything else, so no separate verb is needed. `GET` on this path reports `resurrectable` so a client knows to send one. A merge reap comes back the same way, but a client with the draft page open asks automatically: the app\'s own `POST` rebuilds the package unless the reap\'s own tick wins the race first — at `1.0.0` after the reap, or cancelling the reap and republishing into it. A package a resurrect brought back is a live draft again from there, so the ordinary idle sweep (24 hours since the *last checkpoint request*, not tied to a viewer leaving) reclaims it if nobody keeps asking. Either way a draft that outlives its merge (its close was skipped or its publish failed) can be nudged again, and any later nudge rebuilds it the same way: at `1.0.0` once the reap is deleting the package, or as the next `1.0.N` when the nudge lands before the reap starts and keeps it. Only a deleted draft\'s reap is terminal — its content has no home left — and a nudge for one is refused rather than honoured. **Authorization**: requires `can_update_document` on the draft document AND the target environment\'s `can_create_package` — the same two bars every content-writing draft operation already takes, so anyone modeling in the draft holds both.
|
|
5770
5576
|
* @summary Set the draft\'s checkpoint to its current content
|
|
5771
5577
|
* @param {string} organizationName The unique identifier of the organization
|
|
5772
5578
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
@@ -5784,7 +5590,7 @@ const DraftsApiFp = function (configuration) {
|
|
|
5784
5590
|
});
|
|
5785
5591
|
},
|
|
5786
5592
|
/**
|
|
5787
|
-
* Creates or replaces a document
|
|
5593
|
+
* Creates or replaces a document. `PUT` rather than `POST` because the path is the identifier and the caller chooses it — there is no server-assigned id for a file, so a collection `POST` would have nothing to assign. **The precondition is per file.** `expectedSha` (the `sha` the writer read) replaces the document only if it still holds that version, and `createOnly` creates it only if no document is there. Of two writers holding the same `sha` exactly one wins and the other gets `409` `draft-document-stale`, except that a resent write that already landed is answered as applied (below). They are mutually exclusive (`400` when both are sent). With neither, the write is last-writer-wins, as a write through the documents API has always been. A retry whose change is already in place (the content is current, or the file to delete is gone) is answered as applied, not as a conflict, so a lost response can be resent. A deletion of a gone file with an `expectedSha` counts as applied only when no write in the same set is still to land: a move whose old path was deleted or moved by someone else is stale (`\"\"`), not a second copy. The server requests the draft\'s checkpoint after the write commits, so a client does not request one itself. **Authorization** — `can_update_document` on the draft document, **and** `can_create_package` on the draft\'s target environment. The second is not redundant: `can_update_document` on a draft is satisfied by bare workspace membership, while a file written here reaches the environment on the draft author\'s next checkpoint, carrying the checkpointer\'s bar rather than the writer\'s. The environment comes from the draft\'s own manifest and is never a request field; a draft that names none is refused, since it could not be published either. Refuses with `400` (`draft-notebook-read-only`) when a document path ends `.malloynb` and the write would change it or add a new one to a draft that already has files. A `.malloynb` notebook in a draft is read-only: convert it to a `.malloy` notebook (the same name with `.malloy`, beside it) and edit that, or delete it. Writing identical content, or seeding an empty draft, is allowed, and so is a deletion.
|
|
5788
5594
|
* @summary Write one of a draft\'s documents
|
|
5789
5595
|
* @param {string} organizationName The unique identifier of the organization
|
|
5790
5596
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
@@ -5804,7 +5610,7 @@ const DraftsApiFp = function (configuration) {
|
|
|
5804
5610
|
});
|
|
5805
5611
|
},
|
|
5806
5612
|
/**
|
|
5807
|
-
* Writes a data file\'s bytes — a Parquet, CSV, JSON or Excel (`.xlsx`) file a model reads — into the draft, creating it or replacing the draft\'s earlier upload at the same path. A data file lives beside the draft\'s text documents
|
|
5613
|
+
* Writes a data file\'s bytes — a Parquet, CSV, JSON or Excel (`.xlsx`) file a model reads — into the draft, creating it or replacing the draft\'s earlier upload at the same path. A data file lives beside the draft\'s text documents (docs/draft-data-file-upload-design.md). The body is the file itself, `application/octet-stream`, with `Content-Length` set; a chunked body without one is refused before it is read. Uploading over a data file the package\'s published version serves replaces it in the draft: the draft\'s checkpoint and its next publish carry the upload, and the published version keeps its copy until then. A path the draft holds as a small text document (a CSV the published version shipped, which a draft holds as text) moves: the upload is stored and the text copy removed, so the path lives in one place. `DELETE` on the document path deletes a data file, or — for one the draft inherits — records that the draft no longer carries it; `DELETE` on its `change` restores it to the published copy. Refusals, each with its `code`: - `400` `draft-data-file-body-unreadable`: the request body ended or failed before it was read through (a dropped connection, a truncating proxy). Nothing was written; send it again. - `400` `draft-data-file-invalid`: the path holds a character outside Malloy\'s unquoted DuckDB path set `[A-Za-z0-9._~:/?#@!$&*+,=%-]`, such as a space, a bracket, a quote or an accented letter (a model can\'t name such a file in `duckdb.table(\'…\')`; the message names the path with accents dropped and each run of any other such character replaced by `_`, which the app uploads to instead), or ends in `.txt` (DuckDB has no reader for that extension; rename it `.csv` or `.tsv`), or ends in any other extension outside the formats a model reads as data: `.csv`, `.tsv`, `.parquet`, `.xlsx`, `.json`, `.jsonl`, `.ndjson`, and `.csv.gz`, `.tsv.gz`, `.json.gz`, `.jsonl.gz`, `.ndjson.gz` (an `.xls` is told to save as `.xlsx`). Decided by the path, before the body is read. - `409` `draft-content-not-data`: the path names a file the package treats as text (`publisher.json`, `.malloy`, `.malloynb`, `.md`, `.html`, or a `.json` at the package root). Those are written through `writeDraftDocument`. - `411` `draft-data-file-length-required`: the request declared no `Content-Length`. - `413` `draft-data-file-too-large`: over 32 MiB. - `413` `draft-data-files-over-quota`: the draft would hold more than 64 data files or 128 MiB of them. - `422` `draft-data-file-invalid`: a `.parquet` or `.xlsx` path whose bytes are not that format, or an empty body. - `429` `draft-data-file-rate-limited`: more than 30 uploads into this draft in the last minute, or more uploads in flight on the serving replica than it spools at once (8). Both are counted per replica. Retry after a moment. **Authorization** — the same pair `writeDraftDocument` takes: `can_update_document` on the draft document, and `can_create_package` on the draft\'s target environment.
|
|
5808
5614
|
* @summary Upload a data file into a draft
|
|
5809
5615
|
* @param {string} organizationName The unique identifier of the organization
|
|
5810
5616
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
@@ -5824,7 +5630,7 @@ const DraftsApiFp = function (configuration) {
|
|
|
5824
5630
|
});
|
|
5825
5631
|
},
|
|
5826
5632
|
/**
|
|
5827
|
-
* Writes a set of documents together
|
|
5633
|
+
* Writes a set of documents together, in one transaction: a seed, or a multi-file edit that must not be seen half applied. Ordinary editing uses the per-document `PUT`. This is for the cases that are atomic by nature. Each member may carry its own `expectedSha` or `createOnly` (see `writeDraftDocument`), so a move is one set: `createOnly` on the new path and a deletion with `expectedSha` on the old one. If any member\'s precondition fails, none is written and the `409` `draft-document-stale` names every conflicting path; a set already partly in place (a resent one) commits only what remains. **Authorization**: as `writeDraftDocument`. **Resolving conflicts.** A member carrying the `conflictSha` that `getDraftConflicts` gave its path resolves that one conflict: the path leaves the conflict list and its base moves to the incoming side, so the next sync does not raise it again. With no content and no `deleted` the member keeps the draft\'s file as it is (an uploaded data file too), and only the conflict is cleared. Members without a `conflictSha` write as usual, and a write may resolve any subset of the list. A `conflictSha` that no longer names the path\'s conflict (the incoming side moved, or it was resolved) is `409` `draft-conflict-changed`, and nothing is written. Once none remain, the draft moves on to what came in, and a submitted draft\'s push starts. A resolution never fails on an archive: when the published version the last conflicts came from cannot be read, the draft\'s next sync moves its base instead. **Fenced by a work item.** A caller executing a work item (one claimed through the controlplane\'s private work-item API) sends its claim in `Work-Item-Claim` (`{id}@{generation}`). The claim is checked first thing in the transaction that writes the document rows, and refused with `409` `draft-write-fenced` -- writing nothing -- when it is no longer the live one: released, cancelled, or swept after its holder stopped heartbeating. A malformed header is a `400`. Without the header the write is unfenced, as before. Only this operation honors the header. Refuses with `400` (`draft-notebook-read-only`) when a document path ends `.malloynb` and the write would change it or add a new one to a draft that already has files. A `.malloynb` notebook in a draft is read-only: convert it to a `.malloy` notebook (the same name with `.malloy`, beside it) and edit that, or delete it. Writing identical content, or seeding an empty draft, is allowed, and so is a deletion.
|
|
5828
5634
|
* @summary Write several of a draft\'s documents as one change
|
|
5829
5635
|
* @param {string} organizationName The unique identifier of the organization
|
|
5830
5636
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
@@ -5844,41 +5650,24 @@ const DraftsApiFp = function (configuration) {
|
|
|
5844
5650
|
});
|
|
5845
5651
|
},
|
|
5846
5652
|
/**
|
|
5847
|
-
*
|
|
5848
|
-
* @summary Publish
|
|
5653
|
+
* The one way a draft ships, whether or not its environment reviews drafts on GitHub. Either the draft\'s package is published and this answers `200` with it, or nothing is published and it answers `409` `draft-not-ready` with `details.reason` saying what it waits on. Call it again once that clears: every step is safe to repeat, and a repeat after a publish answers with the version already published. `getDraftPublication` reads the same gates without acting on them. **A draft whose environment does not review on GitHub** is published from its own files, in this order: 1. `conflicts`: the draft has unresolved conflicts (`details.conflictCount`). 2. `stale`: the package has a newer version than the one the draft is synced to; the background sync brings it in. 3. `building` / `build-failed`: the draft\'s latest content has no passing build from the last hour. A missing, pending or stale build is requested here and answers `building`; a failing one answers `build-failed`, with the compiler\'s message. 4. The publish, `createOrUpdatePackage` naming this draft. The body\'s `description` is written into the published `publisher.json`. A package that moved under the draft while it published answers `stale`. **A draft whose environment reviews on GitHub** merges its pull request and publishes the merge commit: 1. A draft whose pull request merged, and which has not changed since, goes straight to the publish (8). One edited after its merge is a new pull request. While a rebuild of a merged draft is pending this answers `building`: the build says whether it holds an edit. A rebuild that failed on the merged content still publishes the merge. One whose content cannot be compared answers `build-failed` when it failed to compile, and `building` when it failed on Credible\'s side, which this call asks to rebuild. 2. A push GitHub refused for good answers `push-refused`, with the reason in `details.pushError`: `data_files_only`, `no_changes`, `content_refused`, `review_outside_package`, `repository_too_large` or `push_refused`, until the draft\'s content changes, which sends it again (`repository_too_large` only fails again: see `push-refused` below). Otherwise a push is owed when the draft has never been sent, has changed since its last push, or the body\'s `title` / `description` differ from the pull request\'s; this call submits it. 3. `conflicts` (the draft\'s own, `details.conflictCount`) and `stale` (as above). 4. `sending` until the owed push lands and the pull request is open at it. 5. The build at the pull request\'s head must be a pass from the last hour. Otherwise this call asks for one, which posts the head\'s check run once it settles, and answers `building`, or `build-failed` for a failing one. 6. GitHub\'s mergeable state, as last recorded: `dirty` answers `pull-request-conflicts` (the draft\'s own conflicts are step 3\'s `conflicts`, so this one is resolved on GitHub), `draft` is read once more, as a press may follow a pull request marked ready, and answers `pull-request-draft` if it still is (or if GitHub cannot be read), and a state GitHub has not computed is read once more and otherwise answers `sending`. `blocked` with a passing build re-posts the head\'s passing check run, since a check run left from an earlier answer can be what blocks it, and goes on to the merge. `behind` alone does not refuse: the merge itself refuses a base branch that changed the package. 7. The package at the head is listed once and refused for what a publish cannot carry: `draft-publish-unreadable-file`, `draft-publish-too-large`, or `draft-publish-manifest-missing` (no `publisher.json`). 8. The pull request is merged at that head, confined to the package and only while the base branch has not changed the package since the draft\'s base, and the merge commit is published. GitHub refusing the merge answers `pull-request-blocked` (a required review or check is outstanding), a base branch that changed the package `stale`, a head that moved `sending`, and a pull request that changes files outside the package `push-refused` with `details.pushError` `review_outside_package`: a merge here never carries them onto the base branch, so they are reconciled on GitHub. A refusal because the pull request already merged (a second Publish racing the first) publishes that merge. Until the merge\'s version exists this answers `publishing` (the webhook or the merge record holds it, or GitHub\'s merge time is not read yet); call again, which never merges twice. **A successful publish closes the draft**, as the publish of a draft always has: the draft and its branch are deleted unless it changed meanwhile, a pull request is open on its branch, the publish created the package without attaching it to the workspace (`workspaceAttached: false`), or an agent sandbox turn is live on it. The close never fails this call; `publishedVersion` names the version published, or the existing one that already carries this merge. **Authorization**: the draft\'s modeling bar (`can_create_document` on the workspace, `can_create_package` on its environment) and `can_update_package` on a package that already exists; the publish itself re-checks them. `409` `draft-converting` means the draft is moving to the new store; retry. A `400` is the publish refusing the package itself (an archive it cannot read, a name it does not accept).
|
|
5654
|
+
* @summary Publish the draft
|
|
5849
5655
|
* @param {string} organizationName The unique identifier of the organization
|
|
5850
5656
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
5851
5657
|
* @param {string} draftId The draft package identifier
|
|
5658
|
+
* @param {DraftPublicationRequest} [draftPublicationRequest]
|
|
5852
5659
|
* @param {*} [options] Override http request option.
|
|
5853
5660
|
* @throws {RequiredError}
|
|
5854
5661
|
*/
|
|
5855
|
-
writeDraftPublication(organizationName, workspaceName, draftId, options) {
|
|
5662
|
+
writeDraftPublication(organizationName, workspaceName, draftId, draftPublicationRequest, options) {
|
|
5856
5663
|
return __awaiter(this, void 0, void 0, function* () {
|
|
5857
5664
|
var _a, _b, _c;
|
|
5858
|
-
const localVarAxiosArgs = yield localVarAxiosParamCreator.writeDraftPublication(organizationName, workspaceName, draftId, options);
|
|
5665
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.writeDraftPublication(organizationName, workspaceName, draftId, draftPublicationRequest, options);
|
|
5859
5666
|
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
5860
5667
|
const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['DraftsApi.writeDraftPublication']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
|
|
5861
5668
|
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
5862
5669
|
});
|
|
5863
5670
|
},
|
|
5864
|
-
/**
|
|
5865
|
-
* Proxies the code-assist git-gateway\'s `createDraftPullRequest`, forwarding the caller\'s own bearer token exactly as the History operations do. The gateway remains the sole authorizer; this endpoint performs no authorization of its own. Idempotent — an already-open pull request for this draft comes back rather than a second one. **Not a pure proxy: this call can sync and retry on your behalf.** A draft whose package already exists on the base branch — most commonly because this draft\'s own earlier pull request already merged it — is refused `409 draft-behind-base` unless it can be shown to derive from the base branch\'s current tip. Rather than surfacing that refusal immediately, this endpoint calls `updateDraftBranch`\'s own implementation, which merges the base branch into the draft\'s branch and writes `metadata.git.package_base_sha` on the draft\'s manifest from what that sync proves, then retries the create exactly once. Only a second refusal (a real race, or a draft whose package belongs to another name entirely) reaches the caller as `409`. A `sync-conflict` or `sync-rejected` from that internal sync surfaces as its own clear refusal, naming the manual paths out (resolve on github.com, or start a fresh draft) — resolve it there, or call `updateDraftBranch` directly for the same outcome without going through this endpoint. **Authorization**: Requires the environment\'s `can_create_package` (enforced by the gateway) — proposing a change is the same authority as writing the draft. **Git-backed drafts only.** A document-store draft answers `400` `draft-not-git-backed` before any call to the gateway: it has no branch, commits or pull request, so the operation does not apply to it. `409` `draft-provisioning` means the draft\'s branch is still being cut; retry.
|
|
5866
|
-
* @summary Open a pull request for a git-backed draft
|
|
5867
|
-
* @param {string} organizationName The unique identifier of the organization
|
|
5868
|
-
* @param {string} workspaceName The unique identifier of the workspace
|
|
5869
|
-
* @param {string} draftId The draft package identifier
|
|
5870
|
-
* @param {*} [options] Override http request option.
|
|
5871
|
-
* @throws {RequiredError}
|
|
5872
|
-
*/
|
|
5873
|
-
writeDraftPullRequest(organizationName, workspaceName, draftId, options) {
|
|
5874
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
5875
|
-
var _a, _b, _c;
|
|
5876
|
-
const localVarAxiosArgs = yield localVarAxiosParamCreator.writeDraftPullRequest(organizationName, workspaceName, draftId, options);
|
|
5877
|
-
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
5878
|
-
const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['DraftsApi.writeDraftPullRequest']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
|
|
5879
|
-
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
5880
|
-
});
|
|
5881
|
-
},
|
|
5882
5671
|
};
|
|
5883
5672
|
};
|
|
5884
5673
|
exports.DraftsApiFp = DraftsApiFp;
|
|
@@ -5890,7 +5679,7 @@ const DraftsApiFactory = function (configuration, basePath, axios) {
|
|
|
5890
5679
|
const localVarFp = (0, exports.DraftsApiFp)(configuration);
|
|
5891
5680
|
return {
|
|
5892
5681
|
/**
|
|
5893
|
-
* Mints a draft in this workspace and returns it. **Always creates**: a package can hold any number of drafts, one per chat by default, so a second request for the same `targetPackageName` mints a second draft rather than returning the first. Callers that want an existing draft list the workspace\'s drafts and open one by id. What keeps two writers off one draft is the draft\'s work-item claim, not uniqueness here.
|
|
5682
|
+
* Mints a draft in this workspace and returns it. **Always creates**: a package can hold any number of drafts, one per chat by default, so a second request for the same `targetPackageName` mints a second draft rather than returning the first. Callers that want an existing draft list the workspace\'s drafts and open one by id. What keeps two writers off one draft is the draft\'s work-item claim, not uniqueness here. Every draft is a document-store draft, in a git-enrolled environment as in any other: the draft\'s files are workspace documents, and git is only where a pushed draft goes for review. **`seedFromPublished` returns the draft already holding a published version\'s files**, in this one call: what opening a published package for editing takes, without a chat. Its refusals all come before the draft exists, and a seed that fails afterwards removes the draft; see the field. `201` with the new draft. **Authorization**: `can_create_document` in the workspace, and on every create the target environment\'s modeling bar (`can_create_package`, modeler or admin): putting a package in draft mode, or starting a new package\'s draft, is modeling work in that environment, and in a git-enrolled one creating the branch is a write into its repository. It is taken before anything is created; refused, it answers `403 draft-modeling-permission-required`.
|
|
5894
5683
|
* @summary Create a draft package
|
|
5895
5684
|
* @param {string} organizationName The unique identifier of the organization
|
|
5896
5685
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
@@ -5914,7 +5703,7 @@ const DraftsApiFactory = function (configuration, basePath, axios) {
|
|
|
5914
5703
|
return localVarFp.deleteDraft(organizationName, workspaceName, draftId, options).then((request) => request(axios, basePath));
|
|
5915
5704
|
},
|
|
5916
5705
|
/**
|
|
5917
|
-
* Thin proxy to the code-assist git-gateway\'s `deleteDraft` — deletes the draft\'s branch in the managed monorepo
|
|
5706
|
+
* Thin proxy to the code-assist git-gateway\'s `deleteDraft` — deletes the draft\'s branch in the managed monorepo, forwarding the caller\'s own bearer token. **This is branch removal only — it does not delete the draft.** Deleting the draft is `DELETE` on the draft itself. Stays as the primitive operator tooling needs: `deleteDraft` deletes an untouched draft\'s branch at its seed commit on the server (docs/git-synced-modeling.md §7.2), so neither the app nor the agent needs to call this. See docs/tenant-offboarding-playbook.md, which prefers it over a raw GitHub call precisely because it carries the FGA check below. The close after a successful publish also deletes a draft\'s branch, but through the gateway directly rather than through this endpoint. **Authorization**: Requires write access to the draft\'s workspace (`can_create_document`) and `can_create_package` on the environment the draft targets, as deleting the draft does. The gateway re-checks the workspace relation. Idempotent, and deliberately not gated on the draft being git-backed, so a provisioning draft\'s half-cut branch can still be cleaned up.
|
|
5918
5707
|
* @summary Delete a git-backed draft\'s branch
|
|
5919
5708
|
* @param {string} organizationName The unique identifier of the organization
|
|
5920
5709
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
@@ -5926,28 +5715,28 @@ const DraftsApiFactory = function (configuration, basePath, axios) {
|
|
|
5926
5715
|
return localVarFp.deleteDraftBranch(organizationName, workspaceName, draftId, options).then((request) => request(axios, basePath));
|
|
5927
5716
|
},
|
|
5928
5717
|
/**
|
|
5929
|
-
* Removes a document from the draft
|
|
5718
|
+
* Removes a document from the draft: it deletes the document row, only if it still holds the `sha` in `expectedSha` when one is sent, and unconditionally (and idempotently) otherwise. **Authorization**: as `writeDraftDocument`.
|
|
5930
5719
|
* @summary Delete one of a draft\'s documents
|
|
5931
5720
|
* @param {string} organizationName The unique identifier of the organization
|
|
5932
5721
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
5933
5722
|
* @param {string} draftId The draft package identifier
|
|
5934
5723
|
* @param {string} documentPath The document\'s path relative to the draft root
|
|
5935
|
-
* @param {string} [
|
|
5936
|
-
* @param {string} [
|
|
5724
|
+
* @param {string} [expectedSha] The `sha` the caller read the document at: the delete applies only if the document still holds that version, else `409` `draft-document-stale`; a file already gone counts as deleted when this is the whole request, so a lost response can be resent.
|
|
5725
|
+
* @param {string} [expectedRef] Deprecated: use `expectedSha`. A git branch head, refused with `400` when set: a draft has no commits to compare it against, and a caller that sends a precondition believes it holds one. Kept one release, so a client from before the document store is refused rather than written unconditionally; removed in the release after.
|
|
5937
5726
|
* @param {*} [options] Override http request option.
|
|
5938
5727
|
* @throws {RequiredError}
|
|
5939
5728
|
*/
|
|
5940
|
-
deleteDraftDocument(organizationName, workspaceName, draftId, documentPath,
|
|
5941
|
-
return localVarFp.deleteDraftDocument(organizationName, workspaceName, draftId, documentPath,
|
|
5729
|
+
deleteDraftDocument(organizationName, workspaceName, draftId, documentPath, expectedSha, expectedRef, options) {
|
|
5730
|
+
return localVarFp.deleteDraftDocument(organizationName, workspaceName, draftId, documentPath, expectedSha, expectedRef, options).then((request) => request(axios, basePath));
|
|
5942
5731
|
},
|
|
5943
5732
|
/**
|
|
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.
|
|
5733
|
+
* Discards the draft\'s change to one file, so the draft carries what its publication has at this path again. This is Restore, for any kind of file; after it the path has no `changeSincePublication` marker. `DELETE` on the document itself deletes the file instead — a different change, which this would undo. What it does follows the file\'s change marker, never whether a published copy can be read: - A data file: the draft\'s own upload or deletion is dropped. Where the draft\'s last publish shipped its own upload, the path returns to that upload; otherwise the published copy is inherited again, and a small UTF-8 file, which a draft holds as a document rather than inheriting, is written back as one. - A text file the draft added: deleted. - A text file the draft edited or deleted: the published copy written back. Answers as `getDraftDocument` with `ref=publication` does when that copy cannot be read (`404` `draft-file-not-in-publication`, `409`, `413`, `503`), changing nothing. `404` `draft-document-unchanged` when the draft has no change at this path — a data file the draft\'s last publish shipped and has not touched since included. Before any change is found, the comparison itself can be refused, with the answers a read of the baseline gives: `403` when the caller cannot read the package the draft is measured against, `409` `draft-publication-baseline-missing` when that baseline cannot be measured (a corrupt archive), and `503` `draft-changes-unavailable` when it could not be read. **Authorization** — the same pair `writeDraftDocument` takes.
|
|
5945
5734
|
* @summary Restore one of a draft\'s files to its published copy
|
|
5946
5735
|
* @param {string} organizationName The unique identifier of the organization
|
|
5947
5736
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
5948
5737
|
* @param {string} draftId The draft package identifier
|
|
5949
5738
|
* @param {string} documentPath The file\'s path relative to the draft root
|
|
5950
|
-
* @param {string} [expectedRef] Deprecated:
|
|
5739
|
+
* @param {string} [expectedRef] Deprecated: a restore takes no precondition. A git branch head, refused with `400` when set: a draft has no commits to compare it against, and a caller that sends a precondition believes it holds one. Kept one release, so a client from before the document store is refused rather than written unconditionally; removed in the release after.
|
|
5951
5740
|
* @param {*} [options] Override http request option.
|
|
5952
5741
|
* @throws {RequiredError}
|
|
5953
5742
|
*/
|
|
@@ -5967,59 +5756,58 @@ const DraftsApiFactory = function (configuration, basePath, axios) {
|
|
|
5967
5756
|
return localVarFp.getDraft(organizationName, workspaceName, draftId, options).then((request) => request(axios, basePath));
|
|
5968
5757
|
},
|
|
5969
5758
|
/**
|
|
5970
|
-
* The
|
|
5971
|
-
* @summary
|
|
5759
|
+
* The draft\'s capabilities, derived by the server from its environment and what its package has published. The same value `getDraft` carries as `capabilities`, for a caller that does not need the rest of the draft: it reads the draft\'s manifest, its review state and one published-version lookup, not the checkpoint or the files. A draft that is moving to the new store answers `409` `draft-converting`: retry. **Authorization**: requires read access to the draft document.
|
|
5760
|
+
* @summary What the draft\'s storage can do
|
|
5972
5761
|
* @param {string} organizationName The unique identifier of the organization
|
|
5973
5762
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
5974
5763
|
* @param {string} draftId The draft package identifier
|
|
5975
5764
|
* @param {*} [options] Override http request option.
|
|
5976
5765
|
* @throws {RequiredError}
|
|
5977
5766
|
*/
|
|
5978
|
-
|
|
5979
|
-
return localVarFp.
|
|
5767
|
+
getDraftCapabilities(organizationName, workspaceName, draftId, options) {
|
|
5768
|
+
return localVarFp.getDraftCapabilities(organizationName, workspaceName, draftId, options).then((request) => request(axios, basePath));
|
|
5980
5769
|
},
|
|
5981
5770
|
/**
|
|
5982
|
-
*
|
|
5983
|
-
* @summary
|
|
5771
|
+
* Reports where the draft\'s environment package stands. Always answers `200`; `status` is `none` before the first checkpoint is requested, so a polling client does not treat absence as an error. **A pure read**, and the cheap one: this is what a client polls while a checkpoint is unsettled. It performs no write and starts no publish. This is a pure read. Resurrecting an idle-reaped draft package is a `POST` to `../checkpoints`, so that a publish into a live environment follows from an explicit request rather than from whichever tab last refreshed. `resurrectable` on the response says whether such a request would rebuild anything. **Authorization**: requires read access to the draft document, the same bar as the other draft reads.
|
|
5772
|
+
* @summary The draft\'s checkpoint status
|
|
5984
5773
|
* @param {string} organizationName The unique identifier of the organization
|
|
5985
5774
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
5986
5775
|
* @param {string} draftId The draft package identifier
|
|
5987
5776
|
* @param {*} [options] Override http request option.
|
|
5988
5777
|
* @throws {RequiredError}
|
|
5989
5778
|
*/
|
|
5990
|
-
|
|
5991
|
-
return localVarFp.
|
|
5779
|
+
getDraftCheckpointStatus(organizationName, workspaceName, draftId, options) {
|
|
5780
|
+
return localVarFp.getDraftCheckpointStatus(organizationName, workspaceName, draftId, options).then((request) => request(axios, basePath));
|
|
5992
5781
|
},
|
|
5993
5782
|
/**
|
|
5994
|
-
*
|
|
5995
|
-
* @summary
|
|
5783
|
+
* One entry of `getDraftConflicts` with the incoming side\'s, the draft\'s and their common ancestor\'s version of the file, so the caller can reconcile them and write the result through `writeDraftDocuments` with the `conflictSha` this returns. **Authorization**: requires read access to the draft document, and `can_create_package` on the environment it targets: only a modeler can act on what this serves. `404` when the path has no conflict (it was resolved, or never conflicted).
|
|
5784
|
+
* @summary One conflicting file, with all three of its versions
|
|
5996
5785
|
* @param {string} organizationName The unique identifier of the organization
|
|
5997
5786
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
5998
5787
|
* @param {string} draftId The draft package identifier
|
|
5788
|
+
* @param {string} documentPath The conflicting file\'s path relative to the draft root, as `getDraftConflicts` lists it.
|
|
5999
5789
|
* @param {*} [options] Override http request option.
|
|
6000
5790
|
* @throws {RequiredError}
|
|
6001
5791
|
*/
|
|
6002
|
-
|
|
6003
|
-
return localVarFp.
|
|
5792
|
+
getDraftConflict(organizationName, workspaceName, draftId, documentPath, options) {
|
|
5793
|
+
return localVarFp.getDraftConflict(organizationName, workspaceName, draftId, documentPath, options).then((request) => request(axios, basePath));
|
|
6004
5794
|
},
|
|
6005
5795
|
/**
|
|
6006
|
-
*
|
|
6007
|
-
* @summary
|
|
5796
|
+
* A page of the draft\'s conflicts: every path both the draft and what came in changed since their common ancestor, where what came in is a newer published version of its package (the base moved) or a commit someone pushed to its pull request. A superset of what cannot merge on its own, because nothing here runs a merge. Ordered by `relpath`. Each entry says where its incoming side came from, and carries the `conflictSha` a resolution sends back through `writeDraftDocuments`, a member per file. `getDraftConflict` returns one file\'s three versions. An empty list means nothing waits on the author: what only one side changed is absorbed in the background. Conflicts never block editing or a Submit; a submitted draft\'s push waits for the last one to be resolved and then starts on its own. Served from controlplane\'s record alone: no file content, no archive read and no GitHub call. **Authorization**: requires read access to the draft document. `409` `draft-converting` means the draft is moving to the new store; retry.
|
|
5797
|
+
* @summary The files the draft and what came in both changed
|
|
6008
5798
|
* @param {string} organizationName The unique identifier of the organization
|
|
6009
5799
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
6010
5800
|
* @param {string} draftId The draft package identifier
|
|
6011
|
-
* @param {
|
|
6012
|
-
* @param {string} head The commit to compare TO. Same form as `base`.
|
|
6013
|
-
* @param {number} [limit] Maximum number of items to return. Use -1 or omit to return all results.
|
|
5801
|
+
* @param {number} [limit] Maximum number of items to return. Use -1 or omit to return all results. Valid values: -1 (all results) or 1–500.
|
|
6014
5802
|
* @param {number} [offset] Number of items to skip before starting to return results
|
|
6015
5803
|
* @param {*} [options] Override http request option.
|
|
6016
5804
|
* @throws {RequiredError}
|
|
6017
5805
|
*/
|
|
6018
|
-
|
|
6019
|
-
return localVarFp.
|
|
5806
|
+
getDraftConflicts(organizationName, workspaceName, draftId, limit, offset, options) {
|
|
5807
|
+
return localVarFp.getDraftConflicts(organizationName, workspaceName, draftId, limit, offset, options).then((request) => request(axios, basePath));
|
|
6020
5808
|
},
|
|
6021
5809
|
/**
|
|
6022
|
-
* The draft as it stands, as a package archive: its own files at its latest content, its uploaded data files, and the data files it inherits from the published version, minus any it deleted — the same layering its checkpoints and publishes use (docs/draft-data-file-upload-design.md §4.3), but built from the draft\'s current content rather than its last checkpoint, and with its own `publisher.json`. For working on the package locally. `409` `draft-
|
|
5810
|
+
* The draft as it stands, as a package archive: its own files at its latest content, its uploaded data files, and the data files it inherits from the published version, minus any it deleted — the same layering its checkpoints and publishes use (docs/draft-data-file-upload-design.md §4.3), but built from the draft\'s current content rather than its last checkpoint, and with its own `publisher.json`. For working on the package locally. `409` `draft-converting` while the draft is moving to the new store; `503` `draft-data-file-storage-unavailable` when an upload\'s object or the published archive could not be read. **Authorization**: requires read access to the draft document, and — when the draft\'s package has a published version, whose data files the zip would inherit — update access to the package, as downloading that version does (`getPackageVersionContent`). That check runs before the published archive is fetched, so a reader without it never causes that read.
|
|
6023
5811
|
* @summary Download a draft package as a zip
|
|
6024
5812
|
* @param {string} organizationName The unique identifier of the organization
|
|
6025
5813
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
@@ -6031,13 +5819,13 @@ const DraftsApiFactory = function (configuration, basePath, axios) {
|
|
|
6031
5819
|
return localVarFp.getDraftContent(organizationName, workspaceName, draftId, options).then((request) => request(axios, basePath));
|
|
6032
5820
|
},
|
|
6033
5821
|
/**
|
|
6034
|
-
* One document\'s content
|
|
5822
|
+
* One document\'s content. `409` `draft-converting` while the draft is moving to the new store. Refuses with `413` (`draft-file-unreadable`) when the document is not readable as UTF-8 text under 1MB. That is a permanent refusal about the file\'s shape, not a transient failure: the same refusal stops a publish, so retrying achieves nothing until the file is removed or replaced. **`ref=publication`** reads the document as it is in the version the draft\'s `changeSincePublication` markers compare against. The baseline is resolved server-side, never taken from the caller: the stored archive of the draft\'s last published version, or — for one never published — of the version it was opened on. The answers, each distinct: - `200`: the file\'s content in that baseline. - `403`: the caller can read the draft but not the package whose stored archive is the baseline. Workspace access does not imply environment access, so this read also takes `can_read_package` on it. - `404` `draft-file-not-in-publication`: the baseline exists and does not hold this file. There is nothing to restore from it. - `409` `draft-publication-baseline-missing`: there is no baseline to read — a draft never published and opened on nothing, a publication recorded before baselines were, a published version with no stored archive, one whose archive is corrupt, or one that no longer holds what its publish recorded. Permanent until the draft publishes again. - `413` `draft-file-unreadable`: the baseline\'s copy is not UTF-8 text under 1MB. - `503` `draft-publication-unreadable`: the baseline exists but could not be read right now. Retryable. The content is the published archive\'s bytes decoded as UTF-8, so its SHA-256 is the hash the markers were computed from. A published file a draft cannot hold (binary, or 1 MiB and over) is inherited by the draft rather than held, so it is not in the baseline and answers `404`. **Authorization**: requires read access to the draft document.
|
|
6035
5823
|
* @summary Read one of a draft\'s documents
|
|
6036
5824
|
* @param {string} organizationName The unique identifier of the organization
|
|
6037
5825
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
6038
5826
|
* @param {string} draftId The draft package identifier
|
|
6039
5827
|
* @param {string} documentPath The document\'s path relative to the draft root
|
|
6040
|
-
* @param {string} [ref]
|
|
5828
|
+
* @param {string} [ref] The literal `publication` reads the file as it is in the draft\'s publication baseline — see the operation\'s description. It is matched exactly (lower case). Any other value is ignored: a draft keeps no commits to read at.
|
|
6041
5829
|
* @param {*} [options] Override http request option.
|
|
6042
5830
|
* @throws {RequiredError}
|
|
6043
5831
|
*/
|
|
@@ -6045,7 +5833,7 @@ const DraftsApiFactory = function (configuration, basePath, axios) {
|
|
|
6045
5833
|
return localVarFp.getDraftDocument(organizationName, workspaceName, draftId, documentPath, ref, options).then((request) => request(axios, basePath));
|
|
6046
5834
|
},
|
|
6047
5835
|
/**
|
|
6048
|
-
* The bytes of a file as the draft carries it: a text document\'s content, a data file\'s own upload, or otherwise the data file it inherits from the package\'s published version. So a download works the same on any file of the draft. A path the draft deleted answers `404`; `409` `draft-
|
|
5836
|
+
* The bytes of a file as the draft carries it: a text document\'s content, a data file\'s own upload, or otherwise the data file it inherits from the package\'s published version. So a download works the same on any file of the draft. A path the draft deleted answers `404`; `409` `draft-converting` while the draft is moving to the new store. A text document that cannot be served as text (1 MiB or more) answers `413` `draft-file-unreadable`, as `getDraftDocument` does. An uploaded data file never takes this path. **Authorization**: requires read access to the draft document. A data file the draft inherits also requires update access to the package, as downloading the published version does (`getPackageVersionContent`); the draft\'s own uploads do not. That check runs before the published archive is fetched, so a reader without it gets `403` for any path the draft itself does not hold, a missing one included.
|
|
6049
5837
|
* @summary Download one of a draft\'s files
|
|
6050
5838
|
* @param {string} organizationName The unique identifier of the organization
|
|
6051
5839
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
@@ -6058,48 +5846,45 @@ const DraftsApiFactory = function (configuration, basePath, axios) {
|
|
|
6058
5846
|
return localVarFp.getDraftDocumentContent(organizationName, workspaceName, draftId, documentPath, options).then((request) => request(axios, basePath));
|
|
6059
5847
|
},
|
|
6060
5848
|
/**
|
|
6061
|
-
*
|
|
6062
|
-
* @summary
|
|
5849
|
+
* The gates `writeDraftPublication` applies, read without acting on any of them: no submit, no build request, no merge and no listing of the package on GitHub, so it costs database reads only. `ready` false comes with the `reason` the publish would answer now. `ready` true means every gate this read covers passed; the publish\'s own listing of the package at the pull request\'s head can still refuse it. `ready` says nothing about the caller: a reader who may not publish reads it too, and the publish refuses them `403`. A draft that is owed a push or a build reads `sending` or `building` here, and only `writeDraftPublication` starts them. A `blocked` pull request reads `pull-request-blocked` here even when the publish would re-post its check and merge. `warnings` are about what the publish would ship, not whether it can: today, that a first publish exposes every source (see `DraftPublicationWarning`). They are read only when `ready` is true, and are empty otherwise. **Authorization**: requires read access to the draft document. `409` `draft-converting` means the draft is moving to the new store; retry.
|
|
5850
|
+
* @summary Whether the draft can be published now
|
|
6063
5851
|
* @param {string} organizationName The unique identifier of the organization
|
|
6064
5852
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
6065
5853
|
* @param {string} draftId The draft package identifier
|
|
6066
5854
|
* @param {*} [options] Override http request option.
|
|
6067
5855
|
* @throws {RequiredError}
|
|
6068
5856
|
*/
|
|
6069
|
-
|
|
6070
|
-
return localVarFp.
|
|
5857
|
+
getDraftPublication(organizationName, workspaceName, draftId, options) {
|
|
5858
|
+
return localVarFp.getDraftPublication(organizationName, workspaceName, draftId, options).then((request) => request(axios, basePath));
|
|
6071
5859
|
},
|
|
6072
5860
|
/**
|
|
6073
|
-
*
|
|
6074
|
-
* @summary
|
|
5861
|
+
* Served from controlplane\'s record of the draft and nothing else: no GitHub read and no side effect, so polling it costs controlplane\'s own reads only. Always answers `200` for a draft the caller can read. `state` is `none` when the draft has no pull request, and a draft whose environment does not review on GitHub answers `state: none`, `reviewState: notSubmitted`, so a polling client treats absence as an answer, not an error. `reviewState` says where the review stands and `nextAttemptAt` when it is next worked on; `unsubmittedChanges` says whether the draft has edits since its last push. Poll while `reviewState` is `sending` or a pull request is open, and stop otherwise. `mergeable` is GitHub\'s own verdict as last recorded and is `null` while GitHub is still computing it. Treat `null` as \"not yet known\" and re-read; never as \"not mergeable\". **Authorization**: requires read access to the draft document. `409` `draft-converting` means the draft is moving to the new store; retry.
|
|
5862
|
+
* @summary The draft\'s pull request and review state
|
|
6075
5863
|
* @param {string} organizationName The unique identifier of the organization
|
|
6076
5864
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
6077
5865
|
* @param {string} draftId The draft package identifier
|
|
6078
|
-
* @param {number} [limit]
|
|
6079
|
-
* @param {number} [offset]
|
|
6080
5866
|
* @param {*} [options] Override http request option.
|
|
6081
5867
|
* @throws {RequiredError}
|
|
6082
5868
|
*/
|
|
6083
|
-
|
|
6084
|
-
return localVarFp.
|
|
5869
|
+
getDraftPullRequest(organizationName, workspaceName, draftId, options) {
|
|
5870
|
+
return localVarFp.getDraftPullRequest(organizationName, workspaceName, draftId, options).then((request) => request(axios, basePath));
|
|
6085
5871
|
},
|
|
6086
5872
|
/**
|
|
6087
|
-
* The draft\'s files
|
|
5873
|
+
* The draft\'s files: the documents under `path` to `depth`, held as workspace documents. `409` `draft-converting` while the draft is moving to the new store. **Listed against the draft\'s last publication.** A draft is a package in draft mode, so a listing reports each document\'s `changeSincePublication` — added, modified, or unchanged — and includes the files the publication shipped that the draft has since deleted, as `removed` entries. A deletion is an edit like any other, and a page rendering the draft\'s files needs all of them from one read. A draft never published is measured against the published version it was opened on (the package\'s latest version when none was recorded), and only for a caller with read access to that package: the markers would otherwise name the package\'s published files, and their absence say which of them the draft leaves unchanged, to a reader who cannot read it. For such a caller the draft\'s own files are listed without markers, with `Changes-Unavailable`. A baseline that exists but cannot be measured or read (an archive that failed to download) is `Changes-Unavailable` too, never \"nothing to compare against\". A never-published draft of a package with no published version carries no markers and no removed entries. When the comparison cannot be made (a transient failure, or a publication recorded before its baseline existed), the listing is still returned, without markers, and says so with the `Changes-Unavailable` header rather than failing. Content is omitted from the listing unless `withContent=true`; otherwise read a document to get it. **Authorization**: requires read access to the draft document.
|
|
6088
5874
|
* @summary List a draft\'s documents
|
|
6089
5875
|
* @param {string} organizationName The unique identifier of the organization
|
|
6090
5876
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
6091
5877
|
* @param {string} draftId The draft package identifier
|
|
6092
5878
|
* @param {string} [path] Restrict the listing to this subtree, relative to the draft root.
|
|
6093
|
-
* @param {number} [depth] `1` lists only the
|
|
6094
|
-
* @param {
|
|
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.
|
|
5879
|
+
* @param {number} [depth] `1` lists only the files directly under `path`, as a file browser would. Omitted returns every file in the subtree, which is what a section listing wants. A draft\'s paths are flat, so neither returns directory entries.
|
|
5880
|
+
* @param {boolean} [withContent] Carry each document\'s content on its entry, so a caller that wants the whole draft makes one request rather than one per file. A document\'s text comes as `content`. A data file the draft holds beside its documents (`kind` `data`) carries neither, as in any listing. The listing is whole-draft or refused: past the same file-count and byte limits a checkpoint collects under, it answers `413` `draft-listing-too-large` rather than a partial one, and `limit` and `offset` do not lower what is read, only what is returned. Read the files one at a time instead.
|
|
6096
5881
|
* @param {number} [limit] Maximum number of items to return. Use -1 or omit to return all results.
|
|
6097
5882
|
* @param {number} [offset] Number of items to skip before starting to return results
|
|
6098
5883
|
* @param {*} [options] Override http request option.
|
|
6099
5884
|
* @throws {RequiredError}
|
|
6100
5885
|
*/
|
|
6101
|
-
listDraftDocuments(organizationName, workspaceName, draftId, path, depth,
|
|
6102
|
-
return localVarFp.listDraftDocuments(organizationName, workspaceName, draftId, path, depth,
|
|
5886
|
+
listDraftDocuments(organizationName, workspaceName, draftId, path, depth, withContent, limit, offset, options) {
|
|
5887
|
+
return localVarFp.listDraftDocuments(organizationName, workspaceName, draftId, path, depth, withContent, limit, offset, options).then((request) => request(axios, basePath));
|
|
6103
5888
|
},
|
|
6104
5889
|
/**
|
|
6105
5890
|
* The workspace\'s drafts, each as the same `Draft` the item endpoint returns. **This is how a surface finds drafts.** Before it existed the only way was to list every document in the workspace and filter on type and path prefix, which meant the sidebar, the scope chips and the edit-package flow each pulled every file of every draft in the workspace to render a handful of rows. Composed server-side, one query against the checkpoint rows rather than one request per draft. **Authorization**: requires read access to the workspace, and each draft is filtered to those the caller can read — the same two-stage bar `listDocuments` applies, since a draft\'s authorization object is still its manifest document.
|
|
@@ -6116,7 +5901,7 @@ const DraftsApiFactory = function (configuration, basePath, axios) {
|
|
|
6116
5901
|
return localVarFp.listDrafts(organizationName, workspaceName, retired, limit, offset, options).then((request) => request(axios, basePath));
|
|
6117
5902
|
},
|
|
6118
5903
|
/**
|
|
6119
|
-
* Changes a draft\'s own fields. Every field is optional and an absent one is left alone. Its writers own different slices — a display name comes from a person, `publishedAs` from a publish
|
|
5904
|
+
* Changes a draft\'s own fields. Every field is optional and an absent one is left alone. Its writers own different slices — a display name comes from a person, `publishedAs` from a publish. The package name is not one of them once set: `targetPackageName` cannot change a draft\'s package (`409 draft-package-name-fixed`). A replacement would make each of them responsible for preserving the others\' fields. **A deleted or nonexistent draft answers 404 to a caller who can write its workspace**, and 403 to one who cannot, for the same reason `getDraft` does. **Authorization**: requires `can_update_document` on the draft document, and `can_create_package` on the environment it targets.
|
|
6120
5905
|
* @summary Update a draft package
|
|
6121
5906
|
* @param {string} organizationName The unique identifier of the organization
|
|
6122
5907
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
@@ -6129,32 +5914,7 @@ const DraftsApiFactory = function (configuration, basePath, axios) {
|
|
|
6129
5914
|
return localVarFp.updateDraft(organizationName, workspaceName, draftId, draftUpdate, options).then((request) => request(axios, basePath));
|
|
6130
5915
|
},
|
|
6131
5916
|
/**
|
|
6132
|
-
*
|
|
6133
|
-
* @summary Move the draft\'s branch
|
|
6134
|
-
* @param {string} organizationName The unique identifier of the organization
|
|
6135
|
-
* @param {string} workspaceName The unique identifier of the workspace
|
|
6136
|
-
* @param {string} draftId The draft package identifier
|
|
6137
|
-
* @param {*} [options] Override http request option.
|
|
6138
|
-
* @throws {RequiredError}
|
|
6139
|
-
*/
|
|
6140
|
-
updateDraftBranch(organizationName, workspaceName, draftId, options) {
|
|
6141
|
-
return localVarFp.updateDraftBranch(organizationName, workspaceName, draftId, options).then((request) => request(axios, basePath));
|
|
6142
|
-
},
|
|
6143
|
-
/**
|
|
6144
|
-
* Advances the pull request\'s state. Merging is a transition of the pull request, not an action filed under it — `PATCH` on the resource rather than a `/merge` verb in the path, which is what every other resource in this API does. Proxies the git-gateway\'s `mergeDraftPullRequest`. Squash-merges into the base branch and returns the merge commit SHA, which becomes the published version\'s `git_commit_sha` — the first provenance anchor reachable from the base branch. `expectedHeadSha` is required and pins what is merged to what the caller read, so a checkpoint that landed after the review cannot be merged silently. Read it from `getDraftPullRequest` and pass it straight back. A `409` means the head moved, the pull request is gone, `publisher.json` names a version that already exists, or the package is known not to compile at this head (`draft-compile-failed`); a `405` means GitHub says the branch is not mergeable — a conflict, or a required review that has not passed. The compile check is READ here, never run — it is started by `getDraftPullRequest` and can take minutes, so this call adds no compile latency. The consequence is that it refuses only a `failing` verdict already computed for this exact `expectedHeadSha`. `pending`, `unverified`, and a verdict this replica has not computed at all ALL allow the merge. Treat it as a guard against merging a known-broken package, not as a guarantee that a merged package compiled. **Authorization**: Requires the environment\'s `can_update_project` (enforced by the gateway) — a strictly higher bar than opening the pull request, because a merge changes what serves for the whole environment. **Git-backed drafts only.** A document-store draft answers `400` `draft-not-git-backed` before any call to the gateway: it has no branch, commits or pull request, so the operation does not apply to it. `409` `draft-provisioning` means the draft\'s branch is still being cut; retry.
|
|
6145
|
-
* @summary Merge the draft\'s pull request
|
|
6146
|
-
* @param {string} organizationName The unique identifier of the organization
|
|
6147
|
-
* @param {string} workspaceName The unique identifier of the workspace
|
|
6148
|
-
* @param {string} draftId The draft package identifier
|
|
6149
|
-
* @param {MergeDraftPullRequest} mergeDraftPullRequest
|
|
6150
|
-
* @param {*} [options] Override http request option.
|
|
6151
|
-
* @throws {RequiredError}
|
|
6152
|
-
*/
|
|
6153
|
-
updateDraftPullRequest(organizationName, workspaceName, draftId, mergeDraftPullRequest, options) {
|
|
6154
|
-
return localVarFp.updateDraftPullRequest(organizationName, workspaceName, draftId, mergeDraftPullRequest, options).then((request) => request(axios, basePath));
|
|
6155
|
-
},
|
|
6156
|
-
/**
|
|
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.
|
|
5917
|
+
* Asks for a checkpoint of the draft\'s current content. A `POST` to the collection rather than a `PUT` on a singleton: this starts a job and answers `202`, and the checkpoints it appends to are a series (`1.0.N`), not one value being set. Sending it twice is still safe — see the coalescing note below — but that is a property of the nudge, not a claim that the request is idempotent in the `PUT` sense. The current checkpoint\'s status is a separate read: `GET` on `../checkpoint`. Records that the draft\'s current content should be published as the next checkpoint (`1.0.N`) of its environment draft package — an ordinary published package named `draft-{draftKey}` in the draft\'s target environment, served by the Publisher exactly like any other package there (docs/workspace-architecture-design.md §4). Answers `202` with the current status: this call is a nudge, not the publish. A draft that is moving to the new store answers `409` `draft-converting` and records nothing; retry after a moment. The reconciler resolves the draft\'s current content itself when it collects the work — the draft\'s documents — which is why the request carries no ref and no content: a caller-supplied ref would be both spoofable and racy against the agent\'s own commits, and a nudge that arrives late still publishes what the draft says NOW. Nudges coalesce: any number recorded between publishes produce one checkpoint of the newest content, and a nudge whose content is identical to the latest published checkpoint publishes nothing. That is this operation\'s own contract, not something the verb supplies — a `POST` to a collection is not idempotent, so a retry after a lost response would otherwise mint a second checkpoint of content that has not changed. A failed publish (the draft does not compile, most commonly) records `failed` with the compiler\'s message and leaves the previous checkpoint serving; the next nudge retries with the then-current content. **This is also how a reaped draft package comes back.** A draft whose package has been idle-reaped (24 hours without a checkpoint request) keeps its row as a witness, and a nudge clears the reap marker and re-queues the publish — the same row update that publishes anything else, so no separate verb is needed. `GET` on this path reports `resurrectable` so a client knows to send one. A merge reap comes back the same way, but a client with the draft page open asks automatically: the app\'s own `POST` rebuilds the package unless the reap\'s own tick wins the race first — at `1.0.0` after the reap, or cancelling the reap and republishing into it. A package a resurrect brought back is a live draft again from there, so the ordinary idle sweep (24 hours since the *last checkpoint request*, not tied to a viewer leaving) reclaims it if nobody keeps asking. Either way a draft that outlives its merge (its close was skipped or its publish failed) can be nudged again, and any later nudge rebuilds it the same way: at `1.0.0` once the reap is deleting the package, or as the next `1.0.N` when the nudge lands before the reap starts and keeps it. Only a deleted draft\'s reap is terminal — its content has no home left — and a nudge for one is refused rather than honoured. **Authorization**: requires `can_update_document` on the draft document AND the target environment\'s `can_create_package` — the same two bars every content-writing draft operation already takes, so anyone modeling in the draft holds both.
|
|
6158
5918
|
* @summary Set the draft\'s checkpoint to its current content
|
|
6159
5919
|
* @param {string} organizationName The unique identifier of the organization
|
|
6160
5920
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
@@ -6166,7 +5926,7 @@ const DraftsApiFactory = function (configuration, basePath, axios) {
|
|
|
6166
5926
|
return localVarFp.writeDraftCheckpoint(organizationName, workspaceName, draftId, options).then((request) => request(axios, basePath));
|
|
6167
5927
|
},
|
|
6168
5928
|
/**
|
|
6169
|
-
* Creates or replaces a document
|
|
5929
|
+
* Creates or replaces a document. `PUT` rather than `POST` because the path is the identifier and the caller chooses it — there is no server-assigned id for a file, so a collection `POST` would have nothing to assign. **The precondition is per file.** `expectedSha` (the `sha` the writer read) replaces the document only if it still holds that version, and `createOnly` creates it only if no document is there. Of two writers holding the same `sha` exactly one wins and the other gets `409` `draft-document-stale`, except that a resent write that already landed is answered as applied (below). They are mutually exclusive (`400` when both are sent). With neither, the write is last-writer-wins, as a write through the documents API has always been. A retry whose change is already in place (the content is current, or the file to delete is gone) is answered as applied, not as a conflict, so a lost response can be resent. A deletion of a gone file with an `expectedSha` counts as applied only when no write in the same set is still to land: a move whose old path was deleted or moved by someone else is stale (`\"\"`), not a second copy. The server requests the draft\'s checkpoint after the write commits, so a client does not request one itself. **Authorization** — `can_update_document` on the draft document, **and** `can_create_package` on the draft\'s target environment. The second is not redundant: `can_update_document` on a draft is satisfied by bare workspace membership, while a file written here reaches the environment on the draft author\'s next checkpoint, carrying the checkpointer\'s bar rather than the writer\'s. The environment comes from the draft\'s own manifest and is never a request field; a draft that names none is refused, since it could not be published either. Refuses with `400` (`draft-notebook-read-only`) when a document path ends `.malloynb` and the write would change it or add a new one to a draft that already has files. A `.malloynb` notebook in a draft is read-only: convert it to a `.malloy` notebook (the same name with `.malloy`, beside it) and edit that, or delete it. Writing identical content, or seeding an empty draft, is allowed, and so is a deletion.
|
|
6170
5930
|
* @summary Write one of a draft\'s documents
|
|
6171
5931
|
* @param {string} organizationName The unique identifier of the organization
|
|
6172
5932
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
@@ -6180,7 +5940,7 @@ const DraftsApiFactory = function (configuration, basePath, axios) {
|
|
|
6180
5940
|
return localVarFp.writeDraftDocument(organizationName, workspaceName, draftId, documentPath, draftDocumentWrite, options).then((request) => request(axios, basePath));
|
|
6181
5941
|
},
|
|
6182
5942
|
/**
|
|
6183
|
-
* Writes a data file\'s bytes — a Parquet, CSV, JSON or Excel (`.xlsx`) file a model reads — into the draft, creating it or replacing the draft\'s earlier upload at the same path. A data file lives beside the draft\'s text documents
|
|
5943
|
+
* Writes a data file\'s bytes — a Parquet, CSV, JSON or Excel (`.xlsx`) file a model reads — into the draft, creating it or replacing the draft\'s earlier upload at the same path. A data file lives beside the draft\'s text documents (docs/draft-data-file-upload-design.md). The body is the file itself, `application/octet-stream`, with `Content-Length` set; a chunked body without one is refused before it is read. Uploading over a data file the package\'s published version serves replaces it in the draft: the draft\'s checkpoint and its next publish carry the upload, and the published version keeps its copy until then. A path the draft holds as a small text document (a CSV the published version shipped, which a draft holds as text) moves: the upload is stored and the text copy removed, so the path lives in one place. `DELETE` on the document path deletes a data file, or — for one the draft inherits — records that the draft no longer carries it; `DELETE` on its `change` restores it to the published copy. Refusals, each with its `code`: - `400` `draft-data-file-body-unreadable`: the request body ended or failed before it was read through (a dropped connection, a truncating proxy). Nothing was written; send it again. - `400` `draft-data-file-invalid`: the path holds a character outside Malloy\'s unquoted DuckDB path set `[A-Za-z0-9._~:/?#@!$&*+,=%-]`, such as a space, a bracket, a quote or an accented letter (a model can\'t name such a file in `duckdb.table(\'…\')`; the message names the path with accents dropped and each run of any other such character replaced by `_`, which the app uploads to instead), or ends in `.txt` (DuckDB has no reader for that extension; rename it `.csv` or `.tsv`), or ends in any other extension outside the formats a model reads as data: `.csv`, `.tsv`, `.parquet`, `.xlsx`, `.json`, `.jsonl`, `.ndjson`, and `.csv.gz`, `.tsv.gz`, `.json.gz`, `.jsonl.gz`, `.ndjson.gz` (an `.xls` is told to save as `.xlsx`). Decided by the path, before the body is read. - `409` `draft-content-not-data`: the path names a file the package treats as text (`publisher.json`, `.malloy`, `.malloynb`, `.md`, `.html`, or a `.json` at the package root). Those are written through `writeDraftDocument`. - `411` `draft-data-file-length-required`: the request declared no `Content-Length`. - `413` `draft-data-file-too-large`: over 32 MiB. - `413` `draft-data-files-over-quota`: the draft would hold more than 64 data files or 128 MiB of them. - `422` `draft-data-file-invalid`: a `.parquet` or `.xlsx` path whose bytes are not that format, or an empty body. - `429` `draft-data-file-rate-limited`: more than 30 uploads into this draft in the last minute, or more uploads in flight on the serving replica than it spools at once (8). Both are counted per replica. Retry after a moment. **Authorization** — the same pair `writeDraftDocument` takes: `can_update_document` on the draft document, and `can_create_package` on the draft\'s target environment.
|
|
6184
5944
|
* @summary Upload a data file into a draft
|
|
6185
5945
|
* @param {string} organizationName The unique identifier of the organization
|
|
6186
5946
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
@@ -6194,7 +5954,7 @@ const DraftsApiFactory = function (configuration, basePath, axios) {
|
|
|
6194
5954
|
return localVarFp.writeDraftDocumentContent(organizationName, workspaceName, draftId, documentPath, body, options).then((request) => request(axios, basePath));
|
|
6195
5955
|
},
|
|
6196
5956
|
/**
|
|
6197
|
-
* Writes a set of documents together
|
|
5957
|
+
* Writes a set of documents together, in one transaction: a seed, or a multi-file edit that must not be seen half applied. Ordinary editing uses the per-document `PUT`. This is for the cases that are atomic by nature. Each member may carry its own `expectedSha` or `createOnly` (see `writeDraftDocument`), so a move is one set: `createOnly` on the new path and a deletion with `expectedSha` on the old one. If any member\'s precondition fails, none is written and the `409` `draft-document-stale` names every conflicting path; a set already partly in place (a resent one) commits only what remains. **Authorization**: as `writeDraftDocument`. **Resolving conflicts.** A member carrying the `conflictSha` that `getDraftConflicts` gave its path resolves that one conflict: the path leaves the conflict list and its base moves to the incoming side, so the next sync does not raise it again. With no content and no `deleted` the member keeps the draft\'s file as it is (an uploaded data file too), and only the conflict is cleared. Members without a `conflictSha` write as usual, and a write may resolve any subset of the list. A `conflictSha` that no longer names the path\'s conflict (the incoming side moved, or it was resolved) is `409` `draft-conflict-changed`, and nothing is written. Once none remain, the draft moves on to what came in, and a submitted draft\'s push starts. A resolution never fails on an archive: when the published version the last conflicts came from cannot be read, the draft\'s next sync moves its base instead. **Fenced by a work item.** A caller executing a work item (one claimed through the controlplane\'s private work-item API) sends its claim in `Work-Item-Claim` (`{id}@{generation}`). The claim is checked first thing in the transaction that writes the document rows, and refused with `409` `draft-write-fenced` -- writing nothing -- when it is no longer the live one: released, cancelled, or swept after its holder stopped heartbeating. A malformed header is a `400`. Without the header the write is unfenced, as before. Only this operation honors the header. Refuses with `400` (`draft-notebook-read-only`) when a document path ends `.malloynb` and the write would change it or add a new one to a draft that already has files. A `.malloynb` notebook in a draft is read-only: convert it to a `.malloy` notebook (the same name with `.malloy`, beside it) and edit that, or delete it. Writing identical content, or seeding an empty draft, is allowed, and so is a deletion.
|
|
6198
5958
|
* @summary Write several of a draft\'s documents as one change
|
|
6199
5959
|
* @param {string} organizationName The unique identifier of the organization
|
|
6200
5960
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
@@ -6208,28 +5968,17 @@ const DraftsApiFactory = function (configuration, basePath, axios) {
|
|
|
6208
5968
|
return localVarFp.writeDraftDocuments(organizationName, workspaceName, draftId, draftDocumentsWrite, workItemClaim, options).then((request) => request(axios, basePath));
|
|
6209
5969
|
},
|
|
6210
5970
|
/**
|
|
6211
|
-
*
|
|
6212
|
-
* @summary Publish
|
|
6213
|
-
* @param {string} organizationName The unique identifier of the organization
|
|
6214
|
-
* @param {string} workspaceName The unique identifier of the workspace
|
|
6215
|
-
* @param {string} draftId The draft package identifier
|
|
6216
|
-
* @param {*} [options] Override http request option.
|
|
6217
|
-
* @throws {RequiredError}
|
|
6218
|
-
*/
|
|
6219
|
-
writeDraftPublication(organizationName, workspaceName, draftId, options) {
|
|
6220
|
-
return localVarFp.writeDraftPublication(organizationName, workspaceName, draftId, options).then((request) => request(axios, basePath));
|
|
6221
|
-
},
|
|
6222
|
-
/**
|
|
6223
|
-
* Proxies the code-assist git-gateway\'s `createDraftPullRequest`, forwarding the caller\'s own bearer token exactly as the History operations do. The gateway remains the sole authorizer; this endpoint performs no authorization of its own. Idempotent — an already-open pull request for this draft comes back rather than a second one. **Not a pure proxy: this call can sync and retry on your behalf.** A draft whose package already exists on the base branch — most commonly because this draft\'s own earlier pull request already merged it — is refused `409 draft-behind-base` unless it can be shown to derive from the base branch\'s current tip. Rather than surfacing that refusal immediately, this endpoint calls `updateDraftBranch`\'s own implementation, which merges the base branch into the draft\'s branch and writes `metadata.git.package_base_sha` on the draft\'s manifest from what that sync proves, then retries the create exactly once. Only a second refusal (a real race, or a draft whose package belongs to another name entirely) reaches the caller as `409`. A `sync-conflict` or `sync-rejected` from that internal sync surfaces as its own clear refusal, naming the manual paths out (resolve on github.com, or start a fresh draft) — resolve it there, or call `updateDraftBranch` directly for the same outcome without going through this endpoint. **Authorization**: Requires the environment\'s `can_create_package` (enforced by the gateway) — proposing a change is the same authority as writing the draft. **Git-backed drafts only.** A document-store draft answers `400` `draft-not-git-backed` before any call to the gateway: it has no branch, commits or pull request, so the operation does not apply to it. `409` `draft-provisioning` means the draft\'s branch is still being cut; retry.
|
|
6224
|
-
* @summary Open a pull request for a git-backed draft
|
|
5971
|
+
* The one way a draft ships, whether or not its environment reviews drafts on GitHub. Either the draft\'s package is published and this answers `200` with it, or nothing is published and it answers `409` `draft-not-ready` with `details.reason` saying what it waits on. Call it again once that clears: every step is safe to repeat, and a repeat after a publish answers with the version already published. `getDraftPublication` reads the same gates without acting on them. **A draft whose environment does not review on GitHub** is published from its own files, in this order: 1. `conflicts`: the draft has unresolved conflicts (`details.conflictCount`). 2. `stale`: the package has a newer version than the one the draft is synced to; the background sync brings it in. 3. `building` / `build-failed`: the draft\'s latest content has no passing build from the last hour. A missing, pending or stale build is requested here and answers `building`; a failing one answers `build-failed`, with the compiler\'s message. 4. The publish, `createOrUpdatePackage` naming this draft. The body\'s `description` is written into the published `publisher.json`. A package that moved under the draft while it published answers `stale`. **A draft whose environment reviews on GitHub** merges its pull request and publishes the merge commit: 1. A draft whose pull request merged, and which has not changed since, goes straight to the publish (8). One edited after its merge is a new pull request. While a rebuild of a merged draft is pending this answers `building`: the build says whether it holds an edit. A rebuild that failed on the merged content still publishes the merge. One whose content cannot be compared answers `build-failed` when it failed to compile, and `building` when it failed on Credible\'s side, which this call asks to rebuild. 2. A push GitHub refused for good answers `push-refused`, with the reason in `details.pushError`: `data_files_only`, `no_changes`, `content_refused`, `review_outside_package`, `repository_too_large` or `push_refused`, until the draft\'s content changes, which sends it again (`repository_too_large` only fails again: see `push-refused` below). Otherwise a push is owed when the draft has never been sent, has changed since its last push, or the body\'s `title` / `description` differ from the pull request\'s; this call submits it. 3. `conflicts` (the draft\'s own, `details.conflictCount`) and `stale` (as above). 4. `sending` until the owed push lands and the pull request is open at it. 5. The build at the pull request\'s head must be a pass from the last hour. Otherwise this call asks for one, which posts the head\'s check run once it settles, and answers `building`, or `build-failed` for a failing one. 6. GitHub\'s mergeable state, as last recorded: `dirty` answers `pull-request-conflicts` (the draft\'s own conflicts are step 3\'s `conflicts`, so this one is resolved on GitHub), `draft` is read once more, as a press may follow a pull request marked ready, and answers `pull-request-draft` if it still is (or if GitHub cannot be read), and a state GitHub has not computed is read once more and otherwise answers `sending`. `blocked` with a passing build re-posts the head\'s passing check run, since a check run left from an earlier answer can be what blocks it, and goes on to the merge. `behind` alone does not refuse: the merge itself refuses a base branch that changed the package. 7. The package at the head is listed once and refused for what a publish cannot carry: `draft-publish-unreadable-file`, `draft-publish-too-large`, or `draft-publish-manifest-missing` (no `publisher.json`). 8. The pull request is merged at that head, confined to the package and only while the base branch has not changed the package since the draft\'s base, and the merge commit is published. GitHub refusing the merge answers `pull-request-blocked` (a required review or check is outstanding), a base branch that changed the package `stale`, a head that moved `sending`, and a pull request that changes files outside the package `push-refused` with `details.pushError` `review_outside_package`: a merge here never carries them onto the base branch, so they are reconciled on GitHub. A refusal because the pull request already merged (a second Publish racing the first) publishes that merge. Until the merge\'s version exists this answers `publishing` (the webhook or the merge record holds it, or GitHub\'s merge time is not read yet); call again, which never merges twice. **A successful publish closes the draft**, as the publish of a draft always has: the draft and its branch are deleted unless it changed meanwhile, a pull request is open on its branch, the publish created the package without attaching it to the workspace (`workspaceAttached: false`), or an agent sandbox turn is live on it. The close never fails this call; `publishedVersion` names the version published, or the existing one that already carries this merge. **Authorization**: the draft\'s modeling bar (`can_create_document` on the workspace, `can_create_package` on its environment) and `can_update_package` on a package that already exists; the publish itself re-checks them. `409` `draft-converting` means the draft is moving to the new store; retry. A `400` is the publish refusing the package itself (an archive it cannot read, a name it does not accept).
|
|
5972
|
+
* @summary Publish the draft
|
|
6225
5973
|
* @param {string} organizationName The unique identifier of the organization
|
|
6226
5974
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
6227
5975
|
* @param {string} draftId The draft package identifier
|
|
5976
|
+
* @param {DraftPublicationRequest} [draftPublicationRequest]
|
|
6228
5977
|
* @param {*} [options] Override http request option.
|
|
6229
5978
|
* @throws {RequiredError}
|
|
6230
5979
|
*/
|
|
6231
|
-
|
|
6232
|
-
return localVarFp.
|
|
5980
|
+
writeDraftPublication(organizationName, workspaceName, draftId, draftPublicationRequest, options) {
|
|
5981
|
+
return localVarFp.writeDraftPublication(organizationName, workspaceName, draftId, draftPublicationRequest, options).then((request) => request(axios, basePath));
|
|
6233
5982
|
},
|
|
6234
5983
|
};
|
|
6235
5984
|
};
|
|
@@ -6242,7 +5991,7 @@ exports.DraftsApiFactory = DraftsApiFactory;
|
|
|
6242
5991
|
*/
|
|
6243
5992
|
class DraftsApi extends base_1.BaseAPI {
|
|
6244
5993
|
/**
|
|
6245
|
-
* Mints a draft in this workspace and returns it. **Always creates**: a package can hold any number of drafts, one per chat by default, so a second request for the same `targetPackageName` mints a second draft rather than returning the first. Callers that want an existing draft list the workspace\'s drafts and open one by id. What keeps two writers off one draft is the draft\'s work-item claim, not uniqueness here.
|
|
5994
|
+
* Mints a draft in this workspace and returns it. **Always creates**: a package can hold any number of drafts, one per chat by default, so a second request for the same `targetPackageName` mints a second draft rather than returning the first. Callers that want an existing draft list the workspace\'s drafts and open one by id. What keeps two writers off one draft is the draft\'s work-item claim, not uniqueness here. Every draft is a document-store draft, in a git-enrolled environment as in any other: the draft\'s files are workspace documents, and git is only where a pushed draft goes for review. **`seedFromPublished` returns the draft already holding a published version\'s files**, in this one call: what opening a published package for editing takes, without a chat. Its refusals all come before the draft exists, and a seed that fails afterwards removes the draft; see the field. `201` with the new draft. **Authorization**: `can_create_document` in the workspace, and on every create the target environment\'s modeling bar (`can_create_package`, modeler or admin): putting a package in draft mode, or starting a new package\'s draft, is modeling work in that environment, and in a git-enrolled one creating the branch is a write into its repository. It is taken before anything is created; refused, it answers `403 draft-modeling-permission-required`.
|
|
6246
5995
|
* @summary Create a draft package
|
|
6247
5996
|
* @param {string} organizationName The unique identifier of the organization
|
|
6248
5997
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
@@ -6268,7 +6017,7 @@ class DraftsApi extends base_1.BaseAPI {
|
|
|
6268
6017
|
return (0, exports.DraftsApiFp)(this.configuration).deleteDraft(organizationName, workspaceName, draftId, options).then((request) => request(this.axios, this.basePath));
|
|
6269
6018
|
}
|
|
6270
6019
|
/**
|
|
6271
|
-
* Thin proxy to the code-assist git-gateway\'s `deleteDraft` — deletes the draft\'s branch in the managed monorepo
|
|
6020
|
+
* Thin proxy to the code-assist git-gateway\'s `deleteDraft` — deletes the draft\'s branch in the managed monorepo, forwarding the caller\'s own bearer token. **This is branch removal only — it does not delete the draft.** Deleting the draft is `DELETE` on the draft itself. Stays as the primitive operator tooling needs: `deleteDraft` deletes an untouched draft\'s branch at its seed commit on the server (docs/git-synced-modeling.md §7.2), so neither the app nor the agent needs to call this. See docs/tenant-offboarding-playbook.md, which prefers it over a raw GitHub call precisely because it carries the FGA check below. The close after a successful publish also deletes a draft\'s branch, but through the gateway directly rather than through this endpoint. **Authorization**: Requires write access to the draft\'s workspace (`can_create_document`) and `can_create_package` on the environment the draft targets, as deleting the draft does. The gateway re-checks the workspace relation. Idempotent, and deliberately not gated on the draft being git-backed, so a provisioning draft\'s half-cut branch can still be cleaned up.
|
|
6272
6021
|
* @summary Delete a git-backed draft\'s branch
|
|
6273
6022
|
* @param {string} organizationName The unique identifier of the organization
|
|
6274
6023
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
@@ -6281,29 +6030,29 @@ class DraftsApi extends base_1.BaseAPI {
|
|
|
6281
6030
|
return (0, exports.DraftsApiFp)(this.configuration).deleteDraftBranch(organizationName, workspaceName, draftId, options).then((request) => request(this.axios, this.basePath));
|
|
6282
6031
|
}
|
|
6283
6032
|
/**
|
|
6284
|
-
* Removes a document from the draft
|
|
6033
|
+
* Removes a document from the draft: it deletes the document row, only if it still holds the `sha` in `expectedSha` when one is sent, and unconditionally (and idempotently) otherwise. **Authorization**: as `writeDraftDocument`.
|
|
6285
6034
|
* @summary Delete one of a draft\'s documents
|
|
6286
6035
|
* @param {string} organizationName The unique identifier of the organization
|
|
6287
6036
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
6288
6037
|
* @param {string} draftId The draft package identifier
|
|
6289
6038
|
* @param {string} documentPath The document\'s path relative to the draft root
|
|
6290
|
-
* @param {string} [
|
|
6291
|
-
* @param {string} [
|
|
6039
|
+
* @param {string} [expectedSha] The `sha` the caller read the document at: the delete applies only if the document still holds that version, else `409` `draft-document-stale`; a file already gone counts as deleted when this is the whole request, so a lost response can be resent.
|
|
6040
|
+
* @param {string} [expectedRef] Deprecated: use `expectedSha`. A git branch head, refused with `400` when set: a draft has no commits to compare it against, and a caller that sends a precondition believes it holds one. Kept one release, so a client from before the document store is refused rather than written unconditionally; removed in the release after.
|
|
6292
6041
|
* @param {*} [options] Override http request option.
|
|
6293
6042
|
* @throws {RequiredError}
|
|
6294
6043
|
* @memberof DraftsApi
|
|
6295
6044
|
*/
|
|
6296
|
-
deleteDraftDocument(organizationName, workspaceName, draftId, documentPath,
|
|
6297
|
-
return (0, exports.DraftsApiFp)(this.configuration).deleteDraftDocument(organizationName, workspaceName, draftId, documentPath,
|
|
6045
|
+
deleteDraftDocument(organizationName, workspaceName, draftId, documentPath, expectedSha, expectedRef, options) {
|
|
6046
|
+
return (0, exports.DraftsApiFp)(this.configuration).deleteDraftDocument(organizationName, workspaceName, draftId, documentPath, expectedSha, expectedRef, options).then((request) => request(this.axios, this.basePath));
|
|
6298
6047
|
}
|
|
6299
6048
|
/**
|
|
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.
|
|
6049
|
+
* Discards the draft\'s change to one file, so the draft carries what its publication has at this path again. This is Restore, for any kind of file; after it the path has no `changeSincePublication` marker. `DELETE` on the document itself deletes the file instead — a different change, which this would undo. What it does follows the file\'s change marker, never whether a published copy can be read: - A data file: the draft\'s own upload or deletion is dropped. Where the draft\'s last publish shipped its own upload, the path returns to that upload; otherwise the published copy is inherited again, and a small UTF-8 file, which a draft holds as a document rather than inheriting, is written back as one. - A text file the draft added: deleted. - A text file the draft edited or deleted: the published copy written back. Answers as `getDraftDocument` with `ref=publication` does when that copy cannot be read (`404` `draft-file-not-in-publication`, `409`, `413`, `503`), changing nothing. `404` `draft-document-unchanged` when the draft has no change at this path — a data file the draft\'s last publish shipped and has not touched since included. Before any change is found, the comparison itself can be refused, with the answers a read of the baseline gives: `403` when the caller cannot read the package the draft is measured against, `409` `draft-publication-baseline-missing` when that baseline cannot be measured (a corrupt archive), and `503` `draft-changes-unavailable` when it could not be read. **Authorization** — the same pair `writeDraftDocument` takes.
|
|
6301
6050
|
* @summary Restore one of a draft\'s files to its published copy
|
|
6302
6051
|
* @param {string} organizationName The unique identifier of the organization
|
|
6303
6052
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
6304
6053
|
* @param {string} draftId The draft package identifier
|
|
6305
6054
|
* @param {string} documentPath The file\'s path relative to the draft root
|
|
6306
|
-
* @param {string} [expectedRef] Deprecated:
|
|
6055
|
+
* @param {string} [expectedRef] Deprecated: a restore takes no precondition. A git branch head, refused with `400` when set: a draft has no commits to compare it against, and a caller that sends a precondition believes it holds one. Kept one release, so a client from before the document store is refused rather than written unconditionally; removed in the release after.
|
|
6307
6056
|
* @param {*} [options] Override http request option.
|
|
6308
6057
|
* @throws {RequiredError}
|
|
6309
6058
|
* @memberof DraftsApi
|
|
@@ -6325,8 +6074,8 @@ class DraftsApi extends base_1.BaseAPI {
|
|
|
6325
6074
|
return (0, exports.DraftsApiFp)(this.configuration).getDraft(organizationName, workspaceName, draftId, options).then((request) => request(this.axios, this.basePath));
|
|
6326
6075
|
}
|
|
6327
6076
|
/**
|
|
6328
|
-
* The
|
|
6329
|
-
* @summary
|
|
6077
|
+
* The draft\'s capabilities, derived by the server from its environment and what its package has published. The same value `getDraft` carries as `capabilities`, for a caller that does not need the rest of the draft: it reads the draft\'s manifest, its review state and one published-version lookup, not the checkpoint or the files. A draft that is moving to the new store answers `409` `draft-converting`: retry. **Authorization**: requires read access to the draft document.
|
|
6078
|
+
* @summary What the draft\'s storage can do
|
|
6330
6079
|
* @param {string} organizationName The unique identifier of the organization
|
|
6331
6080
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
6332
6081
|
* @param {string} draftId The draft package identifier
|
|
@@ -6334,12 +6083,12 @@ class DraftsApi extends base_1.BaseAPI {
|
|
|
6334
6083
|
* @throws {RequiredError}
|
|
6335
6084
|
* @memberof DraftsApi
|
|
6336
6085
|
*/
|
|
6337
|
-
|
|
6338
|
-
return (0, exports.DraftsApiFp)(this.configuration).
|
|
6086
|
+
getDraftCapabilities(organizationName, workspaceName, draftId, options) {
|
|
6087
|
+
return (0, exports.DraftsApiFp)(this.configuration).getDraftCapabilities(organizationName, workspaceName, draftId, options).then((request) => request(this.axios, this.basePath));
|
|
6339
6088
|
}
|
|
6340
6089
|
/**
|
|
6341
|
-
*
|
|
6342
|
-
* @summary
|
|
6090
|
+
* Reports where the draft\'s environment package stands. Always answers `200`; `status` is `none` before the first checkpoint is requested, so a polling client does not treat absence as an error. **A pure read**, and the cheap one: this is what a client polls while a checkpoint is unsettled. It performs no write and starts no publish. This is a pure read. Resurrecting an idle-reaped draft package is a `POST` to `../checkpoints`, so that a publish into a live environment follows from an explicit request rather than from whichever tab last refreshed. `resurrectable` on the response says whether such a request would rebuild anything. **Authorization**: requires read access to the draft document, the same bar as the other draft reads.
|
|
6091
|
+
* @summary The draft\'s checkpoint status
|
|
6343
6092
|
* @param {string} organizationName The unique identifier of the organization
|
|
6344
6093
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
6345
6094
|
* @param {string} draftId The draft package identifier
|
|
@@ -6347,41 +6096,40 @@ class DraftsApi extends base_1.BaseAPI {
|
|
|
6347
6096
|
* @throws {RequiredError}
|
|
6348
6097
|
* @memberof DraftsApi
|
|
6349
6098
|
*/
|
|
6350
|
-
|
|
6351
|
-
return (0, exports.DraftsApiFp)(this.configuration).
|
|
6099
|
+
getDraftCheckpointStatus(organizationName, workspaceName, draftId, options) {
|
|
6100
|
+
return (0, exports.DraftsApiFp)(this.configuration).getDraftCheckpointStatus(organizationName, workspaceName, draftId, options).then((request) => request(this.axios, this.basePath));
|
|
6352
6101
|
}
|
|
6353
6102
|
/**
|
|
6354
|
-
*
|
|
6355
|
-
* @summary
|
|
6103
|
+
* One entry of `getDraftConflicts` with the incoming side\'s, the draft\'s and their common ancestor\'s version of the file, so the caller can reconcile them and write the result through `writeDraftDocuments` with the `conflictSha` this returns. **Authorization**: requires read access to the draft document, and `can_create_package` on the environment it targets: only a modeler can act on what this serves. `404` when the path has no conflict (it was resolved, or never conflicted).
|
|
6104
|
+
* @summary One conflicting file, with all three of its versions
|
|
6356
6105
|
* @param {string} organizationName The unique identifier of the organization
|
|
6357
6106
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
6358
6107
|
* @param {string} draftId The draft package identifier
|
|
6108
|
+
* @param {string} documentPath The conflicting file\'s path relative to the draft root, as `getDraftConflicts` lists it.
|
|
6359
6109
|
* @param {*} [options] Override http request option.
|
|
6360
6110
|
* @throws {RequiredError}
|
|
6361
6111
|
* @memberof DraftsApi
|
|
6362
6112
|
*/
|
|
6363
|
-
|
|
6364
|
-
return (0, exports.DraftsApiFp)(this.configuration).
|
|
6113
|
+
getDraftConflict(organizationName, workspaceName, draftId, documentPath, options) {
|
|
6114
|
+
return (0, exports.DraftsApiFp)(this.configuration).getDraftConflict(organizationName, workspaceName, draftId, documentPath, options).then((request) => request(this.axios, this.basePath));
|
|
6365
6115
|
}
|
|
6366
6116
|
/**
|
|
6367
|
-
*
|
|
6368
|
-
* @summary
|
|
6117
|
+
* A page of the draft\'s conflicts: every path both the draft and what came in changed since their common ancestor, where what came in is a newer published version of its package (the base moved) or a commit someone pushed to its pull request. A superset of what cannot merge on its own, because nothing here runs a merge. Ordered by `relpath`. Each entry says where its incoming side came from, and carries the `conflictSha` a resolution sends back through `writeDraftDocuments`, a member per file. `getDraftConflict` returns one file\'s three versions. An empty list means nothing waits on the author: what only one side changed is absorbed in the background. Conflicts never block editing or a Submit; a submitted draft\'s push waits for the last one to be resolved and then starts on its own. Served from controlplane\'s record alone: no file content, no archive read and no GitHub call. **Authorization**: requires read access to the draft document. `409` `draft-converting` means the draft is moving to the new store; retry.
|
|
6118
|
+
* @summary The files the draft and what came in both changed
|
|
6369
6119
|
* @param {string} organizationName The unique identifier of the organization
|
|
6370
6120
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
6371
6121
|
* @param {string} draftId The draft package identifier
|
|
6372
|
-
* @param {
|
|
6373
|
-
* @param {string} head The commit to compare TO. Same form as `base`.
|
|
6374
|
-
* @param {number} [limit] Maximum number of items to return. Use -1 or omit to return all results.
|
|
6122
|
+
* @param {number} [limit] Maximum number of items to return. Use -1 or omit to return all results. Valid values: -1 (all results) or 1–500.
|
|
6375
6123
|
* @param {number} [offset] Number of items to skip before starting to return results
|
|
6376
6124
|
* @param {*} [options] Override http request option.
|
|
6377
6125
|
* @throws {RequiredError}
|
|
6378
6126
|
* @memberof DraftsApi
|
|
6379
6127
|
*/
|
|
6380
|
-
|
|
6381
|
-
return (0, exports.DraftsApiFp)(this.configuration).
|
|
6128
|
+
getDraftConflicts(organizationName, workspaceName, draftId, limit, offset, options) {
|
|
6129
|
+
return (0, exports.DraftsApiFp)(this.configuration).getDraftConflicts(organizationName, workspaceName, draftId, limit, offset, options).then((request) => request(this.axios, this.basePath));
|
|
6382
6130
|
}
|
|
6383
6131
|
/**
|
|
6384
|
-
* The draft as it stands, as a package archive: its own files at its latest content, its uploaded data files, and the data files it inherits from the published version, minus any it deleted — the same layering its checkpoints and publishes use (docs/draft-data-file-upload-design.md §4.3), but built from the draft\'s current content rather than its last checkpoint, and with its own `publisher.json`. For working on the package locally. `409` `draft-
|
|
6132
|
+
* The draft as it stands, as a package archive: its own files at its latest content, its uploaded data files, and the data files it inherits from the published version, minus any it deleted — the same layering its checkpoints and publishes use (docs/draft-data-file-upload-design.md §4.3), but built from the draft\'s current content rather than its last checkpoint, and with its own `publisher.json`. For working on the package locally. `409` `draft-converting` while the draft is moving to the new store; `503` `draft-data-file-storage-unavailable` when an upload\'s object or the published archive could not be read. **Authorization**: requires read access to the draft document, and — when the draft\'s package has a published version, whose data files the zip would inherit — update access to the package, as downloading that version does (`getPackageVersionContent`). That check runs before the published archive is fetched, so a reader without it never causes that read.
|
|
6385
6133
|
* @summary Download a draft package as a zip
|
|
6386
6134
|
* @param {string} organizationName The unique identifier of the organization
|
|
6387
6135
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
@@ -6394,13 +6142,13 @@ class DraftsApi extends base_1.BaseAPI {
|
|
|
6394
6142
|
return (0, exports.DraftsApiFp)(this.configuration).getDraftContent(organizationName, workspaceName, draftId, options).then((request) => request(this.axios, this.basePath));
|
|
6395
6143
|
}
|
|
6396
6144
|
/**
|
|
6397
|
-
* One document\'s content
|
|
6145
|
+
* One document\'s content. `409` `draft-converting` while the draft is moving to the new store. Refuses with `413` (`draft-file-unreadable`) when the document is not readable as UTF-8 text under 1MB. That is a permanent refusal about the file\'s shape, not a transient failure: the same refusal stops a publish, so retrying achieves nothing until the file is removed or replaced. **`ref=publication`** reads the document as it is in the version the draft\'s `changeSincePublication` markers compare against. The baseline is resolved server-side, never taken from the caller: the stored archive of the draft\'s last published version, or — for one never published — of the version it was opened on. The answers, each distinct: - `200`: the file\'s content in that baseline. - `403`: the caller can read the draft but not the package whose stored archive is the baseline. Workspace access does not imply environment access, so this read also takes `can_read_package` on it. - `404` `draft-file-not-in-publication`: the baseline exists and does not hold this file. There is nothing to restore from it. - `409` `draft-publication-baseline-missing`: there is no baseline to read — a draft never published and opened on nothing, a publication recorded before baselines were, a published version with no stored archive, one whose archive is corrupt, or one that no longer holds what its publish recorded. Permanent until the draft publishes again. - `413` `draft-file-unreadable`: the baseline\'s copy is not UTF-8 text under 1MB. - `503` `draft-publication-unreadable`: the baseline exists but could not be read right now. Retryable. The content is the published archive\'s bytes decoded as UTF-8, so its SHA-256 is the hash the markers were computed from. A published file a draft cannot hold (binary, or 1 MiB and over) is inherited by the draft rather than held, so it is not in the baseline and answers `404`. **Authorization**: requires read access to the draft document.
|
|
6398
6146
|
* @summary Read one of a draft\'s documents
|
|
6399
6147
|
* @param {string} organizationName The unique identifier of the organization
|
|
6400
6148
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
6401
6149
|
* @param {string} draftId The draft package identifier
|
|
6402
6150
|
* @param {string} documentPath The document\'s path relative to the draft root
|
|
6403
|
-
* @param {string} [ref]
|
|
6151
|
+
* @param {string} [ref] The literal `publication` reads the file as it is in the draft\'s publication baseline — see the operation\'s description. It is matched exactly (lower case). Any other value is ignored: a draft keeps no commits to read at.
|
|
6404
6152
|
* @param {*} [options] Override http request option.
|
|
6405
6153
|
* @throws {RequiredError}
|
|
6406
6154
|
* @memberof DraftsApi
|
|
@@ -6409,7 +6157,7 @@ class DraftsApi extends base_1.BaseAPI {
|
|
|
6409
6157
|
return (0, exports.DraftsApiFp)(this.configuration).getDraftDocument(organizationName, workspaceName, draftId, documentPath, ref, options).then((request) => request(this.axios, this.basePath));
|
|
6410
6158
|
}
|
|
6411
6159
|
/**
|
|
6412
|
-
* The bytes of a file as the draft carries it: a text document\'s content, a data file\'s own upload, or otherwise the data file it inherits from the package\'s published version. So a download works the same on any file of the draft. A path the draft deleted answers `404`; `409` `draft-
|
|
6160
|
+
* The bytes of a file as the draft carries it: a text document\'s content, a data file\'s own upload, or otherwise the data file it inherits from the package\'s published version. So a download works the same on any file of the draft. A path the draft deleted answers `404`; `409` `draft-converting` while the draft is moving to the new store. A text document that cannot be served as text (1 MiB or more) answers `413` `draft-file-unreadable`, as `getDraftDocument` does. An uploaded data file never takes this path. **Authorization**: requires read access to the draft document. A data file the draft inherits also requires update access to the package, as downloading the published version does (`getPackageVersionContent`); the draft\'s own uploads do not. That check runs before the published archive is fetched, so a reader without it gets `403` for any path the draft itself does not hold, a missing one included.
|
|
6413
6161
|
* @summary Download one of a draft\'s files
|
|
6414
6162
|
* @param {string} organizationName The unique identifier of the organization
|
|
6415
6163
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
@@ -6423,8 +6171,8 @@ class DraftsApi extends base_1.BaseAPI {
|
|
|
6423
6171
|
return (0, exports.DraftsApiFp)(this.configuration).getDraftDocumentContent(organizationName, workspaceName, draftId, documentPath, options).then((request) => request(this.axios, this.basePath));
|
|
6424
6172
|
}
|
|
6425
6173
|
/**
|
|
6426
|
-
*
|
|
6427
|
-
* @summary
|
|
6174
|
+
* The gates `writeDraftPublication` applies, read without acting on any of them: no submit, no build request, no merge and no listing of the package on GitHub, so it costs database reads only. `ready` false comes with the `reason` the publish would answer now. `ready` true means every gate this read covers passed; the publish\'s own listing of the package at the pull request\'s head can still refuse it. `ready` says nothing about the caller: a reader who may not publish reads it too, and the publish refuses them `403`. A draft that is owed a push or a build reads `sending` or `building` here, and only `writeDraftPublication` starts them. A `blocked` pull request reads `pull-request-blocked` here even when the publish would re-post its check and merge. `warnings` are about what the publish would ship, not whether it can: today, that a first publish exposes every source (see `DraftPublicationWarning`). They are read only when `ready` is true, and are empty otherwise. **Authorization**: requires read access to the draft document. `409` `draft-converting` means the draft is moving to the new store; retry.
|
|
6175
|
+
* @summary Whether the draft can be published now
|
|
6428
6176
|
* @param {string} organizationName The unique identifier of the organization
|
|
6429
6177
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
6430
6178
|
* @param {string} draftId The draft package identifier
|
|
@@ -6432,42 +6180,39 @@ class DraftsApi extends base_1.BaseAPI {
|
|
|
6432
6180
|
* @throws {RequiredError}
|
|
6433
6181
|
* @memberof DraftsApi
|
|
6434
6182
|
*/
|
|
6435
|
-
|
|
6436
|
-
return (0, exports.DraftsApiFp)(this.configuration).
|
|
6183
|
+
getDraftPublication(organizationName, workspaceName, draftId, options) {
|
|
6184
|
+
return (0, exports.DraftsApiFp)(this.configuration).getDraftPublication(organizationName, workspaceName, draftId, options).then((request) => request(this.axios, this.basePath));
|
|
6437
6185
|
}
|
|
6438
6186
|
/**
|
|
6439
|
-
*
|
|
6440
|
-
* @summary
|
|
6187
|
+
* Served from controlplane\'s record of the draft and nothing else: no GitHub read and no side effect, so polling it costs controlplane\'s own reads only. Always answers `200` for a draft the caller can read. `state` is `none` when the draft has no pull request, and a draft whose environment does not review on GitHub answers `state: none`, `reviewState: notSubmitted`, so a polling client treats absence as an answer, not an error. `reviewState` says where the review stands and `nextAttemptAt` when it is next worked on; `unsubmittedChanges` says whether the draft has edits since its last push. Poll while `reviewState` is `sending` or a pull request is open, and stop otherwise. `mergeable` is GitHub\'s own verdict as last recorded and is `null` while GitHub is still computing it. Treat `null` as \"not yet known\" and re-read; never as \"not mergeable\". **Authorization**: requires read access to the draft document. `409` `draft-converting` means the draft is moving to the new store; retry.
|
|
6188
|
+
* @summary The draft\'s pull request and review state
|
|
6441
6189
|
* @param {string} organizationName The unique identifier of the organization
|
|
6442
6190
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
6443
6191
|
* @param {string} draftId The draft package identifier
|
|
6444
|
-
* @param {number} [limit]
|
|
6445
|
-
* @param {number} [offset]
|
|
6446
6192
|
* @param {*} [options] Override http request option.
|
|
6447
6193
|
* @throws {RequiredError}
|
|
6448
6194
|
* @memberof DraftsApi
|
|
6449
6195
|
*/
|
|
6450
|
-
|
|
6451
|
-
return (0, exports.DraftsApiFp)(this.configuration).
|
|
6196
|
+
getDraftPullRequest(organizationName, workspaceName, draftId, options) {
|
|
6197
|
+
return (0, exports.DraftsApiFp)(this.configuration).getDraftPullRequest(organizationName, workspaceName, draftId, options).then((request) => request(this.axios, this.basePath));
|
|
6452
6198
|
}
|
|
6453
6199
|
/**
|
|
6454
|
-
* The draft\'s files
|
|
6200
|
+
* The draft\'s files: the documents under `path` to `depth`, held as workspace documents. `409` `draft-converting` while the draft is moving to the new store. **Listed against the draft\'s last publication.** A draft is a package in draft mode, so a listing reports each document\'s `changeSincePublication` — added, modified, or unchanged — and includes the files the publication shipped that the draft has since deleted, as `removed` entries. A deletion is an edit like any other, and a page rendering the draft\'s files needs all of them from one read. A draft never published is measured against the published version it was opened on (the package\'s latest version when none was recorded), and only for a caller with read access to that package: the markers would otherwise name the package\'s published files, and their absence say which of them the draft leaves unchanged, to a reader who cannot read it. For such a caller the draft\'s own files are listed without markers, with `Changes-Unavailable`. A baseline that exists but cannot be measured or read (an archive that failed to download) is `Changes-Unavailable` too, never \"nothing to compare against\". A never-published draft of a package with no published version carries no markers and no removed entries. When the comparison cannot be made (a transient failure, or a publication recorded before its baseline existed), the listing is still returned, without markers, and says so with the `Changes-Unavailable` header rather than failing. Content is omitted from the listing unless `withContent=true`; otherwise read a document to get it. **Authorization**: requires read access to the draft document.
|
|
6455
6201
|
* @summary List a draft\'s documents
|
|
6456
6202
|
* @param {string} organizationName The unique identifier of the organization
|
|
6457
6203
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
6458
6204
|
* @param {string} draftId The draft package identifier
|
|
6459
6205
|
* @param {string} [path] Restrict the listing to this subtree, relative to the draft root.
|
|
6460
|
-
* @param {number} [depth] `1` lists only the
|
|
6461
|
-
* @param {
|
|
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.
|
|
6206
|
+
* @param {number} [depth] `1` lists only the files directly under `path`, as a file browser would. Omitted returns every file in the subtree, which is what a section listing wants. A draft\'s paths are flat, so neither returns directory entries.
|
|
6207
|
+
* @param {boolean} [withContent] Carry each document\'s content on its entry, so a caller that wants the whole draft makes one request rather than one per file. A document\'s text comes as `content`. A data file the draft holds beside its documents (`kind` `data`) carries neither, as in any listing. The listing is whole-draft or refused: past the same file-count and byte limits a checkpoint collects under, it answers `413` `draft-listing-too-large` rather than a partial one, and `limit` and `offset` do not lower what is read, only what is returned. Read the files one at a time instead.
|
|
6463
6208
|
* @param {number} [limit] Maximum number of items to return. Use -1 or omit to return all results.
|
|
6464
6209
|
* @param {number} [offset] Number of items to skip before starting to return results
|
|
6465
6210
|
* @param {*} [options] Override http request option.
|
|
6466
6211
|
* @throws {RequiredError}
|
|
6467
6212
|
* @memberof DraftsApi
|
|
6468
6213
|
*/
|
|
6469
|
-
listDraftDocuments(organizationName, workspaceName, draftId, path, depth,
|
|
6470
|
-
return (0, exports.DraftsApiFp)(this.configuration).listDraftDocuments(organizationName, workspaceName, draftId, path, depth,
|
|
6214
|
+
listDraftDocuments(organizationName, workspaceName, draftId, path, depth, withContent, limit, offset, options) {
|
|
6215
|
+
return (0, exports.DraftsApiFp)(this.configuration).listDraftDocuments(organizationName, workspaceName, draftId, path, depth, withContent, limit, offset, options).then((request) => request(this.axios, this.basePath));
|
|
6471
6216
|
}
|
|
6472
6217
|
/**
|
|
6473
6218
|
* The workspace\'s drafts, each as the same `Draft` the item endpoint returns. **This is how a surface finds drafts.** Before it existed the only way was to list every document in the workspace and filter on type and path prefix, which meant the sidebar, the scope chips and the edit-package flow each pulled every file of every draft in the workspace to render a handful of rows. Composed server-side, one query against the checkpoint rows rather than one request per draft. **Authorization**: requires read access to the workspace, and each draft is filtered to those the caller can read — the same two-stage bar `listDocuments` applies, since a draft\'s authorization object is still its manifest document.
|
|
@@ -6485,7 +6230,7 @@ class DraftsApi extends base_1.BaseAPI {
|
|
|
6485
6230
|
return (0, exports.DraftsApiFp)(this.configuration).listDrafts(organizationName, workspaceName, retired, limit, offset, options).then((request) => request(this.axios, this.basePath));
|
|
6486
6231
|
}
|
|
6487
6232
|
/**
|
|
6488
|
-
* Changes a draft\'s own fields. Every field is optional and an absent one is left alone. Its writers own different slices — a display name comes from a person, `publishedAs` from a publish
|
|
6233
|
+
* Changes a draft\'s own fields. Every field is optional and an absent one is left alone. Its writers own different slices — a display name comes from a person, `publishedAs` from a publish. The package name is not one of them once set: `targetPackageName` cannot change a draft\'s package (`409 draft-package-name-fixed`). A replacement would make each of them responsible for preserving the others\' fields. **A deleted or nonexistent draft answers 404 to a caller who can write its workspace**, and 403 to one who cannot, for the same reason `getDraft` does. **Authorization**: requires `can_update_document` on the draft document, and `can_create_package` on the environment it targets.
|
|
6489
6234
|
* @summary Update a draft package
|
|
6490
6235
|
* @param {string} organizationName The unique identifier of the organization
|
|
6491
6236
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
@@ -6499,34 +6244,7 @@ class DraftsApi extends base_1.BaseAPI {
|
|
|
6499
6244
|
return (0, exports.DraftsApiFp)(this.configuration).updateDraft(organizationName, workspaceName, draftId, draftUpdate, options).then((request) => request(this.axios, this.basePath));
|
|
6500
6245
|
}
|
|
6501
6246
|
/**
|
|
6502
|
-
*
|
|
6503
|
-
* @summary Move the draft\'s branch
|
|
6504
|
-
* @param {string} organizationName The unique identifier of the organization
|
|
6505
|
-
* @param {string} workspaceName The unique identifier of the workspace
|
|
6506
|
-
* @param {string} draftId The draft package identifier
|
|
6507
|
-
* @param {*} [options] Override http request option.
|
|
6508
|
-
* @throws {RequiredError}
|
|
6509
|
-
* @memberof DraftsApi
|
|
6510
|
-
*/
|
|
6511
|
-
updateDraftBranch(organizationName, workspaceName, draftId, options) {
|
|
6512
|
-
return (0, exports.DraftsApiFp)(this.configuration).updateDraftBranch(organizationName, workspaceName, draftId, options).then((request) => request(this.axios, this.basePath));
|
|
6513
|
-
}
|
|
6514
|
-
/**
|
|
6515
|
-
* Advances the pull request\'s state. Merging is a transition of the pull request, not an action filed under it — `PATCH` on the resource rather than a `/merge` verb in the path, which is what every other resource in this API does. Proxies the git-gateway\'s `mergeDraftPullRequest`. Squash-merges into the base branch and returns the merge commit SHA, which becomes the published version\'s `git_commit_sha` — the first provenance anchor reachable from the base branch. `expectedHeadSha` is required and pins what is merged to what the caller read, so a checkpoint that landed after the review cannot be merged silently. Read it from `getDraftPullRequest` and pass it straight back. A `409` means the head moved, the pull request is gone, `publisher.json` names a version that already exists, or the package is known not to compile at this head (`draft-compile-failed`); a `405` means GitHub says the branch is not mergeable — a conflict, or a required review that has not passed. The compile check is READ here, never run — it is started by `getDraftPullRequest` and can take minutes, so this call adds no compile latency. The consequence is that it refuses only a `failing` verdict already computed for this exact `expectedHeadSha`. `pending`, `unverified`, and a verdict this replica has not computed at all ALL allow the merge. Treat it as a guard against merging a known-broken package, not as a guarantee that a merged package compiled. **Authorization**: Requires the environment\'s `can_update_project` (enforced by the gateway) — a strictly higher bar than opening the pull request, because a merge changes what serves for the whole environment. **Git-backed drafts only.** A document-store draft answers `400` `draft-not-git-backed` before any call to the gateway: it has no branch, commits or pull request, so the operation does not apply to it. `409` `draft-provisioning` means the draft\'s branch is still being cut; retry.
|
|
6516
|
-
* @summary Merge the draft\'s pull request
|
|
6517
|
-
* @param {string} organizationName The unique identifier of the organization
|
|
6518
|
-
* @param {string} workspaceName The unique identifier of the workspace
|
|
6519
|
-
* @param {string} draftId The draft package identifier
|
|
6520
|
-
* @param {MergeDraftPullRequest} mergeDraftPullRequest
|
|
6521
|
-
* @param {*} [options] Override http request option.
|
|
6522
|
-
* @throws {RequiredError}
|
|
6523
|
-
* @memberof DraftsApi
|
|
6524
|
-
*/
|
|
6525
|
-
updateDraftPullRequest(organizationName, workspaceName, draftId, mergeDraftPullRequest, options) {
|
|
6526
|
-
return (0, exports.DraftsApiFp)(this.configuration).updateDraftPullRequest(organizationName, workspaceName, draftId, mergeDraftPullRequest, options).then((request) => request(this.axios, this.basePath));
|
|
6527
|
-
}
|
|
6528
|
-
/**
|
|
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.
|
|
6247
|
+
* Asks for a checkpoint of the draft\'s current content. A `POST` to the collection rather than a `PUT` on a singleton: this starts a job and answers `202`, and the checkpoints it appends to are a series (`1.0.N`), not one value being set. Sending it twice is still safe — see the coalescing note below — but that is a property of the nudge, not a claim that the request is idempotent in the `PUT` sense. The current checkpoint\'s status is a separate read: `GET` on `../checkpoint`. Records that the draft\'s current content should be published as the next checkpoint (`1.0.N`) of its environment draft package — an ordinary published package named `draft-{draftKey}` in the draft\'s target environment, served by the Publisher exactly like any other package there (docs/workspace-architecture-design.md §4). Answers `202` with the current status: this call is a nudge, not the publish. A draft that is moving to the new store answers `409` `draft-converting` and records nothing; retry after a moment. The reconciler resolves the draft\'s current content itself when it collects the work — the draft\'s documents — which is why the request carries no ref and no content: a caller-supplied ref would be both spoofable and racy against the agent\'s own commits, and a nudge that arrives late still publishes what the draft says NOW. Nudges coalesce: any number recorded between publishes produce one checkpoint of the newest content, and a nudge whose content is identical to the latest published checkpoint publishes nothing. That is this operation\'s own contract, not something the verb supplies — a `POST` to a collection is not idempotent, so a retry after a lost response would otherwise mint a second checkpoint of content that has not changed. A failed publish (the draft does not compile, most commonly) records `failed` with the compiler\'s message and leaves the previous checkpoint serving; the next nudge retries with the then-current content. **This is also how a reaped draft package comes back.** A draft whose package has been idle-reaped (24 hours without a checkpoint request) keeps its row as a witness, and a nudge clears the reap marker and re-queues the publish — the same row update that publishes anything else, so no separate verb is needed. `GET` on this path reports `resurrectable` so a client knows to send one. A merge reap comes back the same way, but a client with the draft page open asks automatically: the app\'s own `POST` rebuilds the package unless the reap\'s own tick wins the race first — at `1.0.0` after the reap, or cancelling the reap and republishing into it. A package a resurrect brought back is a live draft again from there, so the ordinary idle sweep (24 hours since the *last checkpoint request*, not tied to a viewer leaving) reclaims it if nobody keeps asking. Either way a draft that outlives its merge (its close was skipped or its publish failed) can be nudged again, and any later nudge rebuilds it the same way: at `1.0.0` once the reap is deleting the package, or as the next `1.0.N` when the nudge lands before the reap starts and keeps it. Only a deleted draft\'s reap is terminal — its content has no home left — and a nudge for one is refused rather than honoured. **Authorization**: requires `can_update_document` on the draft document AND the target environment\'s `can_create_package` — the same two bars every content-writing draft operation already takes, so anyone modeling in the draft holds both.
|
|
6530
6248
|
* @summary Set the draft\'s checkpoint to its current content
|
|
6531
6249
|
* @param {string} organizationName The unique identifier of the organization
|
|
6532
6250
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
@@ -6539,7 +6257,7 @@ class DraftsApi extends base_1.BaseAPI {
|
|
|
6539
6257
|
return (0, exports.DraftsApiFp)(this.configuration).writeDraftCheckpoint(organizationName, workspaceName, draftId, options).then((request) => request(this.axios, this.basePath));
|
|
6540
6258
|
}
|
|
6541
6259
|
/**
|
|
6542
|
-
* Creates or replaces a document
|
|
6260
|
+
* Creates or replaces a document. `PUT` rather than `POST` because the path is the identifier and the caller chooses it — there is no server-assigned id for a file, so a collection `POST` would have nothing to assign. **The precondition is per file.** `expectedSha` (the `sha` the writer read) replaces the document only if it still holds that version, and `createOnly` creates it only if no document is there. Of two writers holding the same `sha` exactly one wins and the other gets `409` `draft-document-stale`, except that a resent write that already landed is answered as applied (below). They are mutually exclusive (`400` when both are sent). With neither, the write is last-writer-wins, as a write through the documents API has always been. A retry whose change is already in place (the content is current, or the file to delete is gone) is answered as applied, not as a conflict, so a lost response can be resent. A deletion of a gone file with an `expectedSha` counts as applied only when no write in the same set is still to land: a move whose old path was deleted or moved by someone else is stale (`\"\"`), not a second copy. The server requests the draft\'s checkpoint after the write commits, so a client does not request one itself. **Authorization** — `can_update_document` on the draft document, **and** `can_create_package` on the draft\'s target environment. The second is not redundant: `can_update_document` on a draft is satisfied by bare workspace membership, while a file written here reaches the environment on the draft author\'s next checkpoint, carrying the checkpointer\'s bar rather than the writer\'s. The environment comes from the draft\'s own manifest and is never a request field; a draft that names none is refused, since it could not be published either. Refuses with `400` (`draft-notebook-read-only`) when a document path ends `.malloynb` and the write would change it or add a new one to a draft that already has files. A `.malloynb` notebook in a draft is read-only: convert it to a `.malloy` notebook (the same name with `.malloy`, beside it) and edit that, or delete it. Writing identical content, or seeding an empty draft, is allowed, and so is a deletion.
|
|
6543
6261
|
* @summary Write one of a draft\'s documents
|
|
6544
6262
|
* @param {string} organizationName The unique identifier of the organization
|
|
6545
6263
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
@@ -6554,7 +6272,7 @@ class DraftsApi extends base_1.BaseAPI {
|
|
|
6554
6272
|
return (0, exports.DraftsApiFp)(this.configuration).writeDraftDocument(organizationName, workspaceName, draftId, documentPath, draftDocumentWrite, options).then((request) => request(this.axios, this.basePath));
|
|
6555
6273
|
}
|
|
6556
6274
|
/**
|
|
6557
|
-
* Writes a data file\'s bytes — a Parquet, CSV, JSON or Excel (`.xlsx`) file a model reads — into the draft, creating it or replacing the draft\'s earlier upload at the same path. A data file lives beside the draft\'s text documents
|
|
6275
|
+
* Writes a data file\'s bytes — a Parquet, CSV, JSON or Excel (`.xlsx`) file a model reads — into the draft, creating it or replacing the draft\'s earlier upload at the same path. A data file lives beside the draft\'s text documents (docs/draft-data-file-upload-design.md). The body is the file itself, `application/octet-stream`, with `Content-Length` set; a chunked body without one is refused before it is read. Uploading over a data file the package\'s published version serves replaces it in the draft: the draft\'s checkpoint and its next publish carry the upload, and the published version keeps its copy until then. A path the draft holds as a small text document (a CSV the published version shipped, which a draft holds as text) moves: the upload is stored and the text copy removed, so the path lives in one place. `DELETE` on the document path deletes a data file, or — for one the draft inherits — records that the draft no longer carries it; `DELETE` on its `change` restores it to the published copy. Refusals, each with its `code`: - `400` `draft-data-file-body-unreadable`: the request body ended or failed before it was read through (a dropped connection, a truncating proxy). Nothing was written; send it again. - `400` `draft-data-file-invalid`: the path holds a character outside Malloy\'s unquoted DuckDB path set `[A-Za-z0-9._~:/?#@!$&*+,=%-]`, such as a space, a bracket, a quote or an accented letter (a model can\'t name such a file in `duckdb.table(\'…\')`; the message names the path with accents dropped and each run of any other such character replaced by `_`, which the app uploads to instead), or ends in `.txt` (DuckDB has no reader for that extension; rename it `.csv` or `.tsv`), or ends in any other extension outside the formats a model reads as data: `.csv`, `.tsv`, `.parquet`, `.xlsx`, `.json`, `.jsonl`, `.ndjson`, and `.csv.gz`, `.tsv.gz`, `.json.gz`, `.jsonl.gz`, `.ndjson.gz` (an `.xls` is told to save as `.xlsx`). Decided by the path, before the body is read. - `409` `draft-content-not-data`: the path names a file the package treats as text (`publisher.json`, `.malloy`, `.malloynb`, `.md`, `.html`, or a `.json` at the package root). Those are written through `writeDraftDocument`. - `411` `draft-data-file-length-required`: the request declared no `Content-Length`. - `413` `draft-data-file-too-large`: over 32 MiB. - `413` `draft-data-files-over-quota`: the draft would hold more than 64 data files or 128 MiB of them. - `422` `draft-data-file-invalid`: a `.parquet` or `.xlsx` path whose bytes are not that format, or an empty body. - `429` `draft-data-file-rate-limited`: more than 30 uploads into this draft in the last minute, or more uploads in flight on the serving replica than it spools at once (8). Both are counted per replica. Retry after a moment. **Authorization** — the same pair `writeDraftDocument` takes: `can_update_document` on the draft document, and `can_create_package` on the draft\'s target environment.
|
|
6558
6276
|
* @summary Upload a data file into a draft
|
|
6559
6277
|
* @param {string} organizationName The unique identifier of the organization
|
|
6560
6278
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
@@ -6569,7 +6287,7 @@ class DraftsApi extends base_1.BaseAPI {
|
|
|
6569
6287
|
return (0, exports.DraftsApiFp)(this.configuration).writeDraftDocumentContent(organizationName, workspaceName, draftId, documentPath, body, options).then((request) => request(this.axios, this.basePath));
|
|
6570
6288
|
}
|
|
6571
6289
|
/**
|
|
6572
|
-
* Writes a set of documents together
|
|
6290
|
+
* Writes a set of documents together, in one transaction: a seed, or a multi-file edit that must not be seen half applied. Ordinary editing uses the per-document `PUT`. This is for the cases that are atomic by nature. Each member may carry its own `expectedSha` or `createOnly` (see `writeDraftDocument`), so a move is one set: `createOnly` on the new path and a deletion with `expectedSha` on the old one. If any member\'s precondition fails, none is written and the `409` `draft-document-stale` names every conflicting path; a set already partly in place (a resent one) commits only what remains. **Authorization**: as `writeDraftDocument`. **Resolving conflicts.** A member carrying the `conflictSha` that `getDraftConflicts` gave its path resolves that one conflict: the path leaves the conflict list and its base moves to the incoming side, so the next sync does not raise it again. With no content and no `deleted` the member keeps the draft\'s file as it is (an uploaded data file too), and only the conflict is cleared. Members without a `conflictSha` write as usual, and a write may resolve any subset of the list. A `conflictSha` that no longer names the path\'s conflict (the incoming side moved, or it was resolved) is `409` `draft-conflict-changed`, and nothing is written. Once none remain, the draft moves on to what came in, and a submitted draft\'s push starts. A resolution never fails on an archive: when the published version the last conflicts came from cannot be read, the draft\'s next sync moves its base instead. **Fenced by a work item.** A caller executing a work item (one claimed through the controlplane\'s private work-item API) sends its claim in `Work-Item-Claim` (`{id}@{generation}`). The claim is checked first thing in the transaction that writes the document rows, and refused with `409` `draft-write-fenced` -- writing nothing -- when it is no longer the live one: released, cancelled, or swept after its holder stopped heartbeating. A malformed header is a `400`. Without the header the write is unfenced, as before. Only this operation honors the header. Refuses with `400` (`draft-notebook-read-only`) when a document path ends `.malloynb` and the write would change it or add a new one to a draft that already has files. A `.malloynb` notebook in a draft is read-only: convert it to a `.malloy` notebook (the same name with `.malloy`, beside it) and edit that, or delete it. Writing identical content, or seeding an empty draft, is allowed, and so is a deletion.
|
|
6573
6291
|
* @summary Write several of a draft\'s documents as one change
|
|
6574
6292
|
* @param {string} organizationName The unique identifier of the organization
|
|
6575
6293
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
@@ -6584,30 +6302,18 @@ class DraftsApi extends base_1.BaseAPI {
|
|
|
6584
6302
|
return (0, exports.DraftsApiFp)(this.configuration).writeDraftDocuments(organizationName, workspaceName, draftId, draftDocumentsWrite, workItemClaim, options).then((request) => request(this.axios, this.basePath));
|
|
6585
6303
|
}
|
|
6586
6304
|
/**
|
|
6587
|
-
*
|
|
6588
|
-
* @summary Publish
|
|
6589
|
-
* @param {string} organizationName The unique identifier of the organization
|
|
6590
|
-
* @param {string} workspaceName The unique identifier of the workspace
|
|
6591
|
-
* @param {string} draftId The draft package identifier
|
|
6592
|
-
* @param {*} [options] Override http request option.
|
|
6593
|
-
* @throws {RequiredError}
|
|
6594
|
-
* @memberof DraftsApi
|
|
6595
|
-
*/
|
|
6596
|
-
writeDraftPublication(organizationName, workspaceName, draftId, options) {
|
|
6597
|
-
return (0, exports.DraftsApiFp)(this.configuration).writeDraftPublication(organizationName, workspaceName, draftId, options).then((request) => request(this.axios, this.basePath));
|
|
6598
|
-
}
|
|
6599
|
-
/**
|
|
6600
|
-
* Proxies the code-assist git-gateway\'s `createDraftPullRequest`, forwarding the caller\'s own bearer token exactly as the History operations do. The gateway remains the sole authorizer; this endpoint performs no authorization of its own. Idempotent — an already-open pull request for this draft comes back rather than a second one. **Not a pure proxy: this call can sync and retry on your behalf.** A draft whose package already exists on the base branch — most commonly because this draft\'s own earlier pull request already merged it — is refused `409 draft-behind-base` unless it can be shown to derive from the base branch\'s current tip. Rather than surfacing that refusal immediately, this endpoint calls `updateDraftBranch`\'s own implementation, which merges the base branch into the draft\'s branch and writes `metadata.git.package_base_sha` on the draft\'s manifest from what that sync proves, then retries the create exactly once. Only a second refusal (a real race, or a draft whose package belongs to another name entirely) reaches the caller as `409`. A `sync-conflict` or `sync-rejected` from that internal sync surfaces as its own clear refusal, naming the manual paths out (resolve on github.com, or start a fresh draft) — resolve it there, or call `updateDraftBranch` directly for the same outcome without going through this endpoint. **Authorization**: Requires the environment\'s `can_create_package` (enforced by the gateway) — proposing a change is the same authority as writing the draft. **Git-backed drafts only.** A document-store draft answers `400` `draft-not-git-backed` before any call to the gateway: it has no branch, commits or pull request, so the operation does not apply to it. `409` `draft-provisioning` means the draft\'s branch is still being cut; retry.
|
|
6601
|
-
* @summary Open a pull request for a git-backed draft
|
|
6305
|
+
* The one way a draft ships, whether or not its environment reviews drafts on GitHub. Either the draft\'s package is published and this answers `200` with it, or nothing is published and it answers `409` `draft-not-ready` with `details.reason` saying what it waits on. Call it again once that clears: every step is safe to repeat, and a repeat after a publish answers with the version already published. `getDraftPublication` reads the same gates without acting on them. **A draft whose environment does not review on GitHub** is published from its own files, in this order: 1. `conflicts`: the draft has unresolved conflicts (`details.conflictCount`). 2. `stale`: the package has a newer version than the one the draft is synced to; the background sync brings it in. 3. `building` / `build-failed`: the draft\'s latest content has no passing build from the last hour. A missing, pending or stale build is requested here and answers `building`; a failing one answers `build-failed`, with the compiler\'s message. 4. The publish, `createOrUpdatePackage` naming this draft. The body\'s `description` is written into the published `publisher.json`. A package that moved under the draft while it published answers `stale`. **A draft whose environment reviews on GitHub** merges its pull request and publishes the merge commit: 1. A draft whose pull request merged, and which has not changed since, goes straight to the publish (8). One edited after its merge is a new pull request. While a rebuild of a merged draft is pending this answers `building`: the build says whether it holds an edit. A rebuild that failed on the merged content still publishes the merge. One whose content cannot be compared answers `build-failed` when it failed to compile, and `building` when it failed on Credible\'s side, which this call asks to rebuild. 2. A push GitHub refused for good answers `push-refused`, with the reason in `details.pushError`: `data_files_only`, `no_changes`, `content_refused`, `review_outside_package`, `repository_too_large` or `push_refused`, until the draft\'s content changes, which sends it again (`repository_too_large` only fails again: see `push-refused` below). Otherwise a push is owed when the draft has never been sent, has changed since its last push, or the body\'s `title` / `description` differ from the pull request\'s; this call submits it. 3. `conflicts` (the draft\'s own, `details.conflictCount`) and `stale` (as above). 4. `sending` until the owed push lands and the pull request is open at it. 5. The build at the pull request\'s head must be a pass from the last hour. Otherwise this call asks for one, which posts the head\'s check run once it settles, and answers `building`, or `build-failed` for a failing one. 6. GitHub\'s mergeable state, as last recorded: `dirty` answers `pull-request-conflicts` (the draft\'s own conflicts are step 3\'s `conflicts`, so this one is resolved on GitHub), `draft` is read once more, as a press may follow a pull request marked ready, and answers `pull-request-draft` if it still is (or if GitHub cannot be read), and a state GitHub has not computed is read once more and otherwise answers `sending`. `blocked` with a passing build re-posts the head\'s passing check run, since a check run left from an earlier answer can be what blocks it, and goes on to the merge. `behind` alone does not refuse: the merge itself refuses a base branch that changed the package. 7. The package at the head is listed once and refused for what a publish cannot carry: `draft-publish-unreadable-file`, `draft-publish-too-large`, or `draft-publish-manifest-missing` (no `publisher.json`). 8. The pull request is merged at that head, confined to the package and only while the base branch has not changed the package since the draft\'s base, and the merge commit is published. GitHub refusing the merge answers `pull-request-blocked` (a required review or check is outstanding), a base branch that changed the package `stale`, a head that moved `sending`, and a pull request that changes files outside the package `push-refused` with `details.pushError` `review_outside_package`: a merge here never carries them onto the base branch, so they are reconciled on GitHub. A refusal because the pull request already merged (a second Publish racing the first) publishes that merge. Until the merge\'s version exists this answers `publishing` (the webhook or the merge record holds it, or GitHub\'s merge time is not read yet); call again, which never merges twice. **A successful publish closes the draft**, as the publish of a draft always has: the draft and its branch are deleted unless it changed meanwhile, a pull request is open on its branch, the publish created the package without attaching it to the workspace (`workspaceAttached: false`), or an agent sandbox turn is live on it. The close never fails this call; `publishedVersion` names the version published, or the existing one that already carries this merge. **Authorization**: the draft\'s modeling bar (`can_create_document` on the workspace, `can_create_package` on its environment) and `can_update_package` on a package that already exists; the publish itself re-checks them. `409` `draft-converting` means the draft is moving to the new store; retry. A `400` is the publish refusing the package itself (an archive it cannot read, a name it does not accept).
|
|
6306
|
+
* @summary Publish the draft
|
|
6602
6307
|
* @param {string} organizationName The unique identifier of the organization
|
|
6603
6308
|
* @param {string} workspaceName The unique identifier of the workspace
|
|
6604
6309
|
* @param {string} draftId The draft package identifier
|
|
6310
|
+
* @param {DraftPublicationRequest} [draftPublicationRequest]
|
|
6605
6311
|
* @param {*} [options] Override http request option.
|
|
6606
6312
|
* @throws {RequiredError}
|
|
6607
6313
|
* @memberof DraftsApi
|
|
6608
6314
|
*/
|
|
6609
|
-
|
|
6610
|
-
return (0, exports.DraftsApiFp)(this.configuration).
|
|
6315
|
+
writeDraftPublication(organizationName, workspaceName, draftId, draftPublicationRequest, options) {
|
|
6316
|
+
return (0, exports.DraftsApiFp)(this.configuration).writeDraftPublication(organizationName, workspaceName, draftId, draftPublicationRequest, options).then((request) => request(this.axios, this.basePath));
|
|
6611
6317
|
}
|
|
6612
6318
|
}
|
|
6613
6319
|
exports.DraftsApi = DraftsApi;
|
|
@@ -9668,6 +9374,291 @@ class InvitesApi extends base_1.BaseAPI {
|
|
|
9668
9374
|
}
|
|
9669
9375
|
}
|
|
9670
9376
|
exports.InvitesApi = InvitesApi;
|
|
9377
|
+
/**
|
|
9378
|
+
* MarketplaceSignupsApi - axios parameter creator
|
|
9379
|
+
* @export
|
|
9380
|
+
*/
|
|
9381
|
+
const MarketplaceSignupsApiAxiosParamCreator = function (configuration) {
|
|
9382
|
+
return {
|
|
9383
|
+
/**
|
|
9384
|
+
* The signup URL a marketplace listing names. GCP Marketplace posts the buyer\'s browser here with `x-gcp-marketplace-token`, a JWT that expires five minutes after it is sent, so the request is forwarded to billing (`POST /private/marketplace-signups`) at once. The buyer is not signed in yet, so this path takes the POST unauthenticated; billing checks the token. The answer is a `303` to the signup app\'s `/marketplace` page, because the caller is a browser: with `#signup=<signupId>.<claim>&provider=<provider>` in the fragment when billing records the signup (`provider` is the marketplace, `gcp`), or `#error=<code>` when it refuses it (`SIGNUP_USED` for a token already used, where a cell consumes each once) or cannot be reached (`BILLING_UNAVAILABLE`). A fragment is never sent to a server, so the claim stays out of every log. A deployment with no signup page configured answers `503 MARKETPLACE_OFF` instead. Only `x-gcp-marketplace-token` is read, and only up to 8 KB: a missing or longer token is `#error=INVALID_SIGNUP` without a call to billing. Any other field the form carries is ignored.
|
|
9385
|
+
* @summary Receive a buyer sent by a cloud marketplace
|
|
9386
|
+
* @param {string} [xGcpMarketplaceToken] GCP Marketplace\\\'s signed signup token.
|
|
9387
|
+
* @param {*} [options] Override http request option.
|
|
9388
|
+
* @throws {RequiredError}
|
|
9389
|
+
*/
|
|
9390
|
+
createMarketplaceSignup: (xGcpMarketplaceToken_1, ...args_1) => __awaiter(this, [xGcpMarketplaceToken_1, ...args_1], void 0, function* (xGcpMarketplaceToken, options = {}) {
|
|
9391
|
+
const localVarPath = `/marketplace-signups`;
|
|
9392
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
9393
|
+
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
9394
|
+
let baseOptions;
|
|
9395
|
+
if (configuration) {
|
|
9396
|
+
baseOptions = configuration.baseOptions;
|
|
9397
|
+
}
|
|
9398
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
|
|
9399
|
+
const localVarHeaderParameter = {};
|
|
9400
|
+
const localVarQueryParameter = {};
|
|
9401
|
+
const localVarFormParams = new URLSearchParams();
|
|
9402
|
+
if (xGcpMarketplaceToken !== undefined) {
|
|
9403
|
+
localVarFormParams.set('x-gcp-marketplace-token', xGcpMarketplaceToken);
|
|
9404
|
+
}
|
|
9405
|
+
localVarHeaderParameter['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
9406
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
9407
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
9408
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
9409
|
+
localVarRequestOptions.data = localVarFormParams.toString();
|
|
9410
|
+
return {
|
|
9411
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
9412
|
+
options: localVarRequestOptions,
|
|
9413
|
+
};
|
|
9414
|
+
}),
|
|
9415
|
+
};
|
|
9416
|
+
};
|
|
9417
|
+
exports.MarketplaceSignupsApiAxiosParamCreator = MarketplaceSignupsApiAxiosParamCreator;
|
|
9418
|
+
/**
|
|
9419
|
+
* MarketplaceSignupsApi - functional programming interface
|
|
9420
|
+
* @export
|
|
9421
|
+
*/
|
|
9422
|
+
const MarketplaceSignupsApiFp = function (configuration) {
|
|
9423
|
+
const localVarAxiosParamCreator = (0, exports.MarketplaceSignupsApiAxiosParamCreator)(configuration);
|
|
9424
|
+
return {
|
|
9425
|
+
/**
|
|
9426
|
+
* The signup URL a marketplace listing names. GCP Marketplace posts the buyer\'s browser here with `x-gcp-marketplace-token`, a JWT that expires five minutes after it is sent, so the request is forwarded to billing (`POST /private/marketplace-signups`) at once. The buyer is not signed in yet, so this path takes the POST unauthenticated; billing checks the token. The answer is a `303` to the signup app\'s `/marketplace` page, because the caller is a browser: with `#signup=<signupId>.<claim>&provider=<provider>` in the fragment when billing records the signup (`provider` is the marketplace, `gcp`), or `#error=<code>` when it refuses it (`SIGNUP_USED` for a token already used, where a cell consumes each once) or cannot be reached (`BILLING_UNAVAILABLE`). A fragment is never sent to a server, so the claim stays out of every log. A deployment with no signup page configured answers `503 MARKETPLACE_OFF` instead. Only `x-gcp-marketplace-token` is read, and only up to 8 KB: a missing or longer token is `#error=INVALID_SIGNUP` without a call to billing. Any other field the form carries is ignored.
|
|
9427
|
+
* @summary Receive a buyer sent by a cloud marketplace
|
|
9428
|
+
* @param {string} [xGcpMarketplaceToken] GCP Marketplace\\\'s signed signup token.
|
|
9429
|
+
* @param {*} [options] Override http request option.
|
|
9430
|
+
* @throws {RequiredError}
|
|
9431
|
+
*/
|
|
9432
|
+
createMarketplaceSignup(xGcpMarketplaceToken, options) {
|
|
9433
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
9434
|
+
var _a, _b, _c;
|
|
9435
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.createMarketplaceSignup(xGcpMarketplaceToken, options);
|
|
9436
|
+
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
9437
|
+
const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['MarketplaceSignupsApi.createMarketplaceSignup']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
|
|
9438
|
+
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
9439
|
+
});
|
|
9440
|
+
},
|
|
9441
|
+
};
|
|
9442
|
+
};
|
|
9443
|
+
exports.MarketplaceSignupsApiFp = MarketplaceSignupsApiFp;
|
|
9444
|
+
/**
|
|
9445
|
+
* MarketplaceSignupsApi - factory interface
|
|
9446
|
+
* @export
|
|
9447
|
+
*/
|
|
9448
|
+
const MarketplaceSignupsApiFactory = function (configuration, basePath, axios) {
|
|
9449
|
+
const localVarFp = (0, exports.MarketplaceSignupsApiFp)(configuration);
|
|
9450
|
+
return {
|
|
9451
|
+
/**
|
|
9452
|
+
* The signup URL a marketplace listing names. GCP Marketplace posts the buyer\'s browser here with `x-gcp-marketplace-token`, a JWT that expires five minutes after it is sent, so the request is forwarded to billing (`POST /private/marketplace-signups`) at once. The buyer is not signed in yet, so this path takes the POST unauthenticated; billing checks the token. The answer is a `303` to the signup app\'s `/marketplace` page, because the caller is a browser: with `#signup=<signupId>.<claim>&provider=<provider>` in the fragment when billing records the signup (`provider` is the marketplace, `gcp`), or `#error=<code>` when it refuses it (`SIGNUP_USED` for a token already used, where a cell consumes each once) or cannot be reached (`BILLING_UNAVAILABLE`). A fragment is never sent to a server, so the claim stays out of every log. A deployment with no signup page configured answers `503 MARKETPLACE_OFF` instead. Only `x-gcp-marketplace-token` is read, and only up to 8 KB: a missing or longer token is `#error=INVALID_SIGNUP` without a call to billing. Any other field the form carries is ignored.
|
|
9453
|
+
* @summary Receive a buyer sent by a cloud marketplace
|
|
9454
|
+
* @param {string} [xGcpMarketplaceToken] GCP Marketplace\\\'s signed signup token.
|
|
9455
|
+
* @param {*} [options] Override http request option.
|
|
9456
|
+
* @throws {RequiredError}
|
|
9457
|
+
*/
|
|
9458
|
+
createMarketplaceSignup(xGcpMarketplaceToken, options) {
|
|
9459
|
+
return localVarFp.createMarketplaceSignup(xGcpMarketplaceToken, options).then((request) => request(axios, basePath));
|
|
9460
|
+
},
|
|
9461
|
+
};
|
|
9462
|
+
};
|
|
9463
|
+
exports.MarketplaceSignupsApiFactory = MarketplaceSignupsApiFactory;
|
|
9464
|
+
/**
|
|
9465
|
+
* MarketplaceSignupsApi - object-oriented interface
|
|
9466
|
+
* @export
|
|
9467
|
+
* @class MarketplaceSignupsApi
|
|
9468
|
+
* @extends {BaseAPI}
|
|
9469
|
+
*/
|
|
9470
|
+
class MarketplaceSignupsApi extends base_1.BaseAPI {
|
|
9471
|
+
/**
|
|
9472
|
+
* The signup URL a marketplace listing names. GCP Marketplace posts the buyer\'s browser here with `x-gcp-marketplace-token`, a JWT that expires five minutes after it is sent, so the request is forwarded to billing (`POST /private/marketplace-signups`) at once. The buyer is not signed in yet, so this path takes the POST unauthenticated; billing checks the token. The answer is a `303` to the signup app\'s `/marketplace` page, because the caller is a browser: with `#signup=<signupId>.<claim>&provider=<provider>` in the fragment when billing records the signup (`provider` is the marketplace, `gcp`), or `#error=<code>` when it refuses it (`SIGNUP_USED` for a token already used, where a cell consumes each once) or cannot be reached (`BILLING_UNAVAILABLE`). A fragment is never sent to a server, so the claim stays out of every log. A deployment with no signup page configured answers `503 MARKETPLACE_OFF` instead. Only `x-gcp-marketplace-token` is read, and only up to 8 KB: a missing or longer token is `#error=INVALID_SIGNUP` without a call to billing. Any other field the form carries is ignored.
|
|
9473
|
+
* @summary Receive a buyer sent by a cloud marketplace
|
|
9474
|
+
* @param {string} [xGcpMarketplaceToken] GCP Marketplace\\\'s signed signup token.
|
|
9475
|
+
* @param {*} [options] Override http request option.
|
|
9476
|
+
* @throws {RequiredError}
|
|
9477
|
+
* @memberof MarketplaceSignupsApi
|
|
9478
|
+
*/
|
|
9479
|
+
createMarketplaceSignup(xGcpMarketplaceToken, options) {
|
|
9480
|
+
return (0, exports.MarketplaceSignupsApiFp)(this.configuration).createMarketplaceSignup(xGcpMarketplaceToken, options).then((request) => request(this.axios, this.basePath));
|
|
9481
|
+
}
|
|
9482
|
+
}
|
|
9483
|
+
exports.MarketplaceSignupsApi = MarketplaceSignupsApi;
|
|
9484
|
+
/**
|
|
9485
|
+
* MarketplaceSubscriptionsApi - axios parameter creator
|
|
9486
|
+
* @export
|
|
9487
|
+
*/
|
|
9488
|
+
const MarketplaceSubscriptionsApiAxiosParamCreator = function (configuration) {
|
|
9489
|
+
return {
|
|
9490
|
+
/**
|
|
9491
|
+
* The organization\'s latest purchase through a cloud marketplace, as billing has it. 404 when the organization is not billed through a marketplace. **Authorization**: `can_read_organization`.
|
|
9492
|
+
* @summary The organization\'s marketplace subscription
|
|
9493
|
+
* @param {string} organizationName The organization\'s name
|
|
9494
|
+
* @param {*} [options] Override http request option.
|
|
9495
|
+
* @throws {RequiredError}
|
|
9496
|
+
*/
|
|
9497
|
+
getOrganizationMarketplaceSubscription: (organizationName_1, ...args_1) => __awaiter(this, [organizationName_1, ...args_1], void 0, function* (organizationName, options = {}) {
|
|
9498
|
+
// verify required parameter 'organizationName' is not null or undefined
|
|
9499
|
+
(0, common_1.assertParamExists)('getOrganizationMarketplaceSubscription', 'organizationName', organizationName);
|
|
9500
|
+
const localVarPath = `/organizations/{organizationName}/marketplace-subscription`
|
|
9501
|
+
.replace(`{${"organizationName"}}`, encodeURIComponent(String(organizationName)));
|
|
9502
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
9503
|
+
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
9504
|
+
let baseOptions;
|
|
9505
|
+
if (configuration) {
|
|
9506
|
+
baseOptions = configuration.baseOptions;
|
|
9507
|
+
}
|
|
9508
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
|
|
9509
|
+
const localVarHeaderParameter = {};
|
|
9510
|
+
const localVarQueryParameter = {};
|
|
9511
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
9512
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
9513
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
9514
|
+
return {
|
|
9515
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
9516
|
+
options: localVarRequestOptions,
|
|
9517
|
+
};
|
|
9518
|
+
}),
|
|
9519
|
+
/**
|
|
9520
|
+
* For a buyer who already administers an organization: attaches the marketplace signup they came with (the `signupId` and `claim` from the signup app\'s fragment) to this organization. Billing consumes the claim and approves the purchase; once the subscription is ACTIVE the organization is billed through the marketplace, without the self-serve limits or an LLM spend cap. Until then it keeps how it is billed, self-serve cap included. A purchase that is already suspended or ended records nothing, and one that is suspended or ends before it was ever ACTIVE puts the organization back to how it was billed: an attached organization is never frozen for a subscription that never started. **Authorization**: `active_admin` on the organization.
|
|
9521
|
+
* @summary Bill an existing organization through the buyer\'s marketplace purchase
|
|
9522
|
+
* @param {string} organizationName The organization\'s name
|
|
9523
|
+
* @param {MarketplaceSubscriptionLink} marketplaceSubscriptionLink
|
|
9524
|
+
* @param {*} [options] Override http request option.
|
|
9525
|
+
* @throws {RequiredError}
|
|
9526
|
+
*/
|
|
9527
|
+
putOrganizationMarketplaceSubscription: (organizationName_1, marketplaceSubscriptionLink_1, ...args_1) => __awaiter(this, [organizationName_1, marketplaceSubscriptionLink_1, ...args_1], void 0, function* (organizationName, marketplaceSubscriptionLink, options = {}) {
|
|
9528
|
+
// verify required parameter 'organizationName' is not null or undefined
|
|
9529
|
+
(0, common_1.assertParamExists)('putOrganizationMarketplaceSubscription', 'organizationName', organizationName);
|
|
9530
|
+
// verify required parameter 'marketplaceSubscriptionLink' is not null or undefined
|
|
9531
|
+
(0, common_1.assertParamExists)('putOrganizationMarketplaceSubscription', 'marketplaceSubscriptionLink', marketplaceSubscriptionLink);
|
|
9532
|
+
const localVarPath = `/organizations/{organizationName}/marketplace-subscription`
|
|
9533
|
+
.replace(`{${"organizationName"}}`, encodeURIComponent(String(organizationName)));
|
|
9534
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
9535
|
+
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
9536
|
+
let baseOptions;
|
|
9537
|
+
if (configuration) {
|
|
9538
|
+
baseOptions = configuration.baseOptions;
|
|
9539
|
+
}
|
|
9540
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'PUT' }, baseOptions), options);
|
|
9541
|
+
const localVarHeaderParameter = {};
|
|
9542
|
+
const localVarQueryParameter = {};
|
|
9543
|
+
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
9544
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
9545
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
9546
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
9547
|
+
localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(marketplaceSubscriptionLink, localVarRequestOptions, configuration);
|
|
9548
|
+
return {
|
|
9549
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
9550
|
+
options: localVarRequestOptions,
|
|
9551
|
+
};
|
|
9552
|
+
}),
|
|
9553
|
+
};
|
|
9554
|
+
};
|
|
9555
|
+
exports.MarketplaceSubscriptionsApiAxiosParamCreator = MarketplaceSubscriptionsApiAxiosParamCreator;
|
|
9556
|
+
/**
|
|
9557
|
+
* MarketplaceSubscriptionsApi - functional programming interface
|
|
9558
|
+
* @export
|
|
9559
|
+
*/
|
|
9560
|
+
const MarketplaceSubscriptionsApiFp = function (configuration) {
|
|
9561
|
+
const localVarAxiosParamCreator = (0, exports.MarketplaceSubscriptionsApiAxiosParamCreator)(configuration);
|
|
9562
|
+
return {
|
|
9563
|
+
/**
|
|
9564
|
+
* The organization\'s latest purchase through a cloud marketplace, as billing has it. 404 when the organization is not billed through a marketplace. **Authorization**: `can_read_organization`.
|
|
9565
|
+
* @summary The organization\'s marketplace subscription
|
|
9566
|
+
* @param {string} organizationName The organization\'s name
|
|
9567
|
+
* @param {*} [options] Override http request option.
|
|
9568
|
+
* @throws {RequiredError}
|
|
9569
|
+
*/
|
|
9570
|
+
getOrganizationMarketplaceSubscription(organizationName, options) {
|
|
9571
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
9572
|
+
var _a, _b, _c;
|
|
9573
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.getOrganizationMarketplaceSubscription(organizationName, options);
|
|
9574
|
+
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
9575
|
+
const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['MarketplaceSubscriptionsApi.getOrganizationMarketplaceSubscription']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
|
|
9576
|
+
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
9577
|
+
});
|
|
9578
|
+
},
|
|
9579
|
+
/**
|
|
9580
|
+
* For a buyer who already administers an organization: attaches the marketplace signup they came with (the `signupId` and `claim` from the signup app\'s fragment) to this organization. Billing consumes the claim and approves the purchase; once the subscription is ACTIVE the organization is billed through the marketplace, without the self-serve limits or an LLM spend cap. Until then it keeps how it is billed, self-serve cap included. A purchase that is already suspended or ended records nothing, and one that is suspended or ends before it was ever ACTIVE puts the organization back to how it was billed: an attached organization is never frozen for a subscription that never started. **Authorization**: `active_admin` on the organization.
|
|
9581
|
+
* @summary Bill an existing organization through the buyer\'s marketplace purchase
|
|
9582
|
+
* @param {string} organizationName The organization\'s name
|
|
9583
|
+
* @param {MarketplaceSubscriptionLink} marketplaceSubscriptionLink
|
|
9584
|
+
* @param {*} [options] Override http request option.
|
|
9585
|
+
* @throws {RequiredError}
|
|
9586
|
+
*/
|
|
9587
|
+
putOrganizationMarketplaceSubscription(organizationName, marketplaceSubscriptionLink, options) {
|
|
9588
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
9589
|
+
var _a, _b, _c;
|
|
9590
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.putOrganizationMarketplaceSubscription(organizationName, marketplaceSubscriptionLink, options);
|
|
9591
|
+
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
9592
|
+
const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['MarketplaceSubscriptionsApi.putOrganizationMarketplaceSubscription']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
|
|
9593
|
+
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
9594
|
+
});
|
|
9595
|
+
},
|
|
9596
|
+
};
|
|
9597
|
+
};
|
|
9598
|
+
exports.MarketplaceSubscriptionsApiFp = MarketplaceSubscriptionsApiFp;
|
|
9599
|
+
/**
|
|
9600
|
+
* MarketplaceSubscriptionsApi - factory interface
|
|
9601
|
+
* @export
|
|
9602
|
+
*/
|
|
9603
|
+
const MarketplaceSubscriptionsApiFactory = function (configuration, basePath, axios) {
|
|
9604
|
+
const localVarFp = (0, exports.MarketplaceSubscriptionsApiFp)(configuration);
|
|
9605
|
+
return {
|
|
9606
|
+
/**
|
|
9607
|
+
* The organization\'s latest purchase through a cloud marketplace, as billing has it. 404 when the organization is not billed through a marketplace. **Authorization**: `can_read_organization`.
|
|
9608
|
+
* @summary The organization\'s marketplace subscription
|
|
9609
|
+
* @param {string} organizationName The organization\'s name
|
|
9610
|
+
* @param {*} [options] Override http request option.
|
|
9611
|
+
* @throws {RequiredError}
|
|
9612
|
+
*/
|
|
9613
|
+
getOrganizationMarketplaceSubscription(organizationName, options) {
|
|
9614
|
+
return localVarFp.getOrganizationMarketplaceSubscription(organizationName, options).then((request) => request(axios, basePath));
|
|
9615
|
+
},
|
|
9616
|
+
/**
|
|
9617
|
+
* For a buyer who already administers an organization: attaches the marketplace signup they came with (the `signupId` and `claim` from the signup app\'s fragment) to this organization. Billing consumes the claim and approves the purchase; once the subscription is ACTIVE the organization is billed through the marketplace, without the self-serve limits or an LLM spend cap. Until then it keeps how it is billed, self-serve cap included. A purchase that is already suspended or ended records nothing, and one that is suspended or ends before it was ever ACTIVE puts the organization back to how it was billed: an attached organization is never frozen for a subscription that never started. **Authorization**: `active_admin` on the organization.
|
|
9618
|
+
* @summary Bill an existing organization through the buyer\'s marketplace purchase
|
|
9619
|
+
* @param {string} organizationName The organization\'s name
|
|
9620
|
+
* @param {MarketplaceSubscriptionLink} marketplaceSubscriptionLink
|
|
9621
|
+
* @param {*} [options] Override http request option.
|
|
9622
|
+
* @throws {RequiredError}
|
|
9623
|
+
*/
|
|
9624
|
+
putOrganizationMarketplaceSubscription(organizationName, marketplaceSubscriptionLink, options) {
|
|
9625
|
+
return localVarFp.putOrganizationMarketplaceSubscription(organizationName, marketplaceSubscriptionLink, options).then((request) => request(axios, basePath));
|
|
9626
|
+
},
|
|
9627
|
+
};
|
|
9628
|
+
};
|
|
9629
|
+
exports.MarketplaceSubscriptionsApiFactory = MarketplaceSubscriptionsApiFactory;
|
|
9630
|
+
/**
|
|
9631
|
+
* MarketplaceSubscriptionsApi - object-oriented interface
|
|
9632
|
+
* @export
|
|
9633
|
+
* @class MarketplaceSubscriptionsApi
|
|
9634
|
+
* @extends {BaseAPI}
|
|
9635
|
+
*/
|
|
9636
|
+
class MarketplaceSubscriptionsApi extends base_1.BaseAPI {
|
|
9637
|
+
/**
|
|
9638
|
+
* The organization\'s latest purchase through a cloud marketplace, as billing has it. 404 when the organization is not billed through a marketplace. **Authorization**: `can_read_organization`.
|
|
9639
|
+
* @summary The organization\'s marketplace subscription
|
|
9640
|
+
* @param {string} organizationName The organization\'s name
|
|
9641
|
+
* @param {*} [options] Override http request option.
|
|
9642
|
+
* @throws {RequiredError}
|
|
9643
|
+
* @memberof MarketplaceSubscriptionsApi
|
|
9644
|
+
*/
|
|
9645
|
+
getOrganizationMarketplaceSubscription(organizationName, options) {
|
|
9646
|
+
return (0, exports.MarketplaceSubscriptionsApiFp)(this.configuration).getOrganizationMarketplaceSubscription(organizationName, options).then((request) => request(this.axios, this.basePath));
|
|
9647
|
+
}
|
|
9648
|
+
/**
|
|
9649
|
+
* For a buyer who already administers an organization: attaches the marketplace signup they came with (the `signupId` and `claim` from the signup app\'s fragment) to this organization. Billing consumes the claim and approves the purchase; once the subscription is ACTIVE the organization is billed through the marketplace, without the self-serve limits or an LLM spend cap. Until then it keeps how it is billed, self-serve cap included. A purchase that is already suspended or ended records nothing, and one that is suspended or ends before it was ever ACTIVE puts the organization back to how it was billed: an attached organization is never frozen for a subscription that never started. **Authorization**: `active_admin` on the organization.
|
|
9650
|
+
* @summary Bill an existing organization through the buyer\'s marketplace purchase
|
|
9651
|
+
* @param {string} organizationName The organization\'s name
|
|
9652
|
+
* @param {MarketplaceSubscriptionLink} marketplaceSubscriptionLink
|
|
9653
|
+
* @param {*} [options] Override http request option.
|
|
9654
|
+
* @throws {RequiredError}
|
|
9655
|
+
* @memberof MarketplaceSubscriptionsApi
|
|
9656
|
+
*/
|
|
9657
|
+
putOrganizationMarketplaceSubscription(organizationName, marketplaceSubscriptionLink, options) {
|
|
9658
|
+
return (0, exports.MarketplaceSubscriptionsApiFp)(this.configuration).putOrganizationMarketplaceSubscription(organizationName, marketplaceSubscriptionLink, options).then((request) => request(this.axios, this.basePath));
|
|
9659
|
+
}
|
|
9660
|
+
}
|
|
9661
|
+
exports.MarketplaceSubscriptionsApi = MarketplaceSubscriptionsApi;
|
|
9671
9662
|
/**
|
|
9672
9663
|
* MaterializationsApi - axios parameter creator
|
|
9673
9664
|
* @export
|
|
@@ -10475,7 +10466,7 @@ const OrganizationsApiAxiosParamCreator = function (configuration) {
|
|
|
10475
10466
|
};
|
|
10476
10467
|
}),
|
|
10477
10468
|
/**
|
|
10478
|
-
* Retrieves a comprehensive list of all organizations accessible to the authenticated user. This endpoint returns organization metadata including names, display names, and timestamps. **Authorization**: Requires appropriate permissions to view organizations. **Outside the organization**: an organization the caller is not a member of is listed when a package in it is shared with them and it allows sharing outside it. Its row carries `external: true` and only `name`, `displayName`, `createdAt` and `updatedAt`. **Rate Limiting**: Standard rate limits apply. **Pagination**: Supports offset-based pagination with limit and offset parameters.
|
|
10469
|
+
* Retrieves a comprehensive list of all organizations accessible to the authenticated user. This endpoint returns organization metadata including names, display names, and timestamps. A group access token always lists the organization it belongs to, even when its group holds grants only on single packages there and cannot read the organization itself. It never lists that organization under `userPermission=admin` unless the group is an admin of it. **Authorization**: Requires appropriate permissions to view organizations. **Outside the organization**: an organization the caller is not a member of is listed when a package in it is shared with them and it allows sharing outside it. Its row carries `external: true` and only `name`, `displayName`, `createdAt` and `updatedAt`. **Rate Limiting**: Standard rate limits apply. **Pagination**: Supports offset-based pagination with limit and offset parameters.
|
|
10479
10470
|
* @summary List all organizations
|
|
10480
10471
|
* @param {number} [limit] Maximum number of items to return. Use -1 or omit to return all results. Valid values: -1 (all results) or 1–100.
|
|
10481
10472
|
* @param {number} [offset] Number of items to skip before starting to return results
|
|
@@ -10679,7 +10670,7 @@ const OrganizationsApiFp = function (configuration) {
|
|
|
10679
10670
|
});
|
|
10680
10671
|
},
|
|
10681
10672
|
/**
|
|
10682
|
-
* Retrieves a comprehensive list of all organizations accessible to the authenticated user. This endpoint returns organization metadata including names, display names, and timestamps. **Authorization**: Requires appropriate permissions to view organizations. **Outside the organization**: an organization the caller is not a member of is listed when a package in it is shared with them and it allows sharing outside it. Its row carries `external: true` and only `name`, `displayName`, `createdAt` and `updatedAt`. **Rate Limiting**: Standard rate limits apply. **Pagination**: Supports offset-based pagination with limit and offset parameters.
|
|
10673
|
+
* Retrieves a comprehensive list of all organizations accessible to the authenticated user. This endpoint returns organization metadata including names, display names, and timestamps. A group access token always lists the organization it belongs to, even when its group holds grants only on single packages there and cannot read the organization itself. It never lists that organization under `userPermission=admin` unless the group is an admin of it. **Authorization**: Requires appropriate permissions to view organizations. **Outside the organization**: an organization the caller is not a member of is listed when a package in it is shared with them and it allows sharing outside it. Its row carries `external: true` and only `name`, `displayName`, `createdAt` and `updatedAt`. **Rate Limiting**: Standard rate limits apply. **Pagination**: Supports offset-based pagination with limit and offset parameters.
|
|
10683
10674
|
* @summary List all organizations
|
|
10684
10675
|
* @param {number} [limit] Maximum number of items to return. Use -1 or omit to return all results. Valid values: -1 (all results) or 1–100.
|
|
10685
10676
|
* @param {number} [offset] Number of items to skip before starting to return results
|
|
@@ -10797,7 +10788,7 @@ const OrganizationsApiFactory = function (configuration, basePath, axios) {
|
|
|
10797
10788
|
return localVarFp.listOrganizationUsers(organizationName, blocked, limit, offset, options).then((request) => request(axios, basePath));
|
|
10798
10789
|
},
|
|
10799
10790
|
/**
|
|
10800
|
-
* Retrieves a comprehensive list of all organizations accessible to the authenticated user. This endpoint returns organization metadata including names, display names, and timestamps. **Authorization**: Requires appropriate permissions to view organizations. **Outside the organization**: an organization the caller is not a member of is listed when a package in it is shared with them and it allows sharing outside it. Its row carries `external: true` and only `name`, `displayName`, `createdAt` and `updatedAt`. **Rate Limiting**: Standard rate limits apply. **Pagination**: Supports offset-based pagination with limit and offset parameters.
|
|
10791
|
+
* Retrieves a comprehensive list of all organizations accessible to the authenticated user. This endpoint returns organization metadata including names, display names, and timestamps. A group access token always lists the organization it belongs to, even when its group holds grants only on single packages there and cannot read the organization itself. It never lists that organization under `userPermission=admin` unless the group is an admin of it. **Authorization**: Requires appropriate permissions to view organizations. **Outside the organization**: an organization the caller is not a member of is listed when a package in it is shared with them and it allows sharing outside it. Its row carries `external: true` and only `name`, `displayName`, `createdAt` and `updatedAt`. **Rate Limiting**: Standard rate limits apply. **Pagination**: Supports offset-based pagination with limit and offset parameters.
|
|
10801
10792
|
* @summary List all organizations
|
|
10802
10793
|
* @param {number} [limit] Maximum number of items to return. Use -1 or omit to return all results. Valid values: -1 (all results) or 1–100.
|
|
10803
10794
|
* @param {number} [offset] Number of items to skip before starting to return results
|
|
@@ -10902,7 +10893,7 @@ class OrganizationsApi extends base_1.BaseAPI {
|
|
|
10902
10893
|
return (0, exports.OrganizationsApiFp)(this.configuration).listOrganizationUsers(organizationName, blocked, limit, offset, options).then((request) => request(this.axios, this.basePath));
|
|
10903
10894
|
}
|
|
10904
10895
|
/**
|
|
10905
|
-
* Retrieves a comprehensive list of all organizations accessible to the authenticated user. This endpoint returns organization metadata including names, display names, and timestamps. **Authorization**: Requires appropriate permissions to view organizations. **Outside the organization**: an organization the caller is not a member of is listed when a package in it is shared with them and it allows sharing outside it. Its row carries `external: true` and only `name`, `displayName`, `createdAt` and `updatedAt`. **Rate Limiting**: Standard rate limits apply. **Pagination**: Supports offset-based pagination with limit and offset parameters.
|
|
10896
|
+
* Retrieves a comprehensive list of all organizations accessible to the authenticated user. This endpoint returns organization metadata including names, display names, and timestamps. A group access token always lists the organization it belongs to, even when its group holds grants only on single packages there and cannot read the organization itself. It never lists that organization under `userPermission=admin` unless the group is an admin of it. **Authorization**: Requires appropriate permissions to view organizations. **Outside the organization**: an organization the caller is not a member of is listed when a package in it is shared with them and it allows sharing outside it. Its row carries `external: true` and only `name`, `displayName`, `createdAt` and `updatedAt`. **Rate Limiting**: Standard rate limits apply. **Pagination**: Supports offset-based pagination with limit and offset parameters.
|
|
10906
10897
|
* @summary List all organizations
|
|
10907
10898
|
* @param {number} [limit] Maximum number of items to return. Use -1 or omit to return all results. Valid values: -1 (all results) or 1–100.
|
|
10908
10899
|
* @param {number} [offset] Number of items to skip before starting to return results
|
|
@@ -11439,7 +11430,7 @@ exports.PackagePermissionsApi = PackagePermissionsApi;
|
|
|
11439
11430
|
const PackagesApiAxiosParamCreator = function (configuration) {
|
|
11440
11431
|
return {
|
|
11441
11432
|
/**
|
|
11442
|
-
* Creates a new package or updates an existing one with a new version. This endpoint handles both package metadata and file uploads for package content. **Authorization**: Requires package admin or modeler permissions. **Content**: Accepts multipart form data with package metadata and binary file content. **Validation**: Validates package structure and file integrity using MD5 hash.
|
|
11433
|
+
* Creates a new package or updates an existing one with a new version. This endpoint handles both package metadata and file uploads for package content. **A `version` part without an `id` is assigned.** The server picks the version under the package\'s lock and writes it into the stored archive\'s `publisher.json`: the version `publisher.json` names when it is free and newer than every published version (a floor, so `\"2.0.0\"` written once starts the 2.x line), otherwise the highest published version with its patch bumped, or `1.0.0` for a first publish. The response\'s `publishedVersion` names it, and the package serves it at once (becomes its `latestVersion`), whatever its `autoPromote`: the caller asked to publish, not to stage. A `version` part WITH an `id` publishes exactly that id, and `409`s when it is taken; it serves at once when the request also names it as the package\'s `latestVersion` or creates the package, otherwise when `autoPromote` promotes it. No `version` part updates package metadata only (and a create without one is a `400`). An upload whose `publisher.json` must be rewritten to name its version is a `400` past 512 MiB inflated. **Authorization**: Requires package admin or modeler permissions. **Content**: Accepts multipart form data with package metadata and binary file content. **Validation**: Validates package structure and file integrity using MD5 hash.
|
|
11443
11434
|
* @summary Create or update package
|
|
11444
11435
|
* @param {string} organizationName The unique identifier of the organization
|
|
11445
11436
|
* @param {string} environmentName The unique identifier of the environment
|
|
@@ -11709,7 +11700,7 @@ const PackagesApiAxiosParamCreator = function (configuration) {
|
|
|
11709
11700
|
};
|
|
11710
11701
|
}),
|
|
11711
11702
|
/**
|
|
11712
|
-
* Returns a list of package resource identifiers under the given organization that the current user has access to. By default returns only packages the user can share (admin/modeler role). Set `onlyShareable=false` to include all readable packages (including viewer access), and `public` to filter by whether a package is public. **Note**: This endpoint provides cross-environment package visibility. It aggregates packages from all environments within the organization that the user has access to. **Authorization**: Requires read
|
|
11703
|
+
* Returns a list of package resource identifiers under the given organization that the current user has access to. By default returns only packages the user can share (admin/modeler role). Set `onlyShareable=false` to include all readable packages (including viewer access), and `public` to filter by whether a package is public. **Note**: This endpoint provides cross-environment package visibility. It aggregates packages from all environments within the organization that the user has access to. **Authorization**: Requires that the caller can enter the organization (a member, or a person outside it holding an outside grant on one of its packages), or an API key issued for this organization. Such a key lists the packages its group can read even when the group holds grants only on single packages and cannot read the organization. Any other caller gets 403. `public` requires organization admin permissions. The list holds only packages the caller can read (or share). **Response**: Returns array of package resource identifiers.
|
|
11713
11704
|
* @summary List accessible packages by organization
|
|
11714
11705
|
* @param {string} organizationName The unique identifier of the organization
|
|
11715
11706
|
* @param {boolean} [onlyShareable] When true, returns only packages the user can share (admin/modeler). When false, returns all readable packages.
|
|
@@ -11839,7 +11830,7 @@ const PackagesApiFp = function (configuration) {
|
|
|
11839
11830
|
const localVarAxiosParamCreator = (0, exports.PackagesApiAxiosParamCreator)(configuration);
|
|
11840
11831
|
return {
|
|
11841
11832
|
/**
|
|
11842
|
-
* Creates a new package or updates an existing one with a new version. This endpoint handles both package metadata and file uploads for package content. **Authorization**: Requires package admin or modeler permissions. **Content**: Accepts multipart form data with package metadata and binary file content. **Validation**: Validates package structure and file integrity using MD5 hash.
|
|
11833
|
+
* Creates a new package or updates an existing one with a new version. This endpoint handles both package metadata and file uploads for package content. **A `version` part without an `id` is assigned.** The server picks the version under the package\'s lock and writes it into the stored archive\'s `publisher.json`: the version `publisher.json` names when it is free and newer than every published version (a floor, so `\"2.0.0\"` written once starts the 2.x line), otherwise the highest published version with its patch bumped, or `1.0.0` for a first publish. The response\'s `publishedVersion` names it, and the package serves it at once (becomes its `latestVersion`), whatever its `autoPromote`: the caller asked to publish, not to stage. A `version` part WITH an `id` publishes exactly that id, and `409`s when it is taken; it serves at once when the request also names it as the package\'s `latestVersion` or creates the package, otherwise when `autoPromote` promotes it. No `version` part updates package metadata only (and a create without one is a `400`). An upload whose `publisher.json` must be rewritten to name its version is a `400` past 512 MiB inflated. **Authorization**: Requires package admin or modeler permissions. **Content**: Accepts multipart form data with package metadata and binary file content. **Validation**: Validates package structure and file integrity using MD5 hash.
|
|
11843
11834
|
* @summary Create or update package
|
|
11844
11835
|
* @param {string} organizationName The unique identifier of the organization
|
|
11845
11836
|
* @param {string} environmentName The unique identifier of the environment
|
|
@@ -11959,7 +11950,7 @@ const PackagesApiFp = function (configuration) {
|
|
|
11959
11950
|
});
|
|
11960
11951
|
},
|
|
11961
11952
|
/**
|
|
11962
|
-
* Returns a list of package resource identifiers under the given organization that the current user has access to. By default returns only packages the user can share (admin/modeler role). Set `onlyShareable=false` to include all readable packages (including viewer access), and `public` to filter by whether a package is public. **Note**: This endpoint provides cross-environment package visibility. It aggregates packages from all environments within the organization that the user has access to. **Authorization**: Requires read
|
|
11953
|
+
* Returns a list of package resource identifiers under the given organization that the current user has access to. By default returns only packages the user can share (admin/modeler role). Set `onlyShareable=false` to include all readable packages (including viewer access), and `public` to filter by whether a package is public. **Note**: This endpoint provides cross-environment package visibility. It aggregates packages from all environments within the organization that the user has access to. **Authorization**: Requires that the caller can enter the organization (a member, or a person outside it holding an outside grant on one of its packages), or an API key issued for this organization. Such a key lists the packages its group can read even when the group holds grants only on single packages and cannot read the organization. Any other caller gets 403. `public` requires organization admin permissions. The list holds only packages the caller can read (or share). **Response**: Returns array of package resource identifiers.
|
|
11963
11954
|
* @summary List accessible packages by organization
|
|
11964
11955
|
* @param {string} organizationName The unique identifier of the organization
|
|
11965
11956
|
* @param {boolean} [onlyShareable] When true, returns only packages the user can share (admin/modeler). When false, returns all readable packages.
|
|
@@ -12025,7 +12016,7 @@ const PackagesApiFactory = function (configuration, basePath, axios) {
|
|
|
12025
12016
|
const localVarFp = (0, exports.PackagesApiFp)(configuration);
|
|
12026
12017
|
return {
|
|
12027
12018
|
/**
|
|
12028
|
-
* Creates a new package or updates an existing one with a new version. This endpoint handles both package metadata and file uploads for package content. **Authorization**: Requires package admin or modeler permissions. **Content**: Accepts multipart form data with package metadata and binary file content. **Validation**: Validates package structure and file integrity using MD5 hash.
|
|
12019
|
+
* Creates a new package or updates an existing one with a new version. This endpoint handles both package metadata and file uploads for package content. **A `version` part without an `id` is assigned.** The server picks the version under the package\'s lock and writes it into the stored archive\'s `publisher.json`: the version `publisher.json` names when it is free and newer than every published version (a floor, so `\"2.0.0\"` written once starts the 2.x line), otherwise the highest published version with its patch bumped, or `1.0.0` for a first publish. The response\'s `publishedVersion` names it, and the package serves it at once (becomes its `latestVersion`), whatever its `autoPromote`: the caller asked to publish, not to stage. A `version` part WITH an `id` publishes exactly that id, and `409`s when it is taken; it serves at once when the request also names it as the package\'s `latestVersion` or creates the package, otherwise when `autoPromote` promotes it. No `version` part updates package metadata only (and a create without one is a `400`). An upload whose `publisher.json` must be rewritten to name its version is a `400` past 512 MiB inflated. **Authorization**: Requires package admin or modeler permissions. **Content**: Accepts multipart form data with package metadata and binary file content. **Validation**: Validates package structure and file integrity using MD5 hash.
|
|
12029
12020
|
* @summary Create or update package
|
|
12030
12021
|
* @param {string} organizationName The unique identifier of the organization
|
|
12031
12022
|
* @param {string} environmentName The unique identifier of the environment
|
|
@@ -12109,7 +12100,7 @@ const PackagesApiFactory = function (configuration, basePath, axios) {
|
|
|
12109
12100
|
return localVarFp.getPackageVersionFileContent(organizationName, environmentName, packageName, versionId, documentPath, options).then((request) => request(axios, basePath));
|
|
12110
12101
|
},
|
|
12111
12102
|
/**
|
|
12112
|
-
* Returns a list of package resource identifiers under the given organization that the current user has access to. By default returns only packages the user can share (admin/modeler role). Set `onlyShareable=false` to include all readable packages (including viewer access), and `public` to filter by whether a package is public. **Note**: This endpoint provides cross-environment package visibility. It aggregates packages from all environments within the organization that the user has access to. **Authorization**: Requires read
|
|
12103
|
+
* Returns a list of package resource identifiers under the given organization that the current user has access to. By default returns only packages the user can share (admin/modeler role). Set `onlyShareable=false` to include all readable packages (including viewer access), and `public` to filter by whether a package is public. **Note**: This endpoint provides cross-environment package visibility. It aggregates packages from all environments within the organization that the user has access to. **Authorization**: Requires that the caller can enter the organization (a member, or a person outside it holding an outside grant on one of its packages), or an API key issued for this organization. Such a key lists the packages its group can read even when the group holds grants only on single packages and cannot read the organization. Any other caller gets 403. `public` requires organization admin permissions. The list holds only packages the caller can read (or share). **Response**: Returns array of package resource identifiers.
|
|
12113
12104
|
* @summary List accessible packages by organization
|
|
12114
12105
|
* @param {string} organizationName The unique identifier of the organization
|
|
12115
12106
|
* @param {boolean} [onlyShareable] When true, returns only packages the user can share (admin/modeler). When false, returns all readable packages.
|
|
@@ -12157,7 +12148,7 @@ exports.PackagesApiFactory = PackagesApiFactory;
|
|
|
12157
12148
|
*/
|
|
12158
12149
|
class PackagesApi extends base_1.BaseAPI {
|
|
12159
12150
|
/**
|
|
12160
|
-
* Creates a new package or updates an existing one with a new version. This endpoint handles both package metadata and file uploads for package content. **Authorization**: Requires package admin or modeler permissions. **Content**: Accepts multipart form data with package metadata and binary file content. **Validation**: Validates package structure and file integrity using MD5 hash.
|
|
12151
|
+
* Creates a new package or updates an existing one with a new version. This endpoint handles both package metadata and file uploads for package content. **A `version` part without an `id` is assigned.** The server picks the version under the package\'s lock and writes it into the stored archive\'s `publisher.json`: the version `publisher.json` names when it is free and newer than every published version (a floor, so `\"2.0.0\"` written once starts the 2.x line), otherwise the highest published version with its patch bumped, or `1.0.0` for a first publish. The response\'s `publishedVersion` names it, and the package serves it at once (becomes its `latestVersion`), whatever its `autoPromote`: the caller asked to publish, not to stage. A `version` part WITH an `id` publishes exactly that id, and `409`s when it is taken; it serves at once when the request also names it as the package\'s `latestVersion` or creates the package, otherwise when `autoPromote` promotes it. No `version` part updates package metadata only (and a create without one is a `400`). An upload whose `publisher.json` must be rewritten to name its version is a `400` past 512 MiB inflated. **Authorization**: Requires package admin or modeler permissions. **Content**: Accepts multipart form data with package metadata and binary file content. **Validation**: Validates package structure and file integrity using MD5 hash.
|
|
12161
12152
|
* @summary Create or update package
|
|
12162
12153
|
* @param {string} organizationName The unique identifier of the organization
|
|
12163
12154
|
* @param {string} environmentName The unique identifier of the environment
|
|
@@ -12247,7 +12238,7 @@ class PackagesApi extends base_1.BaseAPI {
|
|
|
12247
12238
|
return (0, exports.PackagesApiFp)(this.configuration).getPackageVersionFileContent(organizationName, environmentName, packageName, versionId, documentPath, options).then((request) => request(this.axios, this.basePath));
|
|
12248
12239
|
}
|
|
12249
12240
|
/**
|
|
12250
|
-
* Returns a list of package resource identifiers under the given organization that the current user has access to. By default returns only packages the user can share (admin/modeler role). Set `onlyShareable=false` to include all readable packages (including viewer access), and `public` to filter by whether a package is public. **Note**: This endpoint provides cross-environment package visibility. It aggregates packages from all environments within the organization that the user has access to. **Authorization**: Requires read
|
|
12241
|
+
* Returns a list of package resource identifiers under the given organization that the current user has access to. By default returns only packages the user can share (admin/modeler role). Set `onlyShareable=false` to include all readable packages (including viewer access), and `public` to filter by whether a package is public. **Note**: This endpoint provides cross-environment package visibility. It aggregates packages from all environments within the organization that the user has access to. **Authorization**: Requires that the caller can enter the organization (a member, or a person outside it holding an outside grant on one of its packages), or an API key issued for this organization. Such a key lists the packages its group can read even when the group holds grants only on single packages and cannot read the organization. Any other caller gets 403. `public` requires organization admin permissions. The list holds only packages the caller can read (or share). **Response**: Returns array of package resource identifiers.
|
|
12251
12242
|
* @summary List accessible packages by organization
|
|
12252
12243
|
* @param {string} organizationName The unique identifier of the organization
|
|
12253
12244
|
* @param {boolean} [onlyShareable] When true, returns only packages the user can share (admin/modeler). When false, returns all readable packages.
|