@cstar.help/js 0.12.0 → 0.12.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/dist/auth/index.cjs +10 -10
- package/dist/auth/index.d.cts +4 -4
- package/dist/auth/index.d.ts +4 -4
- package/dist/auth/index.js +10 -10
- package/package.json +1 -1
- package/dist/index.d.cts +0 -3116
- package/dist/index.d.ts +0 -3116
- package/dist/webhook/index.d.cts +0 -451
- package/dist/webhook/index.d.ts +0 -451
package/dist/auth/index.cjs
CHANGED
|
@@ -40,22 +40,22 @@ var AuthClient = class {
|
|
|
40
40
|
*/
|
|
41
41
|
async signup(params) {
|
|
42
42
|
const response = await this.fetch(
|
|
43
|
-
"/widget/
|
|
43
|
+
"/api/widget/auth/signup",
|
|
44
44
|
{
|
|
45
45
|
method: "POST",
|
|
46
46
|
body: {
|
|
47
|
-
|
|
47
|
+
teamId: this.teamSlug,
|
|
48
48
|
email: params.email,
|
|
49
49
|
password: params.password,
|
|
50
50
|
name: params.name
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
);
|
|
54
|
-
if ("
|
|
54
|
+
if ("accessToken" in response && response.accessToken && response.customer) {
|
|
55
55
|
this.session = {
|
|
56
56
|
customer: response.customer,
|
|
57
|
-
accessToken: response.
|
|
58
|
-
refreshToken: response.
|
|
57
|
+
accessToken: response.accessToken,
|
|
58
|
+
refreshToken: response.refreshToken
|
|
59
59
|
};
|
|
60
60
|
}
|
|
61
61
|
return response;
|
|
@@ -69,19 +69,19 @@ var AuthClient = class {
|
|
|
69
69
|
* @throws Error on invalid credentials, unconfirmed email, or server error
|
|
70
70
|
*/
|
|
71
71
|
async login(params) {
|
|
72
|
-
const response = await this.fetch("/widget/
|
|
72
|
+
const response = await this.fetch("/api/widget/auth/login", {
|
|
73
73
|
method: "POST",
|
|
74
74
|
body: {
|
|
75
|
-
|
|
75
|
+
teamId: this.teamSlug,
|
|
76
76
|
email: params.email,
|
|
77
77
|
password: params.password
|
|
78
78
|
}
|
|
79
79
|
});
|
|
80
|
-
if (response.
|
|
80
|
+
if (response.accessToken && response.customer) {
|
|
81
81
|
this.session = {
|
|
82
82
|
customer: response.customer,
|
|
83
|
-
accessToken: response.
|
|
84
|
-
refreshToken: response.
|
|
83
|
+
accessToken: response.accessToken,
|
|
84
|
+
refreshToken: response.refreshToken
|
|
85
85
|
};
|
|
86
86
|
}
|
|
87
87
|
return response;
|
package/dist/auth/index.d.cts
CHANGED
|
@@ -24,9 +24,9 @@ interface SignupParams {
|
|
|
24
24
|
interface SignupResult {
|
|
25
25
|
customer: AuthCustomer;
|
|
26
26
|
/** Access token for authenticated requests. Null if email confirmation is required. */
|
|
27
|
-
|
|
27
|
+
accessToken: string | null;
|
|
28
28
|
/** Refresh token for renewing the session. Null if email confirmation is required. */
|
|
29
|
-
|
|
29
|
+
refreshToken: string | null;
|
|
30
30
|
}
|
|
31
31
|
/** Response when email confirmation is required after signup. */
|
|
32
32
|
interface SignupConfirmationResult {
|
|
@@ -45,9 +45,9 @@ interface LoginParams {
|
|
|
45
45
|
interface LoginResult {
|
|
46
46
|
customer: AuthCustomer;
|
|
47
47
|
/** Access token for authenticated requests. */
|
|
48
|
-
|
|
48
|
+
accessToken: string | null;
|
|
49
49
|
/** Refresh token for renewing the session. */
|
|
50
|
-
|
|
50
|
+
refreshToken: string | null;
|
|
51
51
|
}
|
|
52
52
|
/** Stored session with tokens and customer identity. */
|
|
53
53
|
interface AuthSession {
|
package/dist/auth/index.d.ts
CHANGED
|
@@ -24,9 +24,9 @@ interface SignupParams {
|
|
|
24
24
|
interface SignupResult {
|
|
25
25
|
customer: AuthCustomer;
|
|
26
26
|
/** Access token for authenticated requests. Null if email confirmation is required. */
|
|
27
|
-
|
|
27
|
+
accessToken: string | null;
|
|
28
28
|
/** Refresh token for renewing the session. Null if email confirmation is required. */
|
|
29
|
-
|
|
29
|
+
refreshToken: string | null;
|
|
30
30
|
}
|
|
31
31
|
/** Response when email confirmation is required after signup. */
|
|
32
32
|
interface SignupConfirmationResult {
|
|
@@ -45,9 +45,9 @@ interface LoginParams {
|
|
|
45
45
|
interface LoginResult {
|
|
46
46
|
customer: AuthCustomer;
|
|
47
47
|
/** Access token for authenticated requests. */
|
|
48
|
-
|
|
48
|
+
accessToken: string | null;
|
|
49
49
|
/** Refresh token for renewing the session. */
|
|
50
|
-
|
|
50
|
+
refreshToken: string | null;
|
|
51
51
|
}
|
|
52
52
|
/** Stored session with tokens and customer identity. */
|
|
53
53
|
interface AuthSession {
|
package/dist/auth/index.js
CHANGED
|
@@ -16,22 +16,22 @@ var AuthClient = class {
|
|
|
16
16
|
*/
|
|
17
17
|
async signup(params) {
|
|
18
18
|
const response = await this.fetch(
|
|
19
|
-
"/widget/
|
|
19
|
+
"/api/widget/auth/signup",
|
|
20
20
|
{
|
|
21
21
|
method: "POST",
|
|
22
22
|
body: {
|
|
23
|
-
|
|
23
|
+
teamId: this.teamSlug,
|
|
24
24
|
email: params.email,
|
|
25
25
|
password: params.password,
|
|
26
26
|
name: params.name
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
);
|
|
30
|
-
if ("
|
|
30
|
+
if ("accessToken" in response && response.accessToken && response.customer) {
|
|
31
31
|
this.session = {
|
|
32
32
|
customer: response.customer,
|
|
33
|
-
accessToken: response.
|
|
34
|
-
refreshToken: response.
|
|
33
|
+
accessToken: response.accessToken,
|
|
34
|
+
refreshToken: response.refreshToken
|
|
35
35
|
};
|
|
36
36
|
}
|
|
37
37
|
return response;
|
|
@@ -45,19 +45,19 @@ var AuthClient = class {
|
|
|
45
45
|
* @throws Error on invalid credentials, unconfirmed email, or server error
|
|
46
46
|
*/
|
|
47
47
|
async login(params) {
|
|
48
|
-
const response = await this.fetch("/widget/
|
|
48
|
+
const response = await this.fetch("/api/widget/auth/login", {
|
|
49
49
|
method: "POST",
|
|
50
50
|
body: {
|
|
51
|
-
|
|
51
|
+
teamId: this.teamSlug,
|
|
52
52
|
email: params.email,
|
|
53
53
|
password: params.password
|
|
54
54
|
}
|
|
55
55
|
});
|
|
56
|
-
if (response.
|
|
56
|
+
if (response.accessToken && response.customer) {
|
|
57
57
|
this.session = {
|
|
58
58
|
customer: response.customer,
|
|
59
|
-
accessToken: response.
|
|
60
|
-
refreshToken: response.
|
|
59
|
+
accessToken: response.accessToken,
|
|
60
|
+
refreshToken: response.refreshToken
|
|
61
61
|
};
|
|
62
62
|
}
|
|
63
63
|
return response;
|