diff --git a/src/apis/screens-api.ts b/src/apis/screens-api.ts index 3fa180b..73a0e82 100644 --- a/src/apis/screens-api.ts +++ b/src/apis/screens-api.ts @@ -57,6 +57,30 @@ import { transformJSONToScreen } from '../models'; // @ts-ignore +import { + ScreenAnnotation, + transformScreenAnnotationToJSON, + transformJSONToScreenAnnotation +} from '../models'; +// @ts-ignore +import { + ScreenAnnotationCreateBody, + transformScreenAnnotationCreateBodyToJSON, + transformJSONToScreenAnnotationCreateBody +} from '../models'; +// @ts-ignore +import { + ScreenAnnotationNoteType, + transformScreenAnnotationNoteTypeToJSON, + transformJSONToScreenAnnotationNoteType +} from '../models'; +// @ts-ignore +import { + ScreenAnnotationUpdateBody, + transformScreenAnnotationUpdateBodyToJSON, + transformJSONToScreenAnnotationUpdateBody +} from '../models'; +// @ts-ignore import { ScreenNote, transformScreenNoteToJSON, @@ -201,6 +225,58 @@ export const ScreensApiAxiosParamCreator = function (configuration?: Configurati options: localVarRequestOptions, }; }, + /** + * Create an annotation on the screen + * @summary Create an annotation + * @param {string} projectId Project id + * @param {string} screenId Screen id + * @param {ScreenAnnotationCreateBody} screenAnnotationCreateBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createScreenAnnotation: async (projectId: string, screenId: string, screenAnnotationCreateBody: ScreenAnnotationCreateBody, options: any = {}): Promise => { + // verify required parameter 'projectId' is not null or undefined + assertParamExists('createScreenAnnotation', 'projectId', projectId) + // verify required parameter 'screenId' is not null or undefined + assertParamExists('createScreenAnnotation', 'screenId', screenId) + // verify required parameter 'screenAnnotationCreateBody' is not null or undefined + assertParamExists('createScreenAnnotation', 'screenAnnotationCreateBody', screenAnnotationCreateBody) + const localVarPath = `/v1/projects/{project_id}/screens/{screen_id}/annotations` + .replace(`{${"project_id"}}`, encodeURIComponent(String(projectId))) + .replace(`{${"screen_id"}}`, encodeURIComponent(String(screenId))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication OAuth2 required + // oauth required + await setOAuthToObject(localVarHeaderParameter, "OAuth2", [], configuration) + + // authentication PersonalAccessToken required + // http bearer authentication required + await setBearerAuthToObject(localVarHeaderParameter, configuration) + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(transformScreenAnnotationCreateBodyToJSON(screenAnnotationCreateBody), localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, /** * Create comment on the screen note * @summary Create a comment @@ -380,6 +456,56 @@ export const ScreensApiAxiosParamCreator = function (configuration?: Configurati options: localVarRequestOptions, }; }, + /** + * Delete an annotation on the screen + * @summary Delete an annotation + * @param {string} projectId Project id + * @param {string} screenId Screen id + * @param {string} annotationId Screen annotation id + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteScreenAnnotation: async (projectId: string, screenId: string, annotationId: string, options: any = {}): Promise => { + // verify required parameter 'projectId' is not null or undefined + assertParamExists('deleteScreenAnnotation', 'projectId', projectId) + // verify required parameter 'screenId' is not null or undefined + assertParamExists('deleteScreenAnnotation', 'screenId', screenId) + // verify required parameter 'annotationId' is not null or undefined + assertParamExists('deleteScreenAnnotation', 'annotationId', annotationId) + const localVarPath = `/v1/projects/{project_id}/screens/{screen_id}/annotations/{annotation_id}` + .replace(`{${"project_id"}}`, encodeURIComponent(String(projectId))) + .replace(`{${"screen_id"}}`, encodeURIComponent(String(screenId))) + .replace(`{${"annotation_id"}}`, encodeURIComponent(String(annotationId))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication OAuth2 required + // oauth required + await setOAuthToObject(localVarHeaderParameter, "OAuth2", [], configuration) + + // authentication PersonalAccessToken required + // http bearer authentication required + await setBearerAuthToObject(localVarHeaderParameter, configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, /** * Delete a comment on the screen note * @summary Delete comment @@ -629,6 +755,154 @@ export const ScreensApiAxiosParamCreator = function (configuration?: Configurati + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Get a screen annotation by id + * @summary Get a single screen annotation + * @param {string} projectId Project id + * @param {string} screenId Screen id + * @param {string} annotationId Screen annotation id + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getScreenAnnotation: async (projectId: string, screenId: string, annotationId: string, options: any = {}): Promise => { + // verify required parameter 'projectId' is not null or undefined + assertParamExists('getScreenAnnotation', 'projectId', projectId) + // verify required parameter 'screenId' is not null or undefined + assertParamExists('getScreenAnnotation', 'screenId', screenId) + // verify required parameter 'annotationId' is not null or undefined + assertParamExists('getScreenAnnotation', 'annotationId', annotationId) + const localVarPath = `/v1/projects/{project_id}/screens/{screen_id}/annotations/{annotation_id}` + .replace(`{${"project_id"}}`, encodeURIComponent(String(projectId))) + .replace(`{${"screen_id"}}`, encodeURIComponent(String(screenId))) + .replace(`{${"annotation_id"}}`, encodeURIComponent(String(annotationId))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication OAuth2 required + // oauth required + await setOAuthToObject(localVarHeaderParameter, "OAuth2", [], configuration) + + // authentication PersonalAccessToken required + // http bearer authentication required + await setBearerAuthToObject(localVarHeaderParameter, configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * List all annotations in the screen + * @summary Get screen annotations + * @param {string} projectId Project id + * @param {string} screenId Screen id + * @param {number} [limit] Pagination limit + * @param {number} [offset] Pagination offset + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getScreenAnnotations: async (projectId: string, screenId: string, limit?: number, offset?: number, options: any = {}): Promise => { + // verify required parameter 'projectId' is not null or undefined + assertParamExists('getScreenAnnotations', 'projectId', projectId) + // verify required parameter 'screenId' is not null or undefined + assertParamExists('getScreenAnnotations', 'screenId', screenId) + const localVarPath = `/v1/projects/{project_id}/screens/{screen_id}/annotations` + .replace(`{${"project_id"}}`, encodeURIComponent(String(projectId))) + .replace(`{${"screen_id"}}`, encodeURIComponent(String(screenId))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication OAuth2 required + // oauth required + await setOAuthToObject(localVarHeaderParameter, "OAuth2", [], configuration) + + // authentication PersonalAccessToken required + // http bearer authentication required + await setBearerAuthToObject(localVarHeaderParameter, configuration) + + if (limit !== undefined) { + localVarQueryParameter['limit'] = limit; + } + + if (offset !== undefined) { + localVarQueryParameter['offset'] = offset; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * List all annotation note types in the project + * @summary Get screen annotation note types + * @param {string} projectId Project id + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getScreenAnnotationsNoteTypes: async (projectId: string, options: any = {}): Promise => { + // verify required parameter 'projectId' is not null or undefined + assertParamExists('getScreenAnnotationsNoteTypes', 'projectId', projectId) + const localVarPath = `/v1/projects/{project_id}/annotations/note_types` + .replace(`{${"project_id"}}`, encodeURIComponent(String(projectId))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication OAuth2 required + // oauth required + await setOAuthToObject(localVarHeaderParameter, "OAuth2", [], configuration) + + // authentication PersonalAccessToken required + // http bearer authentication required + await setBearerAuthToObject(localVarHeaderParameter, configuration) + + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; @@ -1164,6 +1438,62 @@ export const ScreensApiAxiosParamCreator = function (configuration?: Configurati options: localVarRequestOptions, }; }, + /** + * Update an annotation on the screen + * @summary Update an annotation + * @param {string} projectId Project id + * @param {string} screenId Screen id + * @param {string} annotationId Screen annotation id + * @param {ScreenAnnotationUpdateBody} screenAnnotationUpdateBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updateScreenAnnotation: async (projectId: string, screenId: string, annotationId: string, screenAnnotationUpdateBody: ScreenAnnotationUpdateBody, options: any = {}): Promise => { + // verify required parameter 'projectId' is not null or undefined + assertParamExists('updateScreenAnnotation', 'projectId', projectId) + // verify required parameter 'screenId' is not null or undefined + assertParamExists('updateScreenAnnotation', 'screenId', screenId) + // verify required parameter 'annotationId' is not null or undefined + assertParamExists('updateScreenAnnotation', 'annotationId', annotationId) + // verify required parameter 'screenAnnotationUpdateBody' is not null or undefined + assertParamExists('updateScreenAnnotation', 'screenAnnotationUpdateBody', screenAnnotationUpdateBody) + const localVarPath = `/v1/projects/{project_id}/screens/{screen_id}/annotations/{annotation_id}` + .replace(`{${"project_id"}}`, encodeURIComponent(String(projectId))) + .replace(`{${"screen_id"}}`, encodeURIComponent(String(screenId))) + .replace(`{${"annotation_id"}}`, encodeURIComponent(String(annotationId))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'PATCH', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication OAuth2 required + // oauth required + await setOAuthToObject(localVarHeaderParameter, "OAuth2", [], configuration) + + // authentication PersonalAccessToken required + // http bearer authentication required + await setBearerAuthToObject(localVarHeaderParameter, configuration) + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(transformScreenAnnotationUpdateBodyToJSON(screenAnnotationUpdateBody), localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, /** * Update comments on the screen note * @summary Update comment @@ -1308,6 +1638,19 @@ export const ScreensApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.createScreen(projectId, name, image, description, commitMessage, commitColor, tags, sectionId, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Create an annotation on the screen + * @summary Create an annotation + * @param {string} projectId Project id + * @param {string} screenId Screen id + * @param {ScreenAnnotationCreateBody} screenAnnotationCreateBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async createScreenAnnotation(projectId: string, screenId: string, screenAnnotationCreateBody: ScreenAnnotationCreateBody, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.createScreenAnnotation(projectId, screenId, screenAnnotationCreateBody, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, /** * Create comment on the screen note * @summary Create a comment @@ -1350,6 +1693,19 @@ export const ScreensApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.createScreenVersion(projectId, screenId, image, commitMessage, commitColor, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Delete an annotation on the screen + * @summary Delete an annotation + * @param {string} projectId Project id + * @param {string} screenId Screen id + * @param {string} annotationId Screen annotation id + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async deleteScreenAnnotation(projectId: string, screenId: string, annotationId: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteScreenAnnotation(projectId, screenId, annotationId, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, /** * Delete a comment on the screen note * @summary Delete comment @@ -1416,6 +1772,44 @@ export const ScreensApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getScreen(projectId, screenId, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Get a screen annotation by id + * @summary Get a single screen annotation + * @param {string} projectId Project id + * @param {string} screenId Screen id + * @param {string} annotationId Screen annotation id + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getScreenAnnotation(projectId: string, screenId: string, annotationId: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getScreenAnnotation(projectId, screenId, annotationId, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * List all annotations in the screen + * @summary Get screen annotations + * @param {string} projectId Project id + * @param {string} screenId Screen id + * @param {number} [limit] Pagination limit + * @param {number} [offset] Pagination offset + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getScreenAnnotations(projectId: string, screenId: string, limit?: number, offset?: number, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getScreenAnnotations(projectId, screenId, limit, offset, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * List all annotation note types in the project + * @summary Get screen annotation note types + * @param {string} projectId Project id + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getScreenAnnotationsNoteTypes(projectId: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getScreenAnnotationsNoteTypes(projectId, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, /** * List all components in the screen * @summary Get screen components @@ -1549,6 +1943,20 @@ export const ScreensApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.updateScreen(projectId, screenId, screenUpdateBody, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Update an annotation on the screen + * @summary Update an annotation + * @param {string} projectId Project id + * @param {string} screenId Screen id + * @param {string} annotationId Screen annotation id + * @param {ScreenAnnotationUpdateBody} screenAnnotationUpdateBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async updateScreenAnnotation(projectId: string, screenId: string, annotationId: string, screenAnnotationUpdateBody: ScreenAnnotationUpdateBody, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.updateScreenAnnotation(projectId, screenId, annotationId, screenAnnotationUpdateBody, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, /** * Update comments on the screen note * @summary Update comment @@ -1643,6 +2051,7 @@ export interface ScreensApiCreateScreenBody { + /** * Body for createScreenVersion operation in ScreensApi. * @export @@ -1677,6 +2086,7 @@ export interface ScreensApiCreateScreenVersionBody { + /** * Search parameters for getProjectScreens operation in ScreensApi. * @export @@ -1713,6 +2123,29 @@ export interface ScreensApiGetProjectScreensSearchParams { } + +/** + * Search parameters for getScreenAnnotations operation in ScreensApi. + * @export + * @interface ScreensApiGetScreenAnnotationsSearchParams + */ +export interface ScreensApiGetScreenAnnotationsSearchParams { + /** + * Pagination limit + * @type {number} + * @memberof ScreensApiGetScreenAnnotationsSearchParams + */ + readonly limit?: number; + + /** + * Pagination offset + * @type {number} + * @memberof ScreensApiGetScreenAnnotationsSearchParams + */ + readonly offset?: number; +} + + /** * Search parameters for getScreenComponents operation in ScreensApi. * @export @@ -1840,6 +2273,7 @@ export interface ScreensApiGetScreenVersionsSearchParams { + /** * ScreensApi - object-oriented interface * @export @@ -1872,6 +2306,26 @@ export class ScreensApi extends BaseAPI { }; } + /** + * Create an annotation on the screen + * @summary Create an annotation + * @param {string} projectId Project id + * @param {string} screenId Screen id + * @param {ScreenAnnotationCreateBody} screenAnnotationCreateBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ScreensApi + */ + public async createScreenAnnotation(projectId: string, screenId: string, screenAnnotationCreateBody: ScreenAnnotationCreateBody, options?: any) : Promise> { + const screensApiFp = ScreensApiFp(this.configuration); + const request = await screensApiFp.createScreenAnnotation(projectId, screenId, screenAnnotationCreateBody, options); + const response = await request(this.axios, this.basePath); + return { + ...response, + data: transformJSONToEntityReference(response.data) + }; + } + /** * Create comment on the screen note * @summary Create a comment @@ -1935,6 +2389,23 @@ export class ScreensApi extends BaseAPI { }; } + /** + * Delete an annotation on the screen + * @summary Delete an annotation + * @param {string} projectId Project id + * @param {string} screenId Screen id + * @param {string} annotationId Screen annotation id + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ScreensApi + */ + public async deleteScreenAnnotation(projectId: string, screenId: string, annotationId: string, options?: any) : Promise> { + const screensApiFp = ScreensApiFp(this.configuration); + const request = await screensApiFp.deleteScreenAnnotation(projectId, screenId, annotationId, options); + const response = await request(this.axios, this.basePath); + return response; + } + /** * Delete a comment on the screen note * @summary Delete comment @@ -2027,6 +2498,64 @@ export class ScreensApi extends BaseAPI { }; } + /** + * Get a screen annotation by id + * @summary Get a single screen annotation + * @param {string} projectId Project id + * @param {string} screenId Screen id + * @param {string} annotationId Screen annotation id + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ScreensApi + */ + public async getScreenAnnotation(projectId: string, screenId: string, annotationId: string, options?: any) : Promise> { + const screensApiFp = ScreensApiFp(this.configuration); + const request = await screensApiFp.getScreenAnnotation(projectId, screenId, annotationId, options); + const response = await request(this.axios, this.basePath); + return { + ...response, + data: transformJSONToScreenAnnotation(response.data) + }; + } + + /** + * List all annotations in the screen + * @summary Get screen annotations + * @param {string} projectId Project id + * @param {string} screenId Screen id + * @param {ScreensApiGetScreenAnnotationsSearchParams} [searchParams] Search parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ScreensApi + */ + public async getScreenAnnotations(projectId: string, screenId: string, searchParams: ScreensApiGetScreenAnnotationsSearchParams = {}, options?: any) : Promise>> { + const screensApiFp = ScreensApiFp(this.configuration); + const request = await screensApiFp.getScreenAnnotations(projectId, screenId, searchParams.limit, searchParams.offset, options); + const response = await request(this.axios, this.basePath); + return { + ...response, + data: response.data.map(transformJSONToScreenAnnotation) + }; + } + + /** + * List all annotation note types in the project + * @summary Get screen annotation note types + * @param {string} projectId Project id + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ScreensApi + */ + public async getScreenAnnotationsNoteTypes(projectId: string, options?: any) : Promise>> { + const screensApiFp = ScreensApiFp(this.configuration); + const request = await screensApiFp.getScreenAnnotationsNoteTypes(projectId, options); + const response = await request(this.axios, this.basePath); + return { + ...response, + data: response.data.map(transformJSONToScreenAnnotationNoteType) + }; + } + /** * List all components in the screen * @summary Get screen components @@ -2220,6 +2749,24 @@ export class ScreensApi extends BaseAPI { return response; } + /** + * Update an annotation on the screen + * @summary Update an annotation + * @param {string} projectId Project id + * @param {string} screenId Screen id + * @param {string} annotationId Screen annotation id + * @param {ScreenAnnotationUpdateBody} screenAnnotationUpdateBody + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ScreensApi + */ + public async updateScreenAnnotation(projectId: string, screenId: string, annotationId: string, screenAnnotationUpdateBody: ScreenAnnotationUpdateBody, options?: any) : Promise> { + const screensApiFp = ScreensApiFp(this.configuration); + const request = await screensApiFp.updateScreenAnnotation(projectId, screenId, annotationId, screenAnnotationUpdateBody, options); + const response = await request(this.axios, this.basePath); + return response; + } + /** * Update comments on the screen note * @summary Update comment diff --git a/src/index.ts b/src/index.ts index 3f38bc9..eb02159 100644 --- a/src/index.ts +++ b/src/index.ts @@ -176,6 +176,13 @@ export { ResourceSource, ResourceStyleguideSource, Screen, + ScreenAnnotation, + ScreenAnnotationColor, + ScreenAnnotationCreateBody, + ScreenAnnotationNoteType, + ScreenAnnotationNoteTypeEnum, + ScreenAnnotationPosition, + ScreenAnnotationUpdateBody, ScreenNote, ScreenNoteColor, ScreenNoteColorNameEnum, diff --git a/src/models/index.ts b/src/models/index.ts index 61dc6b5..8066b08 100644 --- a/src/models/index.ts +++ b/src/models/index.ts @@ -162,6 +162,13 @@ export * from './resource-project-source'; export * from './resource-source'; export * from './resource-styleguide-source'; export * from './screen'; +export * from './screen-annotation'; +export * from './screen-annotation-color'; +export * from './screen-annotation-create-body'; +export * from './screen-annotation-note-type'; +export * from './screen-annotation-note-type-enum'; +export * from './screen-annotation-position'; +export * from './screen-annotation-update-body'; export * from './screen-note'; export * from './screen-note-color'; export * from './screen-note-color-name-enum'; diff --git a/src/models/screen-annotation-color.ts b/src/models/screen-annotation-color.ts new file mode 100644 index 0000000..63e7bbf --- /dev/null +++ b/src/models/screen-annotation-color.ts @@ -0,0 +1,75 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Zeplin API + * Access your resources in Zeplin + * + * Contact: support@zeplin.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + + +export const transformScreenAnnotationColorToJSON = function (value: ScreenAnnotationColor): any { + return { + name: value.name, + r: value.r, + g: value.g, + b: value.b, + a: value.a + } +} + +export const transformJSONToScreenAnnotationColor = function (value: any): ScreenAnnotationColor { + return { + name: value.name, + r: value.r, + g: value.g, + b: value.b, + a: value.a + } +} + +/** + * + * @export + * @interface ScreenAnnotationColor + */ +export interface ScreenAnnotationColor { + /** + * Name of the color + * @type {string} + * @memberof ScreenAnnotationColor + */ + name?: string; + /** + * Red component of the color + * @type {number} + * @memberof ScreenAnnotationColor + */ + r: number; + /** + * Green component of the color + * @type {number} + * @memberof ScreenAnnotationColor + */ + g: number; + /** + * Blue component of the color + * @type {number} + * @memberof ScreenAnnotationColor + */ + b: number; + /** + * Alpha component of the color + * @type {number} + * @memberof ScreenAnnotationColor + */ + a: number; +} + + diff --git a/src/models/screen-annotation-create-body.ts b/src/models/screen-annotation-create-body.ts new file mode 100644 index 0000000..b8e0bf5 --- /dev/null +++ b/src/models/screen-annotation-create-body.ts @@ -0,0 +1,64 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Zeplin API + * Access your resources in Zeplin + * + * Contact: support@zeplin.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import { + ScreenAnnotationPosition, + transformScreenAnnotationPositionToJSON, + transformJSONToScreenAnnotationPosition +} from './screen-annotation-position'; + + +export const transformScreenAnnotationCreateBodyToJSON = function (value: ScreenAnnotationCreateBody): any { + return { + content: value.content, + position: transformScreenAnnotationPositionToJSON(value.position), + type: value.type + } +} + +export const transformJSONToScreenAnnotationCreateBody = function (value: any): ScreenAnnotationCreateBody { + return { + content: value.content, + position: transformJSONToScreenAnnotationPosition(value.position), + type: value.type + } +} + +/** + * + * @export + * @interface ScreenAnnotationCreateBody + */ +export interface ScreenAnnotationCreateBody { + /** + * Content of the annotation + * @type {string} + * @memberof ScreenAnnotationCreateBody + */ + content: string; + /** + * + * @type {ScreenAnnotationPosition} + * @memberof ScreenAnnotationCreateBody + */ + position: ScreenAnnotationPosition; + /** + * The unique id of the annotation type + * @type {string} + * @memberof ScreenAnnotationCreateBody + */ + type?: string; +} + + diff --git a/src/models/screen-annotation-note-type-enum.ts b/src/models/screen-annotation-note-type-enum.ts new file mode 100644 index 0000000..075e5db --- /dev/null +++ b/src/models/screen-annotation-note-type-enum.ts @@ -0,0 +1,39 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Zeplin API + * Access your resources in Zeplin + * + * Contact: support@zeplin.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + + +export const transformScreenAnnotationNoteTypeEnumToJSON = function (value: ScreenAnnotationNoteTypeEnum): any { + return value; +} + +export const transformJSONToScreenAnnotationNoteTypeEnum = function (value: any): ScreenAnnotationNoteTypeEnum { + return value; +} + +/** + * Type of the annotation note + * @export + * @enum {string} + */ +export enum ScreenAnnotationNoteTypeEnum { + BEHAVIOR = 'Behavior', + REQUIREMENT = 'Requirement', + ANIMATION = 'Animation', + ACCESSIBILITY = 'Accessibility', + API = 'API', + TRACKING = 'Tracking' +} + + diff --git a/src/models/screen-annotation-note-type.ts b/src/models/screen-annotation-note-type.ts new file mode 100644 index 0000000..031097b --- /dev/null +++ b/src/models/screen-annotation-note-type.ts @@ -0,0 +1,69 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Zeplin API + * Access your resources in Zeplin + * + * Contact: support@zeplin.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import { + ScreenAnnotationColor, + transformScreenAnnotationColorToJSON, + transformJSONToScreenAnnotationColor +} from './screen-annotation-color'; +import { + ScreenAnnotationNoteTypeEnum, + transformScreenAnnotationNoteTypeEnumToJSON, + transformJSONToScreenAnnotationNoteTypeEnum +} from './screen-annotation-note-type-enum'; + + +export const transformScreenAnnotationNoteTypeToJSON = function (value: ScreenAnnotationNoteType): any { + return { + id: value.id, + name: transformScreenAnnotationNoteTypeEnumToJSON(value.name), + color: transformScreenAnnotationColorToJSON(value.color) + } +} + +export const transformJSONToScreenAnnotationNoteType = function (value: any): ScreenAnnotationNoteType { + return { + id: value.id, + name: transformJSONToScreenAnnotationNoteTypeEnum(value.name), + color: transformJSONToScreenAnnotationColor(value.color) + } +} + +/** + * + * @export + * @interface ScreenAnnotationNoteType + */ +export interface ScreenAnnotationNoteType { + /** + * The unique id of the annotation + * @type {string} + * @memberof ScreenAnnotationNoteType + */ + id: string; + /** + * + * @type {ScreenAnnotationNoteTypeEnum} + * @memberof ScreenAnnotationNoteType + */ + name: ScreenAnnotationNoteTypeEnum; + /** + * + * @type {ScreenAnnotationColor} + * @memberof ScreenAnnotationNoteType + */ + color: ScreenAnnotationColor; +} + + diff --git a/src/models/screen-annotation-position.ts b/src/models/screen-annotation-position.ts new file mode 100644 index 0000000..9bcb692 --- /dev/null +++ b/src/models/screen-annotation-position.ts @@ -0,0 +1,51 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Zeplin API + * Access your resources in Zeplin + * + * Contact: support@zeplin.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + + +export const transformScreenAnnotationPositionToJSON = function (value: ScreenAnnotationPosition): any { + return { + x: value.x, + y: value.y + } +} + +export const transformJSONToScreenAnnotationPosition = function (value: any): ScreenAnnotationPosition { + return { + x: value.x, + y: value.y + } +} + +/** + * Position of the annotation with respect to top left corner. Values are normalized in [0, 1] + * @export + * @interface ScreenAnnotationPosition + */ +export interface ScreenAnnotationPosition { + /** + * + * @type {number} + * @memberof ScreenAnnotationPosition + */ + x: number; + /** + * + * @type {number} + * @memberof ScreenAnnotationPosition + */ + y: number; +} + + diff --git a/src/models/screen-annotation-update-body.ts b/src/models/screen-annotation-update-body.ts new file mode 100644 index 0000000..2a42aeb --- /dev/null +++ b/src/models/screen-annotation-update-body.ts @@ -0,0 +1,64 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Zeplin API + * Access your resources in Zeplin + * + * Contact: support@zeplin.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import { + ScreenAnnotationPosition, + transformScreenAnnotationPositionToJSON, + transformJSONToScreenAnnotationPosition +} from './screen-annotation-position'; + + +export const transformScreenAnnotationUpdateBodyToJSON = function (value: ScreenAnnotationUpdateBody): any { + return { + content: value.content, + position: value.position && transformScreenAnnotationPositionToJSON(value.position), + type: value.type + } +} + +export const transformJSONToScreenAnnotationUpdateBody = function (value: any): ScreenAnnotationUpdateBody { + return { + content: value.content, + position: value.position && transformJSONToScreenAnnotationPosition(value.position), + type: value.type + } +} + +/** + * + * @export + * @interface ScreenAnnotationUpdateBody + */ +export interface ScreenAnnotationUpdateBody { + /** + * Content of the annotation + * @type {string} + * @memberof ScreenAnnotationUpdateBody + */ + content?: string; + /** + * + * @type {ScreenAnnotationPosition} + * @memberof ScreenAnnotationUpdateBody + */ + position?: ScreenAnnotationPosition; + /** + * The unique id of the annotation type + * @type {string} + * @memberof ScreenAnnotationUpdateBody + */ + type?: string; +} + + diff --git a/src/models/screen-annotation.ts b/src/models/screen-annotation.ts new file mode 100644 index 0000000..edb4e9b --- /dev/null +++ b/src/models/screen-annotation.ts @@ -0,0 +1,106 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Zeplin API + * Access your resources in Zeplin + * + * Contact: support@zeplin.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import { + ScreenAnnotationNoteType, + transformScreenAnnotationNoteTypeToJSON, + transformJSONToScreenAnnotationNoteType +} from './screen-annotation-note-type'; +import { + ScreenAnnotationPosition, + transformScreenAnnotationPositionToJSON, + transformJSONToScreenAnnotationPosition +} from './screen-annotation-position'; +import { + User, + transformUserToJSON, + transformJSONToUser +} from './user'; + + +export const transformScreenAnnotationToJSON = function (value: ScreenAnnotation): any { + return { + id: value.id, + content: value.content, + type: transformScreenAnnotationNoteTypeToJSON(value.type), + position: transformScreenAnnotationPositionToJSON(value.position), + creator: transformUserToJSON(value.creator), + updated: value.updated, + created: value.created + } +} + +export const transformJSONToScreenAnnotation = function (value: any): ScreenAnnotation { + return { + id: value.id, + content: value.content, + type: transformJSONToScreenAnnotationNoteType(value.type), + position: transformJSONToScreenAnnotationPosition(value.position), + creator: transformJSONToUser(value.creator), + updated: value.updated, + created: value.created + } +} + +/** + * + * @export + * @interface ScreenAnnotation + */ +export interface ScreenAnnotation { + /** + * The unique id of the annotation + * @type {string} + * @memberof ScreenAnnotation + */ + id: string; + /** + * The text of the annotation + * @type {string} + * @memberof ScreenAnnotation + */ + content: string; + /** + * + * @type {ScreenAnnotationNoteType} + * @memberof ScreenAnnotation + */ + type: ScreenAnnotationNoteType; + /** + * + * @type {ScreenAnnotationPosition} + * @memberof ScreenAnnotation + */ + position: ScreenAnnotationPosition; + /** + * + * @type {User} + * @memberof ScreenAnnotation + */ + creator: User; + /** + * The unix timestamp when the annotation was last updated + * @type {number} + * @memberof ScreenAnnotation + */ + updated: number; + /** + * The unix timestamp when the annotation was created + * @type {number} + * @memberof ScreenAnnotation + */ + created: number; +} + +