@jd-data-limited/easy-fm 1.1.2-alpha1 → 1.1.3-alpha1
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.js +4 -4
- package/index.ts +4 -4
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -63,7 +63,7 @@ export default class FileMakerConnection {
|
|
|
63
63
|
return new Promise((resolve, reject) => {
|
|
64
64
|
if (this.token)
|
|
65
65
|
throw new Error("Already logged in. Run logout() first");
|
|
66
|
-
if (this.databaseConDetails
|
|
66
|
+
if (this.databaseConDetails.database.method === "filemaker") {
|
|
67
67
|
fetch(`${this.endpoint}/sessions`, {
|
|
68
68
|
hostname: this.hostname,
|
|
69
69
|
port: 443,
|
|
@@ -92,11 +92,11 @@ export default class FileMakerConnection {
|
|
|
92
92
|
reject(e);
|
|
93
93
|
});
|
|
94
94
|
}
|
|
95
|
-
else if (this.databaseConDetails
|
|
95
|
+
else if (this.databaseConDetails.database.method === "token") {
|
|
96
96
|
this._token = this.databaseConDetails[0].token;
|
|
97
97
|
resolve(this.token);
|
|
98
98
|
}
|
|
99
|
-
else if (this.databaseConDetails
|
|
99
|
+
else if (this.databaseConDetails.database.method === "oauth") {
|
|
100
100
|
fetch(`${this.endpoint}/sessions`, {
|
|
101
101
|
method: "POST",
|
|
102
102
|
headers: {
|
|
@@ -118,7 +118,7 @@ export default class FileMakerConnection {
|
|
|
118
118
|
resolve(this.token);
|
|
119
119
|
});
|
|
120
120
|
}
|
|
121
|
-
else if (this.databaseConDetails
|
|
121
|
+
else if (this.databaseConDetails.database.method === "claris") {
|
|
122
122
|
fetch(`${this.endpoint}/sessions`, {
|
|
123
123
|
method: "POST",
|
|
124
124
|
headers: {
|
package/index.ts
CHANGED
|
@@ -137,7 +137,7 @@ export default class FileMakerConnection {
|
|
|
137
137
|
return new Promise<string>((resolve, reject) => {
|
|
138
138
|
if (this.token) throw new Error("Already logged in. Run logout() first")
|
|
139
139
|
|
|
140
|
-
if (this.databaseConDetails
|
|
140
|
+
if (this.databaseConDetails.database.method === "filemaker") {
|
|
141
141
|
fetch(`${this.endpoint}/sessions`, {
|
|
142
142
|
hostname: this.hostname,
|
|
143
143
|
port: 443,
|
|
@@ -164,10 +164,10 @@ export default class FileMakerConnection {
|
|
|
164
164
|
.catch(e => {
|
|
165
165
|
reject(e)
|
|
166
166
|
})
|
|
167
|
-
} else if (this.databaseConDetails
|
|
167
|
+
} else if (this.databaseConDetails.database.method === "token") {
|
|
168
168
|
this._token = (<loginOptionsToken>this.databaseConDetails[0]).token
|
|
169
169
|
resolve(this.token)
|
|
170
|
-
} else if (this.databaseConDetails
|
|
170
|
+
} else if (this.databaseConDetails.database.method === "oauth") {
|
|
171
171
|
fetch(`${this.endpoint}/sessions`, {
|
|
172
172
|
method: "POST",
|
|
173
173
|
headers: {
|
|
@@ -188,7 +188,7 @@ export default class FileMakerConnection {
|
|
|
188
188
|
this._token = _res.headers["x-fm-data-access-token"]
|
|
189
189
|
resolve(this.token)
|
|
190
190
|
})
|
|
191
|
-
} else if (this.databaseConDetails
|
|
191
|
+
} else if (this.databaseConDetails.database.method === "claris") {
|
|
192
192
|
fetch(`${this.endpoint}/sessions`, {
|
|
193
193
|
method: "POST",
|
|
194
194
|
headers: {
|