Skip to content

Commit 76bd03f

Browse files
authored
Revert "Add loading state while seam API is requested (#242)" (#246)
This reverts commit 3378ae7.
1 parent dd81bb2 commit 76bd03f

14 files changed

+23
-292
lines changed

lib/interact-for-access-code.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import prompts from "prompts"
22
import { getSeam } from "./get-seam"
33
import { interactForDevice } from "./interact-for-device"
4-
import { withLoading } from "./util/with-loading"
54

65
export const interactForAccessCode = async ({
76
device_id,
@@ -14,11 +13,9 @@ export const interactForAccessCode = async ({
1413
device_id = await interactForDevice()
1514
}
1615

17-
const accessCodes = await withLoading("Fetching access codes...", () =>
18-
seam.accessCodes.list({
19-
device_id,
20-
})
21-
)
16+
const accessCodes = await seam.accessCodes.list({
17+
device_id,
18+
})
2219

2320
const { accessCodeId } = await prompts({
2421
name: "accessCodeId",

lib/interact-for-acs-entrance.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
import prompts from "prompts"
22
import { getSeam } from "./get-seam"
3-
import { withLoading } from "./util/with-loading"
43

54
export const interactForAcsEntrance = async () => {
65
const seam = await getSeam()
76

8-
const entrances = await withLoading("Fetching ACS entrances...", () =>
9-
seam.acs.entrances.list()
10-
)
7+
const entrances = await seam.acs.entrances.list()
118

129
const { acsEntranceId } = await prompts({
1310
name: "acsEntranceId",

lib/interact-for-acs-system.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
import prompts from "prompts"
22
import { getSeam } from "./get-seam"
3-
import { withLoading } from "./util/with-loading"
43

54
export const interactForAcsSystem = async (message?: string) => {
65
const seam = await getSeam()
76

8-
const systems = await withLoading("Fetching ACS systems...", () =>
9-
seam.acs.systems.list()
10-
)
7+
const systems = await seam.acs.systems.list()
118

129
const { acsSystemId } = await prompts({
1310
name: "acsSystemId",

lib/interact-for-acs-user.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import prompts from "prompts"
22
import { getSeam } from "./get-seam"
33
import { interactForAcsSystem } from "./interact-for-acs-system"
4-
import { withLoading } from "./util/with-loading"
54

65
export const interactForAcsUser = async () => {
76
const seam = await getSeam()
@@ -10,11 +9,9 @@ export const interactForAcsUser = async () => {
109
"What acs_system does the acs_user belong to?"
1110
)
1211

13-
const users = await withLoading("Fetching ACS users...", () =>
14-
seam.acs.users.list({
15-
acs_system_id,
16-
})
17-
)
12+
const users = await seam.acs.users.list({
13+
acs_system_id,
14+
})
1815

1916
const { acsUserId } = await prompts({
2017
name: "acsUserId",

lib/interact-for-action-attempt-poll.ts

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import prompts from "prompts"
22
import { getSeam } from "./get-seam"
33
import { ActionAttemptsGetResponse } from "@seamapi/http/connect"
4-
import { withLoading } from "./util/with-loading"
54

65
export const interactForActionAttemptPoll = async (
76
action_attempt: ActionAttemptsGetResponse["action_attempt"]
@@ -20,13 +19,9 @@ export const interactForActionAttemptPoll = async (
2019
const seam = await getSeam()
2120
const { action_attempt_id } = action_attempt
2221

23-
const updated_action_attempt = await withLoading(
24-
"Polling action attempt...",
25-
() =>
26-
seam.actionAttempts.get(
27-
{ action_attempt_id },
28-
{ waitForActionAttempt: { pollingInterval: 240, timeout: 10_000 } }
29-
)
22+
const updated_action_attempt = await seam.actionAttempts.get(
23+
{ action_attempt_id },
24+
{ waitForActionAttempt: { pollingInterval: 240, timeout: 10_000 } }
3025
)
3126

3227
console.dir(updated_action_attempt, { depth: null })

lib/interact-for-connected-account.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
11
import prompts from "prompts"
22
import { getSeam } from "./get-seam"
33
import { getConfigStore } from "./get-config-store"
4-
import { withLoading } from "./util/with-loading"
54
export const interactForConnectedAccount = async () => {
65
const seam = await getSeam()
76

8-
const connected_accounts = await withLoading(
9-
"Fetching connected accounts...",
10-
() => seam.connectedAccounts.list()
11-
)
7+
const connected_accounts = await seam.connectedAccounts.list()
128

139
const { connectedAccountId } = await prompts({
1410
name: "connectedAccountId",

lib/interact-for-credential-pool.ts

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import prompts from "prompts"
22
import { getSeam } from "./get-seam"
33
import { interactForAcsSystem } from "./interact-for-acs-system"
4-
import { withLoading } from "./util/with-loading"
54

65
export const interactForCredentialPool = async () => {
76
const seam = await getSeam()
@@ -10,13 +9,9 @@ export const interactForCredentialPool = async () => {
109
"What acs_system does the credential pool belong to?"
1110
)
1211

13-
const credentialPools = await withLoading(
14-
"Fetching ACS credential pools...",
15-
() =>
16-
seam.acs.credentialPools.list({
17-
acs_system_id,
18-
})
19-
)
12+
const credentialPools = await seam.acs.credentialPools.list({
13+
acs_system_id,
14+
})
2015

2116
const { credentialPoolId } = await prompts({
2217
name: "credentialPoolId",

lib/interact-for-device.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
import prompts from "prompts"
22
import { getSeam } from "./get-seam"
33
import { getConfigStore } from "./get-config-store"
4-
import { withLoading } from "./util/with-loading"
54
export const interactForDevice = async () => {
65
const seam = await getSeam()
76

8-
const devices = await withLoading("Fetching devices...", () =>
9-
seam.devices.list()
10-
)
7+
const devices = await seam.devices.list()
118

129
const { deviceId } = await prompts({
1310
name: "deviceId",

lib/interact-for-user-identity.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
import prompts from "prompts"
22
import { getSeam } from "./get-seam"
3-
import { withLoading } from "./util/with-loading"
43

54
export const interactForUserIdentity = async () => {
65
const seam = await getSeam()
76

8-
const uis = await withLoading("Fetching user identities...", () =>
9-
seam.userIdentities.list()
10-
)
7+
const uis = await seam.userIdentities.list()
118

129
const { userIdentityId } = await prompts({
1310
name: "userIdentityId",

lib/interact-for-workspace-id.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
import { getConfigStore } from "./get-config-store"
22
import prompts from "prompts"
33
import { getSeam, getSeamMultiWorkspace } from "./get-seam"
4-
import { withLoading } from "./util/with-loading"
54

65
export const interactForWorkspaceId = async () => {
76
const config = getConfigStore()
87
const seam = await getSeamMultiWorkspace()
98

10-
const workspaces = await withLoading("Fetching workspaces...", () =>
11-
seam.workspaces.list()
12-
)
9+
const workspaces = await seam.workspaces.list()
1310

1411
const { workspaceId } = await prompts({
1512
name: "workspaceId",

0 commit comments

Comments
 (0)