@memnexus-ai/typescript-sdk 1.11.0 → 1.13.6
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 +141 -130
- package/dist/index.d.ts +618 -1
- package/dist/index.js +480 -2
- package/dist/index.mjs +476 -1
- package/package.json +4 -4
package/dist/index.mjs
CHANGED
|
@@ -7940,6 +7940,473 @@ var CommunitiesService = class extends BaseService {
|
|
|
7940
7940
|
}
|
|
7941
7941
|
};
|
|
7942
7942
|
|
|
7943
|
+
// src/services/users/users-service.ts
|
|
7944
|
+
import { z as z157 } from "zod";
|
|
7945
|
+
|
|
7946
|
+
// src/services/users/models/sync-user-request.ts
|
|
7947
|
+
import { z as z148 } from "zod";
|
|
7948
|
+
var syncUserRequest = z148.lazy(() => {
|
|
7949
|
+
return z148.object({
|
|
7950
|
+
workosId: z148.string(),
|
|
7951
|
+
email: z148.string(),
|
|
7952
|
+
firstName: z148.string().optional().nullable(),
|
|
7953
|
+
lastName: z148.string().optional().nullable(),
|
|
7954
|
+
profilePictureUrl: z148.string().optional().nullable()
|
|
7955
|
+
});
|
|
7956
|
+
});
|
|
7957
|
+
var syncUserRequestResponse = z148.lazy(() => {
|
|
7958
|
+
return z148.object({
|
|
7959
|
+
workosId: z148.string(),
|
|
7960
|
+
email: z148.string(),
|
|
7961
|
+
firstName: z148.string().optional().nullable(),
|
|
7962
|
+
lastName: z148.string().optional().nullable(),
|
|
7963
|
+
profilePictureUrl: z148.string().optional().nullable()
|
|
7964
|
+
}).transform((data) => ({
|
|
7965
|
+
workosId: data["workosId"],
|
|
7966
|
+
email: data["email"],
|
|
7967
|
+
firstName: data["firstName"],
|
|
7968
|
+
lastName: data["lastName"],
|
|
7969
|
+
profilePictureUrl: data["profilePictureUrl"]
|
|
7970
|
+
}));
|
|
7971
|
+
});
|
|
7972
|
+
var syncUserRequestRequest = z148.lazy(() => {
|
|
7973
|
+
return z148.object({
|
|
7974
|
+
workosId: z148.string(),
|
|
7975
|
+
email: z148.string(),
|
|
7976
|
+
firstName: z148.string().optional().nullable(),
|
|
7977
|
+
lastName: z148.string().optional().nullable(),
|
|
7978
|
+
profilePictureUrl: z148.string().optional().nullable()
|
|
7979
|
+
}).transform((data) => ({
|
|
7980
|
+
workosId: data["workosId"],
|
|
7981
|
+
email: data["email"],
|
|
7982
|
+
firstName: data["firstName"],
|
|
7983
|
+
lastName: data["lastName"],
|
|
7984
|
+
profilePictureUrl: data["profilePictureUrl"]
|
|
7985
|
+
}));
|
|
7986
|
+
});
|
|
7987
|
+
|
|
7988
|
+
// src/services/users/models/sync-user-ok-response.ts
|
|
7989
|
+
import { z as z150 } from "zod";
|
|
7990
|
+
|
|
7991
|
+
// src/services/users/models/user.ts
|
|
7992
|
+
import { z as z149 } from "zod";
|
|
7993
|
+
var user = z149.lazy(() => {
|
|
7994
|
+
return z149.object({
|
|
7995
|
+
id: z149.string(),
|
|
7996
|
+
email: z149.string(),
|
|
7997
|
+
firstName: z149.string().nullable(),
|
|
7998
|
+
lastName: z149.string().nullable(),
|
|
7999
|
+
profilePictureUrl: z149.string().nullable(),
|
|
8000
|
+
plan: z149.string(),
|
|
8001
|
+
memoryLimit: z149.number(),
|
|
8002
|
+
retentionDays: z149.number().nullable(),
|
|
8003
|
+
createdAt: z149.string(),
|
|
8004
|
+
updatedAt: z149.string()
|
|
8005
|
+
});
|
|
8006
|
+
});
|
|
8007
|
+
var userResponse = z149.lazy(() => {
|
|
8008
|
+
return z149.object({
|
|
8009
|
+
id: z149.string(),
|
|
8010
|
+
email: z149.string(),
|
|
8011
|
+
firstName: z149.string().nullable(),
|
|
8012
|
+
lastName: z149.string().nullable(),
|
|
8013
|
+
profilePictureUrl: z149.string().nullable(),
|
|
8014
|
+
plan: z149.string(),
|
|
8015
|
+
memoryLimit: z149.number(),
|
|
8016
|
+
retentionDays: z149.number().nullable(),
|
|
8017
|
+
createdAt: z149.string(),
|
|
8018
|
+
updatedAt: z149.string()
|
|
8019
|
+
}).transform((data) => ({
|
|
8020
|
+
id: data["id"],
|
|
8021
|
+
email: data["email"],
|
|
8022
|
+
firstName: data["firstName"],
|
|
8023
|
+
lastName: data["lastName"],
|
|
8024
|
+
profilePictureUrl: data["profilePictureUrl"],
|
|
8025
|
+
plan: data["plan"],
|
|
8026
|
+
memoryLimit: data["memoryLimit"],
|
|
8027
|
+
retentionDays: data["retentionDays"],
|
|
8028
|
+
createdAt: data["createdAt"],
|
|
8029
|
+
updatedAt: data["updatedAt"]
|
|
8030
|
+
}));
|
|
8031
|
+
});
|
|
8032
|
+
var userRequest = z149.lazy(() => {
|
|
8033
|
+
return z149.object({
|
|
8034
|
+
id: z149.string(),
|
|
8035
|
+
email: z149.string(),
|
|
8036
|
+
firstName: z149.string().nullable(),
|
|
8037
|
+
lastName: z149.string().nullable(),
|
|
8038
|
+
profilePictureUrl: z149.string().nullable(),
|
|
8039
|
+
plan: z149.string(),
|
|
8040
|
+
memoryLimit: z149.number(),
|
|
8041
|
+
retentionDays: z149.number().nullable(),
|
|
8042
|
+
createdAt: z149.string(),
|
|
8043
|
+
updatedAt: z149.string()
|
|
8044
|
+
}).transform((data) => ({
|
|
8045
|
+
id: data["id"],
|
|
8046
|
+
email: data["email"],
|
|
8047
|
+
firstName: data["firstName"],
|
|
8048
|
+
lastName: data["lastName"],
|
|
8049
|
+
profilePictureUrl: data["profilePictureUrl"],
|
|
8050
|
+
plan: data["plan"],
|
|
8051
|
+
memoryLimit: data["memoryLimit"],
|
|
8052
|
+
retentionDays: data["retentionDays"],
|
|
8053
|
+
createdAt: data["createdAt"],
|
|
8054
|
+
updatedAt: data["updatedAt"]
|
|
8055
|
+
}));
|
|
8056
|
+
});
|
|
8057
|
+
|
|
8058
|
+
// src/services/users/models/sync-user-ok-response.ts
|
|
8059
|
+
var syncUserOkResponse = z150.lazy(() => {
|
|
8060
|
+
return z150.object({
|
|
8061
|
+
data: user.optional(),
|
|
8062
|
+
created: z150.boolean().optional()
|
|
8063
|
+
});
|
|
8064
|
+
});
|
|
8065
|
+
var syncUserOkResponseResponse = z150.lazy(() => {
|
|
8066
|
+
return z150.object({
|
|
8067
|
+
data: userResponse.optional(),
|
|
8068
|
+
created: z150.boolean().optional()
|
|
8069
|
+
}).transform((data) => ({
|
|
8070
|
+
data: data["data"],
|
|
8071
|
+
created: data["created"]
|
|
8072
|
+
}));
|
|
8073
|
+
});
|
|
8074
|
+
var syncUserOkResponseRequest = z150.lazy(() => {
|
|
8075
|
+
return z150.object({
|
|
8076
|
+
data: userRequest.optional(),
|
|
8077
|
+
created: z150.boolean().optional()
|
|
8078
|
+
}).transform((data) => ({
|
|
8079
|
+
data: data["data"],
|
|
8080
|
+
created: data["created"]
|
|
8081
|
+
}));
|
|
8082
|
+
});
|
|
8083
|
+
|
|
8084
|
+
// src/services/users/models/get-current-user-ok-response.ts
|
|
8085
|
+
import { z as z152 } from "zod";
|
|
8086
|
+
|
|
8087
|
+
// src/services/users/models/user-usage.ts
|
|
8088
|
+
import { z as z151 } from "zod";
|
|
8089
|
+
var userUsage = z151.lazy(() => {
|
|
8090
|
+
return z151.object({
|
|
8091
|
+
memoriesUsed: z151.number(),
|
|
8092
|
+
memoryLimit: z151.number(),
|
|
8093
|
+
memoriesRemaining: z151.number(),
|
|
8094
|
+
percentUsed: z151.number(),
|
|
8095
|
+
plan: z151.string(),
|
|
8096
|
+
periodStart: z151.string(),
|
|
8097
|
+
periodEnd: z151.string()
|
|
8098
|
+
});
|
|
8099
|
+
});
|
|
8100
|
+
var userUsageResponse = z151.lazy(() => {
|
|
8101
|
+
return z151.object({
|
|
8102
|
+
memoriesUsed: z151.number(),
|
|
8103
|
+
memoryLimit: z151.number(),
|
|
8104
|
+
memoriesRemaining: z151.number(),
|
|
8105
|
+
percentUsed: z151.number(),
|
|
8106
|
+
plan: z151.string(),
|
|
8107
|
+
periodStart: z151.string(),
|
|
8108
|
+
periodEnd: z151.string()
|
|
8109
|
+
}).transform((data) => ({
|
|
8110
|
+
memoriesUsed: data["memoriesUsed"],
|
|
8111
|
+
memoryLimit: data["memoryLimit"],
|
|
8112
|
+
memoriesRemaining: data["memoriesRemaining"],
|
|
8113
|
+
percentUsed: data["percentUsed"],
|
|
8114
|
+
plan: data["plan"],
|
|
8115
|
+
periodStart: data["periodStart"],
|
|
8116
|
+
periodEnd: data["periodEnd"]
|
|
8117
|
+
}));
|
|
8118
|
+
});
|
|
8119
|
+
var userUsageRequest = z151.lazy(() => {
|
|
8120
|
+
return z151.object({
|
|
8121
|
+
memoriesUsed: z151.number(),
|
|
8122
|
+
memoryLimit: z151.number(),
|
|
8123
|
+
memoriesRemaining: z151.number(),
|
|
8124
|
+
percentUsed: z151.number(),
|
|
8125
|
+
plan: z151.string(),
|
|
8126
|
+
periodStart: z151.string(),
|
|
8127
|
+
periodEnd: z151.string()
|
|
8128
|
+
}).transform((data) => ({
|
|
8129
|
+
memoriesUsed: data["memoriesUsed"],
|
|
8130
|
+
memoryLimit: data["memoryLimit"],
|
|
8131
|
+
memoriesRemaining: data["memoriesRemaining"],
|
|
8132
|
+
percentUsed: data["percentUsed"],
|
|
8133
|
+
plan: data["plan"],
|
|
8134
|
+
periodStart: data["periodStart"],
|
|
8135
|
+
periodEnd: data["periodEnd"]
|
|
8136
|
+
}));
|
|
8137
|
+
});
|
|
8138
|
+
|
|
8139
|
+
// src/services/users/models/get-current-user-ok-response.ts
|
|
8140
|
+
var getCurrentUserOkResponse = z152.lazy(() => {
|
|
8141
|
+
return z152.object({
|
|
8142
|
+
data: user.optional(),
|
|
8143
|
+
usage: userUsage.optional()
|
|
8144
|
+
});
|
|
8145
|
+
});
|
|
8146
|
+
var getCurrentUserOkResponseResponse = z152.lazy(() => {
|
|
8147
|
+
return z152.object({
|
|
8148
|
+
data: userResponse.optional(),
|
|
8149
|
+
usage: userUsageResponse.optional()
|
|
8150
|
+
}).transform((data) => ({
|
|
8151
|
+
data: data["data"],
|
|
8152
|
+
usage: data["usage"]
|
|
8153
|
+
}));
|
|
8154
|
+
});
|
|
8155
|
+
var getCurrentUserOkResponseRequest = z152.lazy(() => {
|
|
8156
|
+
return z152.object({
|
|
8157
|
+
data: userRequest.optional(),
|
|
8158
|
+
usage: userUsageRequest.optional()
|
|
8159
|
+
}).transform((data) => ({
|
|
8160
|
+
data: data["data"],
|
|
8161
|
+
usage: data["usage"]
|
|
8162
|
+
}));
|
|
8163
|
+
});
|
|
8164
|
+
|
|
8165
|
+
// src/services/users/models/update-current-user-request.ts
|
|
8166
|
+
import { z as z153 } from "zod";
|
|
8167
|
+
var updateCurrentUserRequest = z153.lazy(() => {
|
|
8168
|
+
return z153.object({
|
|
8169
|
+
firstName: z153.string().optional().nullable(),
|
|
8170
|
+
lastName: z153.string().optional().nullable(),
|
|
8171
|
+
profilePictureUrl: z153.string().optional().nullable()
|
|
8172
|
+
});
|
|
8173
|
+
});
|
|
8174
|
+
var updateCurrentUserRequestResponse = z153.lazy(() => {
|
|
8175
|
+
return z153.object({
|
|
8176
|
+
firstName: z153.string().optional().nullable(),
|
|
8177
|
+
lastName: z153.string().optional().nullable(),
|
|
8178
|
+
profilePictureUrl: z153.string().optional().nullable()
|
|
8179
|
+
}).transform((data) => ({
|
|
8180
|
+
firstName: data["firstName"],
|
|
8181
|
+
lastName: data["lastName"],
|
|
8182
|
+
profilePictureUrl: data["profilePictureUrl"]
|
|
8183
|
+
}));
|
|
8184
|
+
});
|
|
8185
|
+
var updateCurrentUserRequestRequest = z153.lazy(() => {
|
|
8186
|
+
return z153.object({
|
|
8187
|
+
firstName: z153.string().optional().nullable(),
|
|
8188
|
+
lastName: z153.string().optional().nullable(),
|
|
8189
|
+
profilePictureUrl: z153.string().optional().nullable()
|
|
8190
|
+
}).transform((data) => ({
|
|
8191
|
+
firstName: data["firstName"],
|
|
8192
|
+
lastName: data["lastName"],
|
|
8193
|
+
profilePictureUrl: data["profilePictureUrl"]
|
|
8194
|
+
}));
|
|
8195
|
+
});
|
|
8196
|
+
|
|
8197
|
+
// src/services/users/models/update-current-user-ok-response.ts
|
|
8198
|
+
import { z as z154 } from "zod";
|
|
8199
|
+
var updateCurrentUserOkResponse = z154.lazy(() => {
|
|
8200
|
+
return z154.object({
|
|
8201
|
+
data: user.optional()
|
|
8202
|
+
});
|
|
8203
|
+
});
|
|
8204
|
+
var updateCurrentUserOkResponseResponse = z154.lazy(() => {
|
|
8205
|
+
return z154.object({
|
|
8206
|
+
data: userResponse.optional()
|
|
8207
|
+
}).transform((data) => ({
|
|
8208
|
+
data: data["data"]
|
|
8209
|
+
}));
|
|
8210
|
+
});
|
|
8211
|
+
var updateCurrentUserOkResponseRequest = z154.lazy(() => {
|
|
8212
|
+
return z154.object({
|
|
8213
|
+
data: userRequest.optional()
|
|
8214
|
+
}).transform((data) => ({
|
|
8215
|
+
data: data["data"]
|
|
8216
|
+
}));
|
|
8217
|
+
});
|
|
8218
|
+
|
|
8219
|
+
// src/services/users/models/get-current-user-usage-ok-response.ts
|
|
8220
|
+
import { z as z155 } from "zod";
|
|
8221
|
+
var getCurrentUserUsageOkResponse = z155.lazy(() => {
|
|
8222
|
+
return z155.object({
|
|
8223
|
+
data: userUsage.optional()
|
|
8224
|
+
});
|
|
8225
|
+
});
|
|
8226
|
+
var getCurrentUserUsageOkResponseResponse = z155.lazy(() => {
|
|
8227
|
+
return z155.object({
|
|
8228
|
+
data: userUsageResponse.optional()
|
|
8229
|
+
}).transform((data) => ({
|
|
8230
|
+
data: data["data"]
|
|
8231
|
+
}));
|
|
8232
|
+
});
|
|
8233
|
+
var getCurrentUserUsageOkResponseRequest = z155.lazy(() => {
|
|
8234
|
+
return z155.object({
|
|
8235
|
+
data: userUsageRequest.optional()
|
|
8236
|
+
}).transform((data) => ({
|
|
8237
|
+
data: data["data"]
|
|
8238
|
+
}));
|
|
8239
|
+
});
|
|
8240
|
+
|
|
8241
|
+
// src/services/users/models/get-user-by-id-ok-response.ts
|
|
8242
|
+
import { z as z156 } from "zod";
|
|
8243
|
+
var getUserByIdOkResponse = z156.lazy(() => {
|
|
8244
|
+
return z156.object({
|
|
8245
|
+
data: user.optional()
|
|
8246
|
+
});
|
|
8247
|
+
});
|
|
8248
|
+
var getUserByIdOkResponseResponse = z156.lazy(() => {
|
|
8249
|
+
return z156.object({
|
|
8250
|
+
data: userResponse.optional()
|
|
8251
|
+
}).transform((data) => ({
|
|
8252
|
+
data: data["data"]
|
|
8253
|
+
}));
|
|
8254
|
+
});
|
|
8255
|
+
var getUserByIdOkResponseRequest = z156.lazy(() => {
|
|
8256
|
+
return z156.object({
|
|
8257
|
+
data: userRequest.optional()
|
|
8258
|
+
}).transform((data) => ({
|
|
8259
|
+
data: data["data"]
|
|
8260
|
+
}));
|
|
8261
|
+
});
|
|
8262
|
+
|
|
8263
|
+
// src/services/users/users-service.ts
|
|
8264
|
+
var UsersService = class extends BaseService {
|
|
8265
|
+
/**
|
|
8266
|
+
* Called by the customer portal after WorkOS authentication.Creates a new user if they don't exist, or updates their profile if they do.
|
|
8267
|
+
This is the main entry point for user provisioning.
|
|
8268
|
+
|
|
8269
|
+
* @param {RequestConfig} [requestConfig] - The request configuration for retry and validation.
|
|
8270
|
+
* @returns {Promise<HttpResponse<SyncUserOkResponse>>} - User synced successfully
|
|
8271
|
+
*/
|
|
8272
|
+
async syncUser(body, requestConfig) {
|
|
8273
|
+
const request = new RequestBuilder().setBaseUrl((requestConfig == null ? void 0 : requestConfig.baseUrl) || this.config.baseUrl || this.config.environment || "http://localhost:3000" /* DEFAULT */).setConfig(this.config).setMethod("POST").setPath("/api/users/sync").setRequestSchema(syncUserRequestRequest).addAccessTokenAuth(this.config.token).setRequestContentType("json" /* Json */).addResponse({
|
|
8274
|
+
schema: syncUserOkResponseResponse,
|
|
8275
|
+
contentType: "json" /* Json */,
|
|
8276
|
+
status: 200
|
|
8277
|
+
}).addError({
|
|
8278
|
+
error: Error2,
|
|
8279
|
+
contentType: "json" /* Json */,
|
|
8280
|
+
status: 400
|
|
8281
|
+
}).addError({
|
|
8282
|
+
error: Error2,
|
|
8283
|
+
contentType: "json" /* Json */,
|
|
8284
|
+
status: 500
|
|
8285
|
+
}).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).addHeaderParam({ key: "Content-Type", value: "application/json" }).addBody(body).build();
|
|
8286
|
+
return this.client.call(request);
|
|
8287
|
+
}
|
|
8288
|
+
/**
|
|
8289
|
+
* Get the currently authenticated user's profile and usage information
|
|
8290
|
+
* @param {RequestConfig} [requestConfig] - The request configuration for retry and validation.
|
|
8291
|
+
* @returns {Promise<HttpResponse<GetCurrentUserOkResponse>>} - User retrieved successfully
|
|
8292
|
+
*/
|
|
8293
|
+
async getCurrentUser(requestConfig) {
|
|
8294
|
+
const request = new RequestBuilder().setBaseUrl((requestConfig == null ? void 0 : requestConfig.baseUrl) || this.config.baseUrl || this.config.environment || "http://localhost:3000" /* DEFAULT */).setConfig(this.config).setMethod("GET").setPath("/api/users/me").setRequestSchema(z157.any()).addAccessTokenAuth(this.config.token).setRequestContentType("json" /* Json */).addResponse({
|
|
8295
|
+
schema: getCurrentUserOkResponseResponse,
|
|
8296
|
+
contentType: "json" /* Json */,
|
|
8297
|
+
status: 200
|
|
8298
|
+
}).addError({
|
|
8299
|
+
error: Error2,
|
|
8300
|
+
contentType: "json" /* Json */,
|
|
8301
|
+
status: 401
|
|
8302
|
+
}).addError({
|
|
8303
|
+
error: Error2,
|
|
8304
|
+
contentType: "json" /* Json */,
|
|
8305
|
+
status: 404
|
|
8306
|
+
}).addError({
|
|
8307
|
+
error: Error2,
|
|
8308
|
+
contentType: "json" /* Json */,
|
|
8309
|
+
status: 500
|
|
8310
|
+
}).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).build();
|
|
8311
|
+
return this.client.call(request);
|
|
8312
|
+
}
|
|
8313
|
+
/**
|
|
8314
|
+
* Update the currently authenticated user's profile
|
|
8315
|
+
* @param {RequestConfig} [requestConfig] - The request configuration for retry and validation.
|
|
8316
|
+
* @returns {Promise<HttpResponse<UpdateCurrentUserOkResponse>>} - User updated successfully
|
|
8317
|
+
*/
|
|
8318
|
+
async updateCurrentUser(body, requestConfig) {
|
|
8319
|
+
const request = new RequestBuilder().setBaseUrl((requestConfig == null ? void 0 : requestConfig.baseUrl) || this.config.baseUrl || this.config.environment || "http://localhost:3000" /* DEFAULT */).setConfig(this.config).setMethod("PATCH").setPath("/api/users/me").setRequestSchema(updateCurrentUserRequestRequest).addAccessTokenAuth(this.config.token).setRequestContentType("json" /* Json */).addResponse({
|
|
8320
|
+
schema: updateCurrentUserOkResponseResponse,
|
|
8321
|
+
contentType: "json" /* Json */,
|
|
8322
|
+
status: 200
|
|
8323
|
+
}).addError({
|
|
8324
|
+
error: Error2,
|
|
8325
|
+
contentType: "json" /* Json */,
|
|
8326
|
+
status: 401
|
|
8327
|
+
}).addError({
|
|
8328
|
+
error: Error2,
|
|
8329
|
+
contentType: "json" /* Json */,
|
|
8330
|
+
status: 404
|
|
8331
|
+
}).addError({
|
|
8332
|
+
error: Error2,
|
|
8333
|
+
contentType: "json" /* Json */,
|
|
8334
|
+
status: 500
|
|
8335
|
+
}).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).addHeaderParam({ key: "Content-Type", value: "application/json" }).addBody(body).build();
|
|
8336
|
+
return this.client.call(request);
|
|
8337
|
+
}
|
|
8338
|
+
/**
|
|
8339
|
+
* Get the currently authenticated user's memory usage statistics
|
|
8340
|
+
* @param {RequestConfig} [requestConfig] - The request configuration for retry and validation.
|
|
8341
|
+
* @returns {Promise<HttpResponse<GetCurrentUserUsageOkResponse>>} - Usage retrieved successfully
|
|
8342
|
+
*/
|
|
8343
|
+
async getCurrentUserUsage(requestConfig) {
|
|
8344
|
+
const request = new RequestBuilder().setBaseUrl((requestConfig == null ? void 0 : requestConfig.baseUrl) || this.config.baseUrl || this.config.environment || "http://localhost:3000" /* DEFAULT */).setConfig(this.config).setMethod("GET").setPath("/api/users/me/usage").setRequestSchema(z157.any()).addAccessTokenAuth(this.config.token).setRequestContentType("json" /* Json */).addResponse({
|
|
8345
|
+
schema: getCurrentUserUsageOkResponseResponse,
|
|
8346
|
+
contentType: "json" /* Json */,
|
|
8347
|
+
status: 200
|
|
8348
|
+
}).addError({
|
|
8349
|
+
error: Error2,
|
|
8350
|
+
contentType: "json" /* Json */,
|
|
8351
|
+
status: 401
|
|
8352
|
+
}).addError({
|
|
8353
|
+
error: Error2,
|
|
8354
|
+
contentType: "json" /* Json */,
|
|
8355
|
+
status: 404
|
|
8356
|
+
}).addError({
|
|
8357
|
+
error: Error2,
|
|
8358
|
+
contentType: "json" /* Json */,
|
|
8359
|
+
status: 500
|
|
8360
|
+
}).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).build();
|
|
8361
|
+
return this.client.call(request);
|
|
8362
|
+
}
|
|
8363
|
+
/**
|
|
8364
|
+
* Get a user by their internal ID (admin only)
|
|
8365
|
+
* @param {string} id -
|
|
8366
|
+
* @param {RequestConfig} [requestConfig] - The request configuration for retry and validation.
|
|
8367
|
+
* @returns {Promise<HttpResponse<GetUserByIdOkResponse>>} - User retrieved successfully
|
|
8368
|
+
*/
|
|
8369
|
+
async getUserById(id, requestConfig) {
|
|
8370
|
+
const request = new RequestBuilder().setBaseUrl((requestConfig == null ? void 0 : requestConfig.baseUrl) || this.config.baseUrl || this.config.environment || "http://localhost:3000" /* DEFAULT */).setConfig(this.config).setMethod("GET").setPath("/api/users/{id}").setRequestSchema(z157.any()).addAccessTokenAuth(this.config.token).setRequestContentType("json" /* Json */).addResponse({
|
|
8371
|
+
schema: getUserByIdOkResponseResponse,
|
|
8372
|
+
contentType: "json" /* Json */,
|
|
8373
|
+
status: 200
|
|
8374
|
+
}).addError({
|
|
8375
|
+
error: Error2,
|
|
8376
|
+
contentType: "json" /* Json */,
|
|
8377
|
+
status: 401
|
|
8378
|
+
}).addError({
|
|
8379
|
+
error: Error2,
|
|
8380
|
+
contentType: "json" /* Json */,
|
|
8381
|
+
status: 404
|
|
8382
|
+
}).addError({
|
|
8383
|
+
error: Error2,
|
|
8384
|
+
contentType: "json" /* Json */,
|
|
8385
|
+
status: 500
|
|
8386
|
+
}).setRetryAttempts(this.config, requestConfig).setRetryDelayMs(this.config, requestConfig).setResponseValidation(this.config, requestConfig).addPathParam({
|
|
8387
|
+
key: "id",
|
|
8388
|
+
value: id
|
|
8389
|
+
}).build();
|
|
8390
|
+
return this.client.call(request);
|
|
8391
|
+
}
|
|
8392
|
+
};
|
|
8393
|
+
|
|
8394
|
+
// src/services/users/models/user-plan.ts
|
|
8395
|
+
var UserPlan = /* @__PURE__ */ ((UserPlan2) => {
|
|
8396
|
+
UserPlan2["FREE"] = "free";
|
|
8397
|
+
UserPlan2["PRO"] = "pro";
|
|
8398
|
+
UserPlan2["ENTERPRISE"] = "enterprise";
|
|
8399
|
+
return UserPlan2;
|
|
8400
|
+
})(UserPlan || {});
|
|
8401
|
+
|
|
8402
|
+
// src/services/users/models/user-usage-plan.ts
|
|
8403
|
+
var UserUsagePlan = /* @__PURE__ */ ((UserUsagePlan2) => {
|
|
8404
|
+
UserUsagePlan2["FREE"] = "free";
|
|
8405
|
+
UserUsagePlan2["PRO"] = "pro";
|
|
8406
|
+
UserUsagePlan2["ENTERPRISE"] = "enterprise";
|
|
8407
|
+
return UserUsagePlan2;
|
|
8408
|
+
})(UserUsagePlan || {});
|
|
8409
|
+
|
|
7943
8410
|
// src/index.ts
|
|
7944
8411
|
var Memnexus = class {
|
|
7945
8412
|
constructor(config) {
|
|
@@ -7956,6 +8423,7 @@ var Memnexus = class {
|
|
|
7956
8423
|
this.behavior = new BehaviorService(this.config);
|
|
7957
8424
|
this.topics = new TopicsService(this.config);
|
|
7958
8425
|
this.communities = new CommunitiesService(this.config);
|
|
8426
|
+
this.users = new UsersService(this.config);
|
|
7959
8427
|
}
|
|
7960
8428
|
set baseUrl(baseUrl) {
|
|
7961
8429
|
this.apiKeys.baseUrl = baseUrl;
|
|
@@ -7970,6 +8438,7 @@ var Memnexus = class {
|
|
|
7970
8438
|
this.behavior.baseUrl = baseUrl;
|
|
7971
8439
|
this.topics.baseUrl = baseUrl;
|
|
7972
8440
|
this.communities.baseUrl = baseUrl;
|
|
8441
|
+
this.users.baseUrl = baseUrl;
|
|
7973
8442
|
}
|
|
7974
8443
|
set environment(environment) {
|
|
7975
8444
|
this.apiKeys.baseUrl = environment;
|
|
@@ -7984,6 +8453,7 @@ var Memnexus = class {
|
|
|
7984
8453
|
this.behavior.baseUrl = environment;
|
|
7985
8454
|
this.topics.baseUrl = environment;
|
|
7986
8455
|
this.communities.baseUrl = environment;
|
|
8456
|
+
this.users.baseUrl = environment;
|
|
7987
8457
|
}
|
|
7988
8458
|
set timeoutMs(timeoutMs) {
|
|
7989
8459
|
this.apiKeys.timeoutMs = timeoutMs;
|
|
@@ -7998,6 +8468,7 @@ var Memnexus = class {
|
|
|
7998
8468
|
this.behavior.timeoutMs = timeoutMs;
|
|
7999
8469
|
this.topics.timeoutMs = timeoutMs;
|
|
8000
8470
|
this.communities.timeoutMs = timeoutMs;
|
|
8471
|
+
this.users.timeoutMs = timeoutMs;
|
|
8001
8472
|
}
|
|
8002
8473
|
set token(token) {
|
|
8003
8474
|
this.apiKeys.token = token;
|
|
@@ -8012,6 +8483,7 @@ var Memnexus = class {
|
|
|
8012
8483
|
this.behavior.token = token;
|
|
8013
8484
|
this.topics.token = token;
|
|
8014
8485
|
this.communities.token = token;
|
|
8486
|
+
this.users.token = token;
|
|
8015
8487
|
}
|
|
8016
8488
|
};
|
|
8017
8489
|
export {
|
|
@@ -8048,5 +8520,8 @@ export {
|
|
|
8048
8520
|
ServiceCheckStatus,
|
|
8049
8521
|
SystemService,
|
|
8050
8522
|
TopicsService,
|
|
8051
|
-
UpdateMemoryRequestMemoryType
|
|
8523
|
+
UpdateMemoryRequestMemoryType,
|
|
8524
|
+
UserPlan,
|
|
8525
|
+
UserUsagePlan,
|
|
8526
|
+
UsersService
|
|
8052
8527
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@memnexus-ai/typescript-sdk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.13.6",
|
|
4
4
|
"description": "Core API service for MemNexus - single service boundary for all data access",
|
|
5
5
|
"source": "./src/index.ts",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"README.md"
|
|
26
26
|
],
|
|
27
27
|
"author": "MemNexus Team",
|
|
28
|
-
"homepage": "https://github.com/memnexus-ai/
|
|
28
|
+
"homepage": "https://github.com/memnexus-ai/memnexus",
|
|
29
29
|
"license": "MIT",
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@types/node": "^22.13.9",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
},
|
|
45
45
|
"repository": {
|
|
46
46
|
"type": "git",
|
|
47
|
-
"url": "https://github.com/memnexus-ai/
|
|
48
|
-
"directory": "packages/typescript-sdk"
|
|
47
|
+
"url": "https://github.com/memnexus-ai/memnexus",
|
|
48
|
+
"directory": "releases/packages/typescript-sdk"
|
|
49
49
|
}
|
|
50
50
|
}
|