@workos-inc/node 10.12.0 → 10.13.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/lib/{factory-CQfrl-3d.cjs → factory-BfdUyn2X.cjs} +453 -2
- package/lib/factory-BfdUyn2X.cjs.map +1 -0
- package/lib/{factory-CCkRzS83.d.cts → factory-C4y25QQJ.d.cts} +641 -22
- package/lib/{factory-CCkRzS83.d.mts → factory-C4y25QQJ.d.mts} +641 -22
- package/lib/{factory-AQv-AfDk.mjs → factory-DQwwZIi5.mjs} +453 -2
- package/lib/factory-DQwwZIi5.mjs.map +1 -0
- package/lib/index.cjs +1 -1
- package/lib/index.d.cts +2 -2
- package/lib/index.d.mts +2 -2
- package/lib/index.mjs +1 -1
- package/lib/index.worker.cjs +1 -1
- package/lib/index.worker.d.cts +2 -2
- package/lib/index.worker.d.mts +2 -2
- package/lib/index.worker.mjs +1 -1
- package/package.json +1 -1
- package/lib/factory-AQv-AfDk.mjs.map +0 -1
- package/lib/factory-CQfrl-3d.cjs.map +0 -1
|
@@ -1137,6 +1137,27 @@ function deserializeUserApiKeyWithValue(apiKey) {
|
|
|
1137
1137
|
};
|
|
1138
1138
|
}
|
|
1139
1139
|
//#endregion
|
|
1140
|
+
//#region src/user-management/serializers/waitlist.serializer.ts
|
|
1141
|
+
const deserializeWaitlist = (waitlist) => ({
|
|
1142
|
+
object: waitlist.object,
|
|
1143
|
+
id: waitlist.id,
|
|
1144
|
+
createdAt: waitlist.created_at,
|
|
1145
|
+
updatedAt: waitlist.updated_at
|
|
1146
|
+
});
|
|
1147
|
+
//#endregion
|
|
1148
|
+
//#region src/user-management/serializers/waitlist-entry.serializer.ts
|
|
1149
|
+
const deserializeWaitlistEntry = (waitlistEntry) => ({
|
|
1150
|
+
object: waitlistEntry.object,
|
|
1151
|
+
id: waitlistEntry.id,
|
|
1152
|
+
email: waitlistEntry.email,
|
|
1153
|
+
state: waitlistEntry.state,
|
|
1154
|
+
approvedAt: waitlistEntry.approved_at,
|
|
1155
|
+
additionalFields: waitlistEntry.additional_fields,
|
|
1156
|
+
waitlistId: waitlistEntry.waitlist_id ?? null,
|
|
1157
|
+
createdAt: waitlistEntry.created_at,
|
|
1158
|
+
updatedAt: waitlistEntry.updated_at
|
|
1159
|
+
});
|
|
1160
|
+
//#endregion
|
|
1140
1161
|
//#region src/user-management/serializers/organization-membership.serializer.ts
|
|
1141
1162
|
const deserializeOrganizationMembership = (organizationMembership) => ({
|
|
1142
1163
|
object: organizationMembership.object,
|
|
@@ -2185,6 +2206,108 @@ function getJose() {
|
|
|
2185
2206
|
return _josePromise ??= Promise.resolve().then(() => require("./webapi-D3QZrB15.cjs"));
|
|
2186
2207
|
}
|
|
2187
2208
|
//#endregion
|
|
2209
|
+
//#region src/agents/serializers/agent-blueprint.serializer.ts
|
|
2210
|
+
function deserializeAgentBlueprint(blueprint) {
|
|
2211
|
+
return {
|
|
2212
|
+
object: blueprint.object,
|
|
2213
|
+
id: blueprint.id,
|
|
2214
|
+
name: blueprint.name,
|
|
2215
|
+
description: blueprint.description,
|
|
2216
|
+
permissions: blueprint.permissions,
|
|
2217
|
+
invocableBy: {
|
|
2218
|
+
roleSlugs: blueprint.invocable_by.role_slugs,
|
|
2219
|
+
organizationIds: blueprint.invocable_by.organization_ids
|
|
2220
|
+
},
|
|
2221
|
+
sessionSettings: {
|
|
2222
|
+
maxAgeSeconds: blueprint.session_settings.max_age_seconds,
|
|
2223
|
+
accessTokenTtlSeconds: blueprint.session_settings.access_token_ttl_seconds,
|
|
2224
|
+
refreshTokenTtlSeconds: blueprint.session_settings.refresh_token_ttl_seconds
|
|
2225
|
+
},
|
|
2226
|
+
createdAt: blueprint.created_at,
|
|
2227
|
+
updatedAt: blueprint.updated_at
|
|
2228
|
+
};
|
|
2229
|
+
}
|
|
2230
|
+
function serializeCreateAgentBlueprintOptions(options) {
|
|
2231
|
+
return {
|
|
2232
|
+
name: options.name,
|
|
2233
|
+
...options.description !== void 0 && { description: options.description },
|
|
2234
|
+
...options.permissions !== void 0 && { permissions: options.permissions },
|
|
2235
|
+
...options.invocableBy !== void 0 && { invocable_by: {
|
|
2236
|
+
...options.invocableBy.roleSlugs !== void 0 && { role_slugs: options.invocableBy.roleSlugs },
|
|
2237
|
+
...options.invocableBy.organizationIds !== void 0 && { organization_ids: options.invocableBy.organizationIds }
|
|
2238
|
+
} },
|
|
2239
|
+
session_settings: {
|
|
2240
|
+
max_age_seconds: options.sessionSettings.maxAgeSeconds,
|
|
2241
|
+
access_token_ttl_seconds: options.sessionSettings.accessTokenTtlSeconds,
|
|
2242
|
+
refresh_token_ttl_seconds: options.sessionSettings.refreshTokenTtlSeconds
|
|
2243
|
+
}
|
|
2244
|
+
};
|
|
2245
|
+
}
|
|
2246
|
+
function serializeUpdateAgentBlueprintOptions(options) {
|
|
2247
|
+
return {
|
|
2248
|
+
...options.name !== void 0 && { name: options.name },
|
|
2249
|
+
...options.description !== void 0 && { description: options.description },
|
|
2250
|
+
...options.permissions !== void 0 && { permissions: options.permissions },
|
|
2251
|
+
...options.invocableBy !== void 0 && { invocable_by: {
|
|
2252
|
+
...options.invocableBy.roleSlugs !== void 0 && { role_slugs: options.invocableBy.roleSlugs },
|
|
2253
|
+
...options.invocableBy.organizationIds !== void 0 && { organization_ids: options.invocableBy.organizationIds }
|
|
2254
|
+
} },
|
|
2255
|
+
...options.sessionSettings !== void 0 && { session_settings: {
|
|
2256
|
+
...options.sessionSettings.maxAgeSeconds !== void 0 && { max_age_seconds: options.sessionSettings.maxAgeSeconds },
|
|
2257
|
+
...options.sessionSettings.accessTokenTtlSeconds !== void 0 && { access_token_ttl_seconds: options.sessionSettings.accessTokenTtlSeconds },
|
|
2258
|
+
...options.sessionSettings.refreshTokenTtlSeconds !== void 0 && { refresh_token_ttl_seconds: options.sessionSettings.refreshTokenTtlSeconds }
|
|
2259
|
+
} }
|
|
2260
|
+
};
|
|
2261
|
+
}
|
|
2262
|
+
//#endregion
|
|
2263
|
+
//#region src/agents/serializers/agent-instance-session.serializer.ts
|
|
2264
|
+
function deserializeAgentInstanceSession(session) {
|
|
2265
|
+
return {
|
|
2266
|
+
object: session.object,
|
|
2267
|
+
id: session.id,
|
|
2268
|
+
agentInstanceId: session.agent_instance_id,
|
|
2269
|
+
status: session.status,
|
|
2270
|
+
expiresAt: session.expires_at,
|
|
2271
|
+
revokedAt: session.revoked_at,
|
|
2272
|
+
createdAt: session.created_at,
|
|
2273
|
+
updatedAt: session.updated_at
|
|
2274
|
+
};
|
|
2275
|
+
}
|
|
2276
|
+
function serializeListAgentInstanceSessionsOptions(options) {
|
|
2277
|
+
return {
|
|
2278
|
+
agent_blueprint_id: options.agentBlueprintId,
|
|
2279
|
+
agent_instance_id: options.agentInstanceId,
|
|
2280
|
+
limit: options.limit,
|
|
2281
|
+
before: options.before,
|
|
2282
|
+
after: options.after,
|
|
2283
|
+
order: options.order
|
|
2284
|
+
};
|
|
2285
|
+
}
|
|
2286
|
+
//#endregion
|
|
2287
|
+
//#region src/agents/serializers/agent-instance.serializer.ts
|
|
2288
|
+
function deserializeAgentInstance(instance) {
|
|
2289
|
+
return {
|
|
2290
|
+
object: instance.object,
|
|
2291
|
+
id: instance.id,
|
|
2292
|
+
agentBlueprintId: instance.agent_blueprint_id,
|
|
2293
|
+
organizationId: instance.organization_id,
|
|
2294
|
+
organizationMembershipId: instance.organization_membership_id,
|
|
2295
|
+
type: instance.type,
|
|
2296
|
+
createdAt: instance.created_at,
|
|
2297
|
+
updatedAt: instance.updated_at
|
|
2298
|
+
};
|
|
2299
|
+
}
|
|
2300
|
+
function serializeListAgentInstancesOptions(options) {
|
|
2301
|
+
return {
|
|
2302
|
+
organization_id: options.organizationId,
|
|
2303
|
+
agent_blueprint_id: options.agentBlueprintId,
|
|
2304
|
+
limit: options.limit,
|
|
2305
|
+
before: options.before,
|
|
2306
|
+
after: options.after,
|
|
2307
|
+
order: options.order
|
|
2308
|
+
};
|
|
2309
|
+
}
|
|
2310
|
+
//#endregion
|
|
2188
2311
|
//#region src/agents/serializers/agent-registration.serializer.ts
|
|
2189
2312
|
function deserializeAgentRegistration(registration) {
|
|
2190
2313
|
return {
|
|
@@ -2216,6 +2339,45 @@ function deserializeAgentRegistration(registration) {
|
|
|
2216
2339
|
};
|
|
2217
2340
|
}
|
|
2218
2341
|
//#endregion
|
|
2342
|
+
//#region src/agents/serializers/agent-token.serializer.ts
|
|
2343
|
+
function deserializeAgentToken(token) {
|
|
2344
|
+
return {
|
|
2345
|
+
accessToken: token.access_token,
|
|
2346
|
+
tokenType: token.token_type,
|
|
2347
|
+
expiresIn: token.expires_in,
|
|
2348
|
+
refreshToken: token.refresh_token,
|
|
2349
|
+
agentInstanceId: token.agent_instance_id,
|
|
2350
|
+
newInstance: token.new_instance,
|
|
2351
|
+
agentInstanceSessionId: token.agent_instance_session_id,
|
|
2352
|
+
permissions: token.permissions
|
|
2353
|
+
};
|
|
2354
|
+
}
|
|
2355
|
+
function serializeMintAgentTokenOptions(options) {
|
|
2356
|
+
const intent = options.intent !== void 0 ? { intent: options.intent } : {};
|
|
2357
|
+
switch (options.type) {
|
|
2358
|
+
case "user_delegated": return {
|
|
2359
|
+
type: "user_delegated",
|
|
2360
|
+
user_access_token: options.userAccessToken,
|
|
2361
|
+
...intent
|
|
2362
|
+
};
|
|
2363
|
+
case "autonomous": return {
|
|
2364
|
+
type: "autonomous",
|
|
2365
|
+
organization_id: options.organizationId,
|
|
2366
|
+
...intent
|
|
2367
|
+
};
|
|
2368
|
+
case "agent_delegated": return {
|
|
2369
|
+
type: "agent_delegated",
|
|
2370
|
+
agent_access_token: options.agentAccessToken,
|
|
2371
|
+
...intent
|
|
2372
|
+
};
|
|
2373
|
+
case "refresh": return {
|
|
2374
|
+
type: "refresh",
|
|
2375
|
+
refresh_token: options.refreshToken,
|
|
2376
|
+
...intent
|
|
2377
|
+
};
|
|
2378
|
+
}
|
|
2379
|
+
}
|
|
2380
|
+
//#endregion
|
|
2219
2381
|
//#region src/agents/serializers/claim-attempt.serializer.ts
|
|
2220
2382
|
function serializeLinkClaimAttemptToExternalUserOptions(options) {
|
|
2221
2383
|
return {
|
|
@@ -2290,6 +2452,186 @@ var Agents = class {
|
|
|
2290
2452
|
this.workos = workos;
|
|
2291
2453
|
}
|
|
2292
2454
|
/**
|
|
2455
|
+
* Create an agent blueprint
|
|
2456
|
+
*
|
|
2457
|
+
* Creates an agent blueprint: the template describing what an agent may do
|
|
2458
|
+
* (its permission ceiling), who may invoke it, and the lifetimes of its
|
|
2459
|
+
* sessions.
|
|
2460
|
+
*
|
|
2461
|
+
* @param options - Configuration for the new agent blueprint.
|
|
2462
|
+
* @returns {Promise<AgentBlueprint>}
|
|
2463
|
+
* @throws {BadRequestException} 400
|
|
2464
|
+
* @throws {ConflictException} 409 - Name already in use.
|
|
2465
|
+
* @throws {UnprocessableEntityException} 422 - Permission, role, or organization not found.
|
|
2466
|
+
*/
|
|
2467
|
+
async createBlueprint(options) {
|
|
2468
|
+
const { data } = await this.workos.post("/agents/blueprints", serializeCreateAgentBlueprintOptions(options));
|
|
2469
|
+
return deserializeAgentBlueprint(data);
|
|
2470
|
+
}
|
|
2471
|
+
/**
|
|
2472
|
+
* List agent blueprints
|
|
2473
|
+
*
|
|
2474
|
+
* Lists the agent blueprints in the current environment.
|
|
2475
|
+
*
|
|
2476
|
+
* @param options - Pagination options.
|
|
2477
|
+
* @returns {Promise<AutoPaginatable<AgentBlueprint, ListAgentBlueprintsOptions>>}
|
|
2478
|
+
*/
|
|
2479
|
+
async listBlueprints(options) {
|
|
2480
|
+
return new AutoPaginatable(await fetchAndDeserialize(this.workos, "/agents/blueprints", deserializeAgentBlueprint, options), (params) => fetchAndDeserialize(this.workos, "/agents/blueprints", deserializeAgentBlueprint, params), options);
|
|
2481
|
+
}
|
|
2482
|
+
/**
|
|
2483
|
+
* Get an agent blueprint
|
|
2484
|
+
*
|
|
2485
|
+
* Retrieves an agent blueprint by ID.
|
|
2486
|
+
* @param agentBlueprintId - Unique identifier of the agent blueprint.
|
|
2487
|
+
*
|
|
2488
|
+
* @example
|
|
2489
|
+
* "agent_blueprint_01EHWNCE74X7JSDV0X3SZ3KJNY"
|
|
2490
|
+
*
|
|
2491
|
+
* @returns {Promise<AgentBlueprint>}
|
|
2492
|
+
* @throws {NotFoundException} 404
|
|
2493
|
+
*/
|
|
2494
|
+
async getBlueprint(agentBlueprintId) {
|
|
2495
|
+
const { data } = await this.workos.get(`/agents/blueprints/${encodeURIComponent(agentBlueprintId)}`);
|
|
2496
|
+
return deserializeAgentBlueprint(data);
|
|
2497
|
+
}
|
|
2498
|
+
/**
|
|
2499
|
+
* Update an agent blueprint
|
|
2500
|
+
*
|
|
2501
|
+
* Updates an agent blueprint. Omitted fields are left unchanged; provided
|
|
2502
|
+
* lists replace the existing configuration.
|
|
2503
|
+
*
|
|
2504
|
+
* @param options - Object containing the agent blueprint ID and the fields to update.
|
|
2505
|
+
* @returns {Promise<AgentBlueprint>}
|
|
2506
|
+
* @throws {BadRequestException} 400
|
|
2507
|
+
* @throws {NotFoundException} 404
|
|
2508
|
+
* @throws {ConflictException} 409 - Name already in use.
|
|
2509
|
+
* @throws {UnprocessableEntityException} 422 - Permission, role, or organization not found.
|
|
2510
|
+
*/
|
|
2511
|
+
async updateBlueprint(options) {
|
|
2512
|
+
const { agentBlueprintId, ...payload } = options;
|
|
2513
|
+
const { data } = await this.workos.patch(`/agents/blueprints/${encodeURIComponent(agentBlueprintId)}`, serializeUpdateAgentBlueprintOptions(payload));
|
|
2514
|
+
return deserializeAgentBlueprint(data);
|
|
2515
|
+
}
|
|
2516
|
+
/**
|
|
2517
|
+
* Delete an agent blueprint
|
|
2518
|
+
*
|
|
2519
|
+
* Deletes an agent blueprint by ID.
|
|
2520
|
+
* @param agentBlueprintId - Unique identifier of the agent blueprint.
|
|
2521
|
+
*
|
|
2522
|
+
* @example
|
|
2523
|
+
* "agent_blueprint_01EHWNCE74X7JSDV0X3SZ3KJNY"
|
|
2524
|
+
*
|
|
2525
|
+
* @returns {Promise<void>}
|
|
2526
|
+
* @throws {NotFoundException} 404
|
|
2527
|
+
*/
|
|
2528
|
+
async deleteBlueprint(agentBlueprintId) {
|
|
2529
|
+
await this.workos.delete(`/agents/blueprints/${encodeURIComponent(agentBlueprintId)}`);
|
|
2530
|
+
}
|
|
2531
|
+
/**
|
|
2532
|
+
* Mint an agent token
|
|
2533
|
+
*
|
|
2534
|
+
* Mints tokens for an agent session from a blueprint. Supports
|
|
2535
|
+
* user-delegated, autonomous, and agent-delegated mints, as well as
|
|
2536
|
+
* refreshing an existing session with a refresh token.
|
|
2537
|
+
*
|
|
2538
|
+
* @param options - Object containing the agent blueprint ID, the mint type, and its credentials.
|
|
2539
|
+
* @returns {Promise<AgentToken>}
|
|
2540
|
+
* @throws {BadRequestException} 400
|
|
2541
|
+
* @throws {NotFoundException} 404
|
|
2542
|
+
*/
|
|
2543
|
+
async mintToken(options) {
|
|
2544
|
+
const { data } = await this.workos.post(`/agents/blueprints/${encodeURIComponent(options.agentBlueprintId)}/tokens`, serializeMintAgentTokenOptions(options));
|
|
2545
|
+
return deserializeAgentToken(data);
|
|
2546
|
+
}
|
|
2547
|
+
/**
|
|
2548
|
+
* List agent instances
|
|
2549
|
+
*
|
|
2550
|
+
* Lists the agent instances in the current environment, optionally filtered
|
|
2551
|
+
* by organization or agent blueprint.
|
|
2552
|
+
*
|
|
2553
|
+
* @param options - Pagination and filter options.
|
|
2554
|
+
* @returns {Promise<AutoPaginatable<AgentInstance, SerializedListAgentInstancesOptions>>}
|
|
2555
|
+
*/
|
|
2556
|
+
async listInstances(options) {
|
|
2557
|
+
return new AutoPaginatable(await fetchAndDeserialize(this.workos, "/agents/instances", deserializeAgentInstance, options ? serializeListAgentInstancesOptions(options) : void 0), (params) => fetchAndDeserialize(this.workos, "/agents/instances", deserializeAgentInstance, params), options ? serializeListAgentInstancesOptions(options) : void 0);
|
|
2558
|
+
}
|
|
2559
|
+
/**
|
|
2560
|
+
* Get an agent instance
|
|
2561
|
+
*
|
|
2562
|
+
* Retrieves an agent instance by ID.
|
|
2563
|
+
* @param agentInstanceId - Unique identifier of the agent instance.
|
|
2564
|
+
*
|
|
2565
|
+
* @example
|
|
2566
|
+
* "agent_instance_01EHWNCE74X7JSDV0X3SZ3KJNY"
|
|
2567
|
+
*
|
|
2568
|
+
* @returns {Promise<AgentInstance>}
|
|
2569
|
+
* @throws {NotFoundException} 404
|
|
2570
|
+
*/
|
|
2571
|
+
async getInstance(agentInstanceId) {
|
|
2572
|
+
const { data } = await this.workos.get(`/agents/instances/${encodeURIComponent(agentInstanceId)}`);
|
|
2573
|
+
return deserializeAgentInstance(data);
|
|
2574
|
+
}
|
|
2575
|
+
/**
|
|
2576
|
+
* Delete an agent instance
|
|
2577
|
+
*
|
|
2578
|
+
* Deletes an agent instance by ID.
|
|
2579
|
+
* @param agentInstanceId - Unique identifier of the agent instance.
|
|
2580
|
+
*
|
|
2581
|
+
* @example
|
|
2582
|
+
* "agent_instance_01EHWNCE74X7JSDV0X3SZ3KJNY"
|
|
2583
|
+
*
|
|
2584
|
+
* @returns {Promise<void>}
|
|
2585
|
+
* @throws {NotFoundException} 404
|
|
2586
|
+
*/
|
|
2587
|
+
async deleteInstance(agentInstanceId) {
|
|
2588
|
+
await this.workos.delete(`/agents/instances/${encodeURIComponent(agentInstanceId)}`);
|
|
2589
|
+
}
|
|
2590
|
+
/**
|
|
2591
|
+
* List agent instance sessions
|
|
2592
|
+
*
|
|
2593
|
+
* Lists the agent instance sessions in the current environment, optionally
|
|
2594
|
+
* filtered by agent blueprint or agent instance.
|
|
2595
|
+
*
|
|
2596
|
+
* @param options - Pagination and filter options.
|
|
2597
|
+
* @returns {Promise<AutoPaginatable<AgentInstanceSession, SerializedListAgentInstanceSessionsOptions>>}
|
|
2598
|
+
*/
|
|
2599
|
+
async listInstanceSessions(options) {
|
|
2600
|
+
return new AutoPaginatable(await fetchAndDeserialize(this.workos, "/agents/sessions", deserializeAgentInstanceSession, options ? serializeListAgentInstanceSessionsOptions(options) : void 0), (params) => fetchAndDeserialize(this.workos, "/agents/sessions", deserializeAgentInstanceSession, params), options ? serializeListAgentInstanceSessionsOptions(options) : void 0);
|
|
2601
|
+
}
|
|
2602
|
+
/**
|
|
2603
|
+
* Get an agent instance session
|
|
2604
|
+
*
|
|
2605
|
+
* Retrieves an agent instance session by ID.
|
|
2606
|
+
* @param agentInstanceSessionId - Unique identifier of the agent instance session.
|
|
2607
|
+
*
|
|
2608
|
+
* @example
|
|
2609
|
+
* "agent_instance_session_01EHWNCE74X7JSDV0X3SZ3KJNY"
|
|
2610
|
+
*
|
|
2611
|
+
* @returns {Promise<AgentInstanceSession>}
|
|
2612
|
+
* @throws {NotFoundException} 404
|
|
2613
|
+
*/
|
|
2614
|
+
async getInstanceSession(agentInstanceSessionId) {
|
|
2615
|
+
const { data } = await this.workos.get(`/agents/sessions/${encodeURIComponent(agentInstanceSessionId)}`);
|
|
2616
|
+
return deserializeAgentInstanceSession(data);
|
|
2617
|
+
}
|
|
2618
|
+
/**
|
|
2619
|
+
* Revoke an agent instance session
|
|
2620
|
+
*
|
|
2621
|
+
* Revokes an agent instance session by ID, invalidating its tokens.
|
|
2622
|
+
* @param agentInstanceSessionId - Unique identifier of the agent instance session.
|
|
2623
|
+
*
|
|
2624
|
+
* @example
|
|
2625
|
+
* "agent_instance_session_01EHWNCE74X7JSDV0X3SZ3KJNY"
|
|
2626
|
+
*
|
|
2627
|
+
* @returns {Promise<AgentInstanceSession>}
|
|
2628
|
+
* @throws {NotFoundException} 404
|
|
2629
|
+
*/
|
|
2630
|
+
async revokeInstanceSession(agentInstanceSessionId) {
|
|
2631
|
+
const { data } = await this.workos.post(`/agents/sessions/${encodeURIComponent(agentInstanceSessionId)}/revoke`, {});
|
|
2632
|
+
return deserializeAgentInstanceSession(data);
|
|
2633
|
+
}
|
|
2634
|
+
/**
|
|
2293
2635
|
* Link a claim attempt to an external user
|
|
2294
2636
|
*
|
|
2295
2637
|
* Link an external user to a claim attempt and retrieve the code needed
|
|
@@ -4958,6 +5300,23 @@ const serializeUpdateOrganizationMembershipOptions = (options) => ({
|
|
|
4958
5300
|
role_slugs: options.roleSlugs
|
|
4959
5301
|
});
|
|
4960
5302
|
//#endregion
|
|
5303
|
+
//#region src/user-management/serializers/create-waitlist-entry-options.serializer.ts
|
|
5304
|
+
const serializeCreateWaitlistEntryOptions = (options) => ({
|
|
5305
|
+
email: options.email,
|
|
5306
|
+
additional_fields: options.additionalFields,
|
|
5307
|
+
send_confirmation_email: options.sendConfirmationEmail
|
|
5308
|
+
});
|
|
5309
|
+
//#endregion
|
|
5310
|
+
//#region src/user-management/serializers/list-waitlist-entries-options.serializer.ts
|
|
5311
|
+
const serializeListWaitlistEntriesOptions = (options) => ({
|
|
5312
|
+
state: options.state,
|
|
5313
|
+
email: options.email,
|
|
5314
|
+
limit: options.limit,
|
|
5315
|
+
before: options.before,
|
|
5316
|
+
after: options.after,
|
|
5317
|
+
order: options.order
|
|
5318
|
+
});
|
|
5319
|
+
//#endregion
|
|
4961
5320
|
//#region src/user-management/session.ts
|
|
4962
5321
|
var CookieSession = class {
|
|
4963
5322
|
userManagement;
|
|
@@ -5853,6 +6212,98 @@ var UserManagement = class {
|
|
|
5853
6212
|
return deserializeInvitation(data);
|
|
5854
6213
|
}
|
|
5855
6214
|
/**
|
|
6215
|
+
* List waitlists
|
|
6216
|
+
*
|
|
6217
|
+
* Get a list of the waitlists in the environment. All waitlists are
|
|
6218
|
+
* returned in a single response — this endpoint is not paginated.
|
|
6219
|
+
* @returns {Promise<List<Waitlist>>}
|
|
6220
|
+
*/
|
|
6221
|
+
async listWaitlists() {
|
|
6222
|
+
const { data } = await this.workos.get("/user_management/waitlists");
|
|
6223
|
+
return deserializeList(data, deserializeWaitlist);
|
|
6224
|
+
}
|
|
6225
|
+
/**
|
|
6226
|
+
* Get a waitlist
|
|
6227
|
+
*
|
|
6228
|
+
* Get the details of an existing waitlist. The literal id `default`
|
|
6229
|
+
* is accepted and resolves to the environment's default waitlist.
|
|
6230
|
+
* @returns {Promise<Waitlist>}
|
|
6231
|
+
* @throws {NotFoundException} 404
|
|
6232
|
+
*/
|
|
6233
|
+
async getWaitlist(waitlistId) {
|
|
6234
|
+
const { data } = await this.workos.get(`/user_management/waitlists/${waitlistId}`);
|
|
6235
|
+
return deserializeWaitlist(data);
|
|
6236
|
+
}
|
|
6237
|
+
/**
|
|
6238
|
+
* List waitlist entries
|
|
6239
|
+
*
|
|
6240
|
+
* Get a list of the entries on a waitlist matching the criteria specified.
|
|
6241
|
+
* The literal id `default` is accepted and resolves to the environment's
|
|
6242
|
+
* default waitlist.
|
|
6243
|
+
* @param waitlistId - The unique ID of the waitlist.
|
|
6244
|
+
* @param options - Pagination and filter options.
|
|
6245
|
+
* @returns {Promise<AutoPaginatable<WaitlistEntry, SerializedListWaitlistEntriesOptions>>}
|
|
6246
|
+
* @throws {NotFoundException} 404
|
|
6247
|
+
* @throws {UnprocessableEntityException} 422
|
|
6248
|
+
*/
|
|
6249
|
+
async listWaitlistEntries(waitlistId, options) {
|
|
6250
|
+
return new AutoPaginatable(await fetchAndDeserialize(this.workos, `/user_management/waitlists/${waitlistId}/entries`, deserializeWaitlistEntry, options ? serializeListWaitlistEntriesOptions(options) : void 0), (params) => fetchAndDeserialize(this.workos, `/user_management/waitlists/${waitlistId}/entries`, deserializeWaitlistEntry, params), options ? serializeListWaitlistEntriesOptions(options) : void 0);
|
|
6251
|
+
}
|
|
6252
|
+
/**
|
|
6253
|
+
* Create a waitlist entry
|
|
6254
|
+
*
|
|
6255
|
+
* Add an email address to a waitlist. Adding an email address that is
|
|
6256
|
+
* already on the waitlist returns the existing entry unchanged. The
|
|
6257
|
+
* literal id `default` is accepted and resolves to the environment's
|
|
6258
|
+
* default waitlist.
|
|
6259
|
+
* @param waitlistId - The unique ID of the waitlist.
|
|
6260
|
+
* @param payload - Object containing email and optional fields.
|
|
6261
|
+
* @returns {Promise<WaitlistEntry>}
|
|
6262
|
+
* @throws {NotFoundException} 404
|
|
6263
|
+
* @throws {UnprocessableEntityException} 422
|
|
6264
|
+
*/
|
|
6265
|
+
async createWaitlistEntry(waitlistId, payload) {
|
|
6266
|
+
const { data } = await this.workos.post(`/user_management/waitlists/${waitlistId}/entries`, serializeCreateWaitlistEntryOptions(payload));
|
|
6267
|
+
return deserializeWaitlistEntry(data);
|
|
6268
|
+
}
|
|
6269
|
+
/**
|
|
6270
|
+
* Approve a waitlist entry
|
|
6271
|
+
*
|
|
6272
|
+
* Approve a waitlist entry, create an invitation for its email address,
|
|
6273
|
+
* and send the invitation email.
|
|
6274
|
+
* @returns {Promise<WaitlistEntry>}
|
|
6275
|
+
* @throws {NotFoundException} 404
|
|
6276
|
+
* @throws {UnprocessableEntityException} 422
|
|
6277
|
+
*/
|
|
6278
|
+
async approveWaitlistEntry(waitlistEntryId) {
|
|
6279
|
+
const { data } = await this.workos.post(`/user_management/waitlist_entries/${waitlistEntryId}/approve`, null);
|
|
6280
|
+
return deserializeWaitlistEntry(data);
|
|
6281
|
+
}
|
|
6282
|
+
/**
|
|
6283
|
+
* Deny a waitlist entry
|
|
6284
|
+
*
|
|
6285
|
+
* Deny a pending waitlist entry.
|
|
6286
|
+
* @returns {Promise<WaitlistEntry>}
|
|
6287
|
+
* @throws {NotFoundException} 404
|
|
6288
|
+
* @throws {UnprocessableEntityException} 422
|
|
6289
|
+
*/
|
|
6290
|
+
async denyWaitlistEntry(waitlistEntryId) {
|
|
6291
|
+
const { data } = await this.workos.post(`/user_management/waitlist_entries/${waitlistEntryId}/deny`, null);
|
|
6292
|
+
return deserializeWaitlistEntry(data);
|
|
6293
|
+
}
|
|
6294
|
+
/**
|
|
6295
|
+
* Delete a waitlist entry
|
|
6296
|
+
*
|
|
6297
|
+
* Remove the entry from the waitlist. Its email address can join again
|
|
6298
|
+
* unless a user with that email now exists in the environment. Deleting
|
|
6299
|
+
* the entry does not revoke an invitation created by approving it.
|
|
6300
|
+
* @returns {Promise<void>}
|
|
6301
|
+
* @throws {NotFoundException} 404
|
|
6302
|
+
*/
|
|
6303
|
+
async deleteWaitlistEntry(waitlistEntryId) {
|
|
6304
|
+
await this.workos.delete(`/user_management/waitlist_entries/${waitlistEntryId}`);
|
|
6305
|
+
}
|
|
6306
|
+
/**
|
|
5856
6307
|
* Revoke Session
|
|
5857
6308
|
*
|
|
5858
6309
|
* Revoke a [user session](https://workos.com/docs/reference/authkit/session).
|
|
@@ -8270,7 +8721,7 @@ var Vault = class {
|
|
|
8270
8721
|
};
|
|
8271
8722
|
//#endregion
|
|
8272
8723
|
//#region package.json
|
|
8273
|
-
var version = "10.
|
|
8724
|
+
var version = "10.13.0";
|
|
8274
8725
|
//#endregion
|
|
8275
8726
|
//#region src/workos.ts
|
|
8276
8727
|
const DEFAULT_HOSTNAME = "api.workos.com";
|
|
@@ -8823,4 +9274,4 @@ Object.defineProperty(exports, "serializeRevokeSessionOptions", {
|
|
|
8823
9274
|
}
|
|
8824
9275
|
});
|
|
8825
9276
|
|
|
8826
|
-
//# sourceMappingURL=factory-
|
|
9277
|
+
//# sourceMappingURL=factory-BfdUyn2X.cjs.map
|