diff --git a/Makefile b/Makefile index 9768a0f..f6b0c72 100644 --- a/Makefile +++ b/Makefile @@ -25,7 +25,7 @@ clean: .PHONY: distclean distclean: clean - rm -rf __tests__/data/* + rm -rf .cache/ .PHONY: up up: .require-license diff --git a/jest.config.js b/jest.config.js index 2d4ac65..8c60984 100644 --- a/jest.config.js +++ b/jest.config.js @@ -2,7 +2,7 @@ module.exports = { clearMocks: true, collectCoverage: true, coverageDirectory: 'coverage', - modulePathIgnorePatterns: ["./__tests__/data/"], + modulePathIgnorePatterns: ["./.cache/"], 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 } diff --git a/tsconfig.eslint.json b/tsconfig.eslint.json index bffd823..ff20988 100644 --- a/tsconfig.eslint.json +++ b/tsconfig.eslint.json @@ -1,4 +1,4 @@ { - "exclude": ["node_modules", "__tests__/data/**/*", "lib/**/*"], + "exclude": ["node_modules", ".cache/**/*", "lib/**/*"], "extends": "./tsconfig.json" } diff --git a/tsconfig.json b/tsconfig.json index 6c295d6..79df889 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -9,6 +9,6 @@ "outDir": "./lib", "resolveJsonModule": true }, - "exclude": ["node_modules", "__tests__/**/*.spec.ts", "__tests__/data/**/*", "lib/**/*"], + "exclude": ["node_modules", "__tests__/**/*.spec.ts", ".cache/**/*", "lib/**/*"], "extends": "@tsconfig/node16/tsconfig.json" }