@transcend-io/sdk 1.1.11 → 1.2.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/index.d.mts +45 -3
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +149 -56
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
package/dist/index.mjs
CHANGED
|
@@ -284,7 +284,7 @@ const UPDATE_BUSINESS_ENTITIES = gql`
|
|
|
284
284
|
`;
|
|
285
285
|
//#endregion
|
|
286
286
|
//#region src/data-inventory/fetchAllBusinessEntities.ts
|
|
287
|
-
const PAGE_SIZE$
|
|
287
|
+
const PAGE_SIZE$39 = 20;
|
|
288
288
|
/**
|
|
289
289
|
* Fetch all businessEntities in the organization
|
|
290
290
|
*
|
|
@@ -299,14 +299,14 @@ async function fetchAllBusinessEntities(client, options = {}) {
|
|
|
299
299
|
do {
|
|
300
300
|
const { businessEntities: { nodes } } = await makeGraphQLRequest(client, BUSINESS_ENTITIES, {
|
|
301
301
|
variables: {
|
|
302
|
-
first: PAGE_SIZE$
|
|
302
|
+
first: PAGE_SIZE$39,
|
|
303
303
|
offset
|
|
304
304
|
},
|
|
305
305
|
logger
|
|
306
306
|
});
|
|
307
307
|
businessEntities.push(...nodes);
|
|
308
|
-
offset += PAGE_SIZE$
|
|
309
|
-
shouldContinue = nodes.length === PAGE_SIZE$
|
|
308
|
+
offset += PAGE_SIZE$39;
|
|
309
|
+
shouldContinue = nodes.length === PAGE_SIZE$39;
|
|
310
310
|
} while (shouldContinue);
|
|
311
311
|
return businessEntities.sort((a, b) => a.title.localeCompare(b.title));
|
|
312
312
|
}
|
|
@@ -357,7 +357,7 @@ const UPDATE_DATA_SUB_CATEGORIES = gql`
|
|
|
357
357
|
`;
|
|
358
358
|
//#endregion
|
|
359
359
|
//#region src/data-inventory/fetchAllDataCategories.ts
|
|
360
|
-
const PAGE_SIZE$
|
|
360
|
+
const PAGE_SIZE$38 = 20;
|
|
361
361
|
/**
|
|
362
362
|
* Fetch all dataSubCategories in the organization
|
|
363
363
|
*
|
|
@@ -373,14 +373,14 @@ async function fetchAllDataCategories(client, options = {}) {
|
|
|
373
373
|
do {
|
|
374
374
|
const { dataSubCategories: { nodes } } = await makeGraphQLRequest(client, DATA_SUB_CATEGORIES, {
|
|
375
375
|
variables: {
|
|
376
|
-
first: PAGE_SIZE$
|
|
376
|
+
first: PAGE_SIZE$38,
|
|
377
377
|
offset
|
|
378
378
|
},
|
|
379
379
|
logger
|
|
380
380
|
});
|
|
381
381
|
dataSubCategories.push(...nodes);
|
|
382
|
-
offset += PAGE_SIZE$
|
|
383
|
-
shouldContinue = nodes.length === PAGE_SIZE$
|
|
382
|
+
offset += PAGE_SIZE$38;
|
|
383
|
+
shouldContinue = nodes.length === PAGE_SIZE$38;
|
|
384
384
|
} while (shouldContinue);
|
|
385
385
|
return dataSubCategories.sort((a, b) => a.name.localeCompare(b.name));
|
|
386
386
|
}
|
|
@@ -860,7 +860,7 @@ const IDENTIFIERS = parse(gql`
|
|
|
860
860
|
`);
|
|
861
861
|
//#endregion
|
|
862
862
|
//#region src/data-inventory/fetchAllIdentifiers.ts
|
|
863
|
-
const PAGE_SIZE$
|
|
863
|
+
const PAGE_SIZE$37 = 20;
|
|
864
864
|
/**
|
|
865
865
|
* Fetch all identifiers in the organization
|
|
866
866
|
*
|
|
@@ -877,13 +877,13 @@ async function fetchAllIdentifiers(client, options = {}) {
|
|
|
877
877
|
const { identifiers: { nodes } } = await makeGraphQLRequest(client, IDENTIFIERS, {
|
|
878
878
|
logger,
|
|
879
879
|
variables: {
|
|
880
|
-
first: PAGE_SIZE$
|
|
880
|
+
first: PAGE_SIZE$37,
|
|
881
881
|
offset
|
|
882
882
|
}
|
|
883
883
|
});
|
|
884
884
|
identifiers.push(...nodes);
|
|
885
|
-
offset += PAGE_SIZE$
|
|
886
|
-
shouldContinue = nodes.length === PAGE_SIZE$
|
|
885
|
+
offset += PAGE_SIZE$37;
|
|
886
|
+
shouldContinue = nodes.length === PAGE_SIZE$37;
|
|
887
887
|
} while (shouldContinue);
|
|
888
888
|
return identifiers.sort((a, b) => a.name.localeCompare(b.name));
|
|
889
889
|
}
|
|
@@ -962,7 +962,7 @@ const UPDATE_PROCESSING_ACTIVITIES = gql`
|
|
|
962
962
|
`;
|
|
963
963
|
//#endregion
|
|
964
964
|
//#region src/data-inventory/fetchAllProcessingActivities.ts
|
|
965
|
-
const PAGE_SIZE$
|
|
965
|
+
const PAGE_SIZE$36 = 20;
|
|
966
966
|
/**
|
|
967
967
|
* Fetch all processingActivities in the organization
|
|
968
968
|
*
|
|
@@ -978,14 +978,14 @@ async function fetchAllProcessingActivities(client, options = {}) {
|
|
|
978
978
|
do {
|
|
979
979
|
const { processingActivities: { nodes } } = await makeGraphQLRequest(client, PROCESSING_ACTIVITIES, {
|
|
980
980
|
variables: {
|
|
981
|
-
first: PAGE_SIZE$
|
|
981
|
+
first: PAGE_SIZE$36,
|
|
982
982
|
offset
|
|
983
983
|
},
|
|
984
984
|
logger
|
|
985
985
|
});
|
|
986
986
|
processingActivities.push(...nodes);
|
|
987
|
-
offset += PAGE_SIZE$
|
|
988
|
-
shouldContinue = nodes.length === PAGE_SIZE$
|
|
987
|
+
offset += PAGE_SIZE$36;
|
|
988
|
+
shouldContinue = nodes.length === PAGE_SIZE$36;
|
|
989
989
|
} while (shouldContinue);
|
|
990
990
|
return processingActivities.sort((a, b) => a.title.localeCompare(b.title));
|
|
991
991
|
}
|
|
@@ -1050,7 +1050,7 @@ const UPDATE_VENDORS = gql`
|
|
|
1050
1050
|
`;
|
|
1051
1051
|
//#endregion
|
|
1052
1052
|
//#region src/data-inventory/fetchAllVendors.ts
|
|
1053
|
-
const PAGE_SIZE$
|
|
1053
|
+
const PAGE_SIZE$35 = 20;
|
|
1054
1054
|
/**
|
|
1055
1055
|
* Fetch all vendors in the organization
|
|
1056
1056
|
*
|
|
@@ -1065,14 +1065,14 @@ async function fetchAllVendors(client, options = {}) {
|
|
|
1065
1065
|
do {
|
|
1066
1066
|
const { vendors: { nodes } } = await makeGraphQLRequest(client, VENDORS, {
|
|
1067
1067
|
variables: {
|
|
1068
|
-
first: PAGE_SIZE$
|
|
1068
|
+
first: PAGE_SIZE$35,
|
|
1069
1069
|
offset
|
|
1070
1070
|
},
|
|
1071
1071
|
logger
|
|
1072
1072
|
});
|
|
1073
1073
|
vendors.push(...nodes);
|
|
1074
|
-
offset += PAGE_SIZE$
|
|
1075
|
-
shouldContinue = nodes.length === PAGE_SIZE$
|
|
1074
|
+
offset += PAGE_SIZE$35;
|
|
1075
|
+
shouldContinue = nodes.length === PAGE_SIZE$35;
|
|
1076
1076
|
} while (shouldContinue);
|
|
1077
1077
|
return vendors.sort((a, b) => a.title.localeCompare(b.title));
|
|
1078
1078
|
}
|
|
@@ -1521,7 +1521,7 @@ const PURPOSES$1 = parse(gql`
|
|
|
1521
1521
|
`);
|
|
1522
1522
|
//#endregion
|
|
1523
1523
|
//#region src/preference-management/fetchAllPurposes.ts
|
|
1524
|
-
const PAGE_SIZE$
|
|
1524
|
+
const PAGE_SIZE$34 = 20;
|
|
1525
1525
|
/**
|
|
1526
1526
|
* Fetch all purposes in the organization
|
|
1527
1527
|
*
|
|
@@ -1538,14 +1538,14 @@ async function fetchAllPurposes(client, options = {}) {
|
|
|
1538
1538
|
const { purposes: { nodes } } = await makeGraphQLRequest(client, PURPOSES$1, {
|
|
1539
1539
|
logger,
|
|
1540
1540
|
variables: {
|
|
1541
|
-
first: PAGE_SIZE$
|
|
1541
|
+
first: PAGE_SIZE$34,
|
|
1542
1542
|
offset,
|
|
1543
1543
|
input: { includeDeleted }
|
|
1544
1544
|
}
|
|
1545
1545
|
});
|
|
1546
1546
|
purposes.push(...nodes);
|
|
1547
|
-
offset += PAGE_SIZE$
|
|
1548
|
-
shouldContinue = nodes.length === PAGE_SIZE$
|
|
1547
|
+
offset += PAGE_SIZE$34;
|
|
1548
|
+
shouldContinue = nodes.length === PAGE_SIZE$34;
|
|
1549
1549
|
} while (shouldContinue);
|
|
1550
1550
|
return purposes.sort((a, b) => a.trackingType.localeCompare(b.trackingType));
|
|
1551
1551
|
}
|
|
@@ -1588,7 +1588,7 @@ const PREFERENCE_TOPICS = parse(gql`
|
|
|
1588
1588
|
`);
|
|
1589
1589
|
//#endregion
|
|
1590
1590
|
//#region src/preference-management/fetchAllPreferenceTopics.ts
|
|
1591
|
-
const PAGE_SIZE$
|
|
1591
|
+
const PAGE_SIZE$33 = 20;
|
|
1592
1592
|
/**
|
|
1593
1593
|
* Fetch all preference topics in the organization
|
|
1594
1594
|
*
|
|
@@ -1605,13 +1605,13 @@ async function fetchAllPreferenceTopics(client, options = {}) {
|
|
|
1605
1605
|
const { preferenceTopics: { nodes } } = await makeGraphQLRequest(client, PREFERENCE_TOPICS, {
|
|
1606
1606
|
logger,
|
|
1607
1607
|
variables: {
|
|
1608
|
-
first: PAGE_SIZE$
|
|
1608
|
+
first: PAGE_SIZE$33,
|
|
1609
1609
|
offset
|
|
1610
1610
|
}
|
|
1611
1611
|
});
|
|
1612
1612
|
preferenceTopics.push(...nodes);
|
|
1613
|
-
offset += PAGE_SIZE$
|
|
1614
|
-
shouldContinue = nodes.length === PAGE_SIZE$
|
|
1613
|
+
offset += PAGE_SIZE$33;
|
|
1614
|
+
shouldContinue = nodes.length === PAGE_SIZE$33;
|
|
1615
1615
|
} while (shouldContinue);
|
|
1616
1616
|
return preferenceTopics.sort((a, b) => `${a.slug}:${a.purpose.trackingType}`.localeCompare(`${b.slug}:${b.purpose.trackingType}`));
|
|
1617
1617
|
}
|
|
@@ -2696,7 +2696,7 @@ const SET_RESOURCE_ATTRIBUTES = gql`
|
|
|
2696
2696
|
`;
|
|
2697
2697
|
//#endregion
|
|
2698
2698
|
//#region src/administration/fetchAllAttributes.ts
|
|
2699
|
-
const PAGE_SIZE$
|
|
2699
|
+
const PAGE_SIZE$32 = 100;
|
|
2700
2700
|
/**
|
|
2701
2701
|
* Fetch all attribute values for an attribute key
|
|
2702
2702
|
*
|
|
@@ -2712,15 +2712,15 @@ async function fetchAllAttributeValues(client, options) {
|
|
|
2712
2712
|
do {
|
|
2713
2713
|
const { attributeValues: { nodes } } = await makeGraphQLRequest(client, ATTRIBUTE_VALUES, {
|
|
2714
2714
|
variables: {
|
|
2715
|
-
first: PAGE_SIZE$
|
|
2715
|
+
first: PAGE_SIZE$32,
|
|
2716
2716
|
offset,
|
|
2717
2717
|
attributeKeyId
|
|
2718
2718
|
},
|
|
2719
2719
|
logger
|
|
2720
2720
|
});
|
|
2721
2721
|
attributeValues.push(...nodes);
|
|
2722
|
-
offset += PAGE_SIZE$
|
|
2723
|
-
shouldContinue = nodes.length === PAGE_SIZE$
|
|
2722
|
+
offset += PAGE_SIZE$32;
|
|
2723
|
+
shouldContinue = nodes.length === PAGE_SIZE$32;
|
|
2724
2724
|
} while (shouldContinue);
|
|
2725
2725
|
return attributeValues.sort((a, b) => a.name.localeCompare(b.name));
|
|
2726
2726
|
}
|
|
@@ -2739,7 +2739,7 @@ async function fetchAllAttributes(client, options = {}) {
|
|
|
2739
2739
|
do {
|
|
2740
2740
|
const { attributeKeys: { nodes } } = await makeGraphQLRequest(client, ATTRIBUTES, {
|
|
2741
2741
|
variables: {
|
|
2742
|
-
first: PAGE_SIZE$
|
|
2742
|
+
first: PAGE_SIZE$32,
|
|
2743
2743
|
offset
|
|
2744
2744
|
},
|
|
2745
2745
|
logger
|
|
@@ -2751,8 +2751,8 @@ async function fetchAllAttributes(client, options = {}) {
|
|
|
2751
2751
|
filterBy: { attributeKeyId: node.id }
|
|
2752
2752
|
}) : []
|
|
2753
2753
|
}))));
|
|
2754
|
-
offset += PAGE_SIZE$
|
|
2755
|
-
shouldContinue = nodes.length === PAGE_SIZE$
|
|
2754
|
+
offset += PAGE_SIZE$32;
|
|
2755
|
+
shouldContinue = nodes.length === PAGE_SIZE$32;
|
|
2756
2756
|
} while (shouldContinue);
|
|
2757
2757
|
return attributes.sort((a, b) => a.name.localeCompare(b.name));
|
|
2758
2758
|
}
|
|
@@ -2819,10 +2819,34 @@ const TEAMS = gql`
|
|
|
2819
2819
|
name
|
|
2820
2820
|
title
|
|
2821
2821
|
}
|
|
2822
|
+
parentTeam {
|
|
2823
|
+
id
|
|
2824
|
+
name
|
|
2825
|
+
}
|
|
2822
2826
|
}
|
|
2823
2827
|
}
|
|
2824
2828
|
}
|
|
2825
2829
|
`;
|
|
2830
|
+
const PARENT_ORGANIZATION_TEAMS = gql`
|
|
2831
|
+
query TranscendCliParentOrganizationTeams(
|
|
2832
|
+
$first: Int!
|
|
2833
|
+
$offset: Int!
|
|
2834
|
+
$filterBy: ParentTeamFiltersInput
|
|
2835
|
+
) {
|
|
2836
|
+
parentOrganizationTeams(
|
|
2837
|
+
first: $first
|
|
2838
|
+
offset: $offset
|
|
2839
|
+
filterBy: $filterBy
|
|
2840
|
+
orderBy: [{ field: createdAt, direction: ASC }, { field: name, direction: ASC }]
|
|
2841
|
+
) {
|
|
2842
|
+
nodes {
|
|
2843
|
+
id
|
|
2844
|
+
name
|
|
2845
|
+
}
|
|
2846
|
+
totalCount
|
|
2847
|
+
}
|
|
2848
|
+
}
|
|
2849
|
+
`;
|
|
2826
2850
|
const CREATE_TEAM = gql`
|
|
2827
2851
|
mutation TranscendCliCreateTeam($input: TeamInput!) {
|
|
2828
2852
|
createTeam(input: $input) {
|
|
@@ -2845,7 +2869,7 @@ const UPDATE_TEAM = gql`
|
|
|
2845
2869
|
`;
|
|
2846
2870
|
//#endregion
|
|
2847
2871
|
//#region src/administration/fetchAllTeams.ts
|
|
2848
|
-
const PAGE_SIZE$
|
|
2872
|
+
const PAGE_SIZE$31 = 20;
|
|
2849
2873
|
/**
|
|
2850
2874
|
* Fetch all teams in the organization
|
|
2851
2875
|
*
|
|
@@ -2861,17 +2885,69 @@ async function fetchAllTeams(client, options = {}) {
|
|
|
2861
2885
|
do {
|
|
2862
2886
|
const { teams: { nodes } } = await makeGraphQLRequest(client, TEAMS, {
|
|
2863
2887
|
variables: {
|
|
2864
|
-
first: PAGE_SIZE$
|
|
2888
|
+
first: PAGE_SIZE$31,
|
|
2865
2889
|
offset
|
|
2866
2890
|
},
|
|
2867
2891
|
logger
|
|
2868
2892
|
});
|
|
2869
2893
|
teams.push(...nodes);
|
|
2894
|
+
offset += PAGE_SIZE$31;
|
|
2895
|
+
shouldContinue = nodes.length === PAGE_SIZE$31;
|
|
2896
|
+
} while (shouldContinue);
|
|
2897
|
+
return teams.sort((a, b) => a.name.localeCompare(b.name));
|
|
2898
|
+
}
|
|
2899
|
+
//#endregion
|
|
2900
|
+
//#region src/administration/fetchParentOrganizationTeams.ts
|
|
2901
|
+
const PAGE_SIZE$30 = 20;
|
|
2902
|
+
/**
|
|
2903
|
+
* Fetch teams from the parent organization that can be linked to child-org teams
|
|
2904
|
+
*
|
|
2905
|
+
* @param client - GraphQL client
|
|
2906
|
+
* @param options - Options
|
|
2907
|
+
* @returns Parent organization teams
|
|
2908
|
+
*/
|
|
2909
|
+
async function fetchParentOrganizationTeams(client, options = {}) {
|
|
2910
|
+
const { logger, filterBy } = options;
|
|
2911
|
+
const teams = [];
|
|
2912
|
+
let offset = 0;
|
|
2913
|
+
let shouldContinue = false;
|
|
2914
|
+
do {
|
|
2915
|
+
const { parentOrganizationTeams: { nodes } } = await makeGraphQLRequest(client, PARENT_ORGANIZATION_TEAMS, {
|
|
2916
|
+
variables: {
|
|
2917
|
+
first: PAGE_SIZE$30,
|
|
2918
|
+
offset,
|
|
2919
|
+
filterBy
|
|
2920
|
+
},
|
|
2921
|
+
logger
|
|
2922
|
+
});
|
|
2923
|
+
teams.push(...nodes);
|
|
2870
2924
|
offset += PAGE_SIZE$30;
|
|
2871
2925
|
shouldContinue = nodes.length === PAGE_SIZE$30;
|
|
2872
2926
|
} while (shouldContinue);
|
|
2873
2927
|
return teams.sort((a, b) => a.name.localeCompare(b.name));
|
|
2874
2928
|
}
|
|
2929
|
+
/**
|
|
2930
|
+
* Resolve parent organization team names to IDs
|
|
2931
|
+
*
|
|
2932
|
+
* @param client - GraphQL client
|
|
2933
|
+
* @param parentTeamNames - Parent organization team names to resolve
|
|
2934
|
+
* @param options - Options
|
|
2935
|
+
* @returns Map from parent team name to ID
|
|
2936
|
+
*/
|
|
2937
|
+
async function resolveParentTeamIdsByName(client, parentTeamNames, options = {}) {
|
|
2938
|
+
const { logger } = options;
|
|
2939
|
+
const uniqueNames = [...new Set(parentTeamNames)];
|
|
2940
|
+
const parentTeamIdsByName = {};
|
|
2941
|
+
for (const name of uniqueNames) {
|
|
2942
|
+
const match = (await fetchParentOrganizationTeams(client, {
|
|
2943
|
+
logger,
|
|
2944
|
+
filterBy: { text: name }
|
|
2945
|
+
})).find((team) => team.name === name);
|
|
2946
|
+
if (!match) throw new Error(`Failed to find parent organization team with name: ${name}`);
|
|
2947
|
+
parentTeamIdsByName[name] = match.id;
|
|
2948
|
+
}
|
|
2949
|
+
return parentTeamIdsByName;
|
|
2950
|
+
}
|
|
2875
2951
|
//#endregion
|
|
2876
2952
|
//#region src/administration/gqls/user.ts
|
|
2877
2953
|
const USERS = gql`
|
|
@@ -3287,6 +3363,27 @@ async function syncIntlMessages(client, messages, options = {}) {
|
|
|
3287
3363
|
//#endregion
|
|
3288
3364
|
//#region src/administration/syncTeams.ts
|
|
3289
3365
|
/**
|
|
3366
|
+
* Map team input to GraphQL mutation input
|
|
3367
|
+
*
|
|
3368
|
+
* @param team - Team input
|
|
3369
|
+
* @param parentTeamIdsByName - Resolved parent organization team IDs
|
|
3370
|
+
* @returns GraphQL team mutation input
|
|
3371
|
+
*/
|
|
3372
|
+
function toTeamMutationInput(team, parentTeamIdsByName) {
|
|
3373
|
+
const parentTeamName = team["parent-team-name"];
|
|
3374
|
+
const parentTeam = parentTeamName ? parentTeamIdsByName[parentTeamName] : void 0;
|
|
3375
|
+
return {
|
|
3376
|
+
name: team.name,
|
|
3377
|
+
description: team.description,
|
|
3378
|
+
ssoTitle: team["sso-title"],
|
|
3379
|
+
ssoDepartment: team["sso-department"],
|
|
3380
|
+
ssoGroup: team["sso-group"],
|
|
3381
|
+
scopes: team.scopes,
|
|
3382
|
+
userEmails: team.users,
|
|
3383
|
+
...parentTeam ? { parentTeam } : {}
|
|
3384
|
+
};
|
|
3385
|
+
}
|
|
3386
|
+
/**
|
|
3290
3387
|
* Input to create a new team
|
|
3291
3388
|
*
|
|
3292
3389
|
* @param client - GraphQL client
|
|
@@ -3295,17 +3392,9 @@ async function syncIntlMessages(client, messages, options = {}) {
|
|
|
3295
3392
|
* @returns Created team
|
|
3296
3393
|
*/
|
|
3297
3394
|
async function createTeam(client, options) {
|
|
3298
|
-
const { input: team, logger = NOOP_LOGGER } = options;
|
|
3395
|
+
const { input: team, parentTeamIdsByName = {}, logger = NOOP_LOGGER } = options;
|
|
3299
3396
|
const { createTeam } = await makeGraphQLRequest(client, CREATE_TEAM, {
|
|
3300
|
-
variables: { input:
|
|
3301
|
-
name: team.name,
|
|
3302
|
-
description: team.description,
|
|
3303
|
-
ssoTitle: team["sso-title"],
|
|
3304
|
-
ssoDepartment: team["sso-department"],
|
|
3305
|
-
ssoGroup: team["sso-group"],
|
|
3306
|
-
scopes: team.scopes,
|
|
3307
|
-
userEmails: team.users
|
|
3308
|
-
} },
|
|
3397
|
+
variables: { input: toTeamMutationInput(team, parentTeamIdsByName) },
|
|
3309
3398
|
logger
|
|
3310
3399
|
});
|
|
3311
3400
|
return createTeam.team;
|
|
@@ -3318,18 +3407,12 @@ async function createTeam(client, options) {
|
|
|
3318
3407
|
* @returns Updated team
|
|
3319
3408
|
*/
|
|
3320
3409
|
async function updateTeam(client, options) {
|
|
3321
|
-
const { input: team, logger = NOOP_LOGGER } = options;
|
|
3410
|
+
const { input: team, parentTeamIdsByName = {}, logger = NOOP_LOGGER } = options;
|
|
3322
3411
|
const teamId = team.id;
|
|
3323
3412
|
const { updateTeam } = await makeGraphQLRequest(client, UPDATE_TEAM, {
|
|
3324
3413
|
variables: { input: {
|
|
3325
3414
|
id: teamId,
|
|
3326
|
-
|
|
3327
|
-
description: team.description,
|
|
3328
|
-
ssoTitle: team["sso-title"],
|
|
3329
|
-
ssoDepartment: team["sso-department"],
|
|
3330
|
-
ssoGroup: team["sso-group"],
|
|
3331
|
-
scopes: team.scopes,
|
|
3332
|
-
userEmails: team.users
|
|
3415
|
+
...toTeamMutationInput(team, parentTeamIdsByName)
|
|
3333
3416
|
} },
|
|
3334
3417
|
logger
|
|
3335
3418
|
});
|
|
@@ -3347,6 +3430,14 @@ async function syncTeams(client, inputs, options = {}) {
|
|
|
3347
3430
|
const { logger = NOOP_LOGGER } = options;
|
|
3348
3431
|
logger.info(`Syncing "${inputs.length}" teams...`);
|
|
3349
3432
|
let encounteredError = false;
|
|
3433
|
+
const parentTeamNames = inputs.map((input) => input["parent-team-name"]).filter((name) => !!name);
|
|
3434
|
+
let parentTeamIdsByName = {};
|
|
3435
|
+
if (parentTeamNames.length > 0) try {
|
|
3436
|
+
parentTeamIdsByName = await resolveParentTeamIdsByName(client, parentTeamNames, { logger });
|
|
3437
|
+
} catch (err) {
|
|
3438
|
+
logger.error(`Failed to resolve parent organization teams - ${err.message}`);
|
|
3439
|
+
return false;
|
|
3440
|
+
}
|
|
3350
3441
|
const teamsByName = keyBy(await fetchAllTeams(client, { logger }), "name");
|
|
3351
3442
|
const newTeams = inputs.filter((input) => !teamsByName[input.name]);
|
|
3352
3443
|
const updatedTeams = inputs.filter((input) => !!teamsByName[input.name]);
|
|
@@ -3354,6 +3445,7 @@ async function syncTeams(client, inputs, options = {}) {
|
|
|
3354
3445
|
try {
|
|
3355
3446
|
const newTeam = await createTeam(client, {
|
|
3356
3447
|
input: team,
|
|
3448
|
+
parentTeamIdsByName,
|
|
3357
3449
|
logger
|
|
3358
3450
|
});
|
|
3359
3451
|
teamsByName[newTeam.name] = newTeam;
|
|
@@ -3370,6 +3462,7 @@ async function syncTeams(client, inputs, options = {}) {
|
|
|
3370
3462
|
...input,
|
|
3371
3463
|
id: teamsByName[input.name].id
|
|
3372
3464
|
},
|
|
3465
|
+
parentTeamIdsByName,
|
|
3373
3466
|
logger
|
|
3374
3467
|
});
|
|
3375
3468
|
teamsByName[newTeam.name] = newTeam;
|
|
@@ -8513,6 +8606,6 @@ function createMonorepoPackageDefinition(name, directory) {
|
|
|
8513
8606
|
};
|
|
8514
8607
|
}
|
|
8515
8608
|
//#endregion
|
|
8516
|
-
export { ASSESSMENTS, ASSESSMENT_SECTION_FIELDS, ATTRIBUTE_KEYS_REQUESTS, ATTRIBUTE_VALUE_FIELDS, AssessmentAction, AssessmentNestedRule, AssessmentRiskLogic, AssessmentRule, AssessmentRuleWithOperands, AssessmentRuleWithoutOperands, BULK_REQUEST_FILES, CHANGE_REQUEST_DATA_SILO_STATUS, CODE_PACKAGES, CONSENT_MANAGER_ANALYTICS_DATA, CONSENT_PARTITIONS, COOKIES, COOKIE_STATS, CREATE_CODE_PACKAGE, CREATE_CONSENT_EXPERIENCE, CREATE_CONSENT_MANAGER, CREATE_CONSENT_PARTITION, CREATE_DATA_FLOWS, CREATE_DATA_SILOS, CREATE_DATA_SUBJECT, CREATE_ENRICHER, CREATE_IDENTIFIER, CREATE_PROCESSING_PURPOSE_SUB_CATEGORY, ColumnIdentifierMap, ColumnMetadataMap, ColumnPurposeMap, ConsentManagerMetricBin, ConsentPreferenceResponse, DATAPOINT_EXPORT, DATA_FLOWS, DATA_FLOW_STATS, DATA_POINTS, DATA_POINT_COUNT, DATA_SILOS, DATA_SILOS_ENRICHED, DATA_SILO_EXPORT, DATA_SUBJECTS, DELETE_COOKIES, DELETE_DATA_FLOWS, DEPLOYED_PRIVACY_CENTER_URL, DEPLOY_CONSENT_MANAGER, DeletePreferenceRecordCliCsvRow, DeletePreferenceRecordsInput, DeletePreferenceRecordsResponse, ENRICHERS, EXPERIENCES, FETCH_CONSENT_MANAGER, FETCH_CONSENT_MANAGER_ID, FETCH_CONSENT_MANAGER_THEME, FETCH_PRIVACY_CENTER_ID, FailingPreferenceUpdates, FileFormatState, FileMetadataState, IMPORT_ONE_TRUST_ASSESSMENT_FORMS, INITIALIZER, IdentifierMetadataForPreference, MetadataMapping, NEW_IDENTIFIER_TYPES, NOOP_LOGGER, OWNER_FIELDS, POLICIES, PRIVACY_CENTER, PROCESSING_PURPOSE_SUB_CATEGORIES, PURPOSES, PendingSafePreferenceUpdates, PendingWithConflictPreferenceUpdates, PreferenceState, PreferenceUpdateMap, PurposeRowMapping, REDUCED_REQUESTS_FOR_DATA_SILO_COUNT, REMOVE_REQUEST_IDENTIFIERS, REQUEST_DATA_SILOS, REQUEST_ENRICHERS, REQUEST_FILES, REQUEST_IDENTIFIERS, RETRY_REQUEST_DATA_SILO, RETRY_REQUEST_ENRICHER, RETRY_TRANSIENT_MSGS, RequestIdentifiersResponse, RequestUploadReceipts, SERVICE_FIELDS, SKIP_REQUEST_ENRICHER, SOMBRA_VERSION, SUB_DATA_POINTS, SUB_DATA_POINTS_COUNT, SUB_DATA_POINTS_WITH_GUESSES, SYNC_ATTRIBUTE_TYPES, SkippedPreferenceUpdates, TEAM_FIELDS, TOGGLE_CONSENT_PRECEDENCE, TOGGLE_DATA_SUBJECT, TOGGLE_TELEMETRY_PARTITION_STRATEGY, TOGGLE_UNKNOWN_COOKIE_POLICY, TOGGLE_UNKNOWN_REQUEST_POLICY, TRACKING_PURPOSE_FIELDS, UPDATE_CODE_PACKAGES, UPDATE_CONSENT_EXPERIENCE, UPDATE_CONSENT_MANAGER_DOMAINS, UPDATE_CONSENT_MANAGER_PARTITION, UPDATE_CONSENT_MANAGER_THEME, UPDATE_CONSENT_MANAGER_TO_LATEST, UPDATE_CONSENT_MANAGER_VERSION, UPDATE_DATA_FLOWS, UPDATE_DATA_SILOS, UPDATE_DATA_SUBJECT, UPDATE_ENRICHER, UPDATE_IDENTIFIER, UPDATE_LOAD_OPTIONS, UPDATE_OR_CREATE_COOKIES, UPDATE_OR_CREATE_DATA_POINT, UPDATE_POLICIES, UPDATE_PRIVACY_CENTER, UPDATE_PROCESSING_PURPOSE_SUB_CATEGORIES, addMessagesToPromptRun, assumeRole, buildConsentChunks, buildTranscendGraphQLClient, buildTranscendGraphQLClientGeneric, checkIfPendingPreferenceUpdatesAreNoOp, checkIfPendingPreferenceUpdatesCauseConflict, consentWindowHasAny, convertToDataSubjectAllowlist, convertToDataSubjectBlockList, createActionItemCollection, createActionItems, createAgent, createAgentFile, createAgentFunction, createApiKey, createBusinessEntity, createDataCategory, createDataFlows, createDataSubject, createMonorepoPackageDefinition, createPreferenceAccessTokens, createProcessingPurpose, createPrompt, createPromptGroup, createPromptPartial, createRepository, createSoftwareDevelopmentKit, createSombraGotInstance, createTeam, createTranscendConsentGotInstance, createVendor, deleteApiKey, deployConsentManager, fetchActiveSiloDiscoPlugin, fetchAllActionItemCollections, fetchAllActionItems, fetchAllActions, fetchAllAgentFiles, fetchAllAgentFunctions, fetchAllAgents, fetchAllApiKeys, fetchAllAssessments, fetchAllAttributeValues, fetchAllAttributes, fetchAllBusinessEntities, fetchAllCatalogs, fetchAllCodePackages, fetchAllCookies, fetchAllDataCategories, fetchAllDataFlows, fetchAllDataPoints, fetchAllDataSilos, fetchAllDataSubjects, fetchAllEnrichers, fetchAllIdentifiers, fetchAllLargeLanguageModels, fetchAllMessages, fetchAllPolicies, fetchAllPreferenceTopics, fetchAllPrivacyCenters, fetchAllProcessingActivities, fetchAllProcessingPurposes, fetchAllPromptGroups, fetchAllPromptPartials, fetchAllPromptThreads, fetchAllPrompts, fetchAllPurposes, fetchAllPurposesAndPreferences, fetchAllRepositories, fetchAllRequestAttributeKeys, fetchAllRequestEnrichers, fetchAllRequestIdentifierMetadata, fetchAllRequestIdentifiers, fetchAllSiloDiscoveryResults, fetchAllSoftwareDevelopmentKits, fetchAllSubDataPoints, fetchAllTeams, fetchAllTemplates, fetchAllUsers, fetchAllVendors, fetchAndIndexCatalogs, fetchApiKeys, fetchConsentManager, fetchConsentManagerAnalyticsData, fetchConsentManagerExperiences, fetchConsentManagerId, fetchConsentManagerTheme, fetchConsentPreferences, fetchConsentPreferencesChunked, fetchEnrichedDataSilos, fetchIdentifiersAndCreateMissing, fetchPartitions, fetchPrivacyCenterId, fetchPrivacyCenterUrl, fetchPromptsWithVariables, fetchRequestDataSilo, fetchRequestDataSilos, fetchRequestDataSilosCount, fetchRequestFilesForRequest, findEarliestDayWithData, findLatestDayWithData, formatAttributeValues, formatRegions, getBoundsFromConsentFilter, getComparisonTimeForRecord, getPreferenceIdentifiersFromRow, getPreferenceMetadataFromRow, getPreferenceUpdatesFromRow, getPreferencesForIdentifiers, getUniquePreferenceIdentifierNamesFromRow, isTransientError, iterateConsentPages, loadReferenceData, loginUser, makeGraphQLRequest, parseAssessmentDisplayLogic, parseAssessmentRiskLogic, pickConsentChunkMode, reportPromptRun, retryRequestEnricher, setResourceAttributes, syncAction, syncActionItemCollections, syncActionItems, syncAgentFiles, syncAgentFunctions, syncAgents, syncAttribute, syncBusinessEntities, syncConsentManager, syncConsentManagerExperiences, syncCookies, syncDataCategories, syncDataFlows, syncDataSiloDependencies, syncDataSubject, syncEnricher, syncIdentifier, syncIntlMessages, syncPartitions, syncPolicies, syncPrivacyCenter, syncProcessingActivities, syncProcessingPurposes, syncPromptGroups, syncPromptPartials, syncPrompts, syncRepositories, syncSoftwareDevelopmentKits, syncTeams, syncTemplate, syncVendors, transformPreferenceRecordToCsv, updateActionItem, updateActionItemCollection, updateAgentFiles, updateAgentFunctions, updateAgents, updateBusinessEntities, updateConsentManagerToLatest, updateDataCategories, updateDataFlows, updateIntlMessages, updateOrCreateCookies, updatePolicies, updateProcessingPurposes, updatePromptGroups, updatePromptPartials, updatePrompts, updateRepositories, updateSoftwareDevelopmentKits, updateTeam, updateVendors, uploadSiloDiscoveryResults, validateSombraVersion, withTransientRetry };
|
|
8609
|
+
export { ASSESSMENTS, ASSESSMENT_SECTION_FIELDS, ATTRIBUTE_KEYS_REQUESTS, ATTRIBUTE_VALUE_FIELDS, AssessmentAction, AssessmentNestedRule, AssessmentRiskLogic, AssessmentRule, AssessmentRuleWithOperands, AssessmentRuleWithoutOperands, BULK_REQUEST_FILES, CHANGE_REQUEST_DATA_SILO_STATUS, CODE_PACKAGES, CONSENT_MANAGER_ANALYTICS_DATA, CONSENT_PARTITIONS, COOKIES, COOKIE_STATS, CREATE_CODE_PACKAGE, CREATE_CONSENT_EXPERIENCE, CREATE_CONSENT_MANAGER, CREATE_CONSENT_PARTITION, CREATE_DATA_FLOWS, CREATE_DATA_SILOS, CREATE_DATA_SUBJECT, CREATE_ENRICHER, CREATE_IDENTIFIER, CREATE_PROCESSING_PURPOSE_SUB_CATEGORY, ColumnIdentifierMap, ColumnMetadataMap, ColumnPurposeMap, ConsentManagerMetricBin, ConsentPreferenceResponse, DATAPOINT_EXPORT, DATA_FLOWS, DATA_FLOW_STATS, DATA_POINTS, DATA_POINT_COUNT, DATA_SILOS, DATA_SILOS_ENRICHED, DATA_SILO_EXPORT, DATA_SUBJECTS, DELETE_COOKIES, DELETE_DATA_FLOWS, DEPLOYED_PRIVACY_CENTER_URL, DEPLOY_CONSENT_MANAGER, DeletePreferenceRecordCliCsvRow, DeletePreferenceRecordsInput, DeletePreferenceRecordsResponse, ENRICHERS, EXPERIENCES, FETCH_CONSENT_MANAGER, FETCH_CONSENT_MANAGER_ID, FETCH_CONSENT_MANAGER_THEME, FETCH_PRIVACY_CENTER_ID, FailingPreferenceUpdates, FileFormatState, FileMetadataState, IMPORT_ONE_TRUST_ASSESSMENT_FORMS, INITIALIZER, IdentifierMetadataForPreference, MetadataMapping, NEW_IDENTIFIER_TYPES, NOOP_LOGGER, OWNER_FIELDS, POLICIES, PRIVACY_CENTER, PROCESSING_PURPOSE_SUB_CATEGORIES, PURPOSES, PendingSafePreferenceUpdates, PendingWithConflictPreferenceUpdates, PreferenceState, PreferenceUpdateMap, PurposeRowMapping, REDUCED_REQUESTS_FOR_DATA_SILO_COUNT, REMOVE_REQUEST_IDENTIFIERS, REQUEST_DATA_SILOS, REQUEST_ENRICHERS, REQUEST_FILES, REQUEST_IDENTIFIERS, RETRY_REQUEST_DATA_SILO, RETRY_REQUEST_ENRICHER, RETRY_TRANSIENT_MSGS, RequestIdentifiersResponse, RequestUploadReceipts, SERVICE_FIELDS, SKIP_REQUEST_ENRICHER, SOMBRA_VERSION, SUB_DATA_POINTS, SUB_DATA_POINTS_COUNT, SUB_DATA_POINTS_WITH_GUESSES, SYNC_ATTRIBUTE_TYPES, SkippedPreferenceUpdates, TEAM_FIELDS, TOGGLE_CONSENT_PRECEDENCE, TOGGLE_DATA_SUBJECT, TOGGLE_TELEMETRY_PARTITION_STRATEGY, TOGGLE_UNKNOWN_COOKIE_POLICY, TOGGLE_UNKNOWN_REQUEST_POLICY, TRACKING_PURPOSE_FIELDS, UPDATE_CODE_PACKAGES, UPDATE_CONSENT_EXPERIENCE, UPDATE_CONSENT_MANAGER_DOMAINS, UPDATE_CONSENT_MANAGER_PARTITION, UPDATE_CONSENT_MANAGER_THEME, UPDATE_CONSENT_MANAGER_TO_LATEST, UPDATE_CONSENT_MANAGER_VERSION, UPDATE_DATA_FLOWS, UPDATE_DATA_SILOS, UPDATE_DATA_SUBJECT, UPDATE_ENRICHER, UPDATE_IDENTIFIER, UPDATE_LOAD_OPTIONS, UPDATE_OR_CREATE_COOKIES, UPDATE_OR_CREATE_DATA_POINT, UPDATE_POLICIES, UPDATE_PRIVACY_CENTER, UPDATE_PROCESSING_PURPOSE_SUB_CATEGORIES, addMessagesToPromptRun, assumeRole, buildConsentChunks, buildTranscendGraphQLClient, buildTranscendGraphQLClientGeneric, checkIfPendingPreferenceUpdatesAreNoOp, checkIfPendingPreferenceUpdatesCauseConflict, consentWindowHasAny, convertToDataSubjectAllowlist, convertToDataSubjectBlockList, createActionItemCollection, createActionItems, createAgent, createAgentFile, createAgentFunction, createApiKey, createBusinessEntity, createDataCategory, createDataFlows, createDataSubject, createMonorepoPackageDefinition, createPreferenceAccessTokens, createProcessingPurpose, createPrompt, createPromptGroup, createPromptPartial, createRepository, createSoftwareDevelopmentKit, createSombraGotInstance, createTeam, createTranscendConsentGotInstance, createVendor, deleteApiKey, deployConsentManager, fetchActiveSiloDiscoPlugin, fetchAllActionItemCollections, fetchAllActionItems, fetchAllActions, fetchAllAgentFiles, fetchAllAgentFunctions, fetchAllAgents, fetchAllApiKeys, fetchAllAssessments, fetchAllAttributeValues, fetchAllAttributes, fetchAllBusinessEntities, fetchAllCatalogs, fetchAllCodePackages, fetchAllCookies, fetchAllDataCategories, fetchAllDataFlows, fetchAllDataPoints, fetchAllDataSilos, fetchAllDataSubjects, fetchAllEnrichers, fetchAllIdentifiers, fetchAllLargeLanguageModels, fetchAllMessages, fetchAllPolicies, fetchAllPreferenceTopics, fetchAllPrivacyCenters, fetchAllProcessingActivities, fetchAllProcessingPurposes, fetchAllPromptGroups, fetchAllPromptPartials, fetchAllPromptThreads, fetchAllPrompts, fetchAllPurposes, fetchAllPurposesAndPreferences, fetchAllRepositories, fetchAllRequestAttributeKeys, fetchAllRequestEnrichers, fetchAllRequestIdentifierMetadata, fetchAllRequestIdentifiers, fetchAllSiloDiscoveryResults, fetchAllSoftwareDevelopmentKits, fetchAllSubDataPoints, fetchAllTeams, fetchAllTemplates, fetchAllUsers, fetchAllVendors, fetchAndIndexCatalogs, fetchApiKeys, fetchConsentManager, fetchConsentManagerAnalyticsData, fetchConsentManagerExperiences, fetchConsentManagerId, fetchConsentManagerTheme, fetchConsentPreferences, fetchConsentPreferencesChunked, fetchEnrichedDataSilos, fetchIdentifiersAndCreateMissing, fetchParentOrganizationTeams, fetchPartitions, fetchPrivacyCenterId, fetchPrivacyCenterUrl, fetchPromptsWithVariables, fetchRequestDataSilo, fetchRequestDataSilos, fetchRequestDataSilosCount, fetchRequestFilesForRequest, findEarliestDayWithData, findLatestDayWithData, formatAttributeValues, formatRegions, getBoundsFromConsentFilter, getComparisonTimeForRecord, getPreferenceIdentifiersFromRow, getPreferenceMetadataFromRow, getPreferenceUpdatesFromRow, getPreferencesForIdentifiers, getUniquePreferenceIdentifierNamesFromRow, isTransientError, iterateConsentPages, loadReferenceData, loginUser, makeGraphQLRequest, parseAssessmentDisplayLogic, parseAssessmentRiskLogic, pickConsentChunkMode, reportPromptRun, resolveParentTeamIdsByName, retryRequestEnricher, setResourceAttributes, syncAction, syncActionItemCollections, syncActionItems, syncAgentFiles, syncAgentFunctions, syncAgents, syncAttribute, syncBusinessEntities, syncConsentManager, syncConsentManagerExperiences, syncCookies, syncDataCategories, syncDataFlows, syncDataSiloDependencies, syncDataSubject, syncEnricher, syncIdentifier, syncIntlMessages, syncPartitions, syncPolicies, syncPrivacyCenter, syncProcessingActivities, syncProcessingPurposes, syncPromptGroups, syncPromptPartials, syncPrompts, syncRepositories, syncSoftwareDevelopmentKits, syncTeams, syncTemplate, syncVendors, transformPreferenceRecordToCsv, updateActionItem, updateActionItemCollection, updateAgentFiles, updateAgentFunctions, updateAgents, updateBusinessEntities, updateConsentManagerToLatest, updateDataCategories, updateDataFlows, updateIntlMessages, updateOrCreateCookies, updatePolicies, updateProcessingPurposes, updatePromptGroups, updatePromptPartials, updatePrompts, updateRepositories, updateSoftwareDevelopmentKits, updateTeam, updateVendors, uploadSiloDiscoveryResults, validateSombraVersion, withTransientRetry };
|
|
8517
8610
|
|
|
8518
8611
|
//# sourceMappingURL=index.mjs.map
|