@turnkey/sdk-browser 5.15.2 → 5.16.1

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.
@@ -100,6 +100,37 @@ class TurnkeySDKClientBase {
100
100
  url: fullUrl,
101
101
  };
102
102
  };
103
+ this.getAppStatus = async (input) => {
104
+ const sessionData = await getStorageValue(StorageKeys.Session);
105
+ const session = sessionData ? parseSession(sessionData) : null;
106
+ return this.request("/public/v1/query/get_app_status", {
107
+ ...input,
108
+ organizationId: input.organizationId ??
109
+ session?.organizationId ??
110
+ this.config.organizationId,
111
+ });
112
+ };
113
+ this.stampGetAppStatus = async (input) => {
114
+ if (!this.stamper) {
115
+ return undefined;
116
+ }
117
+ const sessionData = await getStorageValue(StorageKeys.Session);
118
+ const session = sessionData ? parseSession(sessionData) : null;
119
+ const fullUrl = this.config.apiBaseUrl + "/public/v1/query/get_app_status";
120
+ const body = {
121
+ ...input,
122
+ organizationId: input.organizationId ??
123
+ session?.organizationId ??
124
+ this.config.organizationId,
125
+ };
126
+ const stringifiedBody = JSON.stringify(body);
127
+ const stamp = await this.stamper.stamp(stringifiedBody);
128
+ return {
129
+ body: stringifiedBody,
130
+ stamp: stamp,
131
+ url: fullUrl,
132
+ };
133
+ };
103
134
  this.getAuthenticator = async (input) => {
104
135
  const sessionData = await getStorageValue(StorageKeys.Session);
105
136
  const session = sessionData ? parseSession(sessionData) : null;
@@ -1155,6 +1186,37 @@ class TurnkeySDKClientBase {
1155
1186
  url: fullUrl,
1156
1187
  };
1157
1188
  };
1189
+ this.listWebhookEndpoints = async (input) => {
1190
+ const sessionData = await getStorageValue(StorageKeys.Session);
1191
+ const session = sessionData ? parseSession(sessionData) : null;
1192
+ return this.request("/public/v1/query/list_webhook_endpoints", {
1193
+ ...input,
1194
+ organizationId: input.organizationId ??
1195
+ session?.organizationId ??
1196
+ this.config.organizationId,
1197
+ });
1198
+ };
1199
+ this.stampListWebhookEndpoints = async (input) => {
1200
+ if (!this.stamper) {
1201
+ return undefined;
1202
+ }
1203
+ const sessionData = await getStorageValue(StorageKeys.Session);
1204
+ const session = sessionData ? parseSession(sessionData) : null;
1205
+ const fullUrl = this.config.apiBaseUrl + "/public/v1/query/list_webhook_endpoints";
1206
+ const body = {
1207
+ ...input,
1208
+ organizationId: input.organizationId ??
1209
+ session?.organizationId ??
1210
+ this.config.organizationId,
1211
+ };
1212
+ const stringifiedBody = JSON.stringify(body);
1213
+ const stamp = await this.stamper.stamp(stringifiedBody);
1214
+ return {
1215
+ body: stringifiedBody,
1216
+ stamp: stamp,
1217
+ url: fullUrl,
1218
+ };
1219
+ };
1158
1220
  this.getWhoami = async (input = {}) => {
1159
1221
  const sessionData = await getStorageValue(StorageKeys.Session);
1160
1222
  const session = sessionData ? parseSession(sessionData) : null;
@@ -1254,6 +1316,41 @@ class TurnkeySDKClientBase {
1254
1316
  url: fullUrl,
1255
1317
  };
1256
1318
  };
1319
+ this.createApiOnlyUsers = async (input) => {
1320
+ const sessionData = await getStorageValue(StorageKeys.Session);
1321
+ const session = sessionData ? parseSession(sessionData) : null;
1322
+ const { organizationId, timestampMs, ...rest } = input;
1323
+ return this.command("/public/v1/submit/create_api_only_users", {
1324
+ parameters: rest,
1325
+ organizationId: organizationId ??
1326
+ session?.organizationId ??
1327
+ this.config.organizationId,
1328
+ timestampMs: timestampMs ?? String(Date.now()),
1329
+ type: "ACTIVITY_TYPE_CREATE_API_ONLY_USERS",
1330
+ }, "createApiOnlyUsersResult");
1331
+ };
1332
+ this.stampCreateApiOnlyUsers = async (input) => {
1333
+ if (!this.stamper) {
1334
+ return undefined;
1335
+ }
1336
+ const sessionData = await getStorageValue(StorageKeys.Session);
1337
+ const session = sessionData ? parseSession(sessionData) : null;
1338
+ const { organizationId, timestampMs, ...parameters } = input;
1339
+ const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/create_api_only_users";
1340
+ const bodyWithType = {
1341
+ parameters,
1342
+ organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
1343
+ timestampMs: timestampMs ?? String(Date.now()),
1344
+ type: "ACTIVITY_TYPE_CREATE_API_ONLY_USERS",
1345
+ };
1346
+ const stringifiedBody = JSON.stringify(bodyWithType);
1347
+ const stamp = await this.stamper.stamp(stringifiedBody);
1348
+ return {
1349
+ body: stringifiedBody,
1350
+ stamp: stamp,
1351
+ url: fullUrl,
1352
+ };
1353
+ };
1257
1354
  this.createAuthenticators = async (input) => {
1258
1355
  const sessionData = await getStorageValue(StorageKeys.Session);
1259
1356
  const session = sessionData ? parseSession(sessionData) : null;
@@ -1851,6 +1948,41 @@ class TurnkeySDKClientBase {
1851
1948
  url: fullUrl,
1852
1949
  };
1853
1950
  };
1951
+ this.createWebhookEndpoint = async (input) => {
1952
+ const sessionData = await getStorageValue(StorageKeys.Session);
1953
+ const session = sessionData ? parseSession(sessionData) : null;
1954
+ const { organizationId, timestampMs, ...rest } = input;
1955
+ return this.command("/public/v1/submit/create_webhook_endpoint", {
1956
+ parameters: rest,
1957
+ organizationId: organizationId ??
1958
+ session?.organizationId ??
1959
+ this.config.organizationId,
1960
+ timestampMs: timestampMs ?? String(Date.now()),
1961
+ type: "ACTIVITY_TYPE_CREATE_WEBHOOK_ENDPOINT",
1962
+ }, "createWebhookEndpointResult");
1963
+ };
1964
+ this.stampCreateWebhookEndpoint = async (input) => {
1965
+ if (!this.stamper) {
1966
+ return undefined;
1967
+ }
1968
+ const sessionData = await getStorageValue(StorageKeys.Session);
1969
+ const session = sessionData ? parseSession(sessionData) : null;
1970
+ const { organizationId, timestampMs, ...parameters } = input;
1971
+ const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/create_webhook_endpoint";
1972
+ const bodyWithType = {
1973
+ parameters,
1974
+ organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
1975
+ timestampMs: timestampMs ?? String(Date.now()),
1976
+ type: "ACTIVITY_TYPE_CREATE_WEBHOOK_ENDPOINT",
1977
+ };
1978
+ const stringifiedBody = JSON.stringify(bodyWithType);
1979
+ const stamp = await this.stamper.stamp(stringifiedBody);
1980
+ return {
1981
+ body: stringifiedBody,
1982
+ stamp: stamp,
1983
+ url: fullUrl,
1984
+ };
1985
+ };
1854
1986
  this.deleteApiKeys = async (input) => {
1855
1987
  const sessionData = await getStorageValue(StorageKeys.Session);
1856
1988
  const session = sessionData ? parseSession(sessionData) : null;
@@ -2413,6 +2545,41 @@ class TurnkeySDKClientBase {
2413
2545
  url: fullUrl,
2414
2546
  };
2415
2547
  };
2548
+ this.deleteWebhookEndpoint = async (input) => {
2549
+ const sessionData = await getStorageValue(StorageKeys.Session);
2550
+ const session = sessionData ? parseSession(sessionData) : null;
2551
+ const { organizationId, timestampMs, ...rest } = input;
2552
+ return this.command("/public/v1/submit/delete_webhook_endpoint", {
2553
+ parameters: rest,
2554
+ organizationId: organizationId ??
2555
+ session?.organizationId ??
2556
+ this.config.organizationId,
2557
+ timestampMs: timestampMs ?? String(Date.now()),
2558
+ type: "ACTIVITY_TYPE_DELETE_WEBHOOK_ENDPOINT",
2559
+ }, "deleteWebhookEndpointResult");
2560
+ };
2561
+ this.stampDeleteWebhookEndpoint = async (input) => {
2562
+ if (!this.stamper) {
2563
+ return undefined;
2564
+ }
2565
+ const sessionData = await getStorageValue(StorageKeys.Session);
2566
+ const session = sessionData ? parseSession(sessionData) : null;
2567
+ const { organizationId, timestampMs, ...parameters } = input;
2568
+ const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/delete_webhook_endpoint";
2569
+ const bodyWithType = {
2570
+ parameters,
2571
+ organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
2572
+ timestampMs: timestampMs ?? String(Date.now()),
2573
+ type: "ACTIVITY_TYPE_DELETE_WEBHOOK_ENDPOINT",
2574
+ };
2575
+ const stringifiedBody = JSON.stringify(bodyWithType);
2576
+ const stamp = await this.stamper.stamp(stringifiedBody);
2577
+ return {
2578
+ body: stringifiedBody,
2579
+ stamp: stamp,
2580
+ url: fullUrl,
2581
+ };
2582
+ };
2416
2583
  this.emailAuth = async (input) => {
2417
2584
  const sessionData = await getStorageValue(StorageKeys.Session);
2418
2585
  const session = sessionData ? parseSession(sessionData) : null;
@@ -3427,6 +3594,41 @@ class TurnkeySDKClientBase {
3427
3594
  url: fullUrl,
3428
3595
  };
3429
3596
  };
3597
+ this.updateOrganizationName = async (input) => {
3598
+ const sessionData = await getStorageValue(StorageKeys.Session);
3599
+ const session = sessionData ? parseSession(sessionData) : null;
3600
+ const { organizationId, timestampMs, ...rest } = input;
3601
+ return this.command("/public/v1/submit/update_organization_name", {
3602
+ parameters: rest,
3603
+ organizationId: organizationId ??
3604
+ session?.organizationId ??
3605
+ this.config.organizationId,
3606
+ timestampMs: timestampMs ?? String(Date.now()),
3607
+ type: "ACTIVITY_TYPE_UPDATE_ORGANIZATION_NAME",
3608
+ }, "updateOrganizationNameResult");
3609
+ };
3610
+ this.stampUpdateOrganizationName = async (input) => {
3611
+ if (!this.stamper) {
3612
+ return undefined;
3613
+ }
3614
+ const sessionData = await getStorageValue(StorageKeys.Session);
3615
+ const session = sessionData ? parseSession(sessionData) : null;
3616
+ const { organizationId, timestampMs, ...parameters } = input;
3617
+ const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/update_organization_name";
3618
+ const bodyWithType = {
3619
+ parameters,
3620
+ organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
3621
+ timestampMs: timestampMs ?? String(Date.now()),
3622
+ type: "ACTIVITY_TYPE_UPDATE_ORGANIZATION_NAME",
3623
+ };
3624
+ const stringifiedBody = JSON.stringify(bodyWithType);
3625
+ const stamp = await this.stamper.stamp(stringifiedBody);
3626
+ return {
3627
+ body: stringifiedBody,
3628
+ stamp: stamp,
3629
+ url: fullUrl,
3630
+ };
3631
+ };
3430
3632
  this.updatePolicy = async (input) => {
3431
3633
  const sessionData = await getStorageValue(StorageKeys.Session);
3432
3634
  const session = sessionData ? parseSession(sessionData) : null;
@@ -3742,6 +3944,41 @@ class TurnkeySDKClientBase {
3742
3944
  url: fullUrl,
3743
3945
  };
3744
3946
  };
3947
+ this.updateWebhookEndpoint = async (input) => {
3948
+ const sessionData = await getStorageValue(StorageKeys.Session);
3949
+ const session = sessionData ? parseSession(sessionData) : null;
3950
+ const { organizationId, timestampMs, ...rest } = input;
3951
+ return this.command("/public/v1/submit/update_webhook_endpoint", {
3952
+ parameters: rest,
3953
+ organizationId: organizationId ??
3954
+ session?.organizationId ??
3955
+ this.config.organizationId,
3956
+ timestampMs: timestampMs ?? String(Date.now()),
3957
+ type: "ACTIVITY_TYPE_UPDATE_WEBHOOK_ENDPOINT",
3958
+ }, "updateWebhookEndpointResult");
3959
+ };
3960
+ this.stampUpdateWebhookEndpoint = async (input) => {
3961
+ if (!this.stamper) {
3962
+ return undefined;
3963
+ }
3964
+ const sessionData = await getStorageValue(StorageKeys.Session);
3965
+ const session = sessionData ? parseSession(sessionData) : null;
3966
+ const { organizationId, timestampMs, ...parameters } = input;
3967
+ const fullUrl = this.config.apiBaseUrl + "/public/v1/submit/update_webhook_endpoint";
3968
+ const bodyWithType = {
3969
+ parameters,
3970
+ organizationId: organizationId ?? session?.organizationId ?? this.config.organizationId,
3971
+ timestampMs: timestampMs ?? String(Date.now()),
3972
+ type: "ACTIVITY_TYPE_UPDATE_WEBHOOK_ENDPOINT",
3973
+ };
3974
+ const stringifiedBody = JSON.stringify(bodyWithType);
3975
+ const stamp = await this.stamper.stamp(stringifiedBody);
3976
+ return {
3977
+ body: stringifiedBody,
3978
+ stamp: stamp,
3979
+ url: fullUrl,
3980
+ };
3981
+ };
3745
3982
  this.verifyOtp = async (input) => {
3746
3983
  const sessionData = await getStorageValue(StorageKeys.Session);
3747
3984
  const session = sessionData ? parseSession(sessionData) : null;