@seamapi/http 1.89.0 → 1.91.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 +141 -0
- package/dist/connect.cjs.map +1 -1
- package/dist/connect.d.cts +48 -3
- package/dist/index.cjs +143 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/lib/seam/connect/routes/connected-accounts/connected-accounts.d.ts +2 -0
- package/lib/seam/connect/routes/connected-accounts/connected-accounts.js +4 -0
- package/lib/seam/connect/routes/connected-accounts/connected-accounts.js.map +1 -1
- package/lib/seam/connect/routes/connected-accounts/index.d.ts +1 -0
- package/lib/seam/connect/routes/connected-accounts/index.js +1 -0
- package/lib/seam/connect/routes/connected-accounts/index.js.map +1 -1
- package/lib/seam/connect/routes/connected-accounts/simulate/index.d.ts +1 -0
- package/lib/seam/connect/routes/connected-accounts/simulate/index.js +6 -0
- package/lib/seam/connect/routes/connected-accounts/simulate/index.js.map +1 -0
- package/lib/seam/connect/routes/connected-accounts/simulate/simulate.d.ts +34 -0
- package/lib/seam/connect/routes/connected-accounts/simulate/simulate.js +98 -0
- package/lib/seam/connect/routes/connected-accounts/simulate/simulate.js.map +1 -0
- package/lib/seam/connect/routes/seam/customer/v1/connectors/connectors.d.ts +13 -0
- package/lib/seam/connect/routes/seam/customer/v1/connectors/connectors.js +12 -0
- package/lib/seam/connect/routes/seam/customer/v1/connectors/connectors.js.map +1 -1
- package/lib/seam/connect/routes/seam-http-endpoints.d.ts +6 -3
- package/lib/seam/connect/routes/seam-http-endpoints.js +18 -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/connected-accounts/connected-accounts.ts +9 -0
- package/src/lib/seam/connect/routes/connected-accounts/index.ts +1 -0
- package/src/lib/seam/connect/routes/connected-accounts/simulate/index.ts +6 -0
- package/src/lib/seam/connect/routes/connected-accounts/simulate/simulate.ts +204 -0
- package/src/lib/seam/connect/routes/seam/customer/v1/connectors/connectors.ts +41 -0
- package/src/lib/seam/connect/routes/seam-http-endpoints.ts +45 -0
- package/src/lib/version.ts +1 -1
package/dist/connect.cjs
CHANGED
|
@@ -3932,6 +3932,104 @@ var SeamHttpConnectWebviews = class _SeamHttpConnectWebviews {
|
|
|
3932
3932
|
}
|
|
3933
3933
|
};
|
|
3934
3934
|
|
|
3935
|
+
// src/lib/seam/connect/routes/connected-accounts/simulate/simulate.ts
|
|
3936
|
+
var SeamHttpConnectedAccountsSimulate = class _SeamHttpConnectedAccountsSimulate {
|
|
3937
|
+
client;
|
|
3938
|
+
defaults;
|
|
3939
|
+
ltsVersion = seamApiLtsVersion;
|
|
3940
|
+
static ltsVersion = seamApiLtsVersion;
|
|
3941
|
+
constructor(apiKeyOrOptions = {}) {
|
|
3942
|
+
const options = parseOptions(apiKeyOrOptions);
|
|
3943
|
+
this.client = "client" in options ? options.client : createClient(options);
|
|
3944
|
+
this.defaults = limitToSeamHttpRequestOptions(options);
|
|
3945
|
+
}
|
|
3946
|
+
static fromClient(client, options = {}) {
|
|
3947
|
+
const constructorOptions = { ...options, client };
|
|
3948
|
+
if (!isSeamHttpOptionsWithClient(constructorOptions)) {
|
|
3949
|
+
throw new SeamHttpInvalidOptionsError("Missing client");
|
|
3950
|
+
}
|
|
3951
|
+
return new _SeamHttpConnectedAccountsSimulate(constructorOptions);
|
|
3952
|
+
}
|
|
3953
|
+
static fromApiKey(apiKey, options = {}) {
|
|
3954
|
+
const constructorOptions = { ...options, apiKey };
|
|
3955
|
+
if (!isSeamHttpOptionsWithApiKey(constructorOptions)) {
|
|
3956
|
+
throw new SeamHttpInvalidOptionsError("Missing apiKey");
|
|
3957
|
+
}
|
|
3958
|
+
return new _SeamHttpConnectedAccountsSimulate(constructorOptions);
|
|
3959
|
+
}
|
|
3960
|
+
static fromClientSessionToken(clientSessionToken, options = {}) {
|
|
3961
|
+
const constructorOptions = { ...options, clientSessionToken };
|
|
3962
|
+
if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) {
|
|
3963
|
+
throw new SeamHttpInvalidOptionsError("Missing clientSessionToken");
|
|
3964
|
+
}
|
|
3965
|
+
return new _SeamHttpConnectedAccountsSimulate(constructorOptions);
|
|
3966
|
+
}
|
|
3967
|
+
static async fromPublishableKey(publishableKey, userIdentifierKey, options = {}) {
|
|
3968
|
+
warnOnInsecureuserIdentifierKey(userIdentifierKey);
|
|
3969
|
+
const clientOptions = parseOptions({ ...options, publishableKey });
|
|
3970
|
+
if (isSeamHttpOptionsWithClient(clientOptions)) {
|
|
3971
|
+
throw new SeamHttpInvalidOptionsError(
|
|
3972
|
+
"The client option cannot be used with SeamHttpConnectedAccountsSimulate.fromPublishableKey"
|
|
3973
|
+
);
|
|
3974
|
+
}
|
|
3975
|
+
const client = createClient(clientOptions);
|
|
3976
|
+
const clientSessions = SeamHttpClientSessions.fromClient(client);
|
|
3977
|
+
const { token } = await clientSessions.getOrCreate({
|
|
3978
|
+
user_identifier_key: userIdentifierKey
|
|
3979
|
+
});
|
|
3980
|
+
return _SeamHttpConnectedAccountsSimulate.fromClientSessionToken(
|
|
3981
|
+
token,
|
|
3982
|
+
options
|
|
3983
|
+
);
|
|
3984
|
+
}
|
|
3985
|
+
static fromConsoleSessionToken(consoleSessionToken, workspaceId, options = {}) {
|
|
3986
|
+
const constructorOptions = { ...options, consoleSessionToken, workspaceId };
|
|
3987
|
+
if (!isSeamHttpOptionsWithConsoleSessionToken(constructorOptions)) {
|
|
3988
|
+
throw new SeamHttpInvalidOptionsError(
|
|
3989
|
+
"Missing consoleSessionToken or workspaceId"
|
|
3990
|
+
);
|
|
3991
|
+
}
|
|
3992
|
+
return new _SeamHttpConnectedAccountsSimulate(constructorOptions);
|
|
3993
|
+
}
|
|
3994
|
+
static fromPersonalAccessToken(personalAccessToken, workspaceId, options = {}) {
|
|
3995
|
+
const constructorOptions = { ...options, personalAccessToken, workspaceId };
|
|
3996
|
+
if (!isSeamHttpOptionsWithPersonalAccessToken(constructorOptions)) {
|
|
3997
|
+
throw new SeamHttpInvalidOptionsError(
|
|
3998
|
+
"Missing personalAccessToken or workspaceId"
|
|
3999
|
+
);
|
|
4000
|
+
}
|
|
4001
|
+
return new _SeamHttpConnectedAccountsSimulate(constructorOptions);
|
|
4002
|
+
}
|
|
4003
|
+
createPaginator(request) {
|
|
4004
|
+
return new SeamPaginator(this, request);
|
|
4005
|
+
}
|
|
4006
|
+
async updateClientSessionToken(clientSessionToken) {
|
|
4007
|
+
const { headers } = this.client.defaults;
|
|
4008
|
+
const authHeaders = getAuthHeadersForClientSessionToken({
|
|
4009
|
+
clientSessionToken
|
|
4010
|
+
});
|
|
4011
|
+
for (const key of Object.keys(authHeaders)) {
|
|
4012
|
+
if (headers[key] == null) {
|
|
4013
|
+
throw new Error(
|
|
4014
|
+
"Cannot update a clientSessionToken on a client created without a clientSessionToken"
|
|
4015
|
+
);
|
|
4016
|
+
}
|
|
4017
|
+
}
|
|
4018
|
+
this.client.defaults.headers = { ...headers, ...authHeaders };
|
|
4019
|
+
const clientSessions = SeamHttpClientSessions.fromClient(this.client);
|
|
4020
|
+
await clientSessions.get();
|
|
4021
|
+
}
|
|
4022
|
+
disconnect(parameters, options = {}) {
|
|
4023
|
+
return new SeamHttpRequest(this, {
|
|
4024
|
+
pathname: "/connected_accounts/simulate/disconnect",
|
|
4025
|
+
method: "POST",
|
|
4026
|
+
body: parameters,
|
|
4027
|
+
responseKey: void 0,
|
|
4028
|
+
options
|
|
4029
|
+
});
|
|
4030
|
+
}
|
|
4031
|
+
};
|
|
4032
|
+
|
|
3935
4033
|
// src/lib/seam/connect/routes/connected-accounts/connected-accounts.ts
|
|
3936
4034
|
var SeamHttpConnectedAccounts = class _SeamHttpConnectedAccounts {
|
|
3937
4035
|
client;
|
|
@@ -4016,6 +4114,12 @@ var SeamHttpConnectedAccounts = class _SeamHttpConnectedAccounts {
|
|
|
4016
4114
|
const clientSessions = SeamHttpClientSessions.fromClient(this.client);
|
|
4017
4115
|
await clientSessions.get();
|
|
4018
4116
|
}
|
|
4117
|
+
get simulate() {
|
|
4118
|
+
return SeamHttpConnectedAccountsSimulate.fromClient(
|
|
4119
|
+
this.client,
|
|
4120
|
+
this.defaults
|
|
4121
|
+
);
|
|
4122
|
+
}
|
|
4019
4123
|
delete(parameters, options = {}) {
|
|
4020
4124
|
return new SeamHttpRequest(this, {
|
|
4021
4125
|
pathname: "/connected_accounts/delete",
|
|
@@ -6312,6 +6416,20 @@ var SeamHttpSeamCustomerV1Connectors = class _SeamHttpSeamCustomerV1Connectors {
|
|
|
6312
6416
|
const clientSessions = SeamHttpClientSessions.fromClient(this.client);
|
|
6313
6417
|
await clientSessions.get();
|
|
6314
6418
|
}
|
|
6419
|
+
connectorTypes(parameters, options = {}) {
|
|
6420
|
+
if (!this.defaults.isUndocumentedApiEnabled) {
|
|
6421
|
+
throw new Error(
|
|
6422
|
+
"Cannot use undocumented API without isUndocumentedApiEnabled"
|
|
6423
|
+
);
|
|
6424
|
+
}
|
|
6425
|
+
return new SeamHttpRequest(this, {
|
|
6426
|
+
pathname: "/seam/customer/v1/connectors/connector_types",
|
|
6427
|
+
method: "GET",
|
|
6428
|
+
params: parameters,
|
|
6429
|
+
responseKey: "connector_types",
|
|
6430
|
+
options
|
|
6431
|
+
});
|
|
6432
|
+
}
|
|
6315
6433
|
create(parameters, options = {}) {
|
|
6316
6434
|
if (!this.defaults.isUndocumentedApiEnabled) {
|
|
6317
6435
|
throw new Error(
|
|
@@ -10377,6 +10495,16 @@ var SeamHttpEndpoints = class _SeamHttpEndpoints {
|
|
|
10377
10495
|
return seam.update(...args);
|
|
10378
10496
|
};
|
|
10379
10497
|
}
|
|
10498
|
+
get "/connected_accounts/simulate/disconnect"() {
|
|
10499
|
+
const { client, defaults } = this;
|
|
10500
|
+
return function connectedAccountsSimulateDisconnect(...args) {
|
|
10501
|
+
const seam = SeamHttpConnectedAccountsSimulate.fromClient(
|
|
10502
|
+
client,
|
|
10503
|
+
defaults
|
|
10504
|
+
);
|
|
10505
|
+
return seam.disconnect(...args);
|
|
10506
|
+
};
|
|
10507
|
+
}
|
|
10380
10508
|
get "/customers/create_portal"() {
|
|
10381
10509
|
const { client, defaults } = this;
|
|
10382
10510
|
return function customersCreatePortal(...args) {
|
|
@@ -10769,6 +10897,18 @@ var SeamHttpEndpoints = class _SeamHttpEndpoints {
|
|
|
10769
10897
|
return seam.update(...args);
|
|
10770
10898
|
};
|
|
10771
10899
|
}
|
|
10900
|
+
get "/seam/customer/v1/connectors/connector_types"() {
|
|
10901
|
+
const { client, defaults } = this;
|
|
10902
|
+
if (!this.defaults.isUndocumentedApiEnabled) {
|
|
10903
|
+
throw new Error(
|
|
10904
|
+
"Cannot use undocumented API without isUndocumentedApiEnabled"
|
|
10905
|
+
);
|
|
10906
|
+
}
|
|
10907
|
+
return function seamCustomerV1ConnectorsConnectorTypes(...args) {
|
|
10908
|
+
const seam = SeamHttpSeamCustomerV1Connectors.fromClient(client, defaults);
|
|
10909
|
+
return seam.connectorTypes(...args);
|
|
10910
|
+
};
|
|
10911
|
+
}
|
|
10772
10912
|
get "/seam/customer/v1/connectors/create"() {
|
|
10773
10913
|
const { client, defaults } = this;
|
|
10774
10914
|
if (!this.defaults.isUndocumentedApiEnabled) {
|
|
@@ -11749,6 +11889,7 @@ exports.SeamHttpBridges = SeamHttpBridges;
|
|
|
11749
11889
|
exports.SeamHttpClientSessions = SeamHttpClientSessions;
|
|
11750
11890
|
exports.SeamHttpConnectWebviews = SeamHttpConnectWebviews;
|
|
11751
11891
|
exports.SeamHttpConnectedAccounts = SeamHttpConnectedAccounts;
|
|
11892
|
+
exports.SeamHttpConnectedAccountsSimulate = SeamHttpConnectedAccountsSimulate;
|
|
11752
11893
|
exports.SeamHttpCustomers = SeamHttpCustomers;
|
|
11753
11894
|
exports.SeamHttpDevices = SeamHttpDevices;
|
|
11754
11895
|
exports.SeamHttpDevicesSimulate = SeamHttpDevicesSimulate;
|