@tool-bridge/server 0.21.1 → 0.22.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/admin.js +170 -0
- package/dist/airtable-ML2GIGCH.js +790 -0
- package/dist/{alt_text_generator_ai-W7O34SNG.js → alt_text_generator_ai-FGYQAF2A.js} +12 -11
- package/dist/{amap-VOX4T2AW.js → amap-G7V65NGK.js} +221 -220
- package/dist/anthropic-6ZK24TBB.js +203 -0
- package/dist/apify-VDGYHP6W.js +248 -0
- package/dist/brave_search-TAATLZOS.js +302 -0
- package/dist/chunk-2IAI3XQM.js +302 -0
- package/dist/chunk-7ISGFRC6.js +161 -0
- package/dist/{chunk-E6JCVKW6.js → chunk-BNMLA2RC.js} +3 -3
- package/dist/chunk-HA4BGL6C.js +8429 -0
- package/dist/{chunk-KMTT3I6D.js → chunk-RMAWSG7E.js} +19172 -25717
- package/dist/{chunk-XYBU3WZH.js → chunk-RTW5VRTK.js} +3 -3
- package/dist/chunk-U7PTOA3U.js +7320 -0
- package/dist/chunk-UY6ANCOY.js +378 -0
- package/dist/{chunk-ATK45BXV.js → chunk-X7ZUTKHR.js} +4 -2
- package/dist/circleci-BQ2UWXL2.js +389 -0
- package/dist/clerk-2JYWQNOI.js +1019 -0
- package/dist/cohere-6MI7AQM4.js +185 -0
- package/dist/{confluence-B3EWPZVE.js → confluence-6Y6GDETF.js} +105 -104
- package/dist/{convertapi-EUWSQYPF.js → convertapi-HBZCSWOX.js} +32 -31
- package/dist/{currencyapi-KVTIK3GL.js → currencyapi-337U5TGI.js} +71 -71
- package/dist/deepseek-OSPASO7O.js +210 -0
- package/dist/docker_hub-3ATQOY5L.js +933 -0
- package/dist/dropbox-LSA4GM2Y.js +1305 -0
- package/dist/dub-VZPJSPI6.js +680 -0
- package/dist/e2b-6SDYQZL2.js +278 -0
- package/dist/exa-B6EUYDVP.js +332 -0
- package/dist/{fal_ai-23E7JPNT.js → fal_ai-K4Q27IME.js} +81 -80
- package/dist/{feishu-7QRIDUV6.js → feishu-4TKXG4SU.js} +528 -572
- package/dist/{feishu_custom_bot-TJ4K7QNJ.js → feishu_custom_bot-7CTEAKRB.js} +57 -53
- package/dist/figma-OUKSZLD5.js +777 -0
- package/dist/firehydrant-7MOYL7QH.js +563 -0
- package/dist/{fixer-BWON27UO.js → fixer-H2BV2NO4.js} +34 -33
- package/dist/fly-PXKY6PNH.js +469 -0
- package/dist/{front-QCGXYEDJ.js → front-UZYIV5DW.js} +104 -104
- package/dist/geocodio-NSYO7TFP.js +213 -0
- package/dist/ghost-QBKKQQMF.js +338 -0
- package/dist/github-ENLSJ4CL.js +5421 -0
- package/dist/gmail-KQSDEB47.js +1887 -0
- package/dist/googlecalendar-5YCX4SZF.js +2524 -0
- package/dist/{googledocs-BUHL4J2H.js → googledocs-SSWIVFKA.js} +341 -340
- package/dist/{grafana-GLU2DWF2.js → grafana-TF2LXDQA.js} +221 -220
- package/dist/graphhopper-CURBVHYK.js +325 -0
- package/dist/index.d.ts +1132 -332
- package/dist/index.js +31 -14
- package/dist/{ip2proxy-EZ64Y4ZH.js → ip2proxy-YNVMTZEM.js} +28 -27
- package/dist/ipgeolocation_io-NAU7VJ4J.js +315 -0
- package/dist/ipqualityscore-OT63L4TI.js +279 -0
- package/dist/{jina_ai-EFBHTBXL.js → jina_ai-6WBMBGWM.js} +23 -23
- package/dist/{jira-HQSHAA5K.js → jira-DVDVTHNO.js} +118 -117
- package/dist/langsmith-IM5N4YAU.js +593 -0
- package/dist/lemlist-277SHUQF.js +289 -0
- package/dist/{linear-K7RYFYAD.js → linear-AEPH7B5V.js} +327 -326
- package/dist/logsnag-VEWRAGBG.js +150 -0
- package/dist/main.js +57 -280
- package/dist/{mattermost-S2BRCWLQ.js → mattermost-Q3A2BIZA.js} +59 -58
- package/dist/mem0-AXS7GZGI.js +544 -0
- package/dist/memos-7TXG4ZTU.js +744 -0
- package/dist/{metabase-MMSEPCOF.js → metabase-NSVACWQM.js} +90 -89
- package/dist/mistral_ai-YZ52RGD4.js +1196 -0
- package/dist/{mother_duck-H7PCQNZ2.js → mother_duck-XLLL6FVL.js} +94 -93
- package/dist/ngrok-4O4W3WZW.js +356 -0
- package/dist/{notes-PFMKRO33.js → notes-YTB3TJOO.js} +11 -9
- package/dist/notion-4W4O7J7V.js +940 -0
- package/dist/open_exchange_rates-23QJXVO5.js +215 -0
- package/dist/openai-ZS7GLSLH.js +800 -0
- package/dist/opengraph_io-PMVH7OYI.js +362 -0
- package/dist/openrouter-ONRGFNB6.js +441 -0
- package/dist/outline-UCUYZZ7J.js +599 -0
- package/dist/paddle-35HTKTUL.js +454 -0
- package/dist/perplexity-NVOBYN24.js +220 -0
- package/dist/pinecone-55CJY73C.js +571 -0
- package/dist/{pipedrive-Y2O7QGFF.js → pipedrive-WMCAKS72.js} +99 -98
- package/dist/polar-SM4ZM53B.js +395 -0
- package/dist/posthog-NWCXVXNJ.js +3464 -0
- package/dist/postmark-QJV5PHUQ.js +427 -0
- package/dist/{prerender-MENYM2TY.js → prerender-2W7UT4SC.js} +31 -30
- package/dist/{pubmed-GOXUVVH5.js → pubmed-VVV7XYLU.js} +239 -238
- package/dist/{railway-V2SID4WV.js → railway-KGI57S3O.js} +118 -117
- package/dist/readwise-AGHTQB42.js +470 -0
- package/dist/render-O4HBROCK.js +461 -0
- package/dist/{replicate-756MXPYX.js → replicate-KWBOMX7D.js} +81 -80
- package/dist/{resend-ZKH3BTBI.js → resend-DRH6Y6I4.js} +20 -16
- package/dist/rootly-XGCUDW6X.js +336 -0
- package/dist/{scrapfly-NSRHFDIQ.js → scrapfly-OIQ3OY6L.js} +62 -61
- package/dist/{scrapingbee-OQHLAVEY.js → scrapingbee-OCZO4FHX.js} +56 -56
- package/dist/{screenshot_fyi-DVWG3AXC.js → screenshot_fyi-CUNGFZOC.js} +16 -16
- package/dist/semantic_scholar-3UJRLKES.js +611 -0
- package/dist/{sentry-546MNDJG.js → sentry-5BWVZFJV.js} +208 -207
- package/dist/{shodan-C3OON3Z3.js → shodan-HI37CTEW.js} +62 -61
- package/dist/shopify-LJ2EV2HH.js +610 -0
- package/dist/stripe-3LHMV55K.js +585 -0
- package/dist/{supabase-U2SL4D63.js → supabase-H2KPX3Q2.js} +245 -244
- package/dist/tavily-FBEWGH3Z.js +326 -0
- package/dist/telegram-MYYO3JND.js +1767 -0
- package/dist/{telnyx-CXQ4EZUX.js → telnyx-H4ALEGAX.js} +57 -56
- package/dist/todoist-OBWICA5Q.js +664 -0
- package/dist/trello-GUFUJRWO.js +1080 -0
- package/dist/turso-NIAK4UMS.js +416 -0
- package/dist/{twilio-4PDBJKWX.js → twilio-K6SLK2CX.js} +70 -69
- package/dist/umami-42RS2EPS.js +389 -0
- package/dist/unsplash-V7TOTETT.js +351 -0
- package/dist/{upstash_redis-G4LQBYHA.js → upstash_redis-AWQMB6Y3.js} +51 -50
- package/dist/uptimerobot-AZC2DHOT.js +483 -0
- package/dist/v2ex-4TVRNMLS.js +667 -0
- package/dist/vercel-DPHTJ3XR.js +1076 -0
- package/dist/{wolfram_alpha_api-3G4PUJWB.js → wolfram_alpha_api-XAG7IXBW.js} +36 -35
- package/dist/wordpress-KMPKVGUX.js +812 -0
- package/dist/workos-PKB2YR7S.js +664 -0
- package/dist/zhihu-Y4H4XYPB.js +254 -0
- package/package.json +18 -9
- package/dist/airtable-LLZDFN7M.js +0 -789
- package/dist/anthropic-G23NN3X5.js +0 -202
- package/dist/apify-Y3SS734K.js +0 -247
- package/dist/brave_search-ZC7OAPSZ.js +0 -301
- package/dist/chunk-R6P4XAE5.js +0 -248
- package/dist/chunk-U7B6DS2O.js +0 -977
- package/dist/chunk-UZM2RXZH.js +0 -23436
- package/dist/circleci-3BAX5FCG.js +0 -388
- package/dist/clerk-6LEM6TNU.js +0 -1019
- package/dist/cloudflare_dns-KINYTJUD.js +0 -588
- package/dist/cohere-XCJ5AJ6B.js +0 -185
- package/dist/deepseek-PC5YGNC5.js +0 -209
- package/dist/docker_hub-C3MA5FU6.js +0 -932
- package/dist/dropbox-XBV7Z2IR.js +0 -1304
- package/dist/dub-LDOFG3HC.js +0 -679
- package/dist/e2b-JMCPSVBW.js +0 -277
- package/dist/exa-RAK7O7RD.js +0 -331
- package/dist/figma-E6IX5DTH.js +0 -773
- package/dist/firehydrant-ZBLPQREE.js +0 -562
- package/dist/fly-ZH3HFCZJ.js +0 -468
- package/dist/geocodio-YGNI7DA4.js +0 -212
- package/dist/ghost-EVSGKH2Q.js +0 -337
- package/dist/github-MA2BGRCJ.js +0 -5420
- package/dist/gmail-E5E6AADE.js +0 -1886
- package/dist/googlecalendar-BTLFPXTD.js +0 -2523
- package/dist/graphhopper-WSMB3TCD.js +0 -324
- package/dist/ipgeolocation_io-AA7HAS22.js +0 -315
- package/dist/ipqualityscore-BHJXVTJT.js +0 -277
- package/dist/langsmith-5W6SCT6F.js +0 -592
- package/dist/lemlist-HJWH6UMK.js +0 -288
- package/dist/logsnag-4KFOHL37.js +0 -150
- package/dist/mem0-CAW43CIC.js +0 -543
- package/dist/memos-TWEGPKFM.js +0 -740
- package/dist/mistral_ai-64BGZQHP.js +0 -1195
- package/dist/ngrok-GQCUGZKJ.js +0 -356
- package/dist/notion-DQWZWP4N.js +0 -936
- package/dist/open_exchange_rates-QMMD735E.js +0 -214
- package/dist/openai-W6PX32NZ.js +0 -799
- package/dist/opengraph_io-HNDBXYNW.js +0 -361
- package/dist/openrouter-JJYMEAUL.js +0 -437
- package/dist/outline-MCBNQZYY.js +0 -595
- package/dist/paddle-D2SKLUDN.js +0 -453
- package/dist/perplexity-XIFMKUAE.js +0 -219
- package/dist/pinecone-HUFTALV2.js +0 -570
- package/dist/polar-TYTOMOSR.js +0 -394
- package/dist/posthog-43JAR3VW.js +0 -3463
- package/dist/postmark-KL2QJYSG.js +0 -426
- package/dist/readwise-CI4GIMMJ.js +0 -469
- package/dist/render-SUBJ6YRZ.js +0 -460
- package/dist/rootly-CD2LJHPI.js +0 -336
- package/dist/semantic_scholar-T4A252KW.js +0 -610
- package/dist/shopify-Y2HN2MCQ.js +0 -609
- package/dist/stripe-VE3CD3AY.js +0 -584
- package/dist/tavily-KCZHK6HE.js +0 -326
- package/dist/telegram-3URFBCMY.js +0 -1766
- package/dist/todoist-HNPWNYTD.js +0 -663
- package/dist/trello-3W2MIXRP.js +0 -1079
- package/dist/turso-2EQF7C2Z.js +0 -415
- package/dist/umami-5REN7TGP.js +0 -388
- package/dist/unsplash-EIXL424F.js +0 -350
- package/dist/uptimerobot-KNJ3EYLY.js +0 -482
- package/dist/v2ex-RHJ234PZ.js +0 -666
- package/dist/vercel-AS6NCIC7.js +0 -1075
- package/dist/wordpress-KNDAAUV7.js +0 -811
- package/dist/workos-R6UITSJ7.js +0 -663
- package/dist/zhihu-AGK4HILK.js +0 -253
|
@@ -0,0 +1,664 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createAuthedClient
|
|
3
|
+
} from "./chunk-RTW5VRTK.js";
|
|
4
|
+
import "./chunk-BNMLA2RC.js";
|
|
5
|
+
import {
|
|
6
|
+
compactDefined
|
|
7
|
+
} from "./chunk-JXHMDBAY.js";
|
|
8
|
+
import {
|
|
9
|
+
createProviderPlugin,
|
|
10
|
+
upstreamError
|
|
11
|
+
} from "./chunk-X7ZUTKHR.js";
|
|
12
|
+
import "./chunk-7ISGFRC6.js";
|
|
13
|
+
import "./chunk-UY6ANCOY.js";
|
|
14
|
+
import {
|
|
15
|
+
TBError
|
|
16
|
+
} from "./chunk-HA4BGL6C.js";
|
|
17
|
+
import "./chunk-U67V476Y.js";
|
|
18
|
+
|
|
19
|
+
// ../plugins/src/workos/api.ts
|
|
20
|
+
var SERVICE = "workos";
|
|
21
|
+
var API_BASE = "https://api.workos.com";
|
|
22
|
+
function errorMessage(payload, status) {
|
|
23
|
+
const error = payload.error;
|
|
24
|
+
if (error !== null && typeof error === "object" && !Array.isArray(error)) {
|
|
25
|
+
const nested = error.message;
|
|
26
|
+
if (typeof nested === "string" && nested.trim() !== "") return nested.trim();
|
|
27
|
+
}
|
|
28
|
+
for (const value of [payload.message, payload.error_description, payload.error]) {
|
|
29
|
+
if (typeof value === "string" && value.trim() !== "") return value.trim();
|
|
30
|
+
}
|
|
31
|
+
return `WorkOS \u8FD4\u56DE HTTP ${status}`;
|
|
32
|
+
}
|
|
33
|
+
var http = createAuthedClient({
|
|
34
|
+
baseUrl: `${API_BASE}/`,
|
|
35
|
+
service: SERVICE,
|
|
36
|
+
auth: { kind: "bearer" },
|
|
37
|
+
headers: { accept: "application/json" },
|
|
38
|
+
mapError: ({ bodyKind, data, status }) => {
|
|
39
|
+
if (bodyKind === "invalid-json") {
|
|
40
|
+
return new TBError("unavailable", "WorkOS \u8FD4\u56DE\u4E86\u975E\u6CD5 JSON", { retryable: true });
|
|
41
|
+
}
|
|
42
|
+
const payload = bodyKind === "empty" ? {} : data !== null && typeof data === "object" && !Array.isArray(data) ? data : void 0;
|
|
43
|
+
return payload === void 0 ? new TBError("unavailable", "WorkOS \u8FD4\u56DE\u7684\u4E0D\u662F JSON \u5BF9\u8C61", { retryable: true }) : upstreamError(status, errorMessage(payload, status));
|
|
44
|
+
},
|
|
45
|
+
mapTransportError: ({ message }) => new TBError(
|
|
46
|
+
"unavailable",
|
|
47
|
+
message === void 0 ? "WorkOS \u8BF7\u6C42\u5931\u8D25" : `WorkOS \u8BF7\u6C42\u5931\u8D25: ${message}`,
|
|
48
|
+
{ retryable: true }
|
|
49
|
+
)
|
|
50
|
+
});
|
|
51
|
+
async function request(ctx, input) {
|
|
52
|
+
const response = await http.request(ctx, {
|
|
53
|
+
method: input.method,
|
|
54
|
+
path: input.path,
|
|
55
|
+
// 多值过滤是重复同名键(与 Render 的逗号拼接不同)。
|
|
56
|
+
query: Object.entries(input.query ?? {}),
|
|
57
|
+
...input.body === void 0 ? {} : { json: input.body },
|
|
58
|
+
invalidJsonMessage: "WorkOS \u8FD4\u56DE\u4E86\u975E\u6CD5 JSON"
|
|
59
|
+
});
|
|
60
|
+
const payload = response.bodyKind === "empty" ? {} : response.data !== null && typeof response.data === "object" && !Array.isArray(response.data) ? response.data : void 0;
|
|
61
|
+
if (payload === void 0) {
|
|
62
|
+
throw new TBError("unavailable", "WorkOS \u8FD4\u56DE\u7684\u4E0D\u662F JSON \u5BF9\u8C61", { retryable: true });
|
|
63
|
+
}
|
|
64
|
+
return payload;
|
|
65
|
+
}
|
|
66
|
+
function unwrap(payload, key) {
|
|
67
|
+
const value = payload[key];
|
|
68
|
+
if (value !== null && typeof value === "object" && !Array.isArray(value)) return value;
|
|
69
|
+
return payload;
|
|
70
|
+
}
|
|
71
|
+
function toRecord(value) {
|
|
72
|
+
if (value === null || typeof value !== "object" || Array.isArray(value)) return {};
|
|
73
|
+
return value;
|
|
74
|
+
}
|
|
75
|
+
async function listAction(ctx, path, query, listKey) {
|
|
76
|
+
const payload = await request(ctx, { method: "GET", path, query });
|
|
77
|
+
return {
|
|
78
|
+
[listKey]: Array.isArray(payload.data) ? payload.data : [],
|
|
79
|
+
list_metadata: toRecord(payload.list_metadata),
|
|
80
|
+
raw: payload
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
async function wrappedAction(ctx, input, wrapperKey) {
|
|
84
|
+
const payload = await request(ctx, input);
|
|
85
|
+
return { [wrapperKey]: unwrap(payload, wrapperKey), raw: payload };
|
|
86
|
+
}
|
|
87
|
+
function userBody(input) {
|
|
88
|
+
return compactDefined({
|
|
89
|
+
email: input.email,
|
|
90
|
+
first_name: input.first_name,
|
|
91
|
+
last_name: input.last_name,
|
|
92
|
+
name: input.name,
|
|
93
|
+
email_verified: input.email_verified,
|
|
94
|
+
metadata: input.metadata,
|
|
95
|
+
external_id: input.external_id,
|
|
96
|
+
password: input.password
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
function organizationBody(input) {
|
|
100
|
+
return compactDefined({
|
|
101
|
+
name: input.name,
|
|
102
|
+
allow_profiles_outside_organization: input.allow_profiles_outside_organization,
|
|
103
|
+
domain_data: input.domain_data,
|
|
104
|
+
metadata: input.metadata,
|
|
105
|
+
external_id: input.external_id
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
async function listUsers(input, ctx) {
|
|
109
|
+
return await listAction(ctx, "/user_management/users", {
|
|
110
|
+
before: input.before,
|
|
111
|
+
after: input.after,
|
|
112
|
+
limit: input.limit,
|
|
113
|
+
order: input.order,
|
|
114
|
+
organization_id: input.organization_id,
|
|
115
|
+
email: input.email
|
|
116
|
+
}, "users");
|
|
117
|
+
}
|
|
118
|
+
async function getUser(input, ctx) {
|
|
119
|
+
return await wrappedAction(
|
|
120
|
+
ctx,
|
|
121
|
+
{ method: "GET", path: `/user_management/users/${encodeURIComponent(input.id)}` },
|
|
122
|
+
"user"
|
|
123
|
+
);
|
|
124
|
+
}
|
|
125
|
+
async function createUser(input, ctx) {
|
|
126
|
+
return await wrappedAction(
|
|
127
|
+
ctx,
|
|
128
|
+
{ method: "POST", path: "/user_management/users", body: userBody(input) },
|
|
129
|
+
"user"
|
|
130
|
+
);
|
|
131
|
+
}
|
|
132
|
+
async function updateUser(input, ctx) {
|
|
133
|
+
return await wrappedAction(
|
|
134
|
+
ctx,
|
|
135
|
+
{
|
|
136
|
+
method: "PUT",
|
|
137
|
+
path: `/user_management/users/${encodeURIComponent(input.id)}`,
|
|
138
|
+
body: userBody(input)
|
|
139
|
+
},
|
|
140
|
+
"user"
|
|
141
|
+
);
|
|
142
|
+
}
|
|
143
|
+
async function listOrganizations(input, ctx) {
|
|
144
|
+
return await listAction(ctx, "/organizations", {
|
|
145
|
+
before: input.before,
|
|
146
|
+
after: input.after,
|
|
147
|
+
limit: input.limit,
|
|
148
|
+
order: input.order,
|
|
149
|
+
domains: input.domains,
|
|
150
|
+
search: input.search
|
|
151
|
+
}, "organizations");
|
|
152
|
+
}
|
|
153
|
+
async function getOrganization(input, ctx) {
|
|
154
|
+
return await wrappedAction(
|
|
155
|
+
ctx,
|
|
156
|
+
{ method: "GET", path: `/organizations/${encodeURIComponent(input.id)}` },
|
|
157
|
+
"organization"
|
|
158
|
+
);
|
|
159
|
+
}
|
|
160
|
+
async function createOrganization(input, ctx) {
|
|
161
|
+
return await wrappedAction(
|
|
162
|
+
ctx,
|
|
163
|
+
{ method: "POST", path: "/organizations", body: organizationBody(input) },
|
|
164
|
+
"organization"
|
|
165
|
+
);
|
|
166
|
+
}
|
|
167
|
+
async function updateOrganization(input, ctx) {
|
|
168
|
+
return await wrappedAction(
|
|
169
|
+
ctx,
|
|
170
|
+
{
|
|
171
|
+
method: "PUT",
|
|
172
|
+
path: `/organizations/${encodeURIComponent(input.id)}`,
|
|
173
|
+
body: organizationBody(input)
|
|
174
|
+
},
|
|
175
|
+
"organization"
|
|
176
|
+
);
|
|
177
|
+
}
|
|
178
|
+
async function listOrganizationMemberships(input, ctx) {
|
|
179
|
+
return await listAction(ctx, "/user_management/organization_memberships", {
|
|
180
|
+
before: input.before,
|
|
181
|
+
after: input.after,
|
|
182
|
+
limit: input.limit,
|
|
183
|
+
order: input.order,
|
|
184
|
+
organization_id: input.organization_id,
|
|
185
|
+
user_id: input.user_id,
|
|
186
|
+
statuses: input.statuses
|
|
187
|
+
}, "organization_memberships");
|
|
188
|
+
}
|
|
189
|
+
async function getOrganizationMembership(input, ctx) {
|
|
190
|
+
return await wrappedAction(
|
|
191
|
+
ctx,
|
|
192
|
+
{
|
|
193
|
+
method: "GET",
|
|
194
|
+
path: `/user_management/organization_memberships/${encodeURIComponent(input.id)}`
|
|
195
|
+
},
|
|
196
|
+
"organization_membership"
|
|
197
|
+
);
|
|
198
|
+
}
|
|
199
|
+
async function createOrganizationMembership(input, ctx) {
|
|
200
|
+
return await wrappedAction(
|
|
201
|
+
ctx,
|
|
202
|
+
{
|
|
203
|
+
method: "POST",
|
|
204
|
+
path: "/user_management/organization_memberships",
|
|
205
|
+
body: compactDefined({
|
|
206
|
+
user_id: input.user_id,
|
|
207
|
+
organization_id: input.organization_id,
|
|
208
|
+
role_slug: input.role_slug,
|
|
209
|
+
role_slugs: input.role_slugs
|
|
210
|
+
})
|
|
211
|
+
},
|
|
212
|
+
"organization_membership"
|
|
213
|
+
);
|
|
214
|
+
}
|
|
215
|
+
async function updateOrganizationMembership(input, ctx) {
|
|
216
|
+
return await wrappedAction(
|
|
217
|
+
ctx,
|
|
218
|
+
{
|
|
219
|
+
method: "PUT",
|
|
220
|
+
path: `/user_management/organization_memberships/${encodeURIComponent(input.id)}`,
|
|
221
|
+
body: compactDefined({ role_slug: input.role_slug, role_slugs: input.role_slugs })
|
|
222
|
+
},
|
|
223
|
+
"organization_membership"
|
|
224
|
+
);
|
|
225
|
+
}
|
|
226
|
+
async function deactivateOrganizationMembership(input, ctx) {
|
|
227
|
+
return await wrappedAction(
|
|
228
|
+
ctx,
|
|
229
|
+
{
|
|
230
|
+
method: "PUT",
|
|
231
|
+
path: `/user_management/organization_memberships/${encodeURIComponent(input.id)}/deactivate`
|
|
232
|
+
},
|
|
233
|
+
"organization_membership"
|
|
234
|
+
);
|
|
235
|
+
}
|
|
236
|
+
async function reactivateOrganizationMembership(input, ctx) {
|
|
237
|
+
return await wrappedAction(
|
|
238
|
+
ctx,
|
|
239
|
+
{
|
|
240
|
+
method: "PUT",
|
|
241
|
+
path: `/user_management/organization_memberships/${encodeURIComponent(input.id)}/reactivate`
|
|
242
|
+
},
|
|
243
|
+
"organization_membership"
|
|
244
|
+
);
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
// ../plugins/src/workos/schema.ts
|
|
248
|
+
import { z } from "zod/v4";
|
|
249
|
+
var listUsersInput = z.strictObject({
|
|
250
|
+
before: z.string().min(1).describe("An object ID that defines the cursor position before the requested page.").optional(),
|
|
251
|
+
after: z.string().min(1).describe("An object ID that defines the cursor position after the requested page.").optional(),
|
|
252
|
+
limit: z.int().min(1).max(100).describe("Upper limit on the number of objects to return, between 1 and 100.").optional(),
|
|
253
|
+
order: z.enum(["normal", "desc", "asc"]).describe("Order the results by creation time.").optional(),
|
|
254
|
+
organization_id: z.string().min(1).describe("Filter users by the organization they are members of.").optional(),
|
|
255
|
+
email: z.string().min(1).describe("Filter users by their email address.").optional()
|
|
256
|
+
}).describe("Input parameters for listing WorkOS users.");
|
|
257
|
+
var listUsersOutput = z.strictObject({
|
|
258
|
+
users: z.array(z.looseObject({
|
|
259
|
+
object: z.string().describe("Object type returned by WorkOS.").optional(),
|
|
260
|
+
id: z.string().describe("The unique ID of the user.").optional(),
|
|
261
|
+
email: z.string().describe("The email address of the user.").optional(),
|
|
262
|
+
first_name: z.string().describe("The first name of the user.").nullable().optional(),
|
|
263
|
+
last_name: z.string().describe("The last name of the user.").nullable().optional(),
|
|
264
|
+
name: z.string().describe("The user's full name.").nullable().optional(),
|
|
265
|
+
email_verified: z.boolean().describe("Whether the user's email has been verified.").optional(),
|
|
266
|
+
external_id: z.string().describe("The external ID of the user.").nullable().optional(),
|
|
267
|
+
metadata: z.looseObject({}).describe("Metadata key/value pairs associated with the resource.").optional(),
|
|
268
|
+
created_at: z.string().describe("An ISO 8601 timestamp for when the user was created.").optional(),
|
|
269
|
+
updated_at: z.string().describe("An ISO 8601 timestamp for when the user was last updated.").optional()
|
|
270
|
+
}).describe("WorkOS user object.")).describe("Users returned by WorkOS."),
|
|
271
|
+
list_metadata: z.looseObject({
|
|
272
|
+
before: z.string().describe("Cursor for the previous page when returned by WorkOS.").nullable().optional(),
|
|
273
|
+
after: z.string().describe("Cursor for the next page when returned by WorkOS.").nullable().optional()
|
|
274
|
+
}).describe("WorkOS pagination metadata returned for a list request."),
|
|
275
|
+
raw: z.looseObject({}).describe("Raw WorkOS response payload.")
|
|
276
|
+
}).describe("A page of WorkOS users.");
|
|
277
|
+
var getUserInput = z.strictObject({
|
|
278
|
+
id: z.string().min(1).describe("The unique ID of the user.")
|
|
279
|
+
}).describe("Input parameters for getting a WorkOS user.");
|
|
280
|
+
var getUserOutput = z.strictObject({
|
|
281
|
+
user: z.looseObject({
|
|
282
|
+
object: z.string().describe("Object type returned by WorkOS.").optional(),
|
|
283
|
+
id: z.string().describe("The unique ID of the user.").optional(),
|
|
284
|
+
email: z.string().describe("The email address of the user.").optional(),
|
|
285
|
+
first_name: z.string().describe("The first name of the user.").nullable().optional(),
|
|
286
|
+
last_name: z.string().describe("The last name of the user.").nullable().optional(),
|
|
287
|
+
name: z.string().describe("The user's full name.").nullable().optional(),
|
|
288
|
+
email_verified: z.boolean().describe("Whether the user's email has been verified.").optional(),
|
|
289
|
+
external_id: z.string().describe("The external ID of the user.").nullable().optional(),
|
|
290
|
+
metadata: z.looseObject({}).describe("Metadata key/value pairs associated with the resource.").optional(),
|
|
291
|
+
created_at: z.string().describe("An ISO 8601 timestamp for when the user was created.").optional(),
|
|
292
|
+
updated_at: z.string().describe("An ISO 8601 timestamp for when the user was last updated.").optional()
|
|
293
|
+
}).describe("WorkOS user object."),
|
|
294
|
+
raw: z.looseObject({}).describe("Raw WorkOS response payload.")
|
|
295
|
+
}).describe("A WorkOS user response.");
|
|
296
|
+
var createUserInput = z.strictObject({
|
|
297
|
+
email: z.email().describe("The email address of the user."),
|
|
298
|
+
first_name: z.string().min(1).describe("The first name of the user.").optional(),
|
|
299
|
+
last_name: z.string().min(1).describe("The last name of the user.").optional(),
|
|
300
|
+
name: z.string().min(1).describe("The user's full name.").optional(),
|
|
301
|
+
email_verified: z.boolean().describe("Whether the user's email address was previously verified.").optional(),
|
|
302
|
+
metadata: z.looseObject({}).describe("Metadata key/value pairs associated with the resource.").optional(),
|
|
303
|
+
external_id: z.string().min(1).describe("The external identifier of the user.").optional(),
|
|
304
|
+
password: z.string().min(1).describe("The password to set for the user.").optional()
|
|
305
|
+
}).describe("Input parameters for creating a WorkOS user.");
|
|
306
|
+
var createUserOutput = z.strictObject({
|
|
307
|
+
user: z.looseObject({
|
|
308
|
+
object: z.string().describe("Object type returned by WorkOS.").optional(),
|
|
309
|
+
id: z.string().describe("The unique ID of the user.").optional(),
|
|
310
|
+
email: z.string().describe("The email address of the user.").optional(),
|
|
311
|
+
first_name: z.string().describe("The first name of the user.").nullable().optional(),
|
|
312
|
+
last_name: z.string().describe("The last name of the user.").nullable().optional(),
|
|
313
|
+
name: z.string().describe("The user's full name.").nullable().optional(),
|
|
314
|
+
email_verified: z.boolean().describe("Whether the user's email has been verified.").optional(),
|
|
315
|
+
external_id: z.string().describe("The external ID of the user.").nullable().optional(),
|
|
316
|
+
metadata: z.looseObject({}).describe("Metadata key/value pairs associated with the resource.").optional(),
|
|
317
|
+
created_at: z.string().describe("An ISO 8601 timestamp for when the user was created.").optional(),
|
|
318
|
+
updated_at: z.string().describe("An ISO 8601 timestamp for when the user was last updated.").optional()
|
|
319
|
+
}).describe("WorkOS user object."),
|
|
320
|
+
raw: z.looseObject({}).describe("Raw WorkOS response payload.")
|
|
321
|
+
}).describe("A WorkOS user response.");
|
|
322
|
+
var updateUserInput = z.strictObject({
|
|
323
|
+
id: z.string().min(1).describe("The unique ID of the user."),
|
|
324
|
+
first_name: z.string().min(1).describe("The first name of the user.").optional(),
|
|
325
|
+
last_name: z.string().min(1).describe("The last name of the user.").optional(),
|
|
326
|
+
name: z.string().min(1).describe("The user's full name.").optional(),
|
|
327
|
+
email_verified: z.boolean().describe("Whether the user's email address was previously verified.").optional(),
|
|
328
|
+
metadata: z.looseObject({}).describe("Metadata key/value pairs associated with the resource.").optional(),
|
|
329
|
+
external_id: z.string().min(1).describe("The external identifier of the user.").optional(),
|
|
330
|
+
password: z.string().min(1).describe("The password to set for the user.").optional()
|
|
331
|
+
}).describe("Input parameters for updating a WorkOS user.");
|
|
332
|
+
var updateUserOutput = z.strictObject({
|
|
333
|
+
user: z.looseObject({
|
|
334
|
+
object: z.string().describe("Object type returned by WorkOS.").optional(),
|
|
335
|
+
id: z.string().describe("The unique ID of the user.").optional(),
|
|
336
|
+
email: z.string().describe("The email address of the user.").optional(),
|
|
337
|
+
first_name: z.string().describe("The first name of the user.").nullable().optional(),
|
|
338
|
+
last_name: z.string().describe("The last name of the user.").nullable().optional(),
|
|
339
|
+
name: z.string().describe("The user's full name.").nullable().optional(),
|
|
340
|
+
email_verified: z.boolean().describe("Whether the user's email has been verified.").optional(),
|
|
341
|
+
external_id: z.string().describe("The external ID of the user.").nullable().optional(),
|
|
342
|
+
metadata: z.looseObject({}).describe("Metadata key/value pairs associated with the resource.").optional(),
|
|
343
|
+
created_at: z.string().describe("An ISO 8601 timestamp for when the user was created.").optional(),
|
|
344
|
+
updated_at: z.string().describe("An ISO 8601 timestamp for when the user was last updated.").optional()
|
|
345
|
+
}).describe("WorkOS user object."),
|
|
346
|
+
raw: z.looseObject({}).describe("Raw WorkOS response payload.")
|
|
347
|
+
}).describe("A WorkOS user response.");
|
|
348
|
+
var listOrganizationsInput = z.strictObject({
|
|
349
|
+
before: z.string().min(1).describe("An object ID that defines the cursor position before the requested page.").optional(),
|
|
350
|
+
after: z.string().min(1).describe("An object ID that defines the cursor position after the requested page.").optional(),
|
|
351
|
+
limit: z.int().min(1).max(100).describe("Upper limit on the number of objects to return, between 1 and 100.").optional(),
|
|
352
|
+
order: z.enum(["normal", "desc", "asc"]).describe("Order the results by creation time.").optional(),
|
|
353
|
+
domains: z.array(z.string().min(1).describe("A domain name.")).describe("Domains to match against organizations.").optional(),
|
|
354
|
+
search: z.string().min(1).describe("Search text matched against organization names.").optional()
|
|
355
|
+
}).describe("Input parameters for listing WorkOS organizations.");
|
|
356
|
+
var listOrganizationsOutput = z.strictObject({
|
|
357
|
+
organizations: z.array(z.looseObject({
|
|
358
|
+
object: z.string().describe("Object type returned by WorkOS.").optional(),
|
|
359
|
+
id: z.string().describe("Unique identifier of the organization.").optional(),
|
|
360
|
+
name: z.string().describe("A descriptive name for the organization.").optional(),
|
|
361
|
+
domains: z.array(z.looseObject({}).describe("Organization domain.")).describe("Domains associated with the organization.").optional(),
|
|
362
|
+
metadata: z.looseObject({}).describe("Metadata key/value pairs associated with the resource.").optional(),
|
|
363
|
+
external_id: z.string().describe("The external ID of the organization.").nullable().optional(),
|
|
364
|
+
created_at: z.string().describe("The timestamp when the organization was created.").optional(),
|
|
365
|
+
updated_at: z.string().describe("The timestamp when the organization was last updated.").optional()
|
|
366
|
+
}).describe("WorkOS organization object.")).describe("Organizations returned by WorkOS."),
|
|
367
|
+
list_metadata: z.looseObject({
|
|
368
|
+
before: z.string().describe("Cursor for the previous page when returned by WorkOS.").nullable().optional(),
|
|
369
|
+
after: z.string().describe("Cursor for the next page when returned by WorkOS.").nullable().optional()
|
|
370
|
+
}).describe("WorkOS pagination metadata returned for a list request."),
|
|
371
|
+
raw: z.looseObject({}).describe("Raw WorkOS response payload.")
|
|
372
|
+
}).describe("A page of WorkOS organizations.");
|
|
373
|
+
var getOrganizationInput = z.strictObject({
|
|
374
|
+
id: z.string().min(1).describe("Unique identifier of the organization.")
|
|
375
|
+
}).describe("Input parameters for getting a WorkOS organization.");
|
|
376
|
+
var getOrganizationOutput = z.strictObject({
|
|
377
|
+
organization: z.looseObject({
|
|
378
|
+
object: z.string().describe("Object type returned by WorkOS.").optional(),
|
|
379
|
+
id: z.string().describe("Unique identifier of the organization.").optional(),
|
|
380
|
+
name: z.string().describe("A descriptive name for the organization.").optional(),
|
|
381
|
+
domains: z.array(z.looseObject({}).describe("Organization domain.")).describe("Domains associated with the organization.").optional(),
|
|
382
|
+
metadata: z.looseObject({}).describe("Metadata key/value pairs associated with the resource.").optional(),
|
|
383
|
+
external_id: z.string().describe("The external ID of the organization.").nullable().optional(),
|
|
384
|
+
created_at: z.string().describe("The timestamp when the organization was created.").optional(),
|
|
385
|
+
updated_at: z.string().describe("The timestamp when the organization was last updated.").optional()
|
|
386
|
+
}).describe("WorkOS organization object."),
|
|
387
|
+
raw: z.looseObject({}).describe("Raw WorkOS response payload.")
|
|
388
|
+
}).describe("A WorkOS organization response.");
|
|
389
|
+
var createOrganizationInput = z.strictObject({
|
|
390
|
+
name: z.string().min(1).describe("The name of the organization."),
|
|
391
|
+
allow_profiles_outside_organization: z.boolean().describe("Whether the organization allows profiles from outside the organization to sign in.").optional(),
|
|
392
|
+
domain_data: z.array(z.looseObject({
|
|
393
|
+
domain: z.string().describe("The organization domain name.").optional(),
|
|
394
|
+
state: z.string().describe("The domain verification state.").optional()
|
|
395
|
+
}).describe("WorkOS organization domain data.")).describe("Domains associated with the organization, including verification state.").optional(),
|
|
396
|
+
metadata: z.looseObject({}).describe("Metadata key/value pairs associated with the resource.").optional(),
|
|
397
|
+
external_id: z.string().min(1).describe("An external identifier for the organization.").optional()
|
|
398
|
+
}).describe("Input parameters for creating a WorkOS organization.");
|
|
399
|
+
var createOrganizationOutput = z.strictObject({
|
|
400
|
+
organization: z.looseObject({
|
|
401
|
+
object: z.string().describe("Object type returned by WorkOS.").optional(),
|
|
402
|
+
id: z.string().describe("Unique identifier of the organization.").optional(),
|
|
403
|
+
name: z.string().describe("A descriptive name for the organization.").optional(),
|
|
404
|
+
domains: z.array(z.looseObject({}).describe("Organization domain.")).describe("Domains associated with the organization.").optional(),
|
|
405
|
+
metadata: z.looseObject({}).describe("Metadata key/value pairs associated with the resource.").optional(),
|
|
406
|
+
external_id: z.string().describe("The external ID of the organization.").nullable().optional(),
|
|
407
|
+
created_at: z.string().describe("The timestamp when the organization was created.").optional(),
|
|
408
|
+
updated_at: z.string().describe("The timestamp when the organization was last updated.").optional()
|
|
409
|
+
}).describe("WorkOS organization object."),
|
|
410
|
+
raw: z.looseObject({}).describe("Raw WorkOS response payload.")
|
|
411
|
+
}).describe("A WorkOS organization response.");
|
|
412
|
+
var updateOrganizationInput = z.strictObject({
|
|
413
|
+
id: z.string().min(1).describe("Unique identifier of the organization."),
|
|
414
|
+
name: z.string().min(1).describe("The name of the organization.").optional(),
|
|
415
|
+
allow_profiles_outside_organization: z.boolean().describe("Whether the organization allows profiles from outside the organization to sign in.").optional(),
|
|
416
|
+
domain_data: z.array(z.looseObject({
|
|
417
|
+
domain: z.string().describe("The organization domain name.").optional(),
|
|
418
|
+
state: z.string().describe("The domain verification state.").optional()
|
|
419
|
+
}).describe("WorkOS organization domain data.")).describe("Domains associated with the organization, including verification state.").optional(),
|
|
420
|
+
metadata: z.looseObject({}).describe("Metadata key/value pairs associated with the resource.").optional(),
|
|
421
|
+
external_id: z.string().min(1).describe("An external identifier for the organization.").optional()
|
|
422
|
+
}).describe("Input parameters for updating a WorkOS organization.");
|
|
423
|
+
var updateOrganizationOutput = z.strictObject({
|
|
424
|
+
organization: z.looseObject({
|
|
425
|
+
object: z.string().describe("Object type returned by WorkOS.").optional(),
|
|
426
|
+
id: z.string().describe("Unique identifier of the organization.").optional(),
|
|
427
|
+
name: z.string().describe("A descriptive name for the organization.").optional(),
|
|
428
|
+
domains: z.array(z.looseObject({}).describe("Organization domain.")).describe("Domains associated with the organization.").optional(),
|
|
429
|
+
metadata: z.looseObject({}).describe("Metadata key/value pairs associated with the resource.").optional(),
|
|
430
|
+
external_id: z.string().describe("The external ID of the organization.").nullable().optional(),
|
|
431
|
+
created_at: z.string().describe("The timestamp when the organization was created.").optional(),
|
|
432
|
+
updated_at: z.string().describe("The timestamp when the organization was last updated.").optional()
|
|
433
|
+
}).describe("WorkOS organization object."),
|
|
434
|
+
raw: z.looseObject({}).describe("Raw WorkOS response payload.")
|
|
435
|
+
}).describe("A WorkOS organization response.");
|
|
436
|
+
var listOrganizationMembershipsInput = z.strictObject({
|
|
437
|
+
before: z.string().min(1).describe("An object ID that defines the cursor position before the requested page.").optional(),
|
|
438
|
+
after: z.string().min(1).describe("An object ID that defines the cursor position after the requested page.").optional(),
|
|
439
|
+
limit: z.int().min(1).max(100).describe("Upper limit on the number of objects to return, between 1 and 100.").optional(),
|
|
440
|
+
order: z.enum(["normal", "desc", "asc"]).describe("Order the results by creation time.").optional(),
|
|
441
|
+
organization_id: z.string().min(1).describe("The ID of the organization which the user belongs to.").optional(),
|
|
442
|
+
user_id: z.string().min(1).describe("The ID of the user.").optional(),
|
|
443
|
+
statuses: z.array(z.enum(["active", "inactive", "pending"]).describe("A WorkOS organization membership status.")).describe("Statuses to include in the membership list.").optional()
|
|
444
|
+
}).describe("Input parameters for listing WorkOS organization memberships.");
|
|
445
|
+
var listOrganizationMembershipsOutput = z.strictObject({
|
|
446
|
+
organization_memberships: z.array(z.looseObject({
|
|
447
|
+
object: z.string().describe("Object type returned by WorkOS.").optional(),
|
|
448
|
+
id: z.string().describe("The unique ID of the organization membership.").optional(),
|
|
449
|
+
userId: z.string().describe("The ID of the WorkOS user.").optional(),
|
|
450
|
+
organizationId: z.string().describe("The ID of the WorkOS organization.").optional(),
|
|
451
|
+
organizationName: z.string().describe("The name of the WorkOS organization.").optional(),
|
|
452
|
+
status: z.enum(["active", "inactive", "pending"]).describe("A WorkOS organization membership status.").optional(),
|
|
453
|
+
createdAt: z.string().describe("The timestamp when the organization membership was created.").optional(),
|
|
454
|
+
updatedAt: z.string().describe("The timestamp when the organization membership was last updated.").optional()
|
|
455
|
+
}).describe("WorkOS organization membership object.")).describe("Organization memberships returned by WorkOS."),
|
|
456
|
+
list_metadata: z.looseObject({
|
|
457
|
+
before: z.string().describe("Cursor for the previous page when returned by WorkOS.").nullable().optional(),
|
|
458
|
+
after: z.string().describe("Cursor for the next page when returned by WorkOS.").nullable().optional()
|
|
459
|
+
}).describe("WorkOS pagination metadata returned for a list request."),
|
|
460
|
+
raw: z.looseObject({}).describe("Raw WorkOS response payload.")
|
|
461
|
+
}).describe("A page of WorkOS organization memberships.");
|
|
462
|
+
var getOrganizationMembershipInput = z.strictObject({
|
|
463
|
+
id: z.string().min(1).describe("The unique ID of the organization membership.")
|
|
464
|
+
}).describe("Input parameters for getting a WorkOS organization membership.");
|
|
465
|
+
var getOrganizationMembershipOutput = z.strictObject({
|
|
466
|
+
organization_membership: z.looseObject({
|
|
467
|
+
object: z.string().describe("Object type returned by WorkOS.").optional(),
|
|
468
|
+
id: z.string().describe("The unique ID of the organization membership.").optional(),
|
|
469
|
+
userId: z.string().describe("The ID of the WorkOS user.").optional(),
|
|
470
|
+
organizationId: z.string().describe("The ID of the WorkOS organization.").optional(),
|
|
471
|
+
organizationName: z.string().describe("The name of the WorkOS organization.").optional(),
|
|
472
|
+
status: z.enum(["active", "inactive", "pending"]).describe("A WorkOS organization membership status.").optional(),
|
|
473
|
+
createdAt: z.string().describe("The timestamp when the organization membership was created.").optional(),
|
|
474
|
+
updatedAt: z.string().describe("The timestamp when the organization membership was last updated.").optional()
|
|
475
|
+
}).describe("WorkOS organization membership object."),
|
|
476
|
+
raw: z.looseObject({}).describe("Raw WorkOS response payload.")
|
|
477
|
+
}).describe("A WorkOS organization membership response.");
|
|
478
|
+
var createOrganizationMembershipInput = z.strictObject({
|
|
479
|
+
user_id: z.string().min(1).describe("The ID of the user."),
|
|
480
|
+
organization_id: z.string().min(1).describe("The ID of the organization which the user belongs to."),
|
|
481
|
+
role_slug: z.string().min(1).describe("A single role identifier.").optional(),
|
|
482
|
+
role_slugs: z.array(z.string().min(1).describe("A role identifier.")).describe("Role identifiers to assign to the user.").optional()
|
|
483
|
+
}).describe("Input parameters for creating a WorkOS organization membership.");
|
|
484
|
+
var createOrganizationMembershipOutput = z.strictObject({
|
|
485
|
+
organization_membership: z.looseObject({
|
|
486
|
+
object: z.string().describe("Object type returned by WorkOS.").optional(),
|
|
487
|
+
id: z.string().describe("The unique ID of the organization membership.").optional(),
|
|
488
|
+
userId: z.string().describe("The ID of the WorkOS user.").optional(),
|
|
489
|
+
organizationId: z.string().describe("The ID of the WorkOS organization.").optional(),
|
|
490
|
+
organizationName: z.string().describe("The name of the WorkOS organization.").optional(),
|
|
491
|
+
status: z.enum(["active", "inactive", "pending"]).describe("A WorkOS organization membership status.").optional(),
|
|
492
|
+
createdAt: z.string().describe("The timestamp when the organization membership was created.").optional(),
|
|
493
|
+
updatedAt: z.string().describe("The timestamp when the organization membership was last updated.").optional()
|
|
494
|
+
}).describe("WorkOS organization membership object."),
|
|
495
|
+
raw: z.looseObject({}).describe("Raw WorkOS response payload.")
|
|
496
|
+
}).describe("A WorkOS organization membership response.");
|
|
497
|
+
var updateOrganizationMembershipInput = z.strictObject({
|
|
498
|
+
id: z.string().min(1).describe("The unique ID of the organization membership."),
|
|
499
|
+
role_slug: z.string().min(1).describe("A single role identifier.").optional(),
|
|
500
|
+
role_slugs: z.array(z.string().min(1).describe("A role identifier.")).describe("Role identifiers to assign to the user.").optional()
|
|
501
|
+
}).describe("Input parameters for updating a WorkOS organization membership.");
|
|
502
|
+
var updateOrganizationMembershipOutput = z.strictObject({
|
|
503
|
+
organization_membership: z.looseObject({
|
|
504
|
+
object: z.string().describe("Object type returned by WorkOS.").optional(),
|
|
505
|
+
id: z.string().describe("The unique ID of the organization membership.").optional(),
|
|
506
|
+
userId: z.string().describe("The ID of the WorkOS user.").optional(),
|
|
507
|
+
organizationId: z.string().describe("The ID of the WorkOS organization.").optional(),
|
|
508
|
+
organizationName: z.string().describe("The name of the WorkOS organization.").optional(),
|
|
509
|
+
status: z.enum(["active", "inactive", "pending"]).describe("A WorkOS organization membership status.").optional(),
|
|
510
|
+
createdAt: z.string().describe("The timestamp when the organization membership was created.").optional(),
|
|
511
|
+
updatedAt: z.string().describe("The timestamp when the organization membership was last updated.").optional()
|
|
512
|
+
}).describe("WorkOS organization membership object."),
|
|
513
|
+
raw: z.looseObject({}).describe("Raw WorkOS response payload.")
|
|
514
|
+
}).describe("A WorkOS organization membership response.");
|
|
515
|
+
var deactivateOrganizationMembershipInput = z.strictObject({
|
|
516
|
+
id: z.string().min(1).describe("The unique ID of the organization membership.")
|
|
517
|
+
}).describe("Input parameters for deactivating a WorkOS organization membership.");
|
|
518
|
+
var deactivateOrganizationMembershipOutput = z.strictObject({
|
|
519
|
+
organization_membership: z.looseObject({
|
|
520
|
+
object: z.string().describe("Object type returned by WorkOS.").optional(),
|
|
521
|
+
id: z.string().describe("The unique ID of the organization membership.").optional(),
|
|
522
|
+
userId: z.string().describe("The ID of the WorkOS user.").optional(),
|
|
523
|
+
organizationId: z.string().describe("The ID of the WorkOS organization.").optional(),
|
|
524
|
+
organizationName: z.string().describe("The name of the WorkOS organization.").optional(),
|
|
525
|
+
status: z.enum(["active", "inactive", "pending"]).describe("A WorkOS organization membership status.").optional(),
|
|
526
|
+
createdAt: z.string().describe("The timestamp when the organization membership was created.").optional(),
|
|
527
|
+
updatedAt: z.string().describe("The timestamp when the organization membership was last updated.").optional()
|
|
528
|
+
}).describe("WorkOS organization membership object."),
|
|
529
|
+
raw: z.looseObject({}).describe("Raw WorkOS response payload.")
|
|
530
|
+
}).describe("A WorkOS organization membership response.");
|
|
531
|
+
var reactivateOrganizationMembershipInput = z.strictObject({
|
|
532
|
+
id: z.string().min(1).describe("The unique ID of the organization membership.")
|
|
533
|
+
}).describe("Input parameters for reactivating a WorkOS organization membership.");
|
|
534
|
+
var reactivateOrganizationMembershipOutput = z.strictObject({
|
|
535
|
+
organization_membership: z.looseObject({
|
|
536
|
+
object: z.string().describe("Object type returned by WorkOS.").optional(),
|
|
537
|
+
id: z.string().describe("The unique ID of the organization membership.").optional(),
|
|
538
|
+
userId: z.string().describe("The ID of the WorkOS user.").optional(),
|
|
539
|
+
organizationId: z.string().describe("The ID of the WorkOS organization.").optional(),
|
|
540
|
+
organizationName: z.string().describe("The name of the WorkOS organization.").optional(),
|
|
541
|
+
status: z.enum(["active", "inactive", "pending"]).describe("A WorkOS organization membership status.").optional(),
|
|
542
|
+
createdAt: z.string().describe("The timestamp when the organization membership was created.").optional(),
|
|
543
|
+
updatedAt: z.string().describe("The timestamp when the organization membership was last updated.").optional()
|
|
544
|
+
}).describe("WorkOS organization membership object."),
|
|
545
|
+
raw: z.looseObject({}).describe("Raw WorkOS response payload.")
|
|
546
|
+
}).describe("A WorkOS organization membership response.");
|
|
547
|
+
var workosActions = {
|
|
548
|
+
list_users: {
|
|
549
|
+
description: "List WorkOS AuthKit users with optional cursor and identity filters.",
|
|
550
|
+
effect: "read",
|
|
551
|
+
inputSchema: listUsersInput,
|
|
552
|
+
outputSchema: z.toJSONSchema(listUsersOutput, { io: "output", unrepresentable: "any" })
|
|
553
|
+
},
|
|
554
|
+
get_user: {
|
|
555
|
+
description: "Get a WorkOS AuthKit user by ID.",
|
|
556
|
+
effect: "read",
|
|
557
|
+
inputSchema: getUserInput,
|
|
558
|
+
outputSchema: z.toJSONSchema(getUserOutput, { io: "output", unrepresentable: "any" })
|
|
559
|
+
},
|
|
560
|
+
create_user: {
|
|
561
|
+
description: "Create a WorkOS AuthKit user in the current environment.",
|
|
562
|
+
effect: "write",
|
|
563
|
+
inputSchema: createUserInput,
|
|
564
|
+
outputSchema: z.toJSONSchema(createUserOutput, { io: "output", unrepresentable: "any" })
|
|
565
|
+
},
|
|
566
|
+
update_user: {
|
|
567
|
+
description: "Update properties of an existing WorkOS AuthKit user.",
|
|
568
|
+
effect: "write",
|
|
569
|
+
inputSchema: updateUserInput,
|
|
570
|
+
outputSchema: z.toJSONSchema(updateUserOutput, { io: "output", unrepresentable: "any" })
|
|
571
|
+
},
|
|
572
|
+
list_organizations: {
|
|
573
|
+
description: "List WorkOS organizations with optional cursor, domain, and text filters.",
|
|
574
|
+
effect: "read",
|
|
575
|
+
inputSchema: listOrganizationsInput,
|
|
576
|
+
outputSchema: z.toJSONSchema(listOrganizationsOutput, { io: "output", unrepresentable: "any" })
|
|
577
|
+
},
|
|
578
|
+
get_organization: {
|
|
579
|
+
description: "Get a WorkOS organization by ID.",
|
|
580
|
+
effect: "read",
|
|
581
|
+
inputSchema: getOrganizationInput,
|
|
582
|
+
outputSchema: z.toJSONSchema(getOrganizationOutput, { io: "output", unrepresentable: "any" })
|
|
583
|
+
},
|
|
584
|
+
create_organization: {
|
|
585
|
+
description: "Create a WorkOS organization in the current environment.",
|
|
586
|
+
effect: "write",
|
|
587
|
+
inputSchema: createOrganizationInput,
|
|
588
|
+
outputSchema: z.toJSONSchema(createOrganizationOutput, { io: "output", unrepresentable: "any" })
|
|
589
|
+
},
|
|
590
|
+
update_organization: {
|
|
591
|
+
description: "Update properties of an existing WorkOS organization.",
|
|
592
|
+
effect: "write",
|
|
593
|
+
inputSchema: updateOrganizationInput,
|
|
594
|
+
outputSchema: z.toJSONSchema(updateOrganizationOutput, { io: "output", unrepresentable: "any" })
|
|
595
|
+
},
|
|
596
|
+
list_organization_memberships: {
|
|
597
|
+
description: "List WorkOS organization memberships filtered by user, organization, or membership status.",
|
|
598
|
+
effect: "read",
|
|
599
|
+
inputSchema: listOrganizationMembershipsInput,
|
|
600
|
+
outputSchema: z.toJSONSchema(listOrganizationMembershipsOutput, { io: "output", unrepresentable: "any" })
|
|
601
|
+
},
|
|
602
|
+
get_organization_membership: {
|
|
603
|
+
description: "Get a WorkOS organization membership by ID.",
|
|
604
|
+
effect: "read",
|
|
605
|
+
inputSchema: getOrganizationMembershipInput,
|
|
606
|
+
outputSchema: z.toJSONSchema(getOrganizationMembershipOutput, { io: "output", unrepresentable: "any" })
|
|
607
|
+
},
|
|
608
|
+
create_organization_membership: {
|
|
609
|
+
description: "Create an active WorkOS organization membership for a user and organization.",
|
|
610
|
+
effect: "write",
|
|
611
|
+
inputSchema: createOrganizationMembershipInput,
|
|
612
|
+
outputSchema: z.toJSONSchema(createOrganizationMembershipOutput, { io: "output", unrepresentable: "any" })
|
|
613
|
+
},
|
|
614
|
+
update_organization_membership: {
|
|
615
|
+
description: "Update roles on an existing WorkOS organization membership.",
|
|
616
|
+
effect: "write",
|
|
617
|
+
inputSchema: updateOrganizationMembershipInput,
|
|
618
|
+
outputSchema: z.toJSONSchema(updateOrganizationMembershipOutput, { io: "output", unrepresentable: "any" })
|
|
619
|
+
},
|
|
620
|
+
deactivate_organization_membership: {
|
|
621
|
+
description: "Deactivate an active WorkOS organization membership.",
|
|
622
|
+
effect: "write",
|
|
623
|
+
inputSchema: deactivateOrganizationMembershipInput,
|
|
624
|
+
outputSchema: z.toJSONSchema(deactivateOrganizationMembershipOutput, { io: "output", unrepresentable: "any" })
|
|
625
|
+
},
|
|
626
|
+
reactivate_organization_membership: {
|
|
627
|
+
description: "Reactivate an inactive WorkOS organization membership.",
|
|
628
|
+
effect: "write",
|
|
629
|
+
inputSchema: reactivateOrganizationMembershipInput,
|
|
630
|
+
outputSchema: z.toJSONSchema(reactivateOrganizationMembershipOutput, { io: "output", unrepresentable: "any" })
|
|
631
|
+
}
|
|
632
|
+
};
|
|
633
|
+
|
|
634
|
+
// ../plugins/src/workos/index.ts
|
|
635
|
+
function createWorkosPlugin() {
|
|
636
|
+
return createProviderPlugin({
|
|
637
|
+
description: "WorkOS",
|
|
638
|
+
actions: workosActions,
|
|
639
|
+
// 上游的 credentialValidators 打的是 /organizations?limit=1;list_organizations 无必填入参,
|
|
640
|
+
// 是它的同一个调用。
|
|
641
|
+
credentialProbe: "list_organizations",
|
|
642
|
+
handlers: {
|
|
643
|
+
list_users: listUsers,
|
|
644
|
+
get_user: getUser,
|
|
645
|
+
create_user: createUser,
|
|
646
|
+
update_user: updateUser,
|
|
647
|
+
list_organizations: listOrganizations,
|
|
648
|
+
get_organization: getOrganization,
|
|
649
|
+
create_organization: createOrganization,
|
|
650
|
+
update_organization: updateOrganization,
|
|
651
|
+
list_organization_memberships: listOrganizationMemberships,
|
|
652
|
+
get_organization_membership: getOrganizationMembership,
|
|
653
|
+
create_organization_membership: createOrganizationMembership,
|
|
654
|
+
update_organization_membership: updateOrganizationMembership,
|
|
655
|
+
deactivate_organization_membership: deactivateOrganizationMembership,
|
|
656
|
+
reactivate_organization_membership: reactivateOrganizationMembership
|
|
657
|
+
}
|
|
658
|
+
});
|
|
659
|
+
}
|
|
660
|
+
var workos_default = createWorkosPlugin();
|
|
661
|
+
export {
|
|
662
|
+
createWorkosPlugin,
|
|
663
|
+
workos_default as default
|
|
664
|
+
};
|