-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Clean up constants, types, and TODOs
- Loading branch information
1 parent
e93577f
commit 288635d
Showing
12 changed files
with
73 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,37 @@ | ||
export const CLIENT_ID = 'carto-api-client'; | ||
|
||
// TODO(cleanup): Lots of inconsistency in naming and usage of enums in the project. | ||
|
||
/** @internalRemarks Source: @carto/constants */ | ||
export enum MAP_TYPES { | ||
export enum MapType { | ||
TABLE = 'table', | ||
QUERY = 'query', | ||
TILESET = 'tileset', | ||
} | ||
|
||
/** @internalRemarks Source: @carto/constants */ | ||
export enum API_VERSIONS { | ||
export enum ApiVersion { | ||
V1 = 'v1', | ||
V2 = 'v2', | ||
V3 = 'v3', | ||
} | ||
|
||
/** @internalRemarks Source: @carto/react-core */ | ||
export enum GroupDateType { | ||
YEARS = 'year', | ||
MONTHS = 'month', | ||
WEEKS = 'week', | ||
DAYS = 'day', | ||
HOURS = 'hour', | ||
MINUTES = 'minute', | ||
SECONDS = 'second', | ||
} | ||
|
||
/** @internalRemarks Source: @carto/react-api, @deck.gl/carto */ | ||
export enum FilterType { | ||
IN = 'in', | ||
/** [a, b] both are included. */ | ||
BETWEEN = 'between', | ||
/** [a, b) a is included, b is not. */ | ||
CLOSED_OPEN = 'closed_open', | ||
TIME = 'time', | ||
STRING_SEARCH = 'stringSearch', | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,5 @@ | |
* INTERNAL | ||
*/ | ||
|
||
/** @internal */ | ||
export type $TODO = any; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
import {expect, test} from 'vitest'; | ||
import {CLIENT_ID, MAP_TYPES, API_VERSIONS} from '@carto/api-client'; | ||
import {CLIENT_ID, MapType, ApiVersion} from '@carto/api-client'; | ||
|
||
test('constants', () => { | ||
expect(CLIENT_ID).toBe('carto-api-client'); | ||
expect(MAP_TYPES.TABLE).toBe('table'); | ||
expect(MAP_TYPES.QUERY).toBe('query'); | ||
expect(MAP_TYPES.TILESET).toBe('tileset'); | ||
expect(API_VERSIONS.V1).toBe('v1'); | ||
expect(API_VERSIONS.V2).toBe('v2'); | ||
expect(API_VERSIONS.V3).toBe('v3'); | ||
expect(MapType.TABLE).toBe('table'); | ||
expect(MapType.QUERY).toBe('query'); | ||
expect(MapType.TILESET).toBe('tileset'); | ||
expect(ApiVersion.V1).toBe('v1'); | ||
expect(ApiVersion.V2).toBe('v2'); | ||
expect(ApiVersion.V3).toBe('v3'); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters