@availity/native-form 5.0.3 → 5.0.4
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/CHANGELOG.md +44 -0
- package/dist/index.d.mts +13 -0
- package/dist/index.js +31 -9
- package/dist/index.mjs +30 -7
- package/package.json +4 -4
- package/project.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,50 @@
|
|
|
2
2
|
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
|
4
4
|
|
|
5
|
+
## [5.0.4](https://github.com/Availity/sdk-js/compare/@availity/native-form@5.0.3...@availity/native-form@5.0.4) (2023-08-23)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
# 1.0.0 (2023-08-23)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Bug Fixes
|
|
13
|
+
|
|
14
|
+
* add browser field for output ([0ce7170](https://github.com/Availity/sdk-js/commit/0ce717075a82675b8707e4db0cc07cd4af370f3d))
|
|
15
|
+
* append function is not defined for ie and edge mobile ([d995343](https://github.com/Availity/sdk-js/commit/d995343c63484b5df1b0660d5a44e52db5c2c6a9))
|
|
16
|
+
* **native-form:** fixed error trying to call toString on undefined ([c009460](https://github.com/Availity/sdk-js/commit/c0094607e992ef7072eeb37dedfc908eb2911f3e))
|
|
17
|
+
* **native-form:** update types and use api-axiosv6 ([02b0cd6](https://github.com/Availity/sdk-js/commit/02b0cd6a6c1f401c71b4ddc8482297604531983a))
|
|
18
|
+
* **native-form:** updated handling of falsey values ([ab57615](https://github.com/Availity/sdk-js/commit/ab57615e2158b41a54132e92e05026a2cfd1e0ea))
|
|
19
|
+
* **native-form:** updated test suite name ([fbf824c](https://github.com/Availity/sdk-js/commit/fbf824c7f2c5540193ab3d244a9598524f44d443))
|
|
20
|
+
* update babel and jest configs, rename tests ([c80e194](https://github.com/Availity/sdk-js/commit/c80e1947f0c3cb28c3c7db842c82f381622d72e7))
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
### Code Refactoring
|
|
24
|
+
|
|
25
|
+
* **analytics-core,api-core,authorizations-core,message-core,native-form,upload-core:** eslint fixes ([00e3395](https://github.com/Availity/sdk-js/commit/00e339595962501c96acf2895650f104d4c49809))
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
* build!: switch from lerna to nx and compile to esm with tsup ([c586085](https://github.com/Availity/sdk-js/commit/c5860856ca96b743a0653d335ea00f0889132f7f))
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
### Features
|
|
32
|
+
|
|
33
|
+
* **native-form:** add native form ([#62](https://github.com/Availity/sdk-js/issues/62)) ([8aa0471](https://github.com/Availity/sdk-js/commit/8aa047123d240906c129466800102b9dff2139d5))
|
|
34
|
+
* **native-form:** add operationName to graphql request for query tracking ([5772f57](https://github.com/Availity/sdk-js/commit/5772f57f30278ede6d85daefe2ab7341e8b78b92))
|
|
35
|
+
* **native-form:** call avWebQLApi to obtain sso type ([23a1bd9](https://github.com/Availity/sdk-js/commit/23a1bd98cc71334454d137be822a5a5a23a32447))
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
### BREAKING CHANGES
|
|
39
|
+
|
|
40
|
+
* Drop Internet Explorer support
|
|
41
|
+
* **native-form:** native-form now exports an async function, no longer defaults type
|
|
42
|
+
MIGRATION:
|
|
43
|
+
Before: nativeForm(...args);
|
|
44
|
+
After: await nativeForm(...args);
|
|
45
|
+
* **analytics-core,api-core,authorizations-core,message-core,native-form,upload-core:** .filter()[0] replaced with .find(), .forEach() replaced with for...of
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
5
49
|
## [5.0.3](https://github.com/Availity/sdk-js/compare/@availity/native-form@5.0.2...@availity/native-form@5.0.3) (2022-06-15)
|
|
6
50
|
|
|
7
51
|
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
+
|
|
3
|
+
type SsoType = 'saml' | 'openid';
|
|
4
|
+
|
|
5
|
+
declare function nativeForm(
|
|
6
|
+
spaceId: string,
|
|
7
|
+
params?: Record<string, any>,
|
|
8
|
+
formAttributes?: Record<string, any>,
|
|
9
|
+
type?: SsoType,
|
|
10
|
+
clientId?: string
|
|
11
|
+
): Promise<void>;
|
|
12
|
+
|
|
13
|
+
export { nativeForm as default };
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
var __defProp = Object.defineProperty;
|
|
2
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
@@ -29,6 +30,26 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
29
30
|
return to;
|
|
30
31
|
};
|
|
31
32
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
33
|
+
var __async = (__this, __arguments, generator) => {
|
|
34
|
+
return new Promise((resolve, reject) => {
|
|
35
|
+
var fulfilled = (value) => {
|
|
36
|
+
try {
|
|
37
|
+
step(generator.next(value));
|
|
38
|
+
} catch (e) {
|
|
39
|
+
reject(e);
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
var rejected = (value) => {
|
|
43
|
+
try {
|
|
44
|
+
step(generator.throw(value));
|
|
45
|
+
} catch (e) {
|
|
46
|
+
reject(e);
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
50
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
51
|
+
});
|
|
52
|
+
};
|
|
32
53
|
|
|
33
54
|
// src/index.js
|
|
34
55
|
var src_exports = {};
|
|
@@ -69,18 +90,21 @@ query ssoTypeFindById($id: ID!){
|
|
|
69
90
|
}
|
|
70
91
|
}
|
|
71
92
|
`;
|
|
72
|
-
var nativeForm =
|
|
93
|
+
var nativeForm = (_0, ..._1) => __async(void 0, [_0, ..._1], function* (spaceId, params = {}, formAttributes = {}, type, clientId = "clientId") {
|
|
73
94
|
var _a, _b, _c;
|
|
74
95
|
if (!spaceId)
|
|
75
96
|
throw new Error("spaceId is required and was not provided");
|
|
76
97
|
let typeLower = type == null ? void 0 : type.toLowerCase();
|
|
77
98
|
if (typeLower !== "saml" && typeLower !== "openid") {
|
|
78
99
|
try {
|
|
79
|
-
const { data } =
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
100
|
+
const { data } = yield import_api_axios.avWebQLApi.create(
|
|
101
|
+
{
|
|
102
|
+
query: ssoTypeQuery,
|
|
103
|
+
variables: { id: spaceId },
|
|
104
|
+
operationName: "ssoTypeFindById"
|
|
105
|
+
},
|
|
106
|
+
{ headers: { "X-Client-ID": clientId } }
|
|
107
|
+
);
|
|
84
108
|
typeLower = (_c = (_b = (_a = data == null ? void 0 : data.data) == null ? void 0 : _a.configurationFindOne) == null ? void 0 : _b.type) == null ? void 0 : _c.toLowerCase();
|
|
85
109
|
} catch (error) {
|
|
86
110
|
if (error.response) {
|
|
@@ -110,7 +134,5 @@ var nativeForm = async (spaceId, params = {}, formAttributes = {}, type, clientI
|
|
|
110
134
|
form.insertAdjacentHTML("beforeend", fields);
|
|
111
135
|
document.body.appendChild(form);
|
|
112
136
|
form.submit();
|
|
113
|
-
};
|
|
137
|
+
});
|
|
114
138
|
var src_default = nativeForm;
|
|
115
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
116
|
-
0 && (module.exports = {});
|
package/dist/index.mjs
CHANGED
|
@@ -14,6 +14,26 @@ var __spreadValues = (a, b) => {
|
|
|
14
14
|
}
|
|
15
15
|
return a;
|
|
16
16
|
};
|
|
17
|
+
var __async = (__this, __arguments, generator) => {
|
|
18
|
+
return new Promise((resolve, reject) => {
|
|
19
|
+
var fulfilled = (value) => {
|
|
20
|
+
try {
|
|
21
|
+
step(generator.next(value));
|
|
22
|
+
} catch (e) {
|
|
23
|
+
reject(e);
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
var rejected = (value) => {
|
|
27
|
+
try {
|
|
28
|
+
step(generator.throw(value));
|
|
29
|
+
} catch (e) {
|
|
30
|
+
reject(e);
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
34
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
35
|
+
});
|
|
36
|
+
};
|
|
17
37
|
|
|
18
38
|
// src/index.js
|
|
19
39
|
import { avWebQLApi } from "@availity/api-axios";
|
|
@@ -49,18 +69,21 @@ query ssoTypeFindById($id: ID!){
|
|
|
49
69
|
}
|
|
50
70
|
}
|
|
51
71
|
`;
|
|
52
|
-
var nativeForm =
|
|
72
|
+
var nativeForm = (_0, ..._1) => __async(void 0, [_0, ..._1], function* (spaceId, params = {}, formAttributes = {}, type, clientId = "clientId") {
|
|
53
73
|
var _a, _b, _c;
|
|
54
74
|
if (!spaceId)
|
|
55
75
|
throw new Error("spaceId is required and was not provided");
|
|
56
76
|
let typeLower = type == null ? void 0 : type.toLowerCase();
|
|
57
77
|
if (typeLower !== "saml" && typeLower !== "openid") {
|
|
58
78
|
try {
|
|
59
|
-
const { data } =
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
79
|
+
const { data } = yield avWebQLApi.create(
|
|
80
|
+
{
|
|
81
|
+
query: ssoTypeQuery,
|
|
82
|
+
variables: { id: spaceId },
|
|
83
|
+
operationName: "ssoTypeFindById"
|
|
84
|
+
},
|
|
85
|
+
{ headers: { "X-Client-ID": clientId } }
|
|
86
|
+
);
|
|
64
87
|
typeLower = (_c = (_b = (_a = data == null ? void 0 : data.data) == null ? void 0 : _a.configurationFindOne) == null ? void 0 : _b.type) == null ? void 0 : _c.toLowerCase();
|
|
65
88
|
} catch (error) {
|
|
66
89
|
if (error.response) {
|
|
@@ -90,7 +113,7 @@ var nativeForm = async (spaceId, params = {}, formAttributes = {}, type, clientI
|
|
|
90
113
|
form.insertAdjacentHTML("beforeend", fields);
|
|
91
114
|
document.body.appendChild(form);
|
|
92
115
|
form.submit();
|
|
93
|
-
};
|
|
116
|
+
});
|
|
94
117
|
var src_default = nativeForm;
|
|
95
118
|
export {
|
|
96
119
|
src_default as default
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@availity/native-form",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.4",
|
|
4
4
|
"description": "Submit JSON data via a native form, not AJAX. Useful when you need to open a new page with a POST action.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"availity",
|
|
@@ -33,11 +33,11 @@
|
|
|
33
33
|
"publish": "yarn npm publish --tolerate-republish --access public"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@availity/api-axios": "
|
|
36
|
+
"@availity/api-axios": "8.0.3"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"tsup": "^
|
|
40
|
-
"typescript": "^
|
|
39
|
+
"tsup": "^7.2.0",
|
|
40
|
+
"typescript": "^5.1.6"
|
|
41
41
|
},
|
|
42
42
|
"publishConfig": {
|
|
43
43
|
"access": "public"
|
package/project.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"projectType": "library",
|
|
4
4
|
"targets": {
|
|
5
5
|
"test": {
|
|
6
|
-
"executor": "@
|
|
6
|
+
"executor": "@nx/jest:jest",
|
|
7
7
|
"outputs": ["coverage/native-form"],
|
|
8
8
|
"options": {
|
|
9
9
|
"jestConfig": "packages/native-form/jest.config.js",
|
|
@@ -14,13 +14,13 @@
|
|
|
14
14
|
"executor": "@jscutlery/semver:version",
|
|
15
15
|
"options": {
|
|
16
16
|
"preset": "angular",
|
|
17
|
-
"commitMessageFormat": "chore(
|
|
18
|
-
"tagPrefix": "@availity
|
|
17
|
+
"commitMessageFormat": "chore({projectName}): release version ${version} [skip ci]",
|
|
18
|
+
"tagPrefix": "@availity/{projectName}@",
|
|
19
19
|
"baseBranch": "master"
|
|
20
20
|
}
|
|
21
21
|
},
|
|
22
22
|
"lint": {
|
|
23
|
-
"executor": "@
|
|
23
|
+
"executor": "@nx/linter:eslint",
|
|
24
24
|
"options": {
|
|
25
25
|
"eslintConfig": ".eslintrc.yaml",
|
|
26
26
|
"lintFilePatterns": ["packages/native-form/**/*.{js,ts}"],
|