Skip to content

Commit

Permalink
Merge pull request #1015 from umbraco/feature/simple-publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
nielslyngsoe authored Nov 27, 2023
2 parents 81c76c8 + cee6c8b commit 7cee07d
Show file tree
Hide file tree
Showing 20 changed files with 598 additions and 31 deletions.
4 changes: 4 additions & 0 deletions src/external/backend-api/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,8 @@ export type { PropertyTypeValidationModel } from './models/PropertyTypeValidatio
export type { PublicAccessBaseModel } from './models/PublicAccessBaseModel';
export type { PublicAccessRequestModel } from './models/PublicAccessRequestModel';
export type { PublicAccessResponseModel } from './models/PublicAccessResponseModel';
export type { PublishDocumentRequestModel } from './models/PublishDocumentRequestModel';
export type { PublishDocumentWithDescendantsRequestModel } from './models/PublishDocumentWithDescendantsRequestModel';
export { PublishedStateModel } from './models/PublishedStateModel';
export type { RecycleBinItemResponseModel } from './models/RecycleBinItemResponseModel';
export { RedirectStatusModel } from './models/RedirectStatusModel';
Expand All @@ -223,6 +225,7 @@ export type { RelationResponseModel } from './models/RelationResponseModel';
export type { RelationTypeBaseModel } from './models/RelationTypeBaseModel';
export type { RelationTypeItemResponseModel } from './models/RelationTypeItemResponseModel';
export type { RelationTypeResponseModel } from './models/RelationTypeResponseModel';
export type { ResendInviteUserRequestModel } from './models/ResendInviteUserRequestModel';
export type { ResetPasswordRequestModel } from './models/ResetPasswordRequestModel';
export type { ResetPasswordTokenRequestModel } from './models/ResetPasswordTokenRequestModel';
export type { RichTextRuleModel } from './models/RichTextRuleModel';
Expand Down Expand Up @@ -273,6 +276,7 @@ export type { TextFileViewModelBaseModel } from './models/TextFileViewModelBaseM
export type { TourStatusModel } from './models/TourStatusModel';
export type { TreeItemPresentationModel } from './models/TreeItemPresentationModel';
export type { UnlockUsersRequestModel } from './models/UnlockUsersRequestModel';
export type { UnpublishDocumentRequestModel } from './models/UnpublishDocumentRequestModel';
export type { UpdateContentForDocumentRequestModel } from './models/UpdateContentForDocumentRequestModel';
export type { UpdateContentForMediaRequestModel } from './models/UpdateContentForMediaRequestModel';
export type { UpdateContentTypeForDocumentTypeRequestModel } from './models/UpdateContentTypeForDocumentTypeRequestModel';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import type { DictionaryItemModelBaseModel } from './DictionaryItemModelBaseModel';

export type CreateDictionaryItemRequestModel = (DictionaryItemModelBaseModel & {
id?: string | null;
parentId?: string | null;
});

Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
import type { ItemResponseModelBaseModel } from './ItemResponseModelBaseModel';

export type DataTypeItemResponseModel = (ItemResponseModelBaseModel & {
icon?: string | null;
editorUiAlias?: string | null;
});

Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
import type { FolderTreeItemResponseModel } from './FolderTreeItemResponseModel';

export type DataTypeTreeItemResponseModel = (FolderTreeItemResponseModel & {
icon?: string | null;
editorUiAlias?: string | null;
});

Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/* generated using openapi-typescript-codegen -- do no edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */

export type PublishDocumentRequestModel = {
cultures?: Array<string>;
};

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/* generated using openapi-typescript-codegen -- do no edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */

import type { PublishDocumentRequestModel } from './PublishDocumentRequestModel';

export type PublishDocumentWithDescendantsRequestModel = (PublishDocumentRequestModel & {
includeUnpublishedDescendants?: boolean;
});

Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/* generated using openapi-typescript-codegen -- do no edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */

export type ResendInviteUserRequestModel = {
userId?: string;
message?: string | null;
};

Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/* generated using openapi-typescript-codegen -- do no edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */

export type UnpublishDocumentRequestModel = {
culture?: string | null;
};

279 changes: 279 additions & 0 deletions src/external/backend-api/src/services/DocumentResource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ import type { PagedDocumentTreeItemResponseModel } from '../models/PagedDocument
import type { PagedDocumentTypeResponseModel } from '../models/PagedDocumentTypeResponseModel';
import type { PagedRecycleBinItemResponseModel } from '../models/PagedRecycleBinItemResponseModel';
import type { PublicAccessRequestModel } from '../models/PublicAccessRequestModel';
import type { PublishDocumentRequestModel } from '../models/PublishDocumentRequestModel';
import type { PublishDocumentWithDescendantsRequestModel } from '../models/PublishDocumentWithDescendantsRequestModel';
import type { SortingRequestModel } from '../models/SortingRequestModel';
import type { UnpublishDocumentRequestModel } from '../models/UnpublishDocumentRequestModel';
import type { UpdateDocumentNotificationsRequestModel } from '../models/UpdateDocumentNotificationsRequestModel';
import type { UpdateDocumentRequestModel } from '../models/UpdateDocumentRequestModel';
import type { UpdateDomainsRequestModel } from '../models/UpdateDomainsRequestModel';
Expand Down Expand Up @@ -346,6 +349,255 @@ export class DocumentResource {
});
}

/**
* @returns string Created
* @throws ApiError
*/
public static postDocumentByIdPublicAccess1({
id,
requestBody,
}: {
id: string,
requestBody?: PublicAccessRequestModel,
}): CancelablePromise<string> {
return __request(OpenAPI, {
method: 'POST',
url: '/umbraco/management/api/v2/document/{id}/public-access',
path: {
'id': id,
},
body: requestBody,
mediaType: 'application/json',
responseHeader: 'Location',
errors: {
404: `Not Found`,
},
});
}

/**
* @returns any Success
* @throws ApiError
*/
public static deleteDocumentByIdPublicAccess1({
id,
}: {
id: string,
}): CancelablePromise<any> {
return __request(OpenAPI, {
method: 'DELETE',
url: '/umbraco/management/api/v2/document/{id}/public-access',
path: {
'id': id,
},
errors: {
404: `Not Found`,
},
});
}

/**
* @returns void
* @throws ApiError
*/
public static getDocumentByIdPublicAccess1({
id,
}: {
id: string,
}): CancelablePromise<void> {
return __request(OpenAPI, {
method: 'GET',
url: '/umbraco/management/api/v2/document/{id}/public-access',
path: {
'id': id,
},
errors: {
404: `Not Found`,
},
});
}

/**
* @returns any Success
* @throws ApiError
*/
public static putDocumentByIdPublicAccess1({
id,
requestBody,
}: {
id: string,
requestBody?: PublicAccessRequestModel,
}): CancelablePromise<any> {
return __request(OpenAPI, {
method: 'PUT',
url: '/umbraco/management/api/v2/document/{id}/public-access',
path: {
'id': id,
},
body: requestBody,
mediaType: 'application/json',
errors: {
404: `Not Found`,
},
});
}

/**
* @returns any Success
* @throws ApiError
*/
public static putDocumentByIdPublish({
id,
requestBody,
}: {
id: string,
requestBody?: (PublishDocumentRequestModel | PublishDocumentWithDescendantsRequestModel),
}): CancelablePromise<any> {
return __request(OpenAPI, {
method: 'PUT',
url: '/umbraco/management/api/v1/document/{id}/publish',
path: {
'id': id,
},
body: requestBody,
mediaType: 'application/json',
errors: {
400: `Bad Request`,
404: `Not Found`,
},
});
}

/**
* @returns any Success
* @throws ApiError
*/
public static putDocumentByIdPublish1({
id,
requestBody,
}: {
id: string,
requestBody?: (PublishDocumentRequestModel | PublishDocumentWithDescendantsRequestModel),
}): CancelablePromise<any> {
return __request(OpenAPI, {
method: 'PUT',
url: '/umbraco/management/api/v2/document/{id}/publish',
path: {
'id': id,
},
body: requestBody,
mediaType: 'application/json',
errors: {
400: `Bad Request`,
404: `Not Found`,
},
});
}

/**
* @returns any Success
* @throws ApiError
*/
public static putDocumentByIdPublishWithDescendants({
id,
requestBody,
}: {
id: string,
requestBody?: PublishDocumentWithDescendantsRequestModel,
}): CancelablePromise<any> {
return __request(OpenAPI, {
method: 'PUT',
url: '/umbraco/management/api/v1/document/{id}/publish-with-descendants',
path: {
'id': id,
},
body: requestBody,
mediaType: 'application/json',
errors: {
400: `Bad Request`,
404: `Not Found`,
},
});
}

/**
* @returns any Success
* @throws ApiError
*/
public static putDocumentByIdPublishWithDescendants1({
id,
requestBody,
}: {
id: string,
requestBody?: PublishDocumentWithDescendantsRequestModel,
}): CancelablePromise<any> {
return __request(OpenAPI, {
method: 'PUT',
url: '/umbraco/management/api/v2/document/{id}/publish-with-descendants',
path: {
'id': id,
},
body: requestBody,
mediaType: 'application/json',
errors: {
400: `Bad Request`,
404: `Not Found`,
},
});
}

/**
* @returns any Success
* @throws ApiError
*/
public static putDocumentByIdUnpublish({
id,
requestBody,
}: {
id: string,
requestBody?: UnpublishDocumentRequestModel,
}): CancelablePromise<any> {
return __request(OpenAPI, {
method: 'PUT',
url: '/umbraco/management/api/v1/document/{id}/unpublish',
path: {
'id': id,
},
body: requestBody,
mediaType: 'application/json',
errors: {
400: `Bad Request`,
404: `Not Found`,
},
});
}

/**
* @returns any Success
* @throws ApiError
*/
public static putDocumentByIdUnpublish1({
id,
requestBody,
}: {
id: string,
requestBody?: UnpublishDocumentRequestModel,
}): CancelablePromise<any> {
return __request(OpenAPI, {
method: 'PUT',
url: '/umbraco/management/api/v2/document/{id}/unpublish',
path: {
'id': id,
},
body: requestBody,
mediaType: 'application/json',
errors: {
400: `Bad Request`,
404: `Not Found`,
},
});
}

/**
* @returns PagedDocumentTypeResponseModel Success
* @throws ApiError
Expand Down Expand Up @@ -373,6 +625,33 @@ export class DocumentResource {
});
}

/**
* @returns PagedDocumentTypeResponseModel Success
* @throws ApiError
*/
public static getDocumentAllowedDocumentTypes1({
parentId,
skip,
take = 100,
}: {
parentId?: string,
skip?: number,
take?: number,
}): CancelablePromise<PagedDocumentTypeResponseModel> {
return __request(OpenAPI, {
method: 'GET',
url: '/umbraco/management/api/v2/document/allowed-document-types',
query: {
'parentId': parentId,
'skip': skip,
'take': take,
},
errors: {
404: `Not Found`,
},
});
}

/**
* @returns any Success
* @throws ApiError
Expand Down
Loading

0 comments on commit 7cee07d

Please sign in to comment.