-
Notifications
You must be signed in to change notification settings - Fork 51
Expand file tree
/
Copy pathmsw-mock-data.ts
More file actions
174 lines (168 loc) · 4.31 KB
/
msw-mock-data.ts
File metadata and controls
174 lines (168 loc) · 4.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
/*
* @forgerock/javascript-sdk
*
* msw-mock-data.ts
*
* Copyright (c) 2025 - 2026 Ping Identity Corporation. All rights reserved.
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
*/
import { GeneralResponse } from '../services/index.js';
import type {
OathResponse,
DeletedOAthDevice,
DeviceResponse,
PushDevice,
WebAuthnDevice,
} from '../types/index.js';
import { ProfileDevice } from '../types/profile-device.types.js';
// Mock data
export const MOCK_OATH_DEVICES: OathResponse = {
pagedResultsCookie: 'cookie',
remainingPagedResults: -1,
resultCount: 2,
totalPagedResults: 2,
totalPagedResultsPolicy: 'string',
result: [
{
_id: 'oath-1',
_rev: '1-oath',
createdDate: 1705555555555,
lastAccessDate: 1705555555555,
deviceName: 'Test OATH Device',
uuid: 'oath-uuid-1',
deviceManagementStatus: true,
},
],
};
export const MOCK_DELETED_OATH_DEVICE: DeletedOAthDevice = {
_id: 'oath-1',
_rev: '1-oath',
uuid: 'oath-uuid-1',
recoveryCodes: ['code1', 'code2'],
createdDate: 1705555555555,
lastAccessDate: 1705555555555,
sharedSecret: 'secret123',
deviceName: 'Test OATH Device',
lastLogin: 1705555555555,
counter: 0,
checksumDigit: true,
truncationOffset: 0,
clockDriftSeconds: 0,
};
export const MOCK_PUSH_DEVICES: PushDevice[] = [
{
_id: 'push-1',
_rev: '1-push',
createdDate: 1705555555555,
lastAccessDate: 1705555555555,
deviceName: 'Test Push Device',
uuid: 'push-uuid-1',
deviceManagementStatus: true,
},
];
export const MOCK_WEBAUTHN_DEVICES: GeneralResponse<WebAuthnDevice[]> = {
result: [
{
_id: 'webauthn-1',
_rev: '1-webauthn',
createdDate: 1705555555555,
lastAccessDate: 1705555555555,
credentialId: 'credential-1',
deviceName: 'Test WebAuthn Device',
uuid: 'webauthn-uuid-1',
deviceManagementStatus: true,
},
],
resultCount: 1,
pagedResultsCookie: null,
totalPagedResultsPolicy: 'NONE',
totalPagedResults: -1,
remainingPagedResults: -1,
};
export const MOCK_BINDING_DEVICES: DeviceResponse = {
result: [
{
_id: 'binding-1',
_rev: '1-binding',
createdDate: 1705555555555,
lastAccessDate: 1705555555555,
deviceId: 'device-1',
deviceName: 'Test Binding Device',
uuid: 'binding-uuid-1',
key: {
kty: 'RSA',
kid: 'key-1',
use: 'sig',
alg: 'RS256',
n: 'mock-n',
e: 'mock-e',
},
deviceManagementStatus: true,
},
],
resultCount: 1,
pagedResultsCookie: null,
totalPagedResultsPolicy: 'NONE',
totalPagedResults: -1,
remainingPagedResults: -1,
};
export const MOCK_DEVICE_PROFILE_SUCCESS: GeneralResponse<ProfileDevice[]> = {
result: [
{
_id: 'ce0677ca57da8b38-5bfaa23e9a8ddc7899638da7cccbfe6a8879b6cf',
_rev: '755317638',
identifier: 'ce0677ca57da8b38-5bfaa23e9a8ddc7899638da7cccbfe6a8879b6cf',
metadata: {
platform: {
platform: 'Android',
version: 34,
device: 'emu64a',
deviceName: 'sdk_gphone64_arm64',
model: 'sdk_gphone64_arm64',
brand: 'google',
locale: 'en_US',
timeZone: 'America/Vancouver',
jailBreakScore: 0,
},
hardware: {
hardware: 'ranchu',
manufacturer: 'Google',
storage: 5939,
memory: 2981,
cpu: 4,
display: {
width: 1440,
height: 2678,
orientation: 1,
},
camera: {
numberOfCameras: 2,
},
},
browser: {
userAgent:
'Mozilla/5.0 (Linux; Android 14; sdk_gphone64_arm64 Build/UPB4.230623.005; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/128.0.6613.127 Mobile Safari/537.36',
},
bluetooth: {
supported: true,
},
network: {
connected: true,
},
telephony: {
networkCountryIso: 'us',
carrierName: 'T-Mobile',
},
},
lastSelectedDate: 1727110785783,
alias: 'test',
recoveryCodes: [],
},
],
resultCount: 1,
pagedResultsCookie: null,
totalPagedResultsPolicy: 'NONE',
totalPagedResults: -1,
remainingPagedResults: -1,
};