@atlasauth/cli 0.11.0 → 0.12.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/CHANGELOG.md +9 -0
- package/dist/args.d.ts +106 -0
- package/dist/args.js +38 -0
- package/dist/args.js.map +1 -1
- package/dist/commands/init.js +13 -8
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/migrate.d.ts +6 -2
- package/dist/commands/migrate.js +13 -3
- package/dist/commands/migrate.js.map +1 -1
- package/dist/help.d.ts +1 -1
- package/dist/help.js +38 -0
- package/dist/help.js.map +1 -1
- package/dist/migrate/auth0/plugin.d.ts +2 -0
- package/dist/migrate/auth0/plugin.js +126 -0
- package/dist/migrate/auth0/plugin.js.map +1 -0
- package/dist/migrate/clerk/plugin.d.ts +2 -0
- package/dist/migrate/clerk/plugin.js +76 -0
- package/dist/migrate/clerk/plugin.js.map +1 -0
- package/dist/migrate/descope/plugin.d.ts +2 -0
- package/dist/migrate/descope/plugin.js +83 -0
- package/dist/migrate/descope/plugin.js.map +1 -0
- package/dist/migrate/export/auth0-config.d.ts +29 -0
- package/dist/migrate/export/auth0-config.js +249 -0
- package/dist/migrate/export/auth0-config.js.map +1 -0
- package/dist/migrate/export/auth0.d.ts +62 -0
- package/dist/migrate/export/auth0.js +575 -0
- package/dist/migrate/export/auth0.js.map +1 -0
- package/dist/migrate/export/clerk-config.d.ts +26 -0
- package/dist/migrate/export/clerk-config.js +227 -0
- package/dist/migrate/export/clerk-config.js.map +1 -0
- package/dist/migrate/export/clerk.d.ts +46 -0
- package/dist/migrate/export/clerk.js +486 -0
- package/dist/migrate/export/clerk.js.map +1 -0
- package/dist/migrate/export/descope.d.ts +35 -0
- package/dist/migrate/export/descope.js +208 -0
- package/dist/migrate/export/descope.js.map +1 -0
- package/dist/migrate/export/fake-vendor.test-helper.d.ts +27 -0
- package/dist/migrate/export/fake-vendor.test-helper.js +41 -0
- package/dist/migrate/export/fake-vendor.test-helper.js.map +1 -0
- package/dist/migrate/export/frameworks/app-users.d.ts +42 -0
- package/dist/migrate/export/frameworks/app-users.js +161 -0
- package/dist/migrate/export/frameworks/app-users.js.map +1 -0
- package/dist/migrate/export/frameworks/authjs.d.ts +41 -0
- package/dist/migrate/export/frameworks/authjs.js +146 -0
- package/dist/migrate/export/frameworks/authjs.js.map +1 -0
- package/dist/migrate/export/frameworks/devise.d.ts +39 -0
- package/dist/migrate/export/frameworks/devise.js +218 -0
- package/dist/migrate/export/frameworks/devise.js.map +1 -0
- package/dist/migrate/export/frameworks/django.d.ts +45 -0
- package/dist/migrate/export/frameworks/django.js +315 -0
- package/dist/migrate/export/frameworks/django.js.map +1 -0
- package/dist/migrate/export/frameworks/lucia.d.ts +42 -0
- package/dist/migrate/export/frameworks/lucia.js +263 -0
- package/dist/migrate/export/frameworks/lucia.js.map +1 -0
- package/dist/migrate/export/frameworks/tables.d.ts +90 -0
- package/dist/migrate/export/frameworks/tables.js +325 -0
- package/dist/migrate/export/frameworks/tables.js.map +1 -0
- package/dist/migrate/export/frameworks/webauthn.d.ts +25 -0
- package/dist/migrate/export/frameworks/webauthn.js +130 -0
- package/dist/migrate/export/frameworks/webauthn.js.map +1 -0
- package/dist/migrate/export/kinde-descope-config.d.ts +38 -0
- package/dist/migrate/export/kinde-descope-config.js +172 -0
- package/dist/migrate/export/kinde-descope-config.js.map +1 -0
- package/dist/migrate/export/kinde.d.ts +57 -0
- package/dist/migrate/export/kinde.js +333 -0
- package/dist/migrate/export/kinde.js.map +1 -0
- package/dist/migrate/export/okta-config.d.ts +30 -0
- package/dist/migrate/export/okta-config.js +205 -0
- package/dist/migrate/export/okta-config.js.map +1 -0
- package/dist/migrate/export/okta.d.ts +43 -0
- package/dist/migrate/export/okta.js +337 -0
- package/dist/migrate/export/okta.js.map +1 -0
- package/dist/migrate/export/plugin-kit.d.ts +25 -0
- package/dist/migrate/export/plugin-kit.js +82 -0
- package/dist/migrate/export/plugin-kit.js.map +1 -0
- package/dist/migrate/export/record-set.d.ts +44 -0
- package/dist/migrate/export/record-set.js +98 -0
- package/dist/migrate/export/record-set.js.map +1 -0
- package/dist/migrate/export/translate-kit.d.ts +46 -0
- package/dist/migrate/export/translate-kit.js +148 -0
- package/dist/migrate/export/translate-kit.js.map +1 -0
- package/dist/migrate/export/vendor-http.d.ts +46 -0
- package/dist/migrate/export/vendor-http.js +138 -0
- package/dist/migrate/export/vendor-http.js.map +1 -0
- package/dist/migrate/export/zip.d.ts +8 -0
- package/dist/migrate/export/zip.js +66 -0
- package/dist/migrate/export/zip.js.map +1 -0
- package/dist/migrate/framework/builtins.d.ts +2 -0
- package/dist/migrate/framework/builtins.js +23 -0
- package/dist/migrate/framework/builtins.js.map +1 -0
- package/dist/migrate/framework/commands.d.ts +20 -0
- package/dist/migrate/framework/commands.js +58 -0
- package/dist/migrate/framework/commands.js.map +1 -0
- package/dist/migrate/framework/custom.d.ts +12 -0
- package/dist/migrate/framework/custom.js +96 -0
- package/dist/migrate/framework/custom.js.map +1 -0
- package/dist/migrate/framework/orchestrator.d.ts +113 -0
- package/dist/migrate/framework/orchestrator.js +531 -0
- package/dist/migrate/framework/orchestrator.js.map +1 -0
- package/dist/migrate/framework/plugin.d.ts +165 -0
- package/dist/migrate/framework/plugin.js +3 -0
- package/dist/migrate/framework/plugin.js.map +1 -0
- package/dist/migrate/framework/registry.d.ts +11 -0
- package/dist/migrate/framework/registry.js +44 -0
- package/dist/migrate/framework/registry.js.map +1 -0
- package/dist/migrate/framework/report.d.ts +17 -0
- package/dist/migrate/framework/report.js +103 -0
- package/dist/migrate/framework/report.js.map +1 -0
- package/dist/migrate/frameworks/plugins.d.ts +29 -0
- package/dist/migrate/frameworks/plugins.js +402 -0
- package/dist/migrate/frameworks/plugins.js.map +1 -0
- package/dist/migrate/frameworks/report.d.ts +92 -0
- package/dist/migrate/frameworks/report.js +207 -0
- package/dist/migrate/frameworks/report.js.map +1 -0
- package/dist/migrate/frameworks/translate-js.d.ts +5 -0
- package/dist/migrate/frameworks/translate-js.js +503 -0
- package/dist/migrate/frameworks/translate-js.js.map +1 -0
- package/dist/migrate/frameworks/translate-rails-django.d.ts +3 -0
- package/dist/migrate/frameworks/translate-rails-django.js +1391 -0
- package/dist/migrate/frameworks/translate-rails-django.js.map +1 -0
- package/dist/migrate/kinde/plugin.d.ts +2 -0
- package/dist/migrate/kinde/plugin.js +105 -0
- package/dist/migrate/kinde/plugin.js.map +1 -0
- package/dist/migrate/okta/plugin.d.ts +2 -0
- package/dist/migrate/okta/plugin.js +105 -0
- package/dist/migrate/okta/plugin.js.map +1 -0
- package/package.json +5 -4
|
@@ -0,0 +1,337 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.exportOkta = exportOkta;
|
|
4
|
+
exports.mapOktaUser = mapOktaUser;
|
|
5
|
+
const record_set_1 = require("./record-set");
|
|
6
|
+
const vendor_http_1 = require("./vendor-http");
|
|
7
|
+
/** Profile attributes the user record carries itself; the rest are custom. */
|
|
8
|
+
const BASE_PROFILE = new Set([
|
|
9
|
+
'login',
|
|
10
|
+
'email',
|
|
11
|
+
'secondEmail',
|
|
12
|
+
'firstName',
|
|
13
|
+
'lastName',
|
|
14
|
+
'displayName',
|
|
15
|
+
'nickName',
|
|
16
|
+
'mobilePhone',
|
|
17
|
+
'primaryPhone',
|
|
18
|
+
'profileUrl',
|
|
19
|
+
]);
|
|
20
|
+
/** Okta social IdP types → the provider name an identity record carries. */
|
|
21
|
+
const SOCIAL = {
|
|
22
|
+
GOOGLE: 'google',
|
|
23
|
+
FACEBOOK: 'facebook',
|
|
24
|
+
MICROSOFT: 'microsoft',
|
|
25
|
+
APPLE: 'apple',
|
|
26
|
+
LINKEDIN: 'linkedin',
|
|
27
|
+
GITHUB: 'github',
|
|
28
|
+
GITLAB: 'gitlab',
|
|
29
|
+
AMAZON: 'amazon',
|
|
30
|
+
DISCORD: 'discord',
|
|
31
|
+
PAYPAL: 'paypal',
|
|
32
|
+
SALESFORCE: 'salesforce',
|
|
33
|
+
SPOTIFY: 'spotify',
|
|
34
|
+
XERO: 'xero',
|
|
35
|
+
YAHOO: 'yahoo',
|
|
36
|
+
};
|
|
37
|
+
async function exportOkta(opts) {
|
|
38
|
+
const set = new record_set_1.RecordSet();
|
|
39
|
+
const domain = opts.domain.replace(/^https?:\/\//, '').replace(/\/+$/, '');
|
|
40
|
+
if (!/^[a-z0-9.-]+$/i.test(domain))
|
|
41
|
+
throw new Error(`Not an Okta domain: ${opts.domain}`);
|
|
42
|
+
if (!opts.apiToken && !opts.accessToken)
|
|
43
|
+
throw new Error('Okta export needs an API token (OKTA_API_TOKEN) or an OAuth access token for the management API.');
|
|
44
|
+
const progress = opts.onProgress ?? (() => undefined);
|
|
45
|
+
const http = new vendor_http_1.VendorHttp({
|
|
46
|
+
vendor: 'Okta',
|
|
47
|
+
baseUrl: `https://${domain}/api/v1`,
|
|
48
|
+
headers: { authorization: opts.apiToken ? `SSWS ${opts.apiToken}` : `Bearer ${opts.accessToken}` },
|
|
49
|
+
fetchImpl: opts.fetchImpl,
|
|
50
|
+
sleep: opts.sleep,
|
|
51
|
+
});
|
|
52
|
+
const groupsAs = opts.groupsAs ?? 'roles';
|
|
53
|
+
progress('groups');
|
|
54
|
+
const groups = groupsAs === 'skip' ? [] : (await linkAll(http, '/groups?limit=200')).filter((g) => (0, record_set_1.str)(g.type) !== 'BUILT_IN');
|
|
55
|
+
const groupKey = new Map();
|
|
56
|
+
const keysUsed = new Set();
|
|
57
|
+
for (const g of groups) {
|
|
58
|
+
const id = (0, record_set_1.str)(g.id);
|
|
59
|
+
const name = (0, record_set_1.str)((0, record_set_1.isObj)(g.profile) ? g.profile.name : undefined);
|
|
60
|
+
if (!id || !name)
|
|
61
|
+
continue;
|
|
62
|
+
let key = slug(name);
|
|
63
|
+
while (keysUsed.has(key))
|
|
64
|
+
key = `${key}_${id.slice(-4).toLowerCase()}`;
|
|
65
|
+
keysUsed.add(key);
|
|
66
|
+
groupKey.set(id, key);
|
|
67
|
+
const description = (0, record_set_1.str)((0, record_set_1.isObj)(g.profile) ? g.profile.description : undefined);
|
|
68
|
+
if (groupsAs === 'organizations') {
|
|
69
|
+
set.add('organization', (0, record_set_1.compact)({ id, name, slug: key.replace(/_/g, '-'), public_metadata: description ? { description } : undefined, created_at: (0, record_set_1.str)(g.created) }));
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
set.add('role', (0, record_set_1.compact)({ key, name, description, scope: 'app' }));
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
if (groupsAs === 'organizations') {
|
|
76
|
+
set.add('role', { key: 'member', name: 'Member', scope: 'organization' });
|
|
77
|
+
}
|
|
78
|
+
progress('users');
|
|
79
|
+
const users = await linkAll(http, '/users?limit=200');
|
|
80
|
+
const userIds = new Set();
|
|
81
|
+
for (const u of users) {
|
|
82
|
+
const user = mapOktaUser(u);
|
|
83
|
+
if (!user) {
|
|
84
|
+
set.omit('user', 'no email, phone number or login');
|
|
85
|
+
continue;
|
|
86
|
+
}
|
|
87
|
+
userIds.add(user.id);
|
|
88
|
+
set.add('user', user);
|
|
89
|
+
}
|
|
90
|
+
if (userIds.size) {
|
|
91
|
+
set.warn('Okta never exports password hashes. Turn on the okta lazy-migration preset: each password is checked against Okta on its first sign-in in Atlas, then stored as Argon2id.');
|
|
92
|
+
}
|
|
93
|
+
// Group memberships: roles on the user, or organization memberships.
|
|
94
|
+
if (groups.length) {
|
|
95
|
+
progress('group members');
|
|
96
|
+
const rolesOf = new Map();
|
|
97
|
+
for (const g of groups) {
|
|
98
|
+
const id = (0, record_set_1.str)(g.id);
|
|
99
|
+
const key = id ? groupKey.get(id) : undefined;
|
|
100
|
+
if (!id || !key)
|
|
101
|
+
continue;
|
|
102
|
+
for (const m of await linkAll(http, `/groups/${id}/users?limit=1000`)) {
|
|
103
|
+
const uid = (0, record_set_1.str)(m.id);
|
|
104
|
+
if (!uid || !userIds.has(uid))
|
|
105
|
+
continue;
|
|
106
|
+
if (groupsAs === 'organizations')
|
|
107
|
+
set.add('membership', { organization_id: id, user_id: uid, role: 'member' }, `${id}:${uid}`);
|
|
108
|
+
else
|
|
109
|
+
rolesOf.set(uid, [...(rolesOf.get(uid) ?? []), key]);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
for (const user of set.list('user')) {
|
|
113
|
+
const roles = rolesOf.get(user.id);
|
|
114
|
+
if (roles?.length)
|
|
115
|
+
user.roles = roles;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
progress('identity providers');
|
|
119
|
+
await addIdps(set, http, userIds, domain);
|
|
120
|
+
if (opts.factors) {
|
|
121
|
+
progress('factors');
|
|
122
|
+
for (const id of userIds)
|
|
123
|
+
await addFactors(set, http, id);
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
set.warn('Second factors were not read (pass --factors to carry SMS / voice / email factors). TOTP seeds and Okta Verify never leave Okta.');
|
|
127
|
+
}
|
|
128
|
+
progress('signing keys');
|
|
129
|
+
const server = opts.authorizationServerId ?? 'default';
|
|
130
|
+
try {
|
|
131
|
+
const { body } = await http.get(`https://${domain}/oauth2/${server}/v1/keys`);
|
|
132
|
+
for (const k of (0, record_set_1.objs)(body?.keys))
|
|
133
|
+
if ((0, record_set_1.str)(k.kid))
|
|
134
|
+
set.add('jwks', { kid: (0, record_set_1.str)(k.kid), jwk: k });
|
|
135
|
+
}
|
|
136
|
+
catch (err) {
|
|
137
|
+
if (!(err instanceof vendor_http_1.VendorApiError))
|
|
138
|
+
throw err;
|
|
139
|
+
set.warn(`The ${server} authorization server's keys could not be read; the bridge preset fetches them live.`);
|
|
140
|
+
}
|
|
141
|
+
set.manifest = {
|
|
142
|
+
origin: domain,
|
|
143
|
+
providers: [...new Set(set.list('identity').map((i) => i.provider))].sort(),
|
|
144
|
+
settings: { groups_as: groupsAs, authorization_server: server },
|
|
145
|
+
};
|
|
146
|
+
return set;
|
|
147
|
+
}
|
|
148
|
+
/** One Okta user → a user record (null when it has nothing to sign in with). */
|
|
149
|
+
function mapOktaUser(u) {
|
|
150
|
+
const id = (0, record_set_1.str)(u.id);
|
|
151
|
+
const status = (0, record_set_1.str)(u.status);
|
|
152
|
+
if (!id || status === 'DEPROVISIONED')
|
|
153
|
+
return null;
|
|
154
|
+
const p = (0, record_set_1.isObj)(u.profile) ? u.profile : {};
|
|
155
|
+
const credentials = (0, record_set_1.isObj)(u.credentials) ? u.credentials : {};
|
|
156
|
+
// Okta reports verified addresses under credentials.emails when it has them;
|
|
157
|
+
// otherwise an ACTIVE user has proven the primary address during activation.
|
|
158
|
+
const credEmails = (0, record_set_1.objs)(credentials.emails);
|
|
159
|
+
const verifiedSet = new Set(credEmails.filter((e) => (0, record_set_1.str)(e.status) === 'VERIFIED').map((e) => (0, record_set_1.str)(e.value)?.toLowerCase()));
|
|
160
|
+
const activated = status !== 'STAGED' && status !== 'PROVISIONED';
|
|
161
|
+
const primary = (0, record_set_1.str)(p.email)?.toLowerCase();
|
|
162
|
+
const second = (0, record_set_1.str)(p.secondEmail)?.toLowerCase();
|
|
163
|
+
const emails = [
|
|
164
|
+
...(primary ? [{ email: primary, verified: credEmails.length ? verifiedSet.has(primary) : activated, primary: true }] : []),
|
|
165
|
+
...(second && second !== primary ? [{ email: second, verified: verifiedSet.has(second), primary: false }] : []),
|
|
166
|
+
];
|
|
167
|
+
const phones = [...new Set([(0, record_set_1.e164)(p.mobilePhone), (0, record_set_1.e164)(p.primaryPhone)].filter((x) => !!x))].map((phone, i) => ({
|
|
168
|
+
phone,
|
|
169
|
+
verified: false,
|
|
170
|
+
primary: !emails.length && i === 0,
|
|
171
|
+
}));
|
|
172
|
+
const login = (0, record_set_1.str)(p.login);
|
|
173
|
+
const custom = Object.fromEntries(Object.entries(p).filter(([k, v]) => !BASE_PROFILE.has(k) && v !== null && v !== undefined && v !== ''));
|
|
174
|
+
const user = (0, record_set_1.compact)({
|
|
175
|
+
id,
|
|
176
|
+
emails,
|
|
177
|
+
phones,
|
|
178
|
+
// The Okta login is often the email; keep it as the username only when it is not.
|
|
179
|
+
username: login && login.toLowerCase() !== primary ? login : undefined,
|
|
180
|
+
first_name: (0, record_set_1.str)(p.firstName),
|
|
181
|
+
last_name: (0, record_set_1.str)(p.lastName),
|
|
182
|
+
name: !(0, record_set_1.str)(p.firstName) && !(0, record_set_1.str)(p.lastName) ? (0, record_set_1.str)(p.displayName) : undefined,
|
|
183
|
+
banned: status === 'SUSPENDED' ? true : undefined,
|
|
184
|
+
ban_reason: status === 'SUSPENDED' ? 'Suspended in Okta' : undefined,
|
|
185
|
+
locked: status === 'LOCKED_OUT' ? true : undefined,
|
|
186
|
+
private_metadata: (0, record_set_1.bag)({ ...custom, ...(status && status !== 'ACTIVE' ? { okta_status: status } : {}) }),
|
|
187
|
+
created_at: (0, record_set_1.str)(u.created),
|
|
188
|
+
last_sign_in_at: (0, record_set_1.str)(u.lastLogin),
|
|
189
|
+
});
|
|
190
|
+
return user.emails?.length || user.phones?.length || user.username ? user : null;
|
|
191
|
+
}
|
|
192
|
+
async function addIdps(set, http, userIds, domain) {
|
|
193
|
+
let idps;
|
|
194
|
+
try {
|
|
195
|
+
idps = await linkAll(http, '/idps?limit=200');
|
|
196
|
+
}
|
|
197
|
+
catch (err) {
|
|
198
|
+
if (err instanceof vendor_http_1.VendorApiError && (err.status === 403 || err.status === 401)) {
|
|
199
|
+
set.warn('Identity providers were not readable with this token (okta.idps.read): social links and SAML/OIDC connections were skipped.');
|
|
200
|
+
return;
|
|
201
|
+
}
|
|
202
|
+
throw err;
|
|
203
|
+
}
|
|
204
|
+
for (const idp of idps) {
|
|
205
|
+
const id = (0, record_set_1.str)(idp.id);
|
|
206
|
+
const type = (0, record_set_1.str)(idp.type);
|
|
207
|
+
if (!id || !type || (0, record_set_1.str)(idp.status) === 'INACTIVE')
|
|
208
|
+
continue;
|
|
209
|
+
const name = (0, record_set_1.str)(idp.name) ?? type;
|
|
210
|
+
let provider;
|
|
211
|
+
let kind;
|
|
212
|
+
let connectionId;
|
|
213
|
+
if (SOCIAL[type]) {
|
|
214
|
+
provider = SOCIAL[type];
|
|
215
|
+
kind = 'oauth';
|
|
216
|
+
}
|
|
217
|
+
else if (type === 'SAML2' || type === 'OIDC') {
|
|
218
|
+
connectionId = await addEnterpriseIdp(set, http, idp, domain);
|
|
219
|
+
if (!connectionId)
|
|
220
|
+
continue;
|
|
221
|
+
provider = name;
|
|
222
|
+
kind = type === 'SAML2' ? 'saml' : 'oidc';
|
|
223
|
+
}
|
|
224
|
+
else {
|
|
225
|
+
set.warn(`Identity provider ${name} (${type}) has no Atlas counterpart and was skipped.`);
|
|
226
|
+
continue;
|
|
227
|
+
}
|
|
228
|
+
for (const link of await linkAll(http, `/idps/${id}/users?limit=200`)) {
|
|
229
|
+
const uid = (0, record_set_1.str)(link.id);
|
|
230
|
+
const external = (0, record_set_1.str)(link.externalId);
|
|
231
|
+
if (!uid || !external || !userIds.has(uid))
|
|
232
|
+
continue;
|
|
233
|
+
set.add('identity', (0, record_set_1.compact)({ user_id: uid, provider, provider_user_id: external, kind, sso_connection_id: connectionId, profile: (0, record_set_1.bag)(link.profile) }));
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
async function addEnterpriseIdp(set, http, idp, domain) {
|
|
238
|
+
const id = (0, record_set_1.str)(idp.id);
|
|
239
|
+
const name = (0, record_set_1.str)(idp.name) ?? id;
|
|
240
|
+
const protocol = (0, record_set_1.isObj)(idp.protocol) ? idp.protocol : {};
|
|
241
|
+
const endpoints = (0, record_set_1.isObj)(protocol.endpoints) ? protocol.endpoints : {};
|
|
242
|
+
const credentials = (0, record_set_1.isObj)(protocol.credentials) ? protocol.credentials : {};
|
|
243
|
+
// Okta routes users to an IdP by routing rules, not by a domain on the IdP:
|
|
244
|
+
// the Atlas connection's domains are set after the import.
|
|
245
|
+
const domains = [];
|
|
246
|
+
if ((0, record_set_1.str)(idp.type) === 'SAML2') {
|
|
247
|
+
const trust = (0, record_set_1.isObj)(credentials.trust) ? credentials.trust : {};
|
|
248
|
+
const kid = (0, record_set_1.str)(trust.kid);
|
|
249
|
+
let cert;
|
|
250
|
+
if (kid) {
|
|
251
|
+
try {
|
|
252
|
+
const { body } = await http.get(`/idps/credentials/keys/${kid}`);
|
|
253
|
+
const x5c = Array.isArray(body?.x5c) ? (0, record_set_1.str)(body.x5c[0]) : undefined;
|
|
254
|
+
if (x5c)
|
|
255
|
+
cert = `-----BEGIN CERTIFICATE-----\n${x5c.match(/.{1,64}/g).join('\n')}\n-----END CERTIFICATE-----`;
|
|
256
|
+
}
|
|
257
|
+
catch (err) {
|
|
258
|
+
if (!(err instanceof vendor_http_1.VendorApiError))
|
|
259
|
+
throw err;
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
const sso = (0, record_set_1.isObj)(endpoints.sso) ? endpoints.sso : {};
|
|
263
|
+
const acs = (0, record_set_1.isObj)(endpoints.acs) ? endpoints.acs : {};
|
|
264
|
+
set.add('sso_connection', (0, record_set_1.compact)({
|
|
265
|
+
id,
|
|
266
|
+
name,
|
|
267
|
+
protocol: 'saml',
|
|
268
|
+
domains,
|
|
269
|
+
enabled: (0, record_set_1.str)(idp.status) !== 'INACTIVE',
|
|
270
|
+
saml: (0, record_set_1.compact)({
|
|
271
|
+
idp_entity_id: (0, record_set_1.str)(trust.issuer),
|
|
272
|
+
idp_sso_url: (0, record_set_1.str)(sso.url),
|
|
273
|
+
idp_certificate: cert,
|
|
274
|
+
sp_entity_id: (0, record_set_1.str)(trust.audience),
|
|
275
|
+
sp_acs_url: (0, record_set_1.str)(acs.url) ?? `https://${domain}/sso/saml2/${id}`,
|
|
276
|
+
}),
|
|
277
|
+
}));
|
|
278
|
+
if (!cert)
|
|
279
|
+
set.warn(`SAML identity provider ${name}: its signing certificate could not be read; add it in Atlas.`);
|
|
280
|
+
return id;
|
|
281
|
+
}
|
|
282
|
+
const issuer = (0, record_set_1.isObj)(protocol.issuer) ? (0, record_set_1.str)(protocol.issuer.url) : undefined;
|
|
283
|
+
const client = (0, record_set_1.isObj)(credentials.client) ? credentials.client : {};
|
|
284
|
+
set.add('sso_connection', (0, record_set_1.compact)({
|
|
285
|
+
id,
|
|
286
|
+
name,
|
|
287
|
+
protocol: 'oidc',
|
|
288
|
+
domains,
|
|
289
|
+
enabled: (0, record_set_1.str)(idp.status) !== 'INACTIVE',
|
|
290
|
+
oidc: (0, record_set_1.compact)({ issuer, client_id: (0, record_set_1.str)(client.client_id), scopes: Array.isArray(protocol.scopes) ? protocol.scopes.map(String) : undefined }),
|
|
291
|
+
}));
|
|
292
|
+
set.warn(`OIDC identity provider ${name}: Okta does not return its client secret; enter it in Atlas after the import.`);
|
|
293
|
+
return id;
|
|
294
|
+
}
|
|
295
|
+
async function addFactors(set, http, userId) {
|
|
296
|
+
let factors;
|
|
297
|
+
try {
|
|
298
|
+
factors = (0, record_set_1.objs)((await http.get(`/users/${userId}/factors`)).body);
|
|
299
|
+
}
|
|
300
|
+
catch (err) {
|
|
301
|
+
if (err instanceof vendor_http_1.VendorApiError && (err.status === 403 || err.status === 404))
|
|
302
|
+
return;
|
|
303
|
+
throw err;
|
|
304
|
+
}
|
|
305
|
+
for (const f of factors) {
|
|
306
|
+
if ((0, record_set_1.str)(f.status) !== 'ACTIVE')
|
|
307
|
+
continue;
|
|
308
|
+
const type = (0, record_set_1.str)(f.factorType);
|
|
309
|
+
const profile = (0, record_set_1.isObj)(f.profile) ? f.profile : {};
|
|
310
|
+
if (type === 'sms' || type === 'call') {
|
|
311
|
+
const phone = (0, record_set_1.e164)(profile.phoneNumber);
|
|
312
|
+
if (phone)
|
|
313
|
+
set.add('mfa_factor', { user_id: userId, type: 'phone', phone, verified: true, created_at: (0, record_set_1.str)(f.created) }, `phone:${userId}:${phone}`);
|
|
314
|
+
}
|
|
315
|
+
else if (type === 'email') {
|
|
316
|
+
set.add('mfa_factor', { user_id: userId, type: 'email', verified: true, created_at: (0, record_set_1.str)(f.created) }, `email:${userId}`);
|
|
317
|
+
}
|
|
318
|
+
else if (type) {
|
|
319
|
+
set.omit('mfa_factor', `Okta does not export ${type} secrets; re-enrol in Atlas`);
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
/** Follow `Link: <…>; rel="next"` until the last page. */
|
|
324
|
+
async function linkAll(http, path) {
|
|
325
|
+
const out = [];
|
|
326
|
+
let next = path;
|
|
327
|
+
while (next) {
|
|
328
|
+
const res = await http.get(next);
|
|
329
|
+
out.push(...(0, record_set_1.objs)(res.body));
|
|
330
|
+
next = (0, vendor_http_1.nextLink)(res.headers.get('link'));
|
|
331
|
+
}
|
|
332
|
+
return out;
|
|
333
|
+
}
|
|
334
|
+
function slug(name) {
|
|
335
|
+
return name.trim().toLowerCase().replace(/[^a-z0-9]+/g, '_').replace(/^_+|_+$/g, '') || 'group';
|
|
336
|
+
}
|
|
337
|
+
//# sourceMappingURL=okta.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"okta.js","sourceRoot":"","sources":["../../../src/migrate/export/okta.ts"],"names":[],"mappings":";;AA4EA,gCAuGC;AAGD,kCAyCC;AA9ND,6CAAyF;AACzF,+CAAqE;AA0CrE,8EAA8E;AAC9E,MAAM,YAAY,GAAG,IAAI,GAAG,CAAC;IAC3B,OAAO;IACP,OAAO;IACP,aAAa;IACb,WAAW;IACX,UAAU;IACV,aAAa;IACb,UAAU;IACV,aAAa;IACb,cAAc;IACd,YAAY;CACb,CAAC,CAAC;AAEH,4EAA4E;AAC5E,MAAM,MAAM,GAA2B;IACrC,MAAM,EAAE,QAAQ;IAChB,QAAQ,EAAE,UAAU;IACpB,SAAS,EAAE,WAAW;IACtB,KAAK,EAAE,OAAO;IACd,QAAQ,EAAE,UAAU;IACpB,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE,QAAQ;IAChB,OAAO,EAAE,SAAS;IAClB,MAAM,EAAE,QAAQ;IAChB,UAAU,EAAE,YAAY;IACx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A,gBAAG,EAAC,CAAC,CAAC,OAAO,CAAC,EAAE,EAAE,SAAS,MAAM,EAAE,CAAC,CAAC;QAC3H,CAAC;aAAM,IAAI,IAAI,EAAE,CAAC;YAChB,GAAG,CAAC,IAAI,CAAC,YAAY,EAAE,wBAAwB,IAAI,6BAA6B,CAAC,CAAC;QACpF,CAAC;IACH,CAAC;AACH,CAAC;AAED,0DAA0D;AAC1D,KAAK,UAAU,OAAO,CAAC,IAAgB,EAAE,IAAY;IACnD,MAAM,GAAG,GAAU,EAAE,CAAC;IACtB,IAAI,IAAI,GAAkB,IAAI,CAAC;IAC/B,OAAO,IAAI,EAAE,CAAC;QACZ,MAAM,GAAG,GAAwC,MAAM,IAAI,CAAC,GAAG,CAAU,IAAI,CAAC,CAAC;QAC/E,GAAG,CAAC,IAAI,CAAC,GAAG,IAAA,iBAAI,EAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;QAC5B,IAAI,GAAG,IAAA,sBAAQ,EAAC,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC;IAC3C,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED,SAAS,IAAI,CAAC,IAAY;IACxB,OAAO,IAAI,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,aAAa,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,IAAI,OAAO,CAAC;AAClG,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { MigrationBundleWriter } from '@atlasauth/migrate';
|
|
2
|
+
import type { CredentialSpec, ExportCursor, PluginContext } from '../framework/plugin';
|
|
3
|
+
import type { RecordSet } from './record-set';
|
|
4
|
+
/**
|
|
5
|
+
* Write a vendor export through the sealed-bundle writer: the manifest fields
|
|
6
|
+
* and warnings the exporter learned, what it had to leave out, then every
|
|
7
|
+
* record in canonical order. On `--resume` the vendor is read again and the
|
|
8
|
+
* records an earlier segment already holds are skipped (vendor listings are
|
|
9
|
+
* returned in a stable order).
|
|
10
|
+
*/
|
|
11
|
+
export declare function writeRecordSet(set: RecordSet, writer: MigrationBundleWriter, resume: {
|
|
12
|
+
cursor: ExportCursor | null;
|
|
13
|
+
checkpoint(cursor: ExportCursor): void;
|
|
14
|
+
}, say: (line: string) => void): Promise<void>;
|
|
15
|
+
/** A credential, or a CliError naming every way to pass it. */
|
|
16
|
+
export declare function need(p: PluginContext, spec: CredentialSpec): string;
|
|
17
|
+
/** A boolean flag (`--factors`). */
|
|
18
|
+
export declare function flag(p: PluginContext, name: string): boolean;
|
|
19
|
+
/** A local file named by a credential spec (flag or env var), as text or bytes; undefined when not given. */
|
|
20
|
+
export declare function localFile(p: PluginContext, spec: CredentialSpec, as: 'text'): string | undefined;
|
|
21
|
+
export declare function localFile(p: PluginContext, spec: CredentialSpec, as: 'bytes'): Buffer | undefined;
|
|
22
|
+
/** A vendor host (`acme.us.auth0.com`) from a host or URL. */
|
|
23
|
+
export declare function hostOf(raw: string): string;
|
|
24
|
+
/** Vendor errors become CLI errors with the vendor's own words (never a stack). */
|
|
25
|
+
export declare function vendorStep<T>(label: string, fn: () => Promise<T>): Promise<T>;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.writeRecordSet = writeRecordSet;
|
|
4
|
+
exports.need = need;
|
|
5
|
+
exports.flag = flag;
|
|
6
|
+
exports.localFile = localFile;
|
|
7
|
+
exports.hostOf = hostOf;
|
|
8
|
+
exports.vendorStep = vendorStep;
|
|
9
|
+
const node_fs_1 = require("node:fs");
|
|
10
|
+
const node_path_1 = require("node:path");
|
|
11
|
+
const errors_1 = require("../../errors");
|
|
12
|
+
/**
|
|
13
|
+
* What every vendor plugin shares: replaying an exporter's {@link RecordSet}
|
|
14
|
+
* through the framework's bundle writer, and reading the owner's local files
|
|
15
|
+
* and flags.
|
|
16
|
+
*/
|
|
17
|
+
/** Records between two export checkpoints. */
|
|
18
|
+
const CHECKPOINT_EVERY = 1000;
|
|
19
|
+
/**
|
|
20
|
+
* Write a vendor export through the sealed-bundle writer: the manifest fields
|
|
21
|
+
* and warnings the exporter learned, what it had to leave out, then every
|
|
22
|
+
* record in canonical order. On `--resume` the vendor is read again and the
|
|
23
|
+
* records an earlier segment already holds are skipped (vendor listings are
|
|
24
|
+
* returned in a stable order).
|
|
25
|
+
*/
|
|
26
|
+
async function writeRecordSet(set, writer, resume, say) {
|
|
27
|
+
const start = typeof resume.cursor === 'number' ? resume.cursor : 0;
|
|
28
|
+
writer.describe(set.manifest);
|
|
29
|
+
for (const w of set.warnings)
|
|
30
|
+
writer.warn(w);
|
|
31
|
+
if (!start)
|
|
32
|
+
for (const [model, o] of Object.entries(set.omitted))
|
|
33
|
+
writer.omit(model, o.reason, o.count);
|
|
34
|
+
if (start)
|
|
35
|
+
say(` resuming after record ${start}`);
|
|
36
|
+
let i = 0;
|
|
37
|
+
for (const r of set.ordered()) {
|
|
38
|
+
i++;
|
|
39
|
+
if (i <= start)
|
|
40
|
+
continue;
|
|
41
|
+
const issues = await writer.add(r.model, r.data);
|
|
42
|
+
if (issues.length)
|
|
43
|
+
say(` left out ${r.model} #${i}: ${issues[0].message}`);
|
|
44
|
+
if (i % CHECKPOINT_EVERY === 0)
|
|
45
|
+
resume.checkpoint(i);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
/** A credential, or a CliError naming every way to pass it. */
|
|
49
|
+
function need(p, spec) {
|
|
50
|
+
return p.credential({ ...spec, required: true });
|
|
51
|
+
}
|
|
52
|
+
/** A boolean flag (`--factors`). */
|
|
53
|
+
function flag(p, name) {
|
|
54
|
+
return p.args.values[name] === true;
|
|
55
|
+
}
|
|
56
|
+
function localFile(p, spec, as) {
|
|
57
|
+
const path = p.credential({ ...spec, required: false });
|
|
58
|
+
if (!path)
|
|
59
|
+
return undefined;
|
|
60
|
+
try {
|
|
61
|
+
return as === 'text' ? p.ctx.readFile((0, node_path_1.resolve)(path)) : (0, node_fs_1.readFileSync)((0, node_path_1.resolve)(path));
|
|
62
|
+
}
|
|
63
|
+
catch (err) {
|
|
64
|
+
throw new errors_1.CliError(`Could not read ${spec.label} at ${path}: ${err.message}`);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
/** A vendor host (`acme.us.auth0.com`) from a host or URL. */
|
|
68
|
+
function hostOf(raw) {
|
|
69
|
+
return raw.trim().replace(/^https?:\/\//, '').replace(/[/?#].*$/, '');
|
|
70
|
+
}
|
|
71
|
+
/** Vendor errors become CLI errors with the vendor's own words (never a stack). */
|
|
72
|
+
async function vendorStep(label, fn) {
|
|
73
|
+
try {
|
|
74
|
+
return await fn();
|
|
75
|
+
}
|
|
76
|
+
catch (err) {
|
|
77
|
+
if (err instanceof errors_1.CliError)
|
|
78
|
+
throw err;
|
|
79
|
+
throw new errors_1.CliError(`${label}: ${err.message}`);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
//# sourceMappingURL=plugin-kit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-kit.js","sourceRoot":"","sources":["../../../src/migrate/export/plugin-kit.ts"],"names":[],"mappings":";;AAuBA,wCAmBC;AAGD,oBAEC;AAGD,oBAEC;AAKD,8BAQC;AAGD,wBAEC;AAGD,gCAOC;AAhFD,qCAAuC;AACvC,yCAAoC;AAEpC,yCAAwC;AAIxC;;;;GAIG;AAEH,8CAA8C;AAC9C,MAAM,gBAAgB,GAAG,IAAI,CAAC;AAE9B;;;;;;GAMG;AACI,KAAK,UAAU,cAAc,CAClC,GAAc,EACd,MAA6B,EAC7B,MAA+E,EAC/E,GAA2B;IAE3B,MAAM,KAAK,GAAG,OAAO,MAAM,CAAC,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;IACpE,MAAM,CAAC,QAAQ,CAAC,GAAG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ecordData, type MigrationManifest } from '@atlasauth/migrate';
|
|
2
|
+
/**
|
|
3
|
+
* What a vendor exporter gathered, grouped by canonical model. A vendor API
|
|
4
|
+
* hands data back in ITS order (users carry their identities, organizations
|
|
5
|
+
* their members); the bundle needs canonical order, so exporters collect here
|
|
6
|
+
* and the writer replays {@link RecordSet.ordered}.
|
|
7
|
+
*/
|
|
8
|
+
export declare class RecordSet {
|
|
9
|
+
private readonly rows;
|
|
10
|
+
private readonly seen;
|
|
11
|
+
readonly warnings: string[];
|
|
12
|
+
readonly omitted: Record<string, {
|
|
13
|
+
count: number;
|
|
14
|
+
reason: string;
|
|
15
|
+
}>;
|
|
16
|
+
/** Manifest fields the exporter learned (origin, providers, settings, rpId). */
|
|
17
|
+
manifest: Partial<Pick<MigrationManifest, 'origin' | 'sourceVersion' | 'rpId' | 'providers' | 'settings'>>;
|
|
18
|
+
/**
|
|
19
|
+
* Add a row. With `key`, a second row with the same key is dropped (a member
|
|
20
|
+
* reached through two listings, a role seen on two organizations).
|
|
21
|
+
*/
|
|
22
|
+
add<M extends CanonicalModel>(model: M, data: CanonicalRecordData[M], key?: string): void;
|
|
23
|
+
warn(message: string): void;
|
|
24
|
+
omit(model: string, reason: string, count?: number): void;
|
|
25
|
+
count(model: CanonicalModel): number;
|
|
26
|
+
list<M extends CanonicalModel>(model: M): Array<CanonicalRecordData[M]>;
|
|
27
|
+
/** Every row, in the order the bundle writer requires. */
|
|
28
|
+
ordered(): Generator<{
|
|
29
|
+
model: CanonicalModel;
|
|
30
|
+
data: unknown;
|
|
31
|
+
}>;
|
|
32
|
+
counts(): Record<string, number>;
|
|
33
|
+
}
|
|
34
|
+
export type Obj = Record<string, unknown>;
|
|
35
|
+
export declare const isObj: (v: unknown) => v is Obj;
|
|
36
|
+
export declare const str: (v: unknown) => string | undefined;
|
|
37
|
+
export declare const objs: (v: unknown) => Obj[];
|
|
38
|
+
export declare const strs: (v: unknown) => string[];
|
|
39
|
+
/** A metadata bag, only when it has keys. */
|
|
40
|
+
export declare const bag: (v: unknown) => Obj | undefined;
|
|
41
|
+
/** E.164 or nothing: vendors store numbers with spaces/dashes; anything else is dropped. */
|
|
42
|
+
export declare function e164(raw: unknown): string | undefined;
|
|
43
|
+
/** Drop undefined fields so a record carries only what the vendor had. */
|
|
44
|
+
export declare function compact<T extends object>(o: T): T;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.bag = exports.strs = exports.objs = exports.str = exports.isObj = exports.RecordSet = void 0;
|
|
4
|
+
exports.e164 = e164;
|
|
5
|
+
exports.compact = compact;
|
|
6
|
+
const migrate_1 = require("@atlasauth/migrate");
|
|
7
|
+
/**
|
|
8
|
+
* What a vendor exporter gathered, grouped by canonical model. A vendor API
|
|
9
|
+
* hands data back in ITS order (users carry their identities, organizations
|
|
10
|
+
* their members); the bundle needs canonical order, so exporters collect here
|
|
11
|
+
* and the writer replays {@link RecordSet.ordered}.
|
|
12
|
+
*/
|
|
13
|
+
class RecordSet {
|
|
14
|
+
rows = new Map();
|
|
15
|
+
seen = new Map();
|
|
16
|
+
warnings = [];
|
|
17
|
+
omitted = {};
|
|
18
|
+
/** Manifest fields the exporter learned (origin, providers, settings, rpId). */
|
|
19
|
+
manifest = {};
|
|
20
|
+
/**
|
|
21
|
+
* Add a row. With `key`, a second row with the same key is dropped (a member
|
|
22
|
+
* reached through two listings, a role seen on two organizations).
|
|
23
|
+
*/
|
|
24
|
+
add(model, data, key) {
|
|
25
|
+
if (key !== undefined) {
|
|
26
|
+
const keys = this.seen.get(model) ?? new Set();
|
|
27
|
+
if (keys.has(key))
|
|
28
|
+
return;
|
|
29
|
+
keys.add(key);
|
|
30
|
+
this.seen.set(model, keys);
|
|
31
|
+
}
|
|
32
|
+
const list = this.rows.get(model) ?? [];
|
|
33
|
+
list.push(data);
|
|
34
|
+
this.rows.set(model, list);
|
|
35
|
+
}
|
|
36
|
+
warn(message) {
|
|
37
|
+
if (!this.warnings.includes(message))
|
|
38
|
+
this.warnings.push(message);
|
|
39
|
+
}
|
|
40
|
+
omit(model, reason, count = 1) {
|
|
41
|
+
const o = this.omitted[model] ?? { count: 0, reason };
|
|
42
|
+
o.count += count;
|
|
43
|
+
this.omitted[model] = o;
|
|
44
|
+
}
|
|
45
|
+
count(model) {
|
|
46
|
+
return this.rows.get(model)?.length ?? 0;
|
|
47
|
+
}
|
|
48
|
+
list(model) {
|
|
49
|
+
return (this.rows.get(model) ?? []);
|
|
50
|
+
}
|
|
51
|
+
/** Every row, in the order the bundle writer requires. */
|
|
52
|
+
*ordered() {
|
|
53
|
+
for (const model of migrate_1.CANONICAL_MODEL_ORDER) {
|
|
54
|
+
for (const data of this.rows.get(model) ?? [])
|
|
55
|
+
yield { model, data };
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
counts() {
|
|
59
|
+
const out = {};
|
|
60
|
+
for (const model of migrate_1.CANONICAL_MODEL_ORDER) {
|
|
61
|
+
const n = this.rows.get(model)?.length ?? 0;
|
|
62
|
+
if (n)
|
|
63
|
+
out[model] = n;
|
|
64
|
+
}
|
|
65
|
+
return out;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
exports.RecordSet = RecordSet;
|
|
69
|
+
const isObj = (v) => typeof v === 'object' && v !== null && !Array.isArray(v);
|
|
70
|
+
exports.isObj = isObj;
|
|
71
|
+
const str = (v) => typeof v === 'string' && v.trim() ? v.trim() : typeof v === 'number' && Number.isFinite(v) ? String(v) : undefined;
|
|
72
|
+
exports.str = str;
|
|
73
|
+
const objs = (v) => (Array.isArray(v) ? v.filter(exports.isObj) : []);
|
|
74
|
+
exports.objs = objs;
|
|
75
|
+
const strs = (v) => Array.isArray(v) ? v.map((x) => (0, exports.str)(x)).filter((x) => x !== undefined) : [];
|
|
76
|
+
exports.strs = strs;
|
|
77
|
+
/** A metadata bag, only when it has keys. */
|
|
78
|
+
const bag = (v) => ((0, exports.isObj)(v) && Object.keys(v).length > 0 ? v : undefined);
|
|
79
|
+
exports.bag = bag;
|
|
80
|
+
/** E.164 or nothing: vendors store numbers with spaces/dashes; anything else is dropped. */
|
|
81
|
+
function e164(raw) {
|
|
82
|
+
const s = (0, exports.str)(raw);
|
|
83
|
+
if (!s)
|
|
84
|
+
return undefined;
|
|
85
|
+
const digits = s.replace(/[\s().-]/g, '');
|
|
86
|
+
const withPlus = digits.startsWith('+') ? digits : digits.startsWith('00') ? `+${digits.slice(2)}` : `+${digits}`;
|
|
87
|
+
return /^\+[1-9]\d{6,14}$/.test(withPlus) ? withPlus : undefined;
|
|
88
|
+
}
|
|
89
|
+
/** Drop undefined fields so a record carries only what the vendor had. */
|
|
90
|
+
function compact(o) {
|
|
91
|
+
for (const k of Object.keys(o)) {
|
|
92
|
+
const v = o[k];
|
|
93
|
+
if (v === undefined || (Array.isArray(v) && v.length === 0))
|
|
94
|
+
delete o[k];
|
|
95
|
+
}
|
|
96
|
+
return o;
|
|
97
|
+
}
|
|
98
|
+
//# sourceMappingURL=record-set.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"record-set.js","sourceRoot":"","sources":["../../../src/migrate/export/record-set.ts"],"names":[],"mappings":";;;AAoFA,oBAMC;AAED,0BAMC;AAlGD,gDAK4B;AAE5B;;;;;GAKG;AACH,MAAa,SAAS;IACH,IAAI,GAAG,IAAI,GAAG,EAA6B,CAAC;IAC5C,IAAI,GAAG,IAAI,GAAG,EAA+B,CAAC;IACtD,QAAQ,GAAa,EAAE,CAAC;IACxB,OAAO,GAAsD,EAAE,CAAC;IACzE,gFAAgF;IAChF,QAAQ,GAAqG,EAAE,CAAC;IAEhH;;;OAGG;IACH,GAAG,CAA2B,KAAQ,EAAE,IAA4B,EAAE,GAAY;QAChF,IAAI,GAAG,KAAK,SAAS,EAAE,CAAC;YACtB,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,IAAI,GAAG,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