@seamapi/http 1.96.0 → 1.97.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/dist/connect.cjs +127 -0
- package/dist/connect.cjs.map +1 -1
- package/dist/connect.d.cts +34 -3
- package/dist/index.cjs +129 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/lib/seam/connect/routes/seam/customer/v1/customers/customers.d.ts +34 -0
- package/lib/seam/connect/routes/seam/customer/v1/customers/customers.js +104 -0
- package/lib/seam/connect/routes/seam/customer/v1/customers/customers.js.map +1 -0
- package/lib/seam/connect/routes/seam/customer/v1/customers/index.d.ts +1 -0
- package/lib/seam/connect/routes/seam/customer/v1/customers/index.js +6 -0
- package/lib/seam/connect/routes/seam/customer/v1/customers/index.js.map +1 -0
- package/lib/seam/connect/routes/seam/customer/v1/index.d.ts +1 -0
- package/lib/seam/connect/routes/seam/customer/v1/index.js +1 -0
- package/lib/seam/connect/routes/seam/customer/v1/index.js.map +1 -1
- package/lib/seam/connect/routes/seam/customer/v1/v1.d.ts +2 -0
- package/lib/seam/connect/routes/seam/customer/v1/v1.js +4 -0
- package/lib/seam/connect/routes/seam/customer/v1/v1.js.map +1 -1
- package/lib/seam/connect/routes/seam-http-endpoints.d.ts +4 -2
- package/lib/seam/connect/routes/seam-http-endpoints.js +11 -0
- package/lib/seam/connect/routes/seam-http-endpoints.js.map +1 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +3 -3
- package/src/lib/seam/connect/routes/seam/customer/v1/customers/customers.ts +214 -0
- package/src/lib/seam/connect/routes/seam/customer/v1/customers/index.ts +6 -0
- package/src/lib/seam/connect/routes/seam/customer/v1/index.ts +1 -0
- package/src/lib/seam/connect/routes/seam/customer/v1/v1.ts +8 -0
- package/src/lib/seam/connect/routes/seam-http-endpoints.ts +26 -0
- package/src/lib/version.ts +1 -1
package/dist/connect.cjs
CHANGED
|
@@ -6525,6 +6525,114 @@ var SeamHttpSeamCustomerV1Connectors = class _SeamHttpSeamCustomerV1Connectors {
|
|
|
6525
6525
|
}
|
|
6526
6526
|
};
|
|
6527
6527
|
|
|
6528
|
+
// src/lib/seam/connect/routes/seam/customer/v1/customers/customers.ts
|
|
6529
|
+
var SeamHttpSeamCustomerV1Customers = class _SeamHttpSeamCustomerV1Customers {
|
|
6530
|
+
client;
|
|
6531
|
+
defaults;
|
|
6532
|
+
ltsVersion = seamApiLtsVersion;
|
|
6533
|
+
static ltsVersion = seamApiLtsVersion;
|
|
6534
|
+
constructor(apiKeyOrOptions = {}) {
|
|
6535
|
+
const options = parseOptions(apiKeyOrOptions);
|
|
6536
|
+
if (!options.isUndocumentedApiEnabled) {
|
|
6537
|
+
throw new Error(
|
|
6538
|
+
"Cannot use undocumented API without isUndocumentedApiEnabled"
|
|
6539
|
+
);
|
|
6540
|
+
}
|
|
6541
|
+
this.client = "client" in options ? options.client : createClient(options);
|
|
6542
|
+
this.defaults = limitToSeamHttpRequestOptions(options);
|
|
6543
|
+
}
|
|
6544
|
+
static fromClient(client, options = {}) {
|
|
6545
|
+
const constructorOptions = { ...options, client };
|
|
6546
|
+
if (!isSeamHttpOptionsWithClient(constructorOptions)) {
|
|
6547
|
+
throw new SeamHttpInvalidOptionsError("Missing client");
|
|
6548
|
+
}
|
|
6549
|
+
return new _SeamHttpSeamCustomerV1Customers(constructorOptions);
|
|
6550
|
+
}
|
|
6551
|
+
static fromApiKey(apiKey, options = {}) {
|
|
6552
|
+
const constructorOptions = { ...options, apiKey };
|
|
6553
|
+
if (!isSeamHttpOptionsWithApiKey(constructorOptions)) {
|
|
6554
|
+
throw new SeamHttpInvalidOptionsError("Missing apiKey");
|
|
6555
|
+
}
|
|
6556
|
+
return new _SeamHttpSeamCustomerV1Customers(constructorOptions);
|
|
6557
|
+
}
|
|
6558
|
+
static fromClientSessionToken(clientSessionToken, options = {}) {
|
|
6559
|
+
const constructorOptions = { ...options, clientSessionToken };
|
|
6560
|
+
if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) {
|
|
6561
|
+
throw new SeamHttpInvalidOptionsError("Missing clientSessionToken");
|
|
6562
|
+
}
|
|
6563
|
+
return new _SeamHttpSeamCustomerV1Customers(constructorOptions);
|
|
6564
|
+
}
|
|
6565
|
+
static async fromPublishableKey(publishableKey, userIdentifierKey, options = {}) {
|
|
6566
|
+
warnOnInsecureuserIdentifierKey(userIdentifierKey);
|
|
6567
|
+
const clientOptions = parseOptions({ ...options, publishableKey });
|
|
6568
|
+
if (isSeamHttpOptionsWithClient(clientOptions)) {
|
|
6569
|
+
throw new SeamHttpInvalidOptionsError(
|
|
6570
|
+
"The client option cannot be used with SeamHttpSeamCustomerV1Customers.fromPublishableKey"
|
|
6571
|
+
);
|
|
6572
|
+
}
|
|
6573
|
+
const client = createClient(clientOptions);
|
|
6574
|
+
const clientSessions = SeamHttpClientSessions.fromClient(client);
|
|
6575
|
+
const { token } = await clientSessions.getOrCreate({
|
|
6576
|
+
user_identifier_key: userIdentifierKey
|
|
6577
|
+
});
|
|
6578
|
+
return _SeamHttpSeamCustomerV1Customers.fromClientSessionToken(
|
|
6579
|
+
token,
|
|
6580
|
+
options
|
|
6581
|
+
);
|
|
6582
|
+
}
|
|
6583
|
+
static fromConsoleSessionToken(consoleSessionToken, workspaceId, options = {}) {
|
|
6584
|
+
const constructorOptions = { ...options, consoleSessionToken, workspaceId };
|
|
6585
|
+
if (!isSeamHttpOptionsWithConsoleSessionToken(constructorOptions)) {
|
|
6586
|
+
throw new SeamHttpInvalidOptionsError(
|
|
6587
|
+
"Missing consoleSessionToken or workspaceId"
|
|
6588
|
+
);
|
|
6589
|
+
}
|
|
6590
|
+
return new _SeamHttpSeamCustomerV1Customers(constructorOptions);
|
|
6591
|
+
}
|
|
6592
|
+
static fromPersonalAccessToken(personalAccessToken, workspaceId, options = {}) {
|
|
6593
|
+
const constructorOptions = { ...options, personalAccessToken, workspaceId };
|
|
6594
|
+
if (!isSeamHttpOptionsWithPersonalAccessToken(constructorOptions)) {
|
|
6595
|
+
throw new SeamHttpInvalidOptionsError(
|
|
6596
|
+
"Missing personalAccessToken or workspaceId"
|
|
6597
|
+
);
|
|
6598
|
+
}
|
|
6599
|
+
return new _SeamHttpSeamCustomerV1Customers(constructorOptions);
|
|
6600
|
+
}
|
|
6601
|
+
createPaginator(request) {
|
|
6602
|
+
return new SeamPaginator(this, request);
|
|
6603
|
+
}
|
|
6604
|
+
async updateClientSessionToken(clientSessionToken) {
|
|
6605
|
+
const { headers } = this.client.defaults;
|
|
6606
|
+
const authHeaders = getAuthHeadersForClientSessionToken({
|
|
6607
|
+
clientSessionToken
|
|
6608
|
+
});
|
|
6609
|
+
for (const key of Object.keys(authHeaders)) {
|
|
6610
|
+
if (headers[key] == null) {
|
|
6611
|
+
throw new Error(
|
|
6612
|
+
"Cannot update a clientSessionToken on a client created without a clientSessionToken"
|
|
6613
|
+
);
|
|
6614
|
+
}
|
|
6615
|
+
}
|
|
6616
|
+
this.client.defaults.headers = { ...headers, ...authHeaders };
|
|
6617
|
+
const clientSessions = SeamHttpClientSessions.fromClient(this.client);
|
|
6618
|
+
await clientSessions.get();
|
|
6619
|
+
}
|
|
6620
|
+
list(parameters, options = {}) {
|
|
6621
|
+
if (!this.defaults.isUndocumentedApiEnabled) {
|
|
6622
|
+
throw new Error(
|
|
6623
|
+
"Cannot use undocumented API without isUndocumentedApiEnabled"
|
|
6624
|
+
);
|
|
6625
|
+
}
|
|
6626
|
+
return new SeamHttpRequest(this, {
|
|
6627
|
+
pathname: "/seam/customer/v1/customers/list",
|
|
6628
|
+
method: "POST",
|
|
6629
|
+
body: parameters,
|
|
6630
|
+
responseKey: "customers",
|
|
6631
|
+
options
|
|
6632
|
+
});
|
|
6633
|
+
}
|
|
6634
|
+
};
|
|
6635
|
+
|
|
6528
6636
|
// src/lib/seam/connect/routes/seam/customer/v1/events/events.ts
|
|
6529
6637
|
var SeamHttpSeamCustomerV1Events = class _SeamHttpSeamCustomerV1Events {
|
|
6530
6638
|
client;
|
|
@@ -7344,6 +7452,12 @@ var SeamHttpSeamCustomerV1 = class _SeamHttpSeamCustomerV1 {
|
|
|
7344
7452
|
this.defaults
|
|
7345
7453
|
);
|
|
7346
7454
|
}
|
|
7455
|
+
get customers() {
|
|
7456
|
+
return SeamHttpSeamCustomerV1Customers.fromClient(
|
|
7457
|
+
this.client,
|
|
7458
|
+
this.defaults
|
|
7459
|
+
);
|
|
7460
|
+
}
|
|
7347
7461
|
get events() {
|
|
7348
7462
|
return SeamHttpSeamCustomerV1Events.fromClient(this.client, this.defaults);
|
|
7349
7463
|
}
|
|
@@ -11025,6 +11139,18 @@ var SeamHttpEndpoints = class _SeamHttpEndpoints {
|
|
|
11025
11139
|
return seam.update(...args);
|
|
11026
11140
|
};
|
|
11027
11141
|
}
|
|
11142
|
+
get "/seam/customer/v1/customers/list"() {
|
|
11143
|
+
const { client, defaults } = this;
|
|
11144
|
+
if (!this.defaults.isUndocumentedApiEnabled) {
|
|
11145
|
+
throw new Error(
|
|
11146
|
+
"Cannot use undocumented API without isUndocumentedApiEnabled"
|
|
11147
|
+
);
|
|
11148
|
+
}
|
|
11149
|
+
return function seamCustomerV1CustomersList(...args) {
|
|
11150
|
+
const seam = SeamHttpSeamCustomerV1Customers.fromClient(client, defaults);
|
|
11151
|
+
return seam.list(...args);
|
|
11152
|
+
};
|
|
11153
|
+
}
|
|
11028
11154
|
get "/seam/customer/v1/events/list"() {
|
|
11029
11155
|
const { client, defaults } = this;
|
|
11030
11156
|
if (!this.defaults.isUndocumentedApiEnabled) {
|
|
@@ -11998,6 +12124,7 @@ exports.SeamHttpSeamCustomerV1AccessGrants = SeamHttpSeamCustomerV1AccessGrants;
|
|
|
11998
12124
|
exports.SeamHttpSeamCustomerV1AutomationRuns = SeamHttpSeamCustomerV1AutomationRuns;
|
|
11999
12125
|
exports.SeamHttpSeamCustomerV1Automations = SeamHttpSeamCustomerV1Automations;
|
|
12000
12126
|
exports.SeamHttpSeamCustomerV1Connectors = SeamHttpSeamCustomerV1Connectors;
|
|
12127
|
+
exports.SeamHttpSeamCustomerV1Customers = SeamHttpSeamCustomerV1Customers;
|
|
12001
12128
|
exports.SeamHttpSeamCustomerV1Events = SeamHttpSeamCustomerV1Events;
|
|
12002
12129
|
exports.SeamHttpSeamCustomerV1Portals = SeamHttpSeamCustomerV1Portals;
|
|
12003
12130
|
exports.SeamHttpSeamCustomerV1Reservations = SeamHttpSeamCustomerV1Reservations;
|