@gpt-platform/client 0.3.3 → 0.3.4
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/index.d.mts +29 -10
- package/dist/index.d.ts +29 -10
- package/dist/index.js +75 -11
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +75 -11
- package/dist/index.mjs.map +1 -1
- package/llms.txt +5 -0
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1224,8 +1224,8 @@ function buildUserAgent(sdkVersion, appInfo) {
|
|
|
1224
1224
|
}
|
|
1225
1225
|
|
|
1226
1226
|
// src/version.ts
|
|
1227
|
-
var SDK_VERSION = "0.3.
|
|
1228
|
-
var DEFAULT_API_VERSION = "2026-02-
|
|
1227
|
+
var SDK_VERSION = "0.3.4";
|
|
1228
|
+
var DEFAULT_API_VERSION = "2026-02-27";
|
|
1229
1229
|
|
|
1230
1230
|
// src/base-client.ts
|
|
1231
1231
|
function generateUUID() {
|
|
@@ -1782,6 +1782,11 @@ var getSearchIndexes = (options) => (options.client ?? client).get({
|
|
|
1782
1782
|
url: "/search/indexes",
|
|
1783
1783
|
...options
|
|
1784
1784
|
});
|
|
1785
|
+
var postCrmContactsByIdUnarchive = (options) => (options.client ?? client).post({
|
|
1786
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1787
|
+
url: "/crm/contacts/{id}/unarchive",
|
|
1788
|
+
...options
|
|
1789
|
+
});
|
|
1785
1790
|
var deleteTrainingSessionsById = (options) => (options.client ?? client).delete({
|
|
1786
1791
|
security: [{ scheme: "bearer", type: "http" }],
|
|
1787
1792
|
url: "/training-sessions/{id}",
|
|
@@ -3130,6 +3135,11 @@ var postDocumentsPresignedUpload = (options) => (options.client ?? client).post(
|
|
|
3130
3135
|
...options.headers
|
|
3131
3136
|
}
|
|
3132
3137
|
});
|
|
3138
|
+
var getCrmContactsWorkspaceByWorkspaceIdArchived = (options) => (options.client ?? client).get({
|
|
3139
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
3140
|
+
url: "/crm/contacts/workspace/{workspace_id}/archived",
|
|
3141
|
+
...options
|
|
3142
|
+
});
|
|
3133
3143
|
var postDocumentsBulkDelete = (options) => (options.client ?? client).post({
|
|
3134
3144
|
security: [{ scheme: "bearer", type: "http" }],
|
|
3135
3145
|
url: "/documents/bulk-delete",
|
|
@@ -3219,6 +3229,15 @@ var patchUserProfilesById = (options) => (options.client ?? client).patch({
|
|
|
3219
3229
|
...options.headers
|
|
3220
3230
|
}
|
|
3221
3231
|
});
|
|
3232
|
+
var patchCrmContactsByIdArchive = (options) => (options.client ?? client).patch({
|
|
3233
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
3234
|
+
url: "/crm/contacts/{id}/archive",
|
|
3235
|
+
...options,
|
|
3236
|
+
headers: {
|
|
3237
|
+
"Content-Type": "application/vnd.api+json",
|
|
3238
|
+
...options.headers
|
|
3239
|
+
}
|
|
3240
|
+
});
|
|
3222
3241
|
var patchWebhookConfigsByIdRotateSecret = (options) => (options.client ?? client).patch({
|
|
3223
3242
|
security: [{ scheme: "bearer", type: "http" }],
|
|
3224
3243
|
url: "/webhook-configs/{id}/rotate-secret",
|
|
@@ -5911,7 +5930,9 @@ function createConnectorsNamespace(rb) {
|
|
|
5911
5930
|
code,
|
|
5912
5931
|
state,
|
|
5913
5932
|
workspace_id: workspaceId,
|
|
5914
|
-
...redirectUri !== void 0 && {
|
|
5933
|
+
...redirectUri !== void 0 && {
|
|
5934
|
+
redirect_uri: redirectUri
|
|
5935
|
+
}
|
|
5915
5936
|
}
|
|
5916
5937
|
}
|
|
5917
5938
|
}
|
|
@@ -6042,7 +6063,9 @@ function createConnectorsNamespace(rb) {
|
|
|
6042
6063
|
code,
|
|
6043
6064
|
state,
|
|
6044
6065
|
workspace_id: workspaceId,
|
|
6045
|
-
...redirectUri !== void 0 && {
|
|
6066
|
+
...redirectUri !== void 0 && {
|
|
6067
|
+
redirect_uri: redirectUri
|
|
6068
|
+
}
|
|
6046
6069
|
}
|
|
6047
6070
|
}
|
|
6048
6071
|
}
|
|
@@ -6222,6 +6245,38 @@ function createCrmNamespace(rb) {
|
|
|
6222
6245
|
listByWorkspace: async (workspaceId, options) => {
|
|
6223
6246
|
return rb.execute(
|
|
6224
6247
|
getCrmContactsWorkspaceByWorkspaceId,
|
|
6248
|
+
{
|
|
6249
|
+
path: { workspace_id: workspaceId },
|
|
6250
|
+
query: {
|
|
6251
|
+
...options?.status ? { status: options.status } : {},
|
|
6252
|
+
...options?.filters ? { filters: options.filters } : {},
|
|
6253
|
+
...options?.tags ? { tags: options.tags } : {},
|
|
6254
|
+
...buildPageQuery(options?.page, options?.pageSize)?.query
|
|
6255
|
+
}
|
|
6256
|
+
},
|
|
6257
|
+
options
|
|
6258
|
+
);
|
|
6259
|
+
},
|
|
6260
|
+
/** Archive a contact (soft-delete with restore semantics) */
|
|
6261
|
+
archive: async (id, options) => {
|
|
6262
|
+
return rb.execute(
|
|
6263
|
+
patchCrmContactsByIdArchive,
|
|
6264
|
+
{ path: { id } },
|
|
6265
|
+
options
|
|
6266
|
+
);
|
|
6267
|
+
},
|
|
6268
|
+
/** Restore an archived contact */
|
|
6269
|
+
unarchive: async (id, options) => {
|
|
6270
|
+
return rb.execute(
|
|
6271
|
+
postCrmContactsByIdUnarchive,
|
|
6272
|
+
{ path: { id } },
|
|
6273
|
+
options
|
|
6274
|
+
);
|
|
6275
|
+
},
|
|
6276
|
+
/** List archived (soft-deleted) contacts for a workspace */
|
|
6277
|
+
listArchived: async (workspaceId, options) => {
|
|
6278
|
+
return rb.execute(
|
|
6279
|
+
getCrmContactsWorkspaceByWorkspaceIdArchived,
|
|
6225
6280
|
{
|
|
6226
6281
|
path: { workspace_id: workspaceId },
|
|
6227
6282
|
...buildPageQuery(options?.page, options?.pageSize)
|
|
@@ -7506,7 +7561,8 @@ var LoginSchema = z2.object({
|
|
|
7506
7561
|
var RegisterSchema = z2.object({
|
|
7507
7562
|
email: z2.string().email(),
|
|
7508
7563
|
password: z2.string().min(8),
|
|
7509
|
-
password_confirmation: z2.string().min(8)
|
|
7564
|
+
password_confirmation: z2.string().min(8),
|
|
7565
|
+
tenant_name: z2.string().min(1)
|
|
7510
7566
|
}).refine((data) => data.password === data.password_confirmation, {
|
|
7511
7567
|
message: "Passwords do not match",
|
|
7512
7568
|
path: ["password_confirmation"]
|
|
@@ -7549,25 +7605,32 @@ var ChangePasswordSchema = z2.object({
|
|
|
7549
7605
|
});
|
|
7550
7606
|
function createIdentityNamespace(rb, baseUrl) {
|
|
7551
7607
|
return {
|
|
7552
|
-
/**
|
|
7608
|
+
/**
|
|
7609
|
+
* Login with email and password — returns the authenticated user.
|
|
7610
|
+
* The session token is available as `result.token` (flattened from `data.attributes.token`).
|
|
7611
|
+
*/
|
|
7553
7612
|
login: async (email, password, options) => {
|
|
7554
7613
|
LoginSchema.parse({ email, password });
|
|
7555
7614
|
return rb.execute(
|
|
7556
7615
|
postUsersAuthLogin,
|
|
7557
7616
|
{
|
|
7558
7617
|
body: {
|
|
7559
|
-
data: { type: "
|
|
7618
|
+
data: { type: "user", attributes: { email, password } }
|
|
7560
7619
|
}
|
|
7561
7620
|
},
|
|
7562
7621
|
options
|
|
7563
7622
|
);
|
|
7564
7623
|
},
|
|
7565
|
-
/**
|
|
7566
|
-
|
|
7624
|
+
/**
|
|
7625
|
+
* Register a new user account — returns the newly created user.
|
|
7626
|
+
* The session token is available as `result.token` (flattened from `data.attributes.token`).
|
|
7627
|
+
*/
|
|
7628
|
+
register: async (email, password, passwordConfirmation, tenantName, options) => {
|
|
7567
7629
|
RegisterSchema.parse({
|
|
7568
7630
|
email,
|
|
7569
7631
|
password,
|
|
7570
|
-
password_confirmation: passwordConfirmation
|
|
7632
|
+
password_confirmation: passwordConfirmation,
|
|
7633
|
+
tenant_name: tenantName
|
|
7571
7634
|
});
|
|
7572
7635
|
return rb.execute(
|
|
7573
7636
|
postUsersAuthRegister,
|
|
@@ -7578,7 +7641,8 @@ function createIdentityNamespace(rb, baseUrl) {
|
|
|
7578
7641
|
attributes: {
|
|
7579
7642
|
email,
|
|
7580
7643
|
password,
|
|
7581
|
-
password_confirmation: passwordConfirmation
|
|
7644
|
+
password_confirmation: passwordConfirmation,
|
|
7645
|
+
tenant_name: tenantName
|
|
7582
7646
|
}
|
|
7583
7647
|
}
|
|
7584
7648
|
}
|