@odla-ai/chapter 0.8.0 → 0.9.0
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/README.md +25 -9
- package/dist/chunk-YO6DY5DL.js +281 -0
- package/dist/chunk-YO6DY5DL.js.map +1 -0
- package/dist/chunk-ZCZK6QLC.js +537 -0
- package/dist/chunk-ZCZK6QLC.js.map +1 -0
- package/dist/index.cjs +7 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +23 -14
- package/dist/index.d.ts +23 -14
- package/dist/index.js +7 -4
- package/dist/index.js.map +1 -1
- package/dist/ui/admin/index.d.ts +71 -0
- package/dist/ui/admin/index.js +9 -0
- package/dist/ui/admin/index.js.map +1 -0
- package/dist/ui/index.d.ts +4 -219
- package/dist/ui/index.js +20 -795
- package/dist/ui/index.js.map +1 -1
- package/dist/ui/member/index.d.ts +152 -0
- package/dist/ui/member/index.js +33 -0
- package/dist/ui/member/index.js.map +1 -0
- package/dist/worker/index.cjs +7 -4
- package/dist/worker/index.cjs.map +1 -1
- package/dist/worker/index.js +7 -4
- package/dist/worker/index.js.map +1 -1
- package/package.json +9 -1
package/dist/worker/index.js
CHANGED
|
@@ -95,13 +95,15 @@ function createWorkerContext(options) {
|
|
|
95
95
|
import { createCrmRoutes } from "@odla-ai/crm";
|
|
96
96
|
|
|
97
97
|
// src/clerk.ts
|
|
98
|
+
var heal = (status) => status === 422 ? { ok: true, status, existed: true } : { ok: false, status };
|
|
98
99
|
function clerkInviteRequest(input) {
|
|
99
100
|
return {
|
|
100
101
|
path: "/v1/invitations",
|
|
101
102
|
body: {
|
|
102
103
|
email_address: input.email,
|
|
103
104
|
notify: true,
|
|
104
|
-
...input.redirectUrl ? { redirect_url: input.redirectUrl } : {}
|
|
105
|
+
...input.redirectUrl ? { redirect_url: input.redirectUrl } : {},
|
|
106
|
+
...input.publicMetadata ? { public_metadata: input.publicMetadata } : {}
|
|
105
107
|
}
|
|
106
108
|
};
|
|
107
109
|
}
|
|
@@ -112,7 +114,7 @@ async function createClerkInvitation(secretKey, input, fetchImpl = fetch) {
|
|
|
112
114
|
headers: { authorization: `Bearer ${secretKey}`, "content-type": "application/json" },
|
|
113
115
|
body: JSON.stringify(body)
|
|
114
116
|
});
|
|
115
|
-
return { ok:
|
|
117
|
+
return res.ok ? { ok: true, status: res.status } : heal(res.status);
|
|
116
118
|
}
|
|
117
119
|
function clerkUserRequest(input) {
|
|
118
120
|
return {
|
|
@@ -121,7 +123,8 @@ function clerkUserRequest(input) {
|
|
|
121
123
|
email_address: [input.email],
|
|
122
124
|
skip_password_requirement: true,
|
|
123
125
|
...input.firstName ? { first_name: input.firstName } : {},
|
|
124
|
-
...input.lastName ? { last_name: input.lastName } : {}
|
|
126
|
+
...input.lastName ? { last_name: input.lastName } : {},
|
|
127
|
+
...input.publicMetadata ? { public_metadata: input.publicMetadata } : {}
|
|
125
128
|
}
|
|
126
129
|
};
|
|
127
130
|
}
|
|
@@ -132,7 +135,7 @@ async function createClerkUser(secretKey, input, fetchImpl = fetch) {
|
|
|
132
135
|
headers: { authorization: `Bearer ${secretKey}`, "content-type": "application/json" },
|
|
133
136
|
body: JSON.stringify(body)
|
|
134
137
|
});
|
|
135
|
-
return { ok:
|
|
138
|
+
return res.ok ? { ok: true, status: res.status } : heal(res.status);
|
|
136
139
|
}
|
|
137
140
|
|
|
138
141
|
// src/member.ts
|