@uniformdev/context 20.72.3-alpha.5 → 20.72.3-alpha.52
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/api.d.mts +29 -1
- package/dist/api/api.d.ts +29 -1
- package/dist/api/api.js +23 -2
- package/dist/api/api.mjs +21 -2
- package/package.json +2 -2
package/dist/api/api.d.mts
CHANGED
|
@@ -26,6 +26,11 @@ type ClientOptions = {
|
|
|
26
26
|
signal?: AbortSignal;
|
|
27
27
|
};
|
|
28
28
|
type ExceptProject<T> = Omit<T, 'projectId'>;
|
|
29
|
+
/**
|
|
30
|
+
* Uniform API 401 message for an invalid or expired bearer token.
|
|
31
|
+
* Prefer catching {@link BearerTokenNotValidOrExpiredError} when using ApiClient-based SDKs.
|
|
32
|
+
*/
|
|
33
|
+
declare const UNIFORM_BEARER_TOKEN_NOT_VALID_OR_EXPIRED_MESSAGE: "Bearer token not valid or expired";
|
|
29
34
|
declare class ApiClientError extends Error {
|
|
30
35
|
errorMessage: string;
|
|
31
36
|
fetchMethod: string;
|
|
@@ -35,6 +40,13 @@ declare class ApiClientError extends Error {
|
|
|
35
40
|
requestId?: string | undefined;
|
|
36
41
|
constructor(errorMessage: string, fetchMethod: string, fetchUri: string, statusCode?: number | undefined, statusText?: string | undefined, requestId?: string | undefined);
|
|
37
42
|
}
|
|
43
|
+
/**
|
|
44
|
+
* Thrown when the Uniform API responds with 401 and
|
|
45
|
+
* {@link UNIFORM_BEARER_TOKEN_NOT_VALID_OR_EXPIRED_MESSAGE}.
|
|
46
|
+
*/
|
|
47
|
+
declare class BearerTokenNotValidOrExpiredError extends ApiClientError {
|
|
48
|
+
constructor(errorMessage: string, fetchMethod: string, fetchUri: string, statusCode?: number, statusText?: string, requestId?: string);
|
|
49
|
+
}
|
|
38
50
|
|
|
39
51
|
declare class ApiClient<TOptions extends ClientOptions = ClientOptions> {
|
|
40
52
|
protected options: TOptions;
|
|
@@ -1831,9 +1843,11 @@ declare class AggregateClient extends ApiClient {
|
|
|
1831
1843
|
/** Deletes an Aggregate */
|
|
1832
1844
|
remove(body: ExceptProject<AggregateDeleteParameters>): Promise<void>;
|
|
1833
1845
|
}
|
|
1846
|
+
/** @deprecated Pass `bypassCache: true` to {@link AggregateClient} instead. */
|
|
1834
1847
|
declare class UncachedAggregateClient extends AggregateClient {
|
|
1835
1848
|
constructor(options: Omit<ClientOptions, 'bypassCache'>);
|
|
1836
1849
|
}
|
|
1850
|
+
/** @deprecated Pass `bypassCache: false` to {@link AggregateClient} instead. */
|
|
1837
1851
|
declare class CachedAggregateClient extends AggregateClient {
|
|
1838
1852
|
constructor(options: Omit<ClientOptions, 'bypassCache'>);
|
|
1839
1853
|
}
|
|
@@ -1855,9 +1869,11 @@ declare class DimensionClient extends ApiClient {
|
|
|
1855
1869
|
/** Fetches the known score dimensions for a project */
|
|
1856
1870
|
get(options?: ExceptProject<DimensionGetParameters>): Promise<DimensionGetResponse>;
|
|
1857
1871
|
}
|
|
1872
|
+
/** @deprecated Pass `bypassCache: true` to {@link DimensionClient} instead. */
|
|
1858
1873
|
declare class UncachedDimensionClient extends DimensionClient {
|
|
1859
1874
|
constructor(options: Omit<ClientOptions, 'bypassCache'>);
|
|
1860
1875
|
}
|
|
1876
|
+
/** @deprecated Pass `bypassCache: false` to {@link DimensionClient} instead. */
|
|
1861
1877
|
declare class CachedDimensionClient extends DimensionClient {
|
|
1862
1878
|
constructor(options: Omit<ClientOptions, 'bypassCache'>);
|
|
1863
1879
|
}
|
|
@@ -1876,9 +1892,11 @@ declare class EnrichmentClient extends ApiClient {
|
|
|
1876
1892
|
/** Deletes an enrichment value within an enrichment category. The category is left alone. */
|
|
1877
1893
|
removeValue(body: ExceptProject<EnrichmentValueDeleteParameters>): Promise<void>;
|
|
1878
1894
|
}
|
|
1895
|
+
/** @deprecated Pass `bypassCache: true` to {@link EnrichmentClient} instead. */
|
|
1879
1896
|
declare class UncachedEnrichmentClient extends EnrichmentClient {
|
|
1880
1897
|
constructor(options: Omit<ClientOptions, 'bypassCache'>);
|
|
1881
1898
|
}
|
|
1899
|
+
/** @deprecated Pass `bypassCache: false` to {@link EnrichmentClient} instead. */
|
|
1882
1900
|
declare class CachedEnrichmentClient extends EnrichmentClient {
|
|
1883
1901
|
constructor(options: Omit<ClientOptions, 'bypassCache'>);
|
|
1884
1902
|
}
|
|
@@ -1891,9 +1909,11 @@ declare class ManifestClient extends ApiClient {
|
|
|
1891
1909
|
/** Publishes the Context manifest for a project */
|
|
1892
1910
|
publish(): Promise<void>;
|
|
1893
1911
|
}
|
|
1912
|
+
/** @deprecated Pass `bypassCache: true` to {@link ManifestClient} instead. */
|
|
1894
1913
|
declare class UncachedManifestClient extends ManifestClient {
|
|
1895
1914
|
constructor(options: Omit<ClientOptions, 'bypassCache'>);
|
|
1896
1915
|
}
|
|
1916
|
+
/** @deprecated Pass `bypassCache: false` to {@link ManifestClient} instead. */
|
|
1897
1917
|
declare class CachedManifestClient extends ManifestClient {
|
|
1898
1918
|
constructor(options: Omit<ClientOptions, 'bypassCache'>);
|
|
1899
1919
|
}
|
|
@@ -1908,9 +1928,11 @@ declare class QuirkClient extends ApiClient {
|
|
|
1908
1928
|
/** Deletes a Quirk */
|
|
1909
1929
|
remove(body: ExceptProject<QuirkDeleteParameters>): Promise<void>;
|
|
1910
1930
|
}
|
|
1931
|
+
/** @deprecated Pass `bypassCache: true` to {@link QuirkClient} instead. */
|
|
1911
1932
|
declare class UncachedQuirkClient extends QuirkClient {
|
|
1912
1933
|
constructor(options: Omit<ClientOptions, 'bypassCache'>);
|
|
1913
1934
|
}
|
|
1935
|
+
/** @deprecated Pass `bypassCache: false` to {@link QuirkClient} instead. */
|
|
1914
1936
|
declare class CachedQuirkClient extends QuirkClient {
|
|
1915
1937
|
constructor(options: Omit<ClientOptions, 'bypassCache'>);
|
|
1916
1938
|
}
|
|
@@ -1925,9 +1947,11 @@ declare class SignalClient extends ApiClient {
|
|
|
1925
1947
|
/** Deletes a Signal */
|
|
1926
1948
|
remove(body: ExceptProject<SignalDeleteParameters>): Promise<void>;
|
|
1927
1949
|
}
|
|
1950
|
+
/** @deprecated Pass `bypassCache: true` to {@link SignalClient} instead. */
|
|
1928
1951
|
declare class UncachedSignalClient extends SignalClient {
|
|
1929
1952
|
constructor(options: Omit<ClientOptions, 'bypassCache'>);
|
|
1930
1953
|
}
|
|
1954
|
+
/** @deprecated Pass `bypassCache: false` to {@link SignalClient} instead. */
|
|
1931
1955
|
declare class CachedSignalClient extends SignalClient {
|
|
1932
1956
|
constructor(options: Omit<ClientOptions, 'bypassCache'>);
|
|
1933
1957
|
}
|
|
@@ -1942,9 +1966,11 @@ declare class TestClient extends ApiClient {
|
|
|
1942
1966
|
/** Deletes a Test */
|
|
1943
1967
|
remove(body: ExceptProject<TestDeleteParameters>): Promise<void>;
|
|
1944
1968
|
}
|
|
1969
|
+
/** @deprecated Pass `bypassCache: true` to {@link TestClient} instead. */
|
|
1945
1970
|
declare class UncachedTestClient extends TestClient {
|
|
1946
1971
|
constructor(options: Omit<ClientOptions, 'bypassCache'>);
|
|
1947
1972
|
}
|
|
1973
|
+
/** @deprecated Pass `bypassCache: false` to {@link TestClient} instead. */
|
|
1948
1974
|
declare class CachedTestClient extends TestClient {
|
|
1949
1975
|
constructor(options: Omit<ClientOptions, 'bypassCache'>);
|
|
1950
1976
|
}
|
|
@@ -1959,11 +1985,13 @@ declare class ContextClient {
|
|
|
1959
1985
|
readonly signals: SignalClient;
|
|
1960
1986
|
readonly tests: TestClient;
|
|
1961
1987
|
}
|
|
1988
|
+
/** @deprecated Pass `bypassCache: true` to {@link ContextClient} instead. */
|
|
1962
1989
|
declare class UncachedContextClient extends ContextClient {
|
|
1963
1990
|
constructor(options: Omit<ClientOptions, 'bypassCache'>);
|
|
1964
1991
|
}
|
|
1992
|
+
/** @deprecated Pass `bypassCache: false` to {@link ContextClient} instead. */
|
|
1965
1993
|
declare class CachedContextClient extends ContextClient {
|
|
1966
1994
|
constructor(options: Omit<ClientOptions, 'bypassCache'>);
|
|
1967
1995
|
}
|
|
1968
1996
|
|
|
1969
|
-
export { type Aggregate, AggregateClient, type AggregateDeleteParameters, type AggregateGetParameters, type AggregateGetResponse, type AggregatePutParameters, ApiClient, ApiClientError, CachedAggregateClient, CachedContextClient, CachedDimensionClient, CachedEnrichmentClient, CachedManifestClient, CachedQuirkClient, CachedSignalClient, CachedTestClient, type ClientOptions, ContextClient, type ContextDefinitions, type CookieCriteria, type CurrentPageCriteria, DimensionClient, type DimensionDefinition, type DimensionDisplayData, type DimensionGetParameters, type DimensionGetResponse, type EnrichmentCategory, type EnrichmentCategoryWithValues, EnrichmentClient, type EnrichmentDeleteParameters, type EnrichmentGetParameters, type EnrichmentGetResponse, type EnrichmentPutParameters, type EnrichmentValue, type EnrichmentValueDeleteParameters, type EnrichmentValuePutParameters, type EventCriteria, type ExceptProject, type LimitPolicy, ManifestClient, type ManifestGetParameters, type ManifestGetResponse, type PageViewCountCriteria, type QueryStringCriteria, type Quirk, QuirkClient, type QuirkCriteria, type QuirkDeleteParameters, type QuirkGetParameters, type QuirkGetResponse, type QuirkPutParameters, type RootSignalCriteriaGroup, SignalClient, type SignalDeleteParameters, type SignalGetParameters, type SignalGetResponse, type SignalPutParameters, type SignalWithId, type Test, TestClient, type TestDeleteParameters, type TestGetParameters, type TestGetResponse, type TestPutParameters, UncachedAggregateClient, UncachedContextClient, UncachedDimensionClient, UncachedEnrichmentClient, UncachedManifestClient, UncachedQuirkClient, UncachedSignalClient, UncachedTestClient, computeDimensionDefinitionDisplayData, computeDimensionDisplayData, computeDimensionDisplayName, defaultLimitPolicy, handleRateLimits, nullLimitPolicy, rewriteFiltersForApi };
|
|
1997
|
+
export { type Aggregate, AggregateClient, type AggregateDeleteParameters, type AggregateGetParameters, type AggregateGetResponse, type AggregatePutParameters, ApiClient, ApiClientError, BearerTokenNotValidOrExpiredError, CachedAggregateClient, CachedContextClient, CachedDimensionClient, CachedEnrichmentClient, CachedManifestClient, CachedQuirkClient, CachedSignalClient, CachedTestClient, type ClientOptions, ContextClient, type ContextDefinitions, type CookieCriteria, type CurrentPageCriteria, DimensionClient, type DimensionDefinition, type DimensionDisplayData, type DimensionGetParameters, type DimensionGetResponse, type EnrichmentCategory, type EnrichmentCategoryWithValues, EnrichmentClient, type EnrichmentDeleteParameters, type EnrichmentGetParameters, type EnrichmentGetResponse, type EnrichmentPutParameters, type EnrichmentValue, type EnrichmentValueDeleteParameters, type EnrichmentValuePutParameters, type EventCriteria, type ExceptProject, type LimitPolicy, ManifestClient, type ManifestGetParameters, type ManifestGetResponse, type PageViewCountCriteria, type QueryStringCriteria, type Quirk, QuirkClient, type QuirkCriteria, type QuirkDeleteParameters, type QuirkGetParameters, type QuirkGetResponse, type QuirkPutParameters, type RootSignalCriteriaGroup, SignalClient, type SignalDeleteParameters, type SignalGetParameters, type SignalGetResponse, type SignalPutParameters, type SignalWithId, type Test, TestClient, type TestDeleteParameters, type TestGetParameters, type TestGetResponse, type TestPutParameters, UNIFORM_BEARER_TOKEN_NOT_VALID_OR_EXPIRED_MESSAGE, UncachedAggregateClient, UncachedContextClient, UncachedDimensionClient, UncachedEnrichmentClient, UncachedManifestClient, UncachedQuirkClient, UncachedSignalClient, UncachedTestClient, computeDimensionDefinitionDisplayData, computeDimensionDisplayData, computeDimensionDisplayName, defaultLimitPolicy, handleRateLimits, nullLimitPolicy, rewriteFiltersForApi };
|
package/dist/api/api.d.ts
CHANGED
|
@@ -26,6 +26,11 @@ type ClientOptions = {
|
|
|
26
26
|
signal?: AbortSignal;
|
|
27
27
|
};
|
|
28
28
|
type ExceptProject<T> = Omit<T, 'projectId'>;
|
|
29
|
+
/**
|
|
30
|
+
* Uniform API 401 message for an invalid or expired bearer token.
|
|
31
|
+
* Prefer catching {@link BearerTokenNotValidOrExpiredError} when using ApiClient-based SDKs.
|
|
32
|
+
*/
|
|
33
|
+
declare const UNIFORM_BEARER_TOKEN_NOT_VALID_OR_EXPIRED_MESSAGE: "Bearer token not valid or expired";
|
|
29
34
|
declare class ApiClientError extends Error {
|
|
30
35
|
errorMessage: string;
|
|
31
36
|
fetchMethod: string;
|
|
@@ -35,6 +40,13 @@ declare class ApiClientError extends Error {
|
|
|
35
40
|
requestId?: string | undefined;
|
|
36
41
|
constructor(errorMessage: string, fetchMethod: string, fetchUri: string, statusCode?: number | undefined, statusText?: string | undefined, requestId?: string | undefined);
|
|
37
42
|
}
|
|
43
|
+
/**
|
|
44
|
+
* Thrown when the Uniform API responds with 401 and
|
|
45
|
+
* {@link UNIFORM_BEARER_TOKEN_NOT_VALID_OR_EXPIRED_MESSAGE}.
|
|
46
|
+
*/
|
|
47
|
+
declare class BearerTokenNotValidOrExpiredError extends ApiClientError {
|
|
48
|
+
constructor(errorMessage: string, fetchMethod: string, fetchUri: string, statusCode?: number, statusText?: string, requestId?: string);
|
|
49
|
+
}
|
|
38
50
|
|
|
39
51
|
declare class ApiClient<TOptions extends ClientOptions = ClientOptions> {
|
|
40
52
|
protected options: TOptions;
|
|
@@ -1831,9 +1843,11 @@ declare class AggregateClient extends ApiClient {
|
|
|
1831
1843
|
/** Deletes an Aggregate */
|
|
1832
1844
|
remove(body: ExceptProject<AggregateDeleteParameters>): Promise<void>;
|
|
1833
1845
|
}
|
|
1846
|
+
/** @deprecated Pass `bypassCache: true` to {@link AggregateClient} instead. */
|
|
1834
1847
|
declare class UncachedAggregateClient extends AggregateClient {
|
|
1835
1848
|
constructor(options: Omit<ClientOptions, 'bypassCache'>);
|
|
1836
1849
|
}
|
|
1850
|
+
/** @deprecated Pass `bypassCache: false` to {@link AggregateClient} instead. */
|
|
1837
1851
|
declare class CachedAggregateClient extends AggregateClient {
|
|
1838
1852
|
constructor(options: Omit<ClientOptions, 'bypassCache'>);
|
|
1839
1853
|
}
|
|
@@ -1855,9 +1869,11 @@ declare class DimensionClient extends ApiClient {
|
|
|
1855
1869
|
/** Fetches the known score dimensions for a project */
|
|
1856
1870
|
get(options?: ExceptProject<DimensionGetParameters>): Promise<DimensionGetResponse>;
|
|
1857
1871
|
}
|
|
1872
|
+
/** @deprecated Pass `bypassCache: true` to {@link DimensionClient} instead. */
|
|
1858
1873
|
declare class UncachedDimensionClient extends DimensionClient {
|
|
1859
1874
|
constructor(options: Omit<ClientOptions, 'bypassCache'>);
|
|
1860
1875
|
}
|
|
1876
|
+
/** @deprecated Pass `bypassCache: false` to {@link DimensionClient} instead. */
|
|
1861
1877
|
declare class CachedDimensionClient extends DimensionClient {
|
|
1862
1878
|
constructor(options: Omit<ClientOptions, 'bypassCache'>);
|
|
1863
1879
|
}
|
|
@@ -1876,9 +1892,11 @@ declare class EnrichmentClient extends ApiClient {
|
|
|
1876
1892
|
/** Deletes an enrichment value within an enrichment category. The category is left alone. */
|
|
1877
1893
|
removeValue(body: ExceptProject<EnrichmentValueDeleteParameters>): Promise<void>;
|
|
1878
1894
|
}
|
|
1895
|
+
/** @deprecated Pass `bypassCache: true` to {@link EnrichmentClient} instead. */
|
|
1879
1896
|
declare class UncachedEnrichmentClient extends EnrichmentClient {
|
|
1880
1897
|
constructor(options: Omit<ClientOptions, 'bypassCache'>);
|
|
1881
1898
|
}
|
|
1899
|
+
/** @deprecated Pass `bypassCache: false` to {@link EnrichmentClient} instead. */
|
|
1882
1900
|
declare class CachedEnrichmentClient extends EnrichmentClient {
|
|
1883
1901
|
constructor(options: Omit<ClientOptions, 'bypassCache'>);
|
|
1884
1902
|
}
|
|
@@ -1891,9 +1909,11 @@ declare class ManifestClient extends ApiClient {
|
|
|
1891
1909
|
/** Publishes the Context manifest for a project */
|
|
1892
1910
|
publish(): Promise<void>;
|
|
1893
1911
|
}
|
|
1912
|
+
/** @deprecated Pass `bypassCache: true` to {@link ManifestClient} instead. */
|
|
1894
1913
|
declare class UncachedManifestClient extends ManifestClient {
|
|
1895
1914
|
constructor(options: Omit<ClientOptions, 'bypassCache'>);
|
|
1896
1915
|
}
|
|
1916
|
+
/** @deprecated Pass `bypassCache: false` to {@link ManifestClient} instead. */
|
|
1897
1917
|
declare class CachedManifestClient extends ManifestClient {
|
|
1898
1918
|
constructor(options: Omit<ClientOptions, 'bypassCache'>);
|
|
1899
1919
|
}
|
|
@@ -1908,9 +1928,11 @@ declare class QuirkClient extends ApiClient {
|
|
|
1908
1928
|
/** Deletes a Quirk */
|
|
1909
1929
|
remove(body: ExceptProject<QuirkDeleteParameters>): Promise<void>;
|
|
1910
1930
|
}
|
|
1931
|
+
/** @deprecated Pass `bypassCache: true` to {@link QuirkClient} instead. */
|
|
1911
1932
|
declare class UncachedQuirkClient extends QuirkClient {
|
|
1912
1933
|
constructor(options: Omit<ClientOptions, 'bypassCache'>);
|
|
1913
1934
|
}
|
|
1935
|
+
/** @deprecated Pass `bypassCache: false` to {@link QuirkClient} instead. */
|
|
1914
1936
|
declare class CachedQuirkClient extends QuirkClient {
|
|
1915
1937
|
constructor(options: Omit<ClientOptions, 'bypassCache'>);
|
|
1916
1938
|
}
|
|
@@ -1925,9 +1947,11 @@ declare class SignalClient extends ApiClient {
|
|
|
1925
1947
|
/** Deletes a Signal */
|
|
1926
1948
|
remove(body: ExceptProject<SignalDeleteParameters>): Promise<void>;
|
|
1927
1949
|
}
|
|
1950
|
+
/** @deprecated Pass `bypassCache: true` to {@link SignalClient} instead. */
|
|
1928
1951
|
declare class UncachedSignalClient extends SignalClient {
|
|
1929
1952
|
constructor(options: Omit<ClientOptions, 'bypassCache'>);
|
|
1930
1953
|
}
|
|
1954
|
+
/** @deprecated Pass `bypassCache: false` to {@link SignalClient} instead. */
|
|
1931
1955
|
declare class CachedSignalClient extends SignalClient {
|
|
1932
1956
|
constructor(options: Omit<ClientOptions, 'bypassCache'>);
|
|
1933
1957
|
}
|
|
@@ -1942,9 +1966,11 @@ declare class TestClient extends ApiClient {
|
|
|
1942
1966
|
/** Deletes a Test */
|
|
1943
1967
|
remove(body: ExceptProject<TestDeleteParameters>): Promise<void>;
|
|
1944
1968
|
}
|
|
1969
|
+
/** @deprecated Pass `bypassCache: true` to {@link TestClient} instead. */
|
|
1945
1970
|
declare class UncachedTestClient extends TestClient {
|
|
1946
1971
|
constructor(options: Omit<ClientOptions, 'bypassCache'>);
|
|
1947
1972
|
}
|
|
1973
|
+
/** @deprecated Pass `bypassCache: false` to {@link TestClient} instead. */
|
|
1948
1974
|
declare class CachedTestClient extends TestClient {
|
|
1949
1975
|
constructor(options: Omit<ClientOptions, 'bypassCache'>);
|
|
1950
1976
|
}
|
|
@@ -1959,11 +1985,13 @@ declare class ContextClient {
|
|
|
1959
1985
|
readonly signals: SignalClient;
|
|
1960
1986
|
readonly tests: TestClient;
|
|
1961
1987
|
}
|
|
1988
|
+
/** @deprecated Pass `bypassCache: true` to {@link ContextClient} instead. */
|
|
1962
1989
|
declare class UncachedContextClient extends ContextClient {
|
|
1963
1990
|
constructor(options: Omit<ClientOptions, 'bypassCache'>);
|
|
1964
1991
|
}
|
|
1992
|
+
/** @deprecated Pass `bypassCache: false` to {@link ContextClient} instead. */
|
|
1965
1993
|
declare class CachedContextClient extends ContextClient {
|
|
1966
1994
|
constructor(options: Omit<ClientOptions, 'bypassCache'>);
|
|
1967
1995
|
}
|
|
1968
1996
|
|
|
1969
|
-
export { type Aggregate, AggregateClient, type AggregateDeleteParameters, type AggregateGetParameters, type AggregateGetResponse, type AggregatePutParameters, ApiClient, ApiClientError, CachedAggregateClient, CachedContextClient, CachedDimensionClient, CachedEnrichmentClient, CachedManifestClient, CachedQuirkClient, CachedSignalClient, CachedTestClient, type ClientOptions, ContextClient, type ContextDefinitions, type CookieCriteria, type CurrentPageCriteria, DimensionClient, type DimensionDefinition, type DimensionDisplayData, type DimensionGetParameters, type DimensionGetResponse, type EnrichmentCategory, type EnrichmentCategoryWithValues, EnrichmentClient, type EnrichmentDeleteParameters, type EnrichmentGetParameters, type EnrichmentGetResponse, type EnrichmentPutParameters, type EnrichmentValue, type EnrichmentValueDeleteParameters, type EnrichmentValuePutParameters, type EventCriteria, type ExceptProject, type LimitPolicy, ManifestClient, type ManifestGetParameters, type ManifestGetResponse, type PageViewCountCriteria, type QueryStringCriteria, type Quirk, QuirkClient, type QuirkCriteria, type QuirkDeleteParameters, type QuirkGetParameters, type QuirkGetResponse, type QuirkPutParameters, type RootSignalCriteriaGroup, SignalClient, type SignalDeleteParameters, type SignalGetParameters, type SignalGetResponse, type SignalPutParameters, type SignalWithId, type Test, TestClient, type TestDeleteParameters, type TestGetParameters, type TestGetResponse, type TestPutParameters, UncachedAggregateClient, UncachedContextClient, UncachedDimensionClient, UncachedEnrichmentClient, UncachedManifestClient, UncachedQuirkClient, UncachedSignalClient, UncachedTestClient, computeDimensionDefinitionDisplayData, computeDimensionDisplayData, computeDimensionDisplayName, defaultLimitPolicy, handleRateLimits, nullLimitPolicy, rewriteFiltersForApi };
|
|
1997
|
+
export { type Aggregate, AggregateClient, type AggregateDeleteParameters, type AggregateGetParameters, type AggregateGetResponse, type AggregatePutParameters, ApiClient, ApiClientError, BearerTokenNotValidOrExpiredError, CachedAggregateClient, CachedContextClient, CachedDimensionClient, CachedEnrichmentClient, CachedManifestClient, CachedQuirkClient, CachedSignalClient, CachedTestClient, type ClientOptions, ContextClient, type ContextDefinitions, type CookieCriteria, type CurrentPageCriteria, DimensionClient, type DimensionDefinition, type DimensionDisplayData, type DimensionGetParameters, type DimensionGetResponse, type EnrichmentCategory, type EnrichmentCategoryWithValues, EnrichmentClient, type EnrichmentDeleteParameters, type EnrichmentGetParameters, type EnrichmentGetResponse, type EnrichmentPutParameters, type EnrichmentValue, type EnrichmentValueDeleteParameters, type EnrichmentValuePutParameters, type EventCriteria, type ExceptProject, type LimitPolicy, ManifestClient, type ManifestGetParameters, type ManifestGetResponse, type PageViewCountCriteria, type QueryStringCriteria, type Quirk, QuirkClient, type QuirkCriteria, type QuirkDeleteParameters, type QuirkGetParameters, type QuirkGetResponse, type QuirkPutParameters, type RootSignalCriteriaGroup, SignalClient, type SignalDeleteParameters, type SignalGetParameters, type SignalGetResponse, type SignalPutParameters, type SignalWithId, type Test, TestClient, type TestDeleteParameters, type TestGetParameters, type TestGetResponse, type TestPutParameters, UNIFORM_BEARER_TOKEN_NOT_VALID_OR_EXPIRED_MESSAGE, UncachedAggregateClient, UncachedContextClient, UncachedDimensionClient, UncachedEnrichmentClient, UncachedManifestClient, UncachedQuirkClient, UncachedSignalClient, UncachedTestClient, computeDimensionDefinitionDisplayData, computeDimensionDisplayData, computeDimensionDisplayName, defaultLimitPolicy, handleRateLimits, nullLimitPolicy, rewriteFiltersForApi };
|
package/dist/api/api.js
CHANGED
|
@@ -41,6 +41,7 @@ __export(api_exports, {
|
|
|
41
41
|
AggregateClient: () => AggregateClient,
|
|
42
42
|
ApiClient: () => ApiClient,
|
|
43
43
|
ApiClientError: () => ApiClientError,
|
|
44
|
+
BearerTokenNotValidOrExpiredError: () => BearerTokenNotValidOrExpiredError,
|
|
44
45
|
CachedAggregateClient: () => CachedAggregateClient,
|
|
45
46
|
CachedContextClient: () => CachedContextClient,
|
|
46
47
|
CachedDimensionClient: () => CachedDimensionClient,
|
|
@@ -56,6 +57,7 @@ __export(api_exports, {
|
|
|
56
57
|
QuirkClient: () => QuirkClient,
|
|
57
58
|
SignalClient: () => SignalClient,
|
|
58
59
|
TestClient: () => TestClient,
|
|
60
|
+
UNIFORM_BEARER_TOKEN_NOT_VALID_OR_EXPIRED_MESSAGE: () => UNIFORM_BEARER_TOKEN_NOT_VALID_OR_EXPIRED_MESSAGE,
|
|
59
61
|
UncachedAggregateClient: () => UncachedAggregateClient,
|
|
60
62
|
UncachedContextClient: () => UncachedContextClient,
|
|
61
63
|
UncachedDimensionClient: () => UncachedDimensionClient,
|
|
@@ -78,6 +80,7 @@ module.exports = __toCommonJS(api_exports);
|
|
|
78
80
|
var import_p_limit = __toESM(require("p-limit"));
|
|
79
81
|
var nullLimitPolicy = async (func) => await func();
|
|
80
82
|
var defaultLimitPolicy = (0, import_p_limit.default)(6);
|
|
83
|
+
var UNIFORM_BEARER_TOKEN_NOT_VALID_OR_EXPIRED_MESSAGE = "Bearer token not valid or expired";
|
|
81
84
|
var ApiClientError = class _ApiClientError extends Error {
|
|
82
85
|
constructor(errorMessage, fetchMethod, fetchUri, statusCode, statusText, requestId) {
|
|
83
86
|
super(
|
|
@@ -93,6 +96,12 @@ var ApiClientError = class _ApiClientError extends Error {
|
|
|
93
96
|
Object.setPrototypeOf(this, _ApiClientError.prototype);
|
|
94
97
|
}
|
|
95
98
|
};
|
|
99
|
+
var BearerTokenNotValidOrExpiredError = class _BearerTokenNotValidOrExpiredError extends ApiClientError {
|
|
100
|
+
constructor(errorMessage, fetchMethod, fetchUri, statusCode, statusText, requestId) {
|
|
101
|
+
super(errorMessage, fetchMethod, fetchUri, statusCode, statusText, requestId);
|
|
102
|
+
Object.setPrototypeOf(this, _BearerTokenNotValidOrExpiredError.prototype);
|
|
103
|
+
}
|
|
104
|
+
};
|
|
96
105
|
|
|
97
106
|
// src/api/ApiClient.ts
|
|
98
107
|
var ApiClient = class _ApiClient {
|
|
@@ -128,7 +137,7 @@ var ApiClient = class _ApiClient {
|
|
|
128
137
|
}
|
|
129
138
|
async apiClientWithResponse(fetchUri, options) {
|
|
130
139
|
return this.options.limitPolicy(async () => {
|
|
131
|
-
var _a;
|
|
140
|
+
var _a, _b;
|
|
132
141
|
const coreHeaders = this.options.apiKey ? {
|
|
133
142
|
"x-api-key": this.options.apiKey
|
|
134
143
|
} : {
|
|
@@ -164,9 +173,19 @@ var ApiClient = class _ApiClient {
|
|
|
164
173
|
} catch (e) {
|
|
165
174
|
message = `General error`;
|
|
166
175
|
}
|
|
176
|
+
if (apiResponse.status === 401 && message === UNIFORM_BEARER_TOKEN_NOT_VALID_OR_EXPIRED_MESSAGE) {
|
|
177
|
+
throw new BearerTokenNotValidOrExpiredError(
|
|
178
|
+
message,
|
|
179
|
+
(_a = options == null ? void 0 : options.method) != null ? _a : "GET",
|
|
180
|
+
fetchUri.toString(),
|
|
181
|
+
apiResponse.status,
|
|
182
|
+
apiResponse.statusText,
|
|
183
|
+
_ApiClient.getRequestId(apiResponse)
|
|
184
|
+
);
|
|
185
|
+
}
|
|
167
186
|
throw new ApiClientError(
|
|
168
187
|
message,
|
|
169
|
-
(
|
|
188
|
+
(_b = options == null ? void 0 : options.method) != null ? _b : "GET",
|
|
170
189
|
fetchUri.toString(),
|
|
171
190
|
apiResponse.status,
|
|
172
191
|
apiResponse.statusText,
|
|
@@ -637,6 +656,7 @@ var CachedContextClient = class extends ContextClient {
|
|
|
637
656
|
AggregateClient,
|
|
638
657
|
ApiClient,
|
|
639
658
|
ApiClientError,
|
|
659
|
+
BearerTokenNotValidOrExpiredError,
|
|
640
660
|
CachedAggregateClient,
|
|
641
661
|
CachedContextClient,
|
|
642
662
|
CachedDimensionClient,
|
|
@@ -652,6 +672,7 @@ var CachedContextClient = class extends ContextClient {
|
|
|
652
672
|
QuirkClient,
|
|
653
673
|
SignalClient,
|
|
654
674
|
TestClient,
|
|
675
|
+
UNIFORM_BEARER_TOKEN_NOT_VALID_OR_EXPIRED_MESSAGE,
|
|
655
676
|
UncachedAggregateClient,
|
|
656
677
|
UncachedContextClient,
|
|
657
678
|
UncachedDimensionClient,
|
package/dist/api/api.mjs
CHANGED
|
@@ -12,6 +12,7 @@ var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot
|
|
|
12
12
|
import pLimit from "p-limit";
|
|
13
13
|
var nullLimitPolicy = async (func) => await func();
|
|
14
14
|
var defaultLimitPolicy = pLimit(6);
|
|
15
|
+
var UNIFORM_BEARER_TOKEN_NOT_VALID_OR_EXPIRED_MESSAGE = "Bearer token not valid or expired";
|
|
15
16
|
var ApiClientError = class _ApiClientError extends Error {
|
|
16
17
|
constructor(errorMessage, fetchMethod, fetchUri, statusCode, statusText, requestId) {
|
|
17
18
|
super(
|
|
@@ -27,6 +28,12 @@ var ApiClientError = class _ApiClientError extends Error {
|
|
|
27
28
|
Object.setPrototypeOf(this, _ApiClientError.prototype);
|
|
28
29
|
}
|
|
29
30
|
};
|
|
31
|
+
var BearerTokenNotValidOrExpiredError = class _BearerTokenNotValidOrExpiredError extends ApiClientError {
|
|
32
|
+
constructor(errorMessage, fetchMethod, fetchUri, statusCode, statusText, requestId) {
|
|
33
|
+
super(errorMessage, fetchMethod, fetchUri, statusCode, statusText, requestId);
|
|
34
|
+
Object.setPrototypeOf(this, _BearerTokenNotValidOrExpiredError.prototype);
|
|
35
|
+
}
|
|
36
|
+
};
|
|
30
37
|
|
|
31
38
|
// src/api/ApiClient.ts
|
|
32
39
|
var ApiClient = class _ApiClient {
|
|
@@ -62,7 +69,7 @@ var ApiClient = class _ApiClient {
|
|
|
62
69
|
}
|
|
63
70
|
async apiClientWithResponse(fetchUri, options) {
|
|
64
71
|
return this.options.limitPolicy(async () => {
|
|
65
|
-
var _a;
|
|
72
|
+
var _a, _b;
|
|
66
73
|
const coreHeaders = this.options.apiKey ? {
|
|
67
74
|
"x-api-key": this.options.apiKey
|
|
68
75
|
} : {
|
|
@@ -98,9 +105,19 @@ var ApiClient = class _ApiClient {
|
|
|
98
105
|
} catch (e) {
|
|
99
106
|
message = `General error`;
|
|
100
107
|
}
|
|
108
|
+
if (apiResponse.status === 401 && message === UNIFORM_BEARER_TOKEN_NOT_VALID_OR_EXPIRED_MESSAGE) {
|
|
109
|
+
throw new BearerTokenNotValidOrExpiredError(
|
|
110
|
+
message,
|
|
111
|
+
(_a = options == null ? void 0 : options.method) != null ? _a : "GET",
|
|
112
|
+
fetchUri.toString(),
|
|
113
|
+
apiResponse.status,
|
|
114
|
+
apiResponse.statusText,
|
|
115
|
+
_ApiClient.getRequestId(apiResponse)
|
|
116
|
+
);
|
|
117
|
+
}
|
|
101
118
|
throw new ApiClientError(
|
|
102
119
|
message,
|
|
103
|
-
(
|
|
120
|
+
(_b = options == null ? void 0 : options.method) != null ? _b : "GET",
|
|
104
121
|
fetchUri.toString(),
|
|
105
122
|
apiResponse.status,
|
|
106
123
|
apiResponse.statusText,
|
|
@@ -570,6 +587,7 @@ export {
|
|
|
570
587
|
AggregateClient,
|
|
571
588
|
ApiClient,
|
|
572
589
|
ApiClientError,
|
|
590
|
+
BearerTokenNotValidOrExpiredError,
|
|
573
591
|
CachedAggregateClient,
|
|
574
592
|
CachedContextClient,
|
|
575
593
|
CachedDimensionClient,
|
|
@@ -585,6 +603,7 @@ export {
|
|
|
585
603
|
QuirkClient,
|
|
586
604
|
SignalClient,
|
|
587
605
|
TestClient,
|
|
606
|
+
UNIFORM_BEARER_TOKEN_NOT_VALID_OR_EXPIRED_MESSAGE,
|
|
588
607
|
UncachedAggregateClient,
|
|
589
608
|
UncachedContextClient,
|
|
590
609
|
UncachedDimensionClient,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniformdev/context",
|
|
3
|
-
"version": "20.72.3-alpha.
|
|
3
|
+
"version": "20.72.3-alpha.52+f01685e1ef",
|
|
4
4
|
"description": "Uniform Context core package",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -70,5 +70,5 @@
|
|
|
70
70
|
"publishConfig": {
|
|
71
71
|
"access": "public"
|
|
72
72
|
},
|
|
73
|
-
"gitHead": "
|
|
73
|
+
"gitHead": "f01685e1ef0aeb05dc200ccdcdd5aba6f6cfc437"
|
|
74
74
|
}
|