@seamapi/http 1.90.0 → 1.92.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 +115 -0
- package/dist/connect.cjs.map +1 -1
- package/dist/connect.d.cts +33 -2
- package/dist/index.cjs +117 -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-http-endpoints.d.ts +3 -1
- package/lib/seam/connect/routes/seam-http-endpoints.js +8 -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 +5 -5
- 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-http-endpoints.ts +23 -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",
|
|
@@ -10391,6 +10495,16 @@ var SeamHttpEndpoints = class _SeamHttpEndpoints {
|
|
|
10391
10495
|
return seam.update(...args);
|
|
10392
10496
|
};
|
|
10393
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
|
+
}
|
|
10394
10508
|
get "/customers/create_portal"() {
|
|
10395
10509
|
const { client, defaults } = this;
|
|
10396
10510
|
return function customersCreatePortal(...args) {
|
|
@@ -11775,6 +11889,7 @@ exports.SeamHttpBridges = SeamHttpBridges;
|
|
|
11775
11889
|
exports.SeamHttpClientSessions = SeamHttpClientSessions;
|
|
11776
11890
|
exports.SeamHttpConnectWebviews = SeamHttpConnectWebviews;
|
|
11777
11891
|
exports.SeamHttpConnectedAccounts = SeamHttpConnectedAccounts;
|
|
11892
|
+
exports.SeamHttpConnectedAccountsSimulate = SeamHttpConnectedAccountsSimulate;
|
|
11778
11893
|
exports.SeamHttpCustomers = SeamHttpCustomers;
|
|
11779
11894
|
exports.SeamHttpDevices = SeamHttpDevices;
|
|
11780
11895
|
exports.SeamHttpDevicesSimulate = SeamHttpDevicesSimulate;
|