@opengeoweb/api 6.0.0 → 6.0.2
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/index.esm.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./src/index";
|
|
@@ -135,7 +135,10 @@ function _regeneratorRuntime() {
|
|
|
135
135
|
if ("executing" === state) throw new Error("Generator is already running");
|
|
136
136
|
if ("completed" === state) {
|
|
137
137
|
if ("throw" === method) throw arg;
|
|
138
|
-
return
|
|
138
|
+
return {
|
|
139
|
+
value: void 0,
|
|
140
|
+
done: !0
|
|
141
|
+
};
|
|
139
142
|
}
|
|
140
143
|
for (context.method = method, context.arg = arg;;) {
|
|
141
144
|
var delegate = context.delegate;
|
|
@@ -188,7 +191,7 @@ function _regeneratorRuntime() {
|
|
|
188
191
|
}], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
|
|
189
192
|
}
|
|
190
193
|
function values(iterable) {
|
|
191
|
-
if (iterable) {
|
|
194
|
+
if (iterable || "" === iterable) {
|
|
192
195
|
var iteratorMethod = iterable[iteratorSymbol];
|
|
193
196
|
if (iteratorMethod) return iteratorMethod.call(iterable);
|
|
194
197
|
if ("function" == typeof iterable.next) return iterable;
|
|
@@ -201,15 +204,7 @@ function _regeneratorRuntime() {
|
|
|
201
204
|
return next.next = next;
|
|
202
205
|
}
|
|
203
206
|
}
|
|
204
|
-
|
|
205
|
-
next: doneResult
|
|
206
|
-
};
|
|
207
|
-
}
|
|
208
|
-
function doneResult() {
|
|
209
|
-
return {
|
|
210
|
-
value: undefined,
|
|
211
|
-
done: !0
|
|
212
|
-
};
|
|
207
|
+
throw new TypeError(typeof iterable + " is not iterable");
|
|
213
208
|
}
|
|
214
209
|
return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", {
|
|
215
210
|
value: GeneratorFunctionPrototype,
|
|
@@ -414,7 +409,12 @@ function __awaiter(thisArg, _arguments, P, generator) {
|
|
|
414
409
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
415
410
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
416
411
|
});
|
|
417
|
-
}
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
415
|
+
var e = new Error(message);
|
|
416
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
417
|
+
};
|
|
418
418
|
|
|
419
419
|
var generateRandomId = function generateRandomId() {
|
|
420
420
|
return "-".concat(Math.random().toString(36).substr(2, 9));
|
|
@@ -530,10 +530,13 @@ var ApiProvider = function ApiProvider(_a) {
|
|
|
530
530
|
return function () {
|
|
531
531
|
};
|
|
532
532
|
}, [handleNewApi, name]);
|
|
533
|
-
|
|
534
|
-
|
|
533
|
+
var contextValue = React.useMemo(function () {
|
|
534
|
+
return {
|
|
535
535
|
api: api
|
|
536
|
-
}
|
|
536
|
+
};
|
|
537
|
+
}, [api]);
|
|
538
|
+
return /*#__PURE__*/React.createElement(ApiContext.Provider, {
|
|
539
|
+
value: contextValue
|
|
537
540
|
}, children);
|
|
538
541
|
};
|
|
539
542
|
function useApiContext() {
|
package/package.json
CHANGED
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengeoweb/api",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.2",
|
|
4
4
|
"description": "GeoWeb API library for the opengeoweb project",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
8
|
"url": "git@gitlab.com:opengeoweb/opengeoweb.git"
|
|
9
9
|
},
|
|
10
|
-
"module": "./index.js",
|
|
11
|
-
"main": "./index.js",
|
|
10
|
+
"module": "./index.esm.js",
|
|
12
11
|
"type": "module",
|
|
13
|
-
"
|
|
12
|
+
"main": "./index.esm.js",
|
|
14
13
|
"dependencies": {},
|
|
15
14
|
"peerDependencies": {
|
|
16
|
-
"@opengeoweb/shared": "6.0.
|
|
15
|
+
"@opengeoweb/shared": "6.0.2",
|
|
17
16
|
"axios": "1.4.0",
|
|
18
17
|
"react": "18.2.0"
|
|
19
18
|
}
|
|
@@ -12,7 +12,7 @@ export interface Credentials {
|
|
|
12
12
|
keep_session_alive_at?: number;
|
|
13
13
|
has_connection_issue?: boolean;
|
|
14
14
|
}
|
|
15
|
-
export
|
|
15
|
+
export type ApiUrls = {
|
|
16
16
|
baseURL?: string;
|
|
17
17
|
appURL?: string;
|
|
18
18
|
authTokenURL?: string;
|
|
@@ -27,4 +27,4 @@ export interface ApiModule {
|
|
|
27
27
|
export interface CreateApiProps extends ApiModule {
|
|
28
28
|
timeout?: number;
|
|
29
29
|
}
|
|
30
|
-
export
|
|
30
|
+
export type CreateApiFn = (props: CreateApiProps) => void;
|
|
@@ -17,6 +17,6 @@ export declare const refreshAccessToken: ({ auth, config: { authTokenURL, authCl
|
|
|
17
17
|
export declare const refreshAccessTokenAndSetAuthContext: ({ auth, onSetAuth, config, timeout, }: CreateApiProps) => Promise<void>;
|
|
18
18
|
export declare const createApiInstance: ({ auth, onSetAuth, config: { baseURL, authTokenURL, authClientId, appURL }, timeout, }: CreateApiProps) => AxiosInstance;
|
|
19
19
|
export declare const createNonAuthApiInstance: ({ config: { baseURL }, timeout, }: CreateApiProps) => AxiosInstance;
|
|
20
|
-
export declare const fakeApiRequest: (signal?: AbortController
|
|
20
|
+
export declare const fakeApiRequest: (signal?: AbortController) => Promise<void>;
|
|
21
21
|
export declare const createFakeApiInstance: () => AxiosInstance;
|
|
22
22
|
export declare const getCurrentTimeInSeconds: () => number;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ConfigType } from '@opengeoweb/shared';
|
|
2
|
-
export
|
|
2
|
+
export type ApiParams = string | ConfigType | {
|
|
3
3
|
[key: string]: string | undefined;
|
|
4
4
|
} | null;
|
|
5
5
|
export interface ApiHookProps {
|
|
@@ -9,4 +9,4 @@ export interface ApiHookProps {
|
|
|
9
9
|
fetchApiData?: (params: ApiParams) => Promise<void>;
|
|
10
10
|
clearResults?: () => void;
|
|
11
11
|
}
|
|
12
|
-
export declare const useApi: (apiCall?: ((params?: ApiParams
|
|
12
|
+
export declare const useApi: (apiCall?: ((params?: ApiParams, id?: string) => Promise<any>) | undefined, params?: ApiParams) => ApiHookProps;
|