@squonk/account-server-client 0.1.38-rc.1 → 1.0.0-rc.1
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/asset/asset.cjs +39 -14
- package/asset/asset.cjs.map +1 -1
- package/asset/asset.d.ts +1 -3
- package/asset/asset.js +39 -14
- package/asset/asset.js.map +1 -1
- package/chunk-3O5KIRV4.js +27 -0
- package/{chunk-3TENYKS7.js.map → chunk-3O5KIRV4.js.map} +1 -1
- package/chunk-IUEU2LYC.cjs +27 -0
- package/chunk-IUEU2LYC.cjs.map +1 -0
- package/{custom-instance-00382740.d.ts → custom-instance-b8075093.d.ts} +92 -15
- package/index.cjs +11 -2
- package/index.cjs.map +1 -1
- package/index.d.ts +1 -1
- package/index.js +10 -1
- package/index.js.map +1 -1
- package/merchant/merchant.cjs +14 -5
- package/merchant/merchant.cjs.map +1 -1
- package/merchant/merchant.d.ts +1 -3
- package/merchant/merchant.js +14 -5
- package/merchant/merchant.js.map +1 -1
- package/organisation/organisation.cjs +22 -10
- package/organisation/organisation.cjs.map +1 -1
- package/organisation/organisation.d.ts +1 -3
- package/organisation/organisation.js +22 -10
- package/organisation/organisation.js.map +1 -1
- package/package.json +3 -4
- package/product/product.cjs +75 -26
- package/product/product.cjs.map +1 -1
- package/product/product.d.ts +22 -4
- package/product/product.js +74 -25
- package/product/product.js.map +1 -1
- package/src/account-server-api.schemas.ts +109 -14
- package/src/asset/asset.ts +2 -6
- package/src/merchant/merchant.ts +2 -6
- package/src/organisation/organisation.ts +2 -6
- package/src/product/product.ts +74 -6
- package/src/state/state.ts +2 -6
- package/src/unit/unit.ts +4 -8
- package/src/user/user.ts +4 -8
- package/state/state.cjs +10 -3
- package/state/state.cjs.map +1 -1
- package/state/state.d.ts +1 -3
- package/state/state.js +10 -3
- package/state/state.js.map +1 -1
- package/unit/unit.cjs +42 -17
- package/unit/unit.cjs.map +1 -1
- package/unit/unit.d.ts +3 -5
- package/unit/unit.js +41 -16
- package/unit/unit.js.map +1 -1
- package/user/user.cjs +34 -13
- package/user/user.cjs.map +1 -1
- package/user/user.d.ts +3 -5
- package/user/user.js +34 -13
- package/user/user.js.map +1 -1
- package/chunk-3TENYKS7.js +0 -46
- package/chunk-RHHRF25R.cjs +0 -46
- package/chunk-RHHRF25R.cjs.map +0 -1
package/chunk-RHHRF25R.cjs
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var __defProp = Object.defineProperty;
|
|
2
|
-
var __defProps = Object.defineProperties;
|
|
3
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
-
var __spreadValues = (a, b) => {
|
|
9
|
-
for (var prop in b || (b = {}))
|
|
10
|
-
if (__hasOwnProp.call(b, prop))
|
|
11
|
-
__defNormalProp(a, prop, b[prop]);
|
|
12
|
-
if (__getOwnPropSymbols)
|
|
13
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
-
if (__propIsEnum.call(b, prop))
|
|
15
|
-
__defNormalProp(a, prop, b[prop]);
|
|
16
|
-
}
|
|
17
|
-
return a;
|
|
18
|
-
};
|
|
19
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
-
|
|
21
|
-
// src/custom-instance.ts
|
|
22
|
-
var _axios = require('axios'); var _axios2 = _interopRequireDefault(_axios);
|
|
23
|
-
var AXIOS_INSTANCE = _axios2.default.create();
|
|
24
|
-
var setAuthToken = (token) => {
|
|
25
|
-
AXIOS_INSTANCE.defaults.headers.common["Authorization"] = `Bearer ${token}`;
|
|
26
|
-
};
|
|
27
|
-
var setBaseUrl = (baseUrl) => {
|
|
28
|
-
AXIOS_INSTANCE.defaults.baseURL = baseUrl;
|
|
29
|
-
};
|
|
30
|
-
var customInstance = (config, options) => {
|
|
31
|
-
const source = _axios2.default.CancelToken.source();
|
|
32
|
-
const promise = AXIOS_INSTANCE(__spreadProps(__spreadValues(__spreadValues({}, config), options), { cancelToken: source.token })).then(({ data }) => data);
|
|
33
|
-
promise.cancel = () => {
|
|
34
|
-
source.cancel("Query was cancelled by React Query");
|
|
35
|
-
};
|
|
36
|
-
return promise;
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
exports.__spreadValues = __spreadValues; exports.AXIOS_INSTANCE = AXIOS_INSTANCE; exports.setAuthToken = setAuthToken; exports.setBaseUrl = setBaseUrl; exports.customInstance = customInstance;
|
|
46
|
-
//# sourceMappingURL=chunk-RHHRF25R.cjs.map
|
package/chunk-RHHRF25R.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/custom-instance.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAUA;AAEO,IAAM,iBAAiB,MAAM,OAAO;AAOpC,IAAM,eAAe,CAAC,UAAkB;AAC7C,iBAAe,SAAS,QAAQ,OAAO,mBAAmB,UAAU;AACtE;AAMO,IAAM,aAAa,CAAC,YAAoB;AAC7C,iBAAe,SAAS,UAAU;AACpC;AAEO,IAAM,iBAAiB,CAC5B,QACA,YACqB;AACrB,QAAM,SAAS,MAAM,YAAY,OAAO;AAExC,QAAM,UAAU,eAAe,gDAAK,SAAW,UAAhB,EAAyB,aAAa,OAAO,MAAM,EAAC,EAAE,KACnF,CAAC,EAAE,WAAW,IAChB;AAIA,EAAC,QAAgB,SAAS,MAAM;AAC9B,WAAO,OAAO,oCAAoC;AAAA,EACpD;AAEA,SAAO;AACT","sourcesContent":["/** Based off the example custom-instance from Orval docs\n * https://github.com/anymaniax/orval/blob/master/samples/react-app-with-react-query/src/api/mutator/custom-instance.ts\n *\n * See https://react-query.tanstack.com/guides/query-cancellation\n *\n * TODO: Considering using Fetch-API instead of axios. This instance will have to change. Could be\n * achieved without changing much using `redaxios`\n * Or use 'ky'\n */\n\nimport Axios, { AxiosError, AxiosRequestConfig } from 'axios';\n\nexport const AXIOS_INSTANCE = Axios.create();\n\n/**\n * Set the access token to be added as the `Authorization: Bearer 'token'` header\n * Useful for client only apps where a proxy API route isn't involved to securely add the access token\n * @param token access token\n */\nexport const setAuthToken = (token: string) => {\n AXIOS_INSTANCE.defaults.headers.common['Authorization'] = `Bearer ${token}`;\n};\n\n/**\n * Set the url to which request paths are added to.\n * @param baseUrl origin + subpath e.g. 'https://example.com/subpath' or '/subpath'\n */\nexport const setBaseUrl = (baseUrl: string) => {\n AXIOS_INSTANCE.defaults.baseURL = baseUrl;\n};\n\nexport const customInstance = <TReturn>(\n config: AxiosRequestConfig,\n options?: AxiosRequestConfig,\n): Promise<TReturn> => {\n const source = Axios.CancelToken.source();\n\n const promise = AXIOS_INSTANCE({ ...config, ...options, cancelToken: source.token }).then(\n ({ data }) => data,\n );\n\n // Promise doesn't have a cancel method but react-query requires this method to make cancellations general.\n // This can either be a any assertion or a @ts-ignore comment.\n (promise as any).cancel = () => {\n source.cancel('Query was cancelled by React Query');\n };\n\n return promise;\n};\n\nexport type ErrorType<TError> = AxiosError<TError>;\n"]}
|