diff --git a/Makefile b/Makefile index 9768a0f..81760fc 100644 --- a/Makefile +++ b/Makefile @@ -25,7 +25,7 @@ clean: .PHONY: distclean distclean: clean - rm -rf __tests__/data/* + rm -rf .cache/data .PHONY: up up: .require-license diff --git a/jest.config.js b/jest.config.js index 2d4ac65..2569186 100644 --- a/jest.config.js +++ b/jest.config.js @@ -2,7 +2,6 @@ module.exports = { clearMocks: true, collectCoverage: true, coverageDirectory: 'coverage', - modulePathIgnorePatterns: ["./__tests__/data/"], preset: 'ts-jest', testEnvironment: 'node' } diff --git a/src/APIClient.ts b/src/APIClient.ts index 04683a2..ee2b973 100644 --- a/src/APIClient.ts +++ b/src/APIClient.ts @@ -111,10 +111,10 @@ export class APIClient { .then((resp: AxiosResponse) => keysToCamel(resp.data)) } - public async updateAppVanityURL (appID: number, vanityURL: string): Promise { - return await this.client.post( - `applications/${appID}/vanities`, - { app_id: appID, path_prefix: vanityURL } + public async setContentVanityURL (contentGUID: string, vanityURL: string): Promise { + return await this.client.put( + `v1/content/${contentGUID}/vanity`, + { path: vanityURL } ).then((resp: AxiosResponse) => keysToCamel(resp.data)) } diff --git a/src/Deployer.ts b/src/Deployer.ts index 4011a54..89eea5d 100644 --- a/src/Deployer.ts +++ b/src/Deployer.ts @@ -156,7 +156,7 @@ export class Deployer { `path=${JSON.stringify(resolvedAppPath)}` ].join(' ')) - await this.client.updateAppVanityURL(app.id, resolvedAppPath) + await this.client.setContentVanityURL(app.guid, resolvedAppPath) .catch((err: any) => { debugLog(() => [ 'Deployer: failed to update vanity URL for', diff --git a/src/api-types.ts b/src/api-types.ts index 1f8afae..a3e825f 100644 --- a/src/api-types.ts +++ b/src/api-types.ts @@ -102,9 +102,7 @@ export interface ListApplicationsResponse { } export interface VanityRecordResponse { - id?: number - appId: number - appGuid: string - pathPrefix: string - createdTime?: Date + contentGuid: string + path: string + createdTime: Date }