@transcend-io/sdk 1.9.4 → 2.0.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.mjs CHANGED
@@ -3,11 +3,12 @@ import { GraphQLClient, gql } from "graphql-request";
3
3
  import got from "got";
4
4
  import { parse } from "graphql";
5
5
  import { chunk, difference, flatten, groupBy, keyBy, sortBy, uniq, uniqBy } from "lodash-es";
6
- import { AssessmentsDisplayLogicAction, AttributeKeyType, ComparisonOperator, ConsentTrackerStatus, EnricherType, IdentifierType, IsoCountryCode, IsoCountrySubdivisionCode, LogicOperator, OrderDirection, PolicyType, PreferenceQueryResponseItem, PreferenceStoreAuthLevel, PreferenceStoreIdentifier, PreferenceTopicType, PreferenceUpdateItem, RequestAction, WorkflowConfigType, WorkflowConfigVisibility } from "@transcend-io/privacy-types";
6
+ import { AssessmentsDisplayLogicAction, AttributeKeyType, ComparisonOperator, ConsentTrackerStatus, CustomFunctionType, EnricherType, IdentifierType, IsoCountryCode, IsoCountrySubdivisionCode, LogicOperator, OrderDirection, PolicyType, PreferenceQueryResponseItem, PreferenceStoreAuthLevel, PreferenceStoreIdentifier, PreferenceTopicType, PreferenceUpdateItem, RequestAction, WorkflowConfigType, WorkflowConfigVisibility } from "@transcend-io/privacy-types";
7
7
  import * as t from "io-ts";
8
8
  import { InitialViewState, KnownDefaultPurpose, OnConsentExpiry, UserPrivacySignalEnum } from "@transcend-io/airgap.js-types";
9
9
  import { apply, decodeCodec, valuesOf } from "@transcend-io/type-utils";
10
10
  import semver from "semver";
11
+ import jwt from "jsonwebtoken";
11
12
  //#region src/gqls/shared.ts
12
13
  /**
13
14
  * Shared GQL field selection constants and types used across
@@ -75,7 +76,8 @@ const KNOWN_ERRORS = [
75
76
  "got invalid value",
76
77
  "Client error",
77
78
  "cannot affect row a second time",
78
- "GRAPHQL_VALIDATION_FAILED"
79
+ "GRAPHQL_VALIDATION_FAILED",
80
+ "Failed to decode codec"
79
81
  ];
80
82
  /**
81
83
  * Make a GraphQL request with retries
@@ -110,6 +112,11 @@ const ORGANIZATION = parse(gql`
110
112
  query TranscendCliOrganization {
111
113
  organization {
112
114
  sombra {
115
+ id
116
+ customerUrl
117
+ }
118
+ sombras {
119
+ id
113
120
  customerUrl
114
121
  }
115
122
  }
@@ -117,6 +124,7 @@ const ORGANIZATION = parse(gql`
117
124
  `);
118
125
  //#endregion
119
126
  //#region src/api/createSombraGotInstance.ts
127
+ const UNCONFIGURED_CUSTOMER_URLS = ["https://sombra-reverse-tunnel.transcend.io", "https://sombra-reverse-tunnel.us.transcend.io"];
120
128
  /**
121
129
  * Instantiate an instance of got that is capable of making requests
122
130
  * to a sombra gateway.
@@ -127,11 +135,16 @@ const ORGANIZATION = parse(gql`
127
135
  * @returns The instance of got that is capable of making requests to the customer ingress
128
136
  */
129
137
  async function createSombraGotInstance(transcendUrl, transcendApiKey, options = {}) {
130
- const { logger = NOOP_LOGGER, sombraApiKey, sombraUrl } = options;
138
+ const { logger = NOOP_LOGGER, sombraApiKey, sombraUrl, sombraId } = options;
131
139
  const { organization } = await makeGraphQLRequest(buildTranscendGraphQLClient(transcendUrl, transcendApiKey), ORGANIZATION, { logger });
132
- const { customerUrl } = organization.sombra;
140
+ let customerUrl;
141
+ if (sombraId) {
142
+ const target = organization.sombras.find(({ id }) => id === sombraId);
143
+ if (!target) throw new Error(`Could not find a Sombra gateway with ID: "${sombraId}"`);
144
+ customerUrl = target.customerUrl;
145
+ } else customerUrl = organization.sombra.customerUrl;
133
146
  const sombraToUse = sombraUrl || customerUrl;
134
- if (!sombraUrl && ["https://sombra-reverse-tunnel.transcend.io", "https://sombra-reverse-tunnel.us.transcend.io"].includes(customerUrl)) throw new Error("It looks like your Sombra customer ingress URL has not been set up. Please follow the instructions here to configure networking for Sombra: https://docs.transcend.io/docs/articles/sombra/deploying/customizing-sombra/networking");
147
+ if (!sombraUrl && (!customerUrl || UNCONFIGURED_CUSTOMER_URLS.includes(customerUrl))) throw new Error(`It looks like the customer ingress URL of your Sombra gateway${sombraId ? ` "${sombraId}"` : ""} has not been set up. Please follow the instructions here to configure networking for Sombra: https://docs.transcend.io/docs/articles/sombra/deploying/customizing-sombra/networking`);
135
148
  logger.info(`Using sombra: ${sombraToUse}`);
136
149
  return got.extend({
137
150
  prefixUrl: sombraToUse,
@@ -284,7 +297,7 @@ const UPDATE_BUSINESS_ENTITIES = gql`
284
297
  `;
285
298
  //#endregion
286
299
  //#region src/data-inventory/fetchAllBusinessEntities.ts
287
- const PAGE_SIZE$41 = 20;
300
+ const PAGE_SIZE$42 = 20;
288
301
  /**
289
302
  * Fetch all businessEntities in the organization
290
303
  *
@@ -299,14 +312,14 @@ async function fetchAllBusinessEntities(client, options = {}) {
299
312
  do {
300
313
  const { businessEntities: { nodes } } = await makeGraphQLRequest(client, BUSINESS_ENTITIES, {
301
314
  variables: {
302
- first: PAGE_SIZE$41,
315
+ first: PAGE_SIZE$42,
303
316
  offset
304
317
  },
305
318
  logger
306
319
  });
307
320
  businessEntities.push(...nodes);
308
- offset += PAGE_SIZE$41;
309
- shouldContinue = nodes.length === PAGE_SIZE$41;
321
+ offset += PAGE_SIZE$42;
322
+ shouldContinue = nodes.length === PAGE_SIZE$42;
310
323
  } while (shouldContinue);
311
324
  return businessEntities.sort((a, b) => a.title.localeCompare(b.title));
312
325
  }
@@ -357,7 +370,7 @@ const UPDATE_DATA_SUB_CATEGORIES = gql`
357
370
  `;
358
371
  //#endregion
359
372
  //#region src/data-inventory/fetchAllDataCategories.ts
360
- const PAGE_SIZE$40 = 20;
373
+ const PAGE_SIZE$41 = 20;
361
374
  /**
362
375
  * Fetch all dataSubCategories in the organization
363
376
  *
@@ -373,14 +386,14 @@ async function fetchAllDataCategories(client, options = {}) {
373
386
  do {
374
387
  const { dataSubCategories: { nodes } } = await makeGraphQLRequest(client, DATA_SUB_CATEGORIES, {
375
388
  variables: {
376
- first: PAGE_SIZE$40,
389
+ first: PAGE_SIZE$41,
377
390
  offset
378
391
  },
379
392
  logger
380
393
  });
381
394
  dataSubCategories.push(...nodes);
382
- offset += PAGE_SIZE$40;
383
- shouldContinue = nodes.length === PAGE_SIZE$40;
395
+ offset += PAGE_SIZE$41;
396
+ shouldContinue = nodes.length === PAGE_SIZE$41;
384
397
  } while (shouldContinue);
385
398
  return dataSubCategories.sort((a, b) => a.name.localeCompare(b.name));
386
399
  }
@@ -874,7 +887,7 @@ const IDENTIFIERS = parse(gql`
874
887
  `);
875
888
  //#endregion
876
889
  //#region src/data-inventory/fetchAllIdentifiers.ts
877
- const PAGE_SIZE$39 = 20;
890
+ const PAGE_SIZE$40 = 20;
878
891
  /**
879
892
  * Fetch all identifiers in the organization
880
893
  *
@@ -891,13 +904,13 @@ async function fetchAllIdentifiers(client, options = {}) {
891
904
  const { identifiers: { nodes } } = await makeGraphQLRequest(client, IDENTIFIERS, {
892
905
  logger,
893
906
  variables: {
894
- first: PAGE_SIZE$39,
907
+ first: PAGE_SIZE$40,
895
908
  offset
896
909
  }
897
910
  });
898
911
  identifiers.push(...nodes);
899
- offset += PAGE_SIZE$39;
900
- shouldContinue = nodes.length === PAGE_SIZE$39;
912
+ offset += PAGE_SIZE$40;
913
+ shouldContinue = nodes.length === PAGE_SIZE$40;
901
914
  } while (shouldContinue);
902
915
  return identifiers.sort((a, b) => a.name.localeCompare(b.name));
903
916
  }
@@ -976,7 +989,7 @@ const UPDATE_PROCESSING_ACTIVITIES = gql`
976
989
  `;
977
990
  //#endregion
978
991
  //#region src/data-inventory/fetchAllProcessingActivities.ts
979
- const PAGE_SIZE$38 = 20;
992
+ const PAGE_SIZE$39 = 20;
980
993
  /**
981
994
  * Fetch all processingActivities in the organization
982
995
  *
@@ -992,14 +1005,14 @@ async function fetchAllProcessingActivities(client, options = {}) {
992
1005
  do {
993
1006
  const { processingActivities: { nodes } } = await makeGraphQLRequest(client, PROCESSING_ACTIVITIES, {
994
1007
  variables: {
995
- first: PAGE_SIZE$38,
1008
+ first: PAGE_SIZE$39,
996
1009
  offset
997
1010
  },
998
1011
  logger
999
1012
  });
1000
1013
  processingActivities.push(...nodes);
1001
- offset += PAGE_SIZE$38;
1002
- shouldContinue = nodes.length === PAGE_SIZE$38;
1014
+ offset += PAGE_SIZE$39;
1015
+ shouldContinue = nodes.length === PAGE_SIZE$39;
1003
1016
  } while (shouldContinue);
1004
1017
  return processingActivities.sort((a, b) => a.title.localeCompare(b.title));
1005
1018
  }
@@ -1064,7 +1077,7 @@ const UPDATE_VENDORS = gql`
1064
1077
  `;
1065
1078
  //#endregion
1066
1079
  //#region src/data-inventory/fetchAllVendors.ts
1067
- const PAGE_SIZE$37 = 20;
1080
+ const PAGE_SIZE$38 = 20;
1068
1081
  /**
1069
1082
  * Fetch all vendors in the organization
1070
1083
  *
@@ -1079,14 +1092,14 @@ async function fetchAllVendors(client, options = {}) {
1079
1092
  do {
1080
1093
  const { vendors: { nodes } } = await makeGraphQLRequest(client, VENDORS, {
1081
1094
  variables: {
1082
- first: PAGE_SIZE$37,
1095
+ first: PAGE_SIZE$38,
1083
1096
  offset
1084
1097
  },
1085
1098
  logger
1086
1099
  });
1087
1100
  vendors.push(...nodes);
1088
- offset += PAGE_SIZE$37;
1089
- shouldContinue = nodes.length === PAGE_SIZE$37;
1101
+ offset += PAGE_SIZE$38;
1102
+ shouldContinue = nodes.length === PAGE_SIZE$38;
1090
1103
  } while (shouldContinue);
1091
1104
  return vendors.sort((a, b) => a.title.localeCompare(b.title));
1092
1105
  }
@@ -1325,9 +1338,9 @@ async function syncDataSiloDependencies(client, options) {
1325
1338
  logger.info(`[Batch ${ind}/${dependencyUpdateChunk.length}] Updating "${dependencyUpdateChunk.length}" data silos...`);
1326
1339
  try {
1327
1340
  await makeGraphQLRequest(client, UPDATE_DATA_SILOS, {
1328
- variables: { input: { dataSilos: dependencyUpdateChunk.map(([id, dependedOnDataSiloTitles]) => ({
1341
+ variables: { input: { dataSilos: dependencyUpdateChunk.map(([id, dependedOnDataSilos]) => ({
1329
1342
  id,
1330
- dependedOnDataSiloTitles
1343
+ dependedOnDataSilos
1331
1344
  })) } },
1332
1345
  logger
1333
1346
  });
@@ -1565,7 +1578,7 @@ const UPDATE_PURPOSE = parse(gql`
1565
1578
  `);
1566
1579
  //#endregion
1567
1580
  //#region src/preference-management/fetchAllPurposes.ts
1568
- const PAGE_SIZE$36 = 20;
1581
+ const PAGE_SIZE$37 = 20;
1569
1582
  /**
1570
1583
  * Fetch all purposes in the organization
1571
1584
  *
@@ -1582,14 +1595,14 @@ async function fetchAllPurposes(client, options = {}) {
1582
1595
  const { purposes: { nodes } } = await makeGraphQLRequest(client, PURPOSES$1, {
1583
1596
  logger,
1584
1597
  variables: {
1585
- first: PAGE_SIZE$36,
1598
+ first: PAGE_SIZE$37,
1586
1599
  offset,
1587
1600
  input: { includeDeleted }
1588
1601
  }
1589
1602
  });
1590
1603
  purposes.push(...nodes);
1591
- offset += PAGE_SIZE$36;
1592
- shouldContinue = nodes.length === PAGE_SIZE$36;
1604
+ offset += PAGE_SIZE$37;
1605
+ shouldContinue = nodes.length === PAGE_SIZE$37;
1593
1606
  } while (shouldContinue);
1594
1607
  return purposes.sort((a, b) => a.trackingType.localeCompare(b.trackingType));
1595
1608
  }
@@ -1643,7 +1656,7 @@ const CREATE_OR_UPDATE_PREFERENCE_TOPIC = parse(gql`
1643
1656
  `);
1644
1657
  //#endregion
1645
1658
  //#region src/preference-management/fetchAllPreferenceTopics.ts
1646
- const PAGE_SIZE$35 = 20;
1659
+ const PAGE_SIZE$36 = 20;
1647
1660
  /**
1648
1661
  * Fetch all preference topics in the organization
1649
1662
  *
@@ -1660,13 +1673,13 @@ async function fetchAllPreferenceTopics(client, options = {}) {
1660
1673
  const { preferenceTopics: { nodes } } = await makeGraphQLRequest(client, PREFERENCE_TOPICS, {
1661
1674
  logger,
1662
1675
  variables: {
1663
- first: PAGE_SIZE$35,
1676
+ first: PAGE_SIZE$36,
1664
1677
  offset
1665
1678
  }
1666
1679
  });
1667
1680
  preferenceTopics.push(...nodes);
1668
- offset += PAGE_SIZE$35;
1669
- shouldContinue = nodes.length === PAGE_SIZE$35;
1681
+ offset += PAGE_SIZE$36;
1682
+ shouldContinue = nodes.length === PAGE_SIZE$36;
1670
1683
  } while (shouldContinue);
1671
1684
  return preferenceTopics.sort((a, b) => `${a.slug}:${a.purpose.trackingType}`.localeCompare(`${b.slug}:${b.purpose.trackingType}`));
1672
1685
  }
@@ -2840,7 +2853,7 @@ const CREATE_OR_UPDATE_PREFERENCE_OPTION_VALUES = parse(gql`
2840
2853
  `);
2841
2854
  //#endregion
2842
2855
  //#region src/preference-management/fetchAllPreferenceOptionValues.ts
2843
- const PAGE_SIZE$34 = 50;
2856
+ const PAGE_SIZE$35 = 50;
2844
2857
  /**
2845
2858
  * Fetch all preference option values in the organization
2846
2859
  *
@@ -2856,14 +2869,14 @@ async function fetchAllPreferenceOptionValues(client, options = {}) {
2856
2869
  do {
2857
2870
  const { preferenceOptionValues: { nodes } } = await makeGraphQLRequest(client, PREFERENCE_OPTION_VALUES, {
2858
2871
  variables: {
2859
- first: PAGE_SIZE$34,
2872
+ first: PAGE_SIZE$35,
2860
2873
  offset
2861
2874
  },
2862
2875
  logger
2863
2876
  });
2864
2877
  preferenceOptionValues.push(...nodes);
2865
- offset += PAGE_SIZE$34;
2866
- shouldContinue = nodes.length === PAGE_SIZE$34;
2878
+ offset += PAGE_SIZE$35;
2879
+ shouldContinue = nodes.length === PAGE_SIZE$35;
2867
2880
  } while (shouldContinue);
2868
2881
  return preferenceOptionValues.sort((a, b) => a.slug.localeCompare(b.slug));
2869
2882
  }
@@ -3254,7 +3267,7 @@ const SET_RESOURCE_ATTRIBUTES = gql`
3254
3267
  `;
3255
3268
  //#endregion
3256
3269
  //#region src/administration/fetchAllAttributes.ts
3257
- const PAGE_SIZE$33 = 100;
3270
+ const PAGE_SIZE$34 = 100;
3258
3271
  /**
3259
3272
  * Fetch all attribute values for an attribute key
3260
3273
  *
@@ -3270,15 +3283,15 @@ async function fetchAllAttributeValues(client, options) {
3270
3283
  do {
3271
3284
  const { attributeValues: { nodes } } = await makeGraphQLRequest(client, ATTRIBUTE_VALUES, {
3272
3285
  variables: {
3273
- first: PAGE_SIZE$33,
3286
+ first: PAGE_SIZE$34,
3274
3287
  offset,
3275
3288
  attributeKeyId
3276
3289
  },
3277
3290
  logger
3278
3291
  });
3279
3292
  attributeValues.push(...nodes);
3280
- offset += PAGE_SIZE$33;
3281
- shouldContinue = nodes.length === PAGE_SIZE$33;
3293
+ offset += PAGE_SIZE$34;
3294
+ shouldContinue = nodes.length === PAGE_SIZE$34;
3282
3295
  } while (shouldContinue);
3283
3296
  return attributeValues.sort((a, b) => a.name.localeCompare(b.name));
3284
3297
  }
@@ -3297,7 +3310,7 @@ async function fetchAllAttributes(client, options = {}) {
3297
3310
  do {
3298
3311
  const { attributeKeys: { nodes } } = await makeGraphQLRequest(client, ATTRIBUTES, {
3299
3312
  variables: {
3300
- first: PAGE_SIZE$33,
3313
+ first: PAGE_SIZE$34,
3301
3314
  offset
3302
3315
  },
3303
3316
  logger
@@ -3309,8 +3322,8 @@ async function fetchAllAttributes(client, options = {}) {
3309
3322
  filterBy: { attributeKeyId: node.id }
3310
3323
  }) : []
3311
3324
  }))));
3312
- offset += PAGE_SIZE$33;
3313
- shouldContinue = nodes.length === PAGE_SIZE$33;
3325
+ offset += PAGE_SIZE$34;
3326
+ shouldContinue = nodes.length === PAGE_SIZE$34;
3314
3327
  } while (shouldContinue);
3315
3328
  return attributes.sort((a, b) => a.name.localeCompare(b.name));
3316
3329
  }
@@ -3427,7 +3440,7 @@ const UPDATE_TEAM = gql`
3427
3440
  `;
3428
3441
  //#endregion
3429
3442
  //#region src/administration/fetchAllTeams.ts
3430
- const PAGE_SIZE$32 = 20;
3443
+ const PAGE_SIZE$33 = 20;
3431
3444
  /**
3432
3445
  * Fetch all teams in the organization
3433
3446
  *
@@ -3443,20 +3456,20 @@ async function fetchAllTeams(client, options = {}) {
3443
3456
  do {
3444
3457
  const { teams: { nodes } } = await makeGraphQLRequest(client, TEAMS, {
3445
3458
  variables: {
3446
- first: PAGE_SIZE$32,
3459
+ first: PAGE_SIZE$33,
3447
3460
  offset
3448
3461
  },
3449
3462
  logger
3450
3463
  });
3451
3464
  teams.push(...nodes);
3452
- offset += PAGE_SIZE$32;
3453
- shouldContinue = nodes.length === PAGE_SIZE$32;
3465
+ offset += PAGE_SIZE$33;
3466
+ shouldContinue = nodes.length === PAGE_SIZE$33;
3454
3467
  } while (shouldContinue);
3455
3468
  return teams.sort((a, b) => a.name.localeCompare(b.name));
3456
3469
  }
3457
3470
  //#endregion
3458
3471
  //#region src/administration/fetchParentOrganizationTeams.ts
3459
- const PAGE_SIZE$31 = 20;
3472
+ const PAGE_SIZE$32 = 20;
3460
3473
  /**
3461
3474
  * Fetch teams from the parent organization that can be linked to child-org teams
3462
3475
  *
@@ -3472,15 +3485,15 @@ async function fetchParentOrganizationTeams(client, options = {}) {
3472
3485
  do {
3473
3486
  const { parentOrganizationTeams: { nodes } } = await makeGraphQLRequest(client, PARENT_ORGANIZATION_TEAMS, {
3474
3487
  variables: {
3475
- first: PAGE_SIZE$31,
3488
+ first: PAGE_SIZE$32,
3476
3489
  offset,
3477
3490
  filterBy
3478
3491
  },
3479
3492
  logger
3480
3493
  });
3481
3494
  teams.push(...nodes);
3482
- offset += PAGE_SIZE$31;
3483
- shouldContinue = nodes.length === PAGE_SIZE$31;
3495
+ offset += PAGE_SIZE$32;
3496
+ shouldContinue = nodes.length === PAGE_SIZE$32;
3484
3497
  } while (shouldContinue);
3485
3498
  return teams.sort((a, b) => a.name.localeCompare(b.name));
3486
3499
  }
@@ -3526,7 +3539,7 @@ const USERS = gql`
3526
3539
  `;
3527
3540
  //#endregion
3528
3541
  //#region src/administration/fetchAllUsers.ts
3529
- const PAGE_SIZE$30 = 20;
3542
+ const PAGE_SIZE$31 = 20;
3530
3543
  /**
3531
3544
  * Fetch all users in the organization
3532
3545
  *
@@ -3542,14 +3555,14 @@ async function fetchAllUsers(client, options = {}) {
3542
3555
  do {
3543
3556
  const { users: { nodes } } = await makeGraphQLRequest(client, USERS, {
3544
3557
  variables: {
3545
- first: PAGE_SIZE$30,
3558
+ first: PAGE_SIZE$31,
3546
3559
  offset
3547
3560
  },
3548
3561
  logger
3549
3562
  });
3550
3563
  users.push(...nodes);
3551
- offset += PAGE_SIZE$30;
3552
- shouldContinue = nodes.length === PAGE_SIZE$30;
3564
+ offset += PAGE_SIZE$31;
3565
+ shouldContinue = nodes.length === PAGE_SIZE$31;
3553
3566
  } while (shouldContinue);
3554
3567
  return users.sort((a, b) => a.email.localeCompare(b.email));
3555
3568
  }
@@ -3591,7 +3604,7 @@ const DELETE_API_KEY = gql`
3591
3604
  `;
3592
3605
  //#endregion
3593
3606
  //#region src/administration/fetchApiKeys.ts
3594
- const PAGE_SIZE$29 = 20;
3607
+ const PAGE_SIZE$30 = 20;
3595
3608
  const ADMIN_LINK = "https://app.transcend.io/infrastructure/api-keys";
3596
3609
  /**
3597
3610
  * Fetch all API keys in an organization
@@ -3608,15 +3621,15 @@ async function fetchAllApiKeys(client, options = {}) {
3608
3621
  do {
3609
3622
  const { apiKeys: { nodes } } = await makeGraphQLRequest(client, API_KEYS, {
3610
3623
  variables: {
3611
- first: PAGE_SIZE$29,
3624
+ first: PAGE_SIZE$30,
3612
3625
  offset,
3613
3626
  titles
3614
3627
  },
3615
3628
  logger
3616
3629
  });
3617
3630
  apiKeys.push(...nodes);
3618
- offset += PAGE_SIZE$29;
3619
- shouldContinue = nodes.length === PAGE_SIZE$29;
3631
+ offset += PAGE_SIZE$30;
3632
+ shouldContinue = nodes.length === PAGE_SIZE$30;
3620
3633
  } while (shouldContinue);
3621
3634
  return apiKeys.sort((a, b) => a.title.localeCompare(b.title));
3622
3635
  }
@@ -4591,7 +4604,7 @@ const DELETE_COOKIES = gql`
4591
4604
  `;
4592
4605
  //#endregion
4593
4606
  //#region src/consent/fetchAllCookies.ts
4594
- const PAGE_SIZE$28 = 20;
4607
+ const PAGE_SIZE$29 = 20;
4595
4608
  const DEFAULT_COOKIE_ORDER = [{
4596
4609
  field: "createdAt",
4597
4610
  direction: OrderDirection.Asc
@@ -4616,7 +4629,7 @@ async function fetchAllCookies(client, options = {}) {
4616
4629
  const { cookies: { nodes } } = await makeGraphQLRequest(client, COOKIES, {
4617
4630
  variables: {
4618
4631
  input: { airgapBundleId },
4619
- first: PAGE_SIZE$28,
4632
+ first: PAGE_SIZE$29,
4620
4633
  offset,
4621
4634
  filterBy: { status },
4622
4635
  orderBy
@@ -4624,8 +4637,8 @@ async function fetchAllCookies(client, options = {}) {
4624
4637
  logger
4625
4638
  });
4626
4639
  cookies.push(...nodes);
4627
- offset += PAGE_SIZE$28;
4628
- shouldContinue = nodes.length === PAGE_SIZE$28;
4640
+ offset += PAGE_SIZE$29;
4641
+ shouldContinue = nodes.length === PAGE_SIZE$29;
4629
4642
  } while (shouldContinue);
4630
4643
  return cookies.sort((a, b) => a.name.localeCompare(b.name));
4631
4644
  }
@@ -4737,7 +4750,7 @@ const DELETE_DATA_FLOWS = gql`
4737
4750
  `;
4738
4751
  //#endregion
4739
4752
  //#region src/consent/fetchAllDataFlows.ts
4740
- const PAGE_SIZE$27 = 20;
4753
+ const PAGE_SIZE$28 = 20;
4741
4754
  const DEFAULT_DATA_FLOW_ORDER = [{
4742
4755
  field: "createdAt",
4743
4756
  direction: OrderDirection.Asc
@@ -4762,7 +4775,7 @@ async function fetchAllDataFlows(client, options = {}) {
4762
4775
  const { dataFlows: { nodes } } = await makeGraphQLRequest(client, DATA_FLOWS, {
4763
4776
  variables: {
4764
4777
  input: { airgapBundleId },
4765
- first: PAGE_SIZE$27,
4778
+ first: PAGE_SIZE$28,
4766
4779
  offset,
4767
4780
  filterBy: {
4768
4781
  status,
@@ -4773,8 +4786,8 @@ async function fetchAllDataFlows(client, options = {}) {
4773
4786
  logger
4774
4787
  });
4775
4788
  dataFlows.push(...nodes);
4776
- offset += PAGE_SIZE$27;
4777
- shouldContinue = nodes.length === PAGE_SIZE$27;
4789
+ offset += PAGE_SIZE$28;
4790
+ shouldContinue = nodes.length === PAGE_SIZE$28;
4778
4791
  } while (shouldContinue);
4779
4792
  return dataFlows.sort((a, b) => a.value.localeCompare(b.value));
4780
4793
  }
@@ -5036,7 +5049,7 @@ const UPDATE_PROCESSING_PURPOSE_SUB_CATEGORIES = gql`
5036
5049
  `;
5037
5050
  //#endregion
5038
5051
  //#region src/consent/fetchAllProcessingPurposes.ts
5039
- const PAGE_SIZE$26 = 20;
5052
+ const PAGE_SIZE$27 = 20;
5040
5053
  /**
5041
5054
  * Fetch all processingPurposeSubCategories in the organization
5042
5055
  *
@@ -5051,14 +5064,14 @@ async function fetchAllProcessingPurposes(client, options = {}) {
5051
5064
  do {
5052
5065
  const { processingPurposeSubCategories: { nodes } } = await makeGraphQLRequest(client, PROCESSING_PURPOSE_SUB_CATEGORIES, {
5053
5066
  variables: {
5054
- first: PAGE_SIZE$26,
5067
+ first: PAGE_SIZE$27,
5055
5068
  offset
5056
5069
  },
5057
5070
  logger: options.logger
5058
5071
  });
5059
5072
  processingPurposeSubCategories.push(...nodes);
5060
- offset += PAGE_SIZE$26;
5061
- shouldContinue = nodes.length === PAGE_SIZE$26;
5073
+ offset += PAGE_SIZE$27;
5074
+ shouldContinue = nodes.length === PAGE_SIZE$27;
5062
5075
  } while (shouldContinue);
5063
5076
  return processingPurposeSubCategories.sort((a, b) => a.name.localeCompare(b.name));
5064
5077
  }
@@ -5160,7 +5173,7 @@ const CREATE_CONSENT_EXPERIENCE = gql`
5160
5173
  `;
5161
5174
  //#endregion
5162
5175
  //#region src/consent/fetchConsentManagerExperiences.ts
5163
- const PAGE_SIZE$25 = 50;
5176
+ const PAGE_SIZE$26 = 50;
5164
5177
  /**
5165
5178
  * Fetch consent manager experiences
5166
5179
  *
@@ -5175,14 +5188,14 @@ async function fetchConsentManagerExperiences(client, options = {}) {
5175
5188
  do {
5176
5189
  const { experiences: { nodes } } = await makeGraphQLRequest(client, EXPERIENCES, {
5177
5190
  variables: {
5178
- first: PAGE_SIZE$25,
5191
+ first: PAGE_SIZE$26,
5179
5192
  offset
5180
5193
  },
5181
5194
  logger: options.logger
5182
5195
  });
5183
5196
  experiences.push(...nodes);
5184
- offset += PAGE_SIZE$25;
5185
- shouldContinue = nodes.length === PAGE_SIZE$25;
5197
+ offset += PAGE_SIZE$26;
5198
+ shouldContinue = nodes.length === PAGE_SIZE$26;
5186
5199
  } while (shouldContinue);
5187
5200
  return experiences.sort((a, b) => a.name.localeCompare(b.name));
5188
5201
  }
@@ -5204,7 +5217,7 @@ async function fetchConsentManagerTheme(client, options) {
5204
5217
  }
5205
5218
  //#endregion
5206
5219
  //#region src/consent/fetchConsentThemes.ts
5207
- const PAGE_SIZE$24 = 50;
5220
+ const PAGE_SIZE$25 = 50;
5208
5221
  /**
5209
5222
  * Fetch consent themes
5210
5223
  *
@@ -5221,20 +5234,20 @@ async function fetchConsentThemes(client, options = {}) {
5221
5234
  const { consentUiThemes: { nodes } } = await makeGraphQLRequest(client, FETCH_CONSENT_UI_THEMES, {
5222
5235
  variables: {
5223
5236
  airgapBundleId,
5224
- first: PAGE_SIZE$24,
5237
+ first: PAGE_SIZE$25,
5225
5238
  offset
5226
5239
  },
5227
5240
  logger: options.logger
5228
5241
  });
5229
5242
  themes.push(...nodes);
5230
- offset += PAGE_SIZE$24;
5231
- shouldContinue = nodes.length === PAGE_SIZE$24;
5243
+ offset += PAGE_SIZE$25;
5244
+ shouldContinue = nodes.length === PAGE_SIZE$25;
5232
5245
  } while (shouldContinue);
5233
5246
  return themes;
5234
5247
  }
5235
5248
  //#endregion
5236
5249
  //#region src/consent/fetchConsentVariants.ts
5237
- const PAGE_SIZE$23 = 50;
5250
+ const PAGE_SIZE$24 = 50;
5238
5251
  /**
5239
5252
  * Fetch consent variants
5240
5253
  *
@@ -5251,14 +5264,14 @@ async function fetchConsentVariants(client, options = {}) {
5251
5264
  const { consentUiVariants: { nodes } } = await makeGraphQLRequest(client, FETCH_CONSENT_UI_VARIANTS, {
5252
5265
  variables: {
5253
5266
  airgapBundleId,
5254
- first: PAGE_SIZE$23,
5267
+ first: PAGE_SIZE$24,
5255
5268
  offset
5256
5269
  },
5257
5270
  logger: options.logger
5258
5271
  });
5259
5272
  variants.push(...nodes);
5260
- offset += PAGE_SIZE$23;
5261
- shouldContinue = nodes.length === PAGE_SIZE$23;
5273
+ offset += PAGE_SIZE$24;
5274
+ shouldContinue = nodes.length === PAGE_SIZE$24;
5262
5275
  } while (shouldContinue);
5263
5276
  return variants;
5264
5277
  }
@@ -5611,7 +5624,7 @@ async function syncConsentUiVariants(client, airgapBundleId, yamlVariants, synce
5611
5624
  }
5612
5625
  //#endregion
5613
5626
  //#region src/consent/syncPartitions.ts
5614
- const PAGE_SIZE$22 = 50;
5627
+ const PAGE_SIZE$23 = 50;
5615
5628
  /**
5616
5629
  * Fetch the list of partitions
5617
5630
  *
@@ -5627,14 +5640,14 @@ async function fetchPartitions(client, options = {}) {
5627
5640
  do {
5628
5641
  const { consentPartitions: { nodes } } = await makeGraphQLRequest(client, CONSENT_PARTITIONS, {
5629
5642
  variables: {
5630
- first: PAGE_SIZE$22,
5643
+ first: PAGE_SIZE$23,
5631
5644
  offset
5632
5645
  },
5633
5646
  logger
5634
5647
  });
5635
5648
  partitions.push(...nodes);
5636
- offset += PAGE_SIZE$22;
5637
- shouldContinue = nodes.length === PAGE_SIZE$22;
5649
+ offset += PAGE_SIZE$23;
5650
+ shouldContinue = nodes.length === PAGE_SIZE$23;
5638
5651
  } while (shouldContinue);
5639
5652
  return partitions.sort((a, b) => a.name.localeCompare(b.name));
5640
5653
  }
@@ -6191,7 +6204,7 @@ async function syncPrivacyCenter(client, privacyCenter, options = {}) {
6191
6204
  }
6192
6205
  //#endregion
6193
6206
  //#region src/consent/fetchAllConsentWorkflowTriggers.ts
6194
- const PAGE_SIZE$21 = 50;
6207
+ const PAGE_SIZE$22 = 50;
6195
6208
  /**
6196
6209
  * Fetch all consent workflow triggers in the organization
6197
6210
  *
@@ -6207,14 +6220,14 @@ async function fetchAllConsentWorkflowTriggers(client, options = {}) {
6207
6220
  do {
6208
6221
  const { consentWorkflowTriggers: { nodes } } = await makeGraphQLRequest(client, CONSENT_WORKFLOW_TRIGGERS, {
6209
6222
  variables: {
6210
- first: PAGE_SIZE$21,
6223
+ first: PAGE_SIZE$22,
6211
6224
  offset
6212
6225
  },
6213
6226
  logger
6214
6227
  });
6215
6228
  triggers.push(...nodes);
6216
- offset += PAGE_SIZE$21;
6217
- shouldContinue = nodes.length === PAGE_SIZE$21;
6229
+ offset += PAGE_SIZE$22;
6230
+ shouldContinue = nodes.length === PAGE_SIZE$22;
6218
6231
  } while (shouldContinue);
6219
6232
  return triggers.sort((a, b) => a.name.localeCompare(b.name));
6220
6233
  }
@@ -6250,7 +6263,7 @@ const UPDATE_ACTION = gql`
6250
6263
  `;
6251
6264
  //#endregion
6252
6265
  //#region src/dsr-automation/fetchAllActions.ts
6253
- const PAGE_SIZE$20 = 20;
6266
+ const PAGE_SIZE$21 = 20;
6254
6267
  /**
6255
6268
  * Fetch all actions in the organization
6256
6269
  *
@@ -6266,14 +6279,14 @@ async function fetchAllActions(client, options = {}) {
6266
6279
  do {
6267
6280
  const { actions: { nodes } } = await makeGraphQLRequest(client, ACTIONS, {
6268
6281
  variables: {
6269
- first: PAGE_SIZE$20,
6282
+ first: PAGE_SIZE$21,
6270
6283
  offset
6271
6284
  },
6272
6285
  logger
6273
6286
  });
6274
6287
  actions.push(...nodes);
6275
- offset += PAGE_SIZE$20;
6276
- shouldContinue = nodes.length === PAGE_SIZE$20;
6288
+ offset += PAGE_SIZE$21;
6289
+ shouldContinue = nodes.length === PAGE_SIZE$21;
6277
6290
  } while (shouldContinue);
6278
6291
  return actions.sort((a, b) => a.type.localeCompare(b.type));
6279
6292
  }
@@ -6340,7 +6353,7 @@ const UPDATE_WORKFLOW_CONFIG = parse(gql`
6340
6353
  `);
6341
6354
  //#endregion
6342
6355
  //#region src/dsr-automation/fetchAllWorkflowConfigs.ts
6343
- const PAGE_SIZE$19 = 50;
6356
+ const PAGE_SIZE$20 = 50;
6344
6357
  /**
6345
6358
  * Display title for a workflow config, matching the admin UI:
6346
6359
  * `internalName` when set, otherwise the external title.
@@ -6366,15 +6379,15 @@ async function fetchAllWorkflowConfigs(client, options = {}) {
6366
6379
  do {
6367
6380
  const { workflows: { nodes } } = await makeGraphQLRequest(client, WORKFLOW_CONFIGS, {
6368
6381
  variables: {
6369
- first: PAGE_SIZE$19,
6382
+ first: PAGE_SIZE$20,
6370
6383
  offset,
6371
6384
  filterBy: workflowConfigType ? { workflowConfigType } : void 0
6372
6385
  },
6373
6386
  logger
6374
6387
  });
6375
6388
  configs.push(...nodes);
6376
- offset += PAGE_SIZE$19;
6377
- shouldContinue = nodes.length === PAGE_SIZE$19;
6389
+ offset += PAGE_SIZE$20;
6390
+ shouldContinue = nodes.length === PAGE_SIZE$20;
6378
6391
  } while (shouldContinue);
6379
6392
  return configs.sort((a, b) => getWorkflowConfigDisplayTitle(a).localeCompare(getWorkflowConfigDisplayTitle(b)));
6380
6393
  }
@@ -6803,7 +6816,7 @@ const SKIP_REQUEST_ENRICHER = gql`
6803
6816
  `;
6804
6817
  //#endregion
6805
6818
  //#region src/dsr-automation/fetchAllRequestEnrichers.ts
6806
- const PAGE_SIZE$18 = 50;
6819
+ const PAGE_SIZE$19 = 50;
6807
6820
  /**
6808
6821
  * Fetch all request enrichers for a particular request
6809
6822
  *
@@ -6819,15 +6832,15 @@ async function fetchAllRequestEnrichers(client, options) {
6819
6832
  do {
6820
6833
  const { requestEnrichers: { nodes } } = await makeGraphQLRequest(client, REQUEST_ENRICHERS, {
6821
6834
  variables: {
6822
- first: PAGE_SIZE$18,
6835
+ first: PAGE_SIZE$19,
6823
6836
  offset,
6824
6837
  requestId
6825
6838
  },
6826
6839
  logger
6827
6840
  });
6828
6841
  requestEnrichers.push(...nodes);
6829
- offset += PAGE_SIZE$18;
6830
- shouldContinue = nodes.length === PAGE_SIZE$18;
6842
+ offset += PAGE_SIZE$19;
6843
+ shouldContinue = nodes.length === PAGE_SIZE$19;
6831
6844
  } while (shouldContinue);
6832
6845
  return requestEnrichers;
6833
6846
  }
@@ -6855,7 +6868,7 @@ const RequestIdentifier = t.type({
6855
6868
  /** Type of identifier */
6856
6869
  type: valuesOf(IdentifierType)
6857
6870
  });
6858
- const PAGE_SIZE$17 = 50;
6871
+ const PAGE_SIZE$18 = 50;
6859
6872
  const RequestIdentifiersResponse = t.type({ identifiers: t.array(RequestIdentifier) });
6860
6873
  /**
6861
6874
  * Validate that the Sombra version meets the minimum requirement for
@@ -6886,7 +6899,7 @@ async function fetchAllRequestIdentifiers(client, sombra, options) {
6886
6899
  if (!skipSombraCheck) await validateSombraVersion(client, { logger });
6887
6900
  do {
6888
6901
  const { identifiers: nodes } = decodeCodec(RequestIdentifiersResponse, await withTransientRetry("Failed to fetch request identifiers", () => sombra.post("v1/request-identifiers", { json: {
6889
- first: PAGE_SIZE$17,
6902
+ first: PAGE_SIZE$18,
6890
6903
  offset,
6891
6904
  requestId
6892
6905
  } }).json(), {
@@ -6895,8 +6908,8 @@ async function fetchAllRequestIdentifiers(client, sombra, options) {
6895
6908
  baseDelayMs: 500
6896
6909
  }));
6897
6910
  requestIdentifiers.push(...nodes);
6898
- offset += PAGE_SIZE$17;
6899
- shouldContinue = nodes.length === PAGE_SIZE$17;
6911
+ offset += PAGE_SIZE$18;
6912
+ shouldContinue = nodes.length === PAGE_SIZE$18;
6900
6913
  } while (shouldContinue);
6901
6914
  return requestIdentifiers;
6902
6915
  }
@@ -6939,7 +6952,7 @@ const REQUEST_IDENTIFIERS = parse(gql`
6939
6952
  `);
6940
6953
  //#endregion
6941
6954
  //#region src/dsr-automation/fetchAllRequestIdentifierMetadata.ts
6942
- const PAGE_SIZE$16 = 50;
6955
+ const PAGE_SIZE$17 = 50;
6943
6956
  /**
6944
6957
  * Fetch all request identifier metadata for a particular request
6945
6958
  *
@@ -6957,7 +6970,7 @@ async function fetchAllRequestIdentifierMetadata(client, options = {}) {
6957
6970
  do {
6958
6971
  const { requestIdentifiers: { nodes } } = await makeGraphQLRequest(client, REQUEST_IDENTIFIERS, {
6959
6972
  variables: {
6960
- first: PAGE_SIZE$16,
6973
+ first: PAGE_SIZE$17,
6961
6974
  offset,
6962
6975
  requestIds: resolvedRequestIds,
6963
6976
  updatedAtBefore: updatedAtBefore ? updatedAtBefore.toISOString() : void 0,
@@ -6966,8 +6979,8 @@ async function fetchAllRequestIdentifierMetadata(client, options = {}) {
6966
6979
  logger
6967
6980
  });
6968
6981
  requestIdentifiers.push(...nodes);
6969
- offset += PAGE_SIZE$16;
6970
- shouldContinue = nodes.length === PAGE_SIZE$16;
6982
+ offset += PAGE_SIZE$17;
6983
+ shouldContinue = nodes.length === PAGE_SIZE$17;
6971
6984
  } while (shouldContinue);
6972
6985
  return requestIdentifiers;
6973
6986
  }
@@ -7148,7 +7161,7 @@ const UPDATE_ENRICHER = gql`
7148
7161
  `;
7149
7162
  //#endregion
7150
7163
  //#region src/dsr-automation/syncEnrichers.ts
7151
- const PAGE_SIZE$15 = 20;
7164
+ const PAGE_SIZE$16 = 20;
7152
7165
  /**
7153
7166
  * Fetch all enrichers in the organization
7154
7167
  *
@@ -7165,15 +7178,15 @@ async function fetchAllEnrichers(client, options = {}) {
7165
7178
  do {
7166
7179
  const { enrichers: { nodes } } = await makeGraphQLRequest(client, ENRICHERS, {
7167
7180
  variables: {
7168
- first: PAGE_SIZE$15,
7181
+ first: PAGE_SIZE$16,
7169
7182
  offset,
7170
7183
  title
7171
7184
  },
7172
7185
  logger
7173
7186
  });
7174
7187
  enrichers.push(...nodes);
7175
- offset += PAGE_SIZE$15;
7176
- shouldContinue = nodes.length === PAGE_SIZE$15;
7188
+ offset += PAGE_SIZE$16;
7189
+ shouldContinue = nodes.length === PAGE_SIZE$16;
7177
7190
  } while (shouldContinue);
7178
7191
  return enrichers.sort((a, b) => a.title.localeCompare(b.title));
7179
7192
  }
@@ -7313,7 +7326,7 @@ async function fetchActiveSiloDiscoPlugin(client, options) {
7313
7326
  }
7314
7327
  //#endregion
7315
7328
  //#region src/dsr-automation/fetchAllAttributeKeys.ts
7316
- const PAGE_SIZE$14 = 20;
7329
+ const PAGE_SIZE$15 = 20;
7317
7330
  /**
7318
7331
  * Fetch all attribute keys enabled for privacy requests
7319
7332
  *
@@ -7329,14 +7342,14 @@ async function fetchAllRequestAttributeKeys(client, options = {}) {
7329
7342
  do {
7330
7343
  const { attributeKeys: { nodes } } = await makeGraphQLRequest(client, ATTRIBUTE_KEYS_REQUESTS, {
7331
7344
  variables: {
7332
- first: PAGE_SIZE$14,
7345
+ first: PAGE_SIZE$15,
7333
7346
  offset
7334
7347
  },
7335
7348
  logger
7336
7349
  });
7337
7350
  attributeKeys.push(...nodes);
7338
- offset += PAGE_SIZE$14;
7339
- shouldContinue = nodes.length === PAGE_SIZE$14;
7351
+ offset += PAGE_SIZE$15;
7352
+ shouldContinue = nodes.length === PAGE_SIZE$15;
7340
7353
  } while (shouldContinue);
7341
7354
  return attributeKeys.sort((a, b) => a.name.localeCompare(b.name));
7342
7355
  }
@@ -7367,7 +7380,7 @@ const SILO_DISCOVERY_RESULTS = gql`
7367
7380
  `;
7368
7381
  //#endregion
7369
7382
  //#region src/dsr-automation/fetchAllSiloDiscoveryResults.ts
7370
- const PAGE_SIZE$13 = 30;
7383
+ const PAGE_SIZE$14 = 30;
7371
7384
  /**
7372
7385
  * Fetch all silo discovery results in the organization
7373
7386
  *
@@ -7383,7 +7396,7 @@ async function fetchAllSiloDiscoveryResults(client, options = {}) {
7383
7396
  do {
7384
7397
  const { siloDiscoveryResults: { nodes } } = await makeGraphQLRequest(client, SILO_DISCOVERY_RESULTS, {
7385
7398
  variables: {
7386
- first: PAGE_SIZE$13,
7399
+ first: PAGE_SIZE$14,
7387
7400
  offset,
7388
7401
  input: {},
7389
7402
  filterBy: {}
@@ -7395,8 +7408,8 @@ async function fetchAllSiloDiscoveryResults(client, options = {}) {
7395
7408
  title: node.suggestedCatalog.title
7396
7409
  } : node);
7397
7410
  siloDiscoveryResults.push(...titledNodes);
7398
- offset += PAGE_SIZE$13;
7399
- shouldContinue = nodes.length === PAGE_SIZE$13;
7411
+ offset += PAGE_SIZE$14;
7412
+ shouldContinue = nodes.length === PAGE_SIZE$14;
7400
7413
  } while (shouldContinue);
7401
7414
  return siloDiscoveryResults;
7402
7415
  }
@@ -7415,7 +7428,7 @@ const CATALOGS = gql`
7415
7428
  `;
7416
7429
  //#endregion
7417
7430
  //#region src/dsr-automation/fetchCatalogs.ts
7418
- const PAGE_SIZE$12 = 100;
7431
+ const PAGE_SIZE$13 = 100;
7419
7432
  /**
7420
7433
  * Fetch all integration catalogs in an organization
7421
7434
  *
@@ -7431,14 +7444,14 @@ async function fetchAllCatalogs(client, options = {}) {
7431
7444
  do {
7432
7445
  const { catalogs: { nodes } } = await makeGraphQLRequest(client, CATALOGS, {
7433
7446
  variables: {
7434
- first: PAGE_SIZE$12,
7447
+ first: PAGE_SIZE$13,
7435
7448
  offset
7436
7449
  },
7437
7450
  logger
7438
7451
  });
7439
7452
  catalogs.push(...nodes);
7440
- offset += PAGE_SIZE$12;
7441
- shouldContinue = nodes.length === PAGE_SIZE$12;
7453
+ offset += PAGE_SIZE$13;
7454
+ shouldContinue = nodes.length === PAGE_SIZE$13;
7442
7455
  } while (shouldContinue);
7443
7456
  return catalogs.sort((a, b) => a.integrationName.localeCompare(b.integrationName));
7444
7457
  }
@@ -7541,7 +7554,7 @@ async function fetchRequestDataSilosCount(client, options = {}) {
7541
7554
  });
7542
7555
  return totalCount;
7543
7556
  }
7544
- const PAGE_SIZE$11 = 100;
7557
+ const PAGE_SIZE$12 = 100;
7545
7558
  /**
7546
7559
  * Fetch all request data silos by some filter criteria
7547
7560
  *
@@ -7557,7 +7570,7 @@ async function fetchRequestDataSilos(client, options = {}) {
7557
7570
  do {
7558
7571
  const { requestDataSilos: { nodes } } = await makeGraphQLRequest(client, REQUEST_DATA_SILOS, {
7559
7572
  variables: {
7560
- first: PAGE_SIZE$11,
7573
+ first: PAGE_SIZE$12,
7561
7574
  offset,
7562
7575
  filterBy: {
7563
7576
  dataSiloId,
@@ -7569,8 +7582,8 @@ async function fetchRequestDataSilos(client, options = {}) {
7569
7582
  logger
7570
7583
  });
7571
7584
  requestDataSilos.push(...nodes);
7572
- offset += PAGE_SIZE$11;
7573
- shouldContinue = nodes.length === PAGE_SIZE$11;
7585
+ offset += PAGE_SIZE$12;
7586
+ shouldContinue = nodes.length === PAGE_SIZE$12;
7574
7587
  onProgress?.(nodes.length);
7575
7588
  } while (shouldContinue && (!limit || offset < limit));
7576
7589
  return requestDataSilos;
@@ -7735,7 +7748,7 @@ const CREATE_TEMPLATE = gql`
7735
7748
  `;
7736
7749
  //#endregion
7737
7750
  //#region src/dsr-automation/syncTemplates.ts
7738
- const PAGE_SIZE$10 = 20;
7751
+ const PAGE_SIZE$11 = 20;
7739
7752
  /**
7740
7753
  * Fetch all Templates in the organization
7741
7754
  *
@@ -7751,15 +7764,15 @@ async function fetchAllTemplates(client, options = {}) {
7751
7764
  do {
7752
7765
  const { templates: { nodes } } = await makeGraphQLRequest(client, TEMPLATES, {
7753
7766
  variables: {
7754
- first: PAGE_SIZE$10,
7767
+ first: PAGE_SIZE$11,
7755
7768
  offset,
7756
7769
  title
7757
7770
  },
7758
7771
  logger
7759
7772
  });
7760
7773
  templates.push(...nodes);
7761
- offset += PAGE_SIZE$10;
7762
- shouldContinue = nodes.length === PAGE_SIZE$10;
7774
+ offset += PAGE_SIZE$11;
7775
+ shouldContinue = nodes.length === PAGE_SIZE$11;
7763
7776
  } while (shouldContinue);
7764
7777
  return templates.sort((a, b) => a.title.localeCompare(b.title));
7765
7778
  }
@@ -8109,7 +8122,7 @@ const UPDATE_AGENT_FILES = gql`
8109
8122
  `;
8110
8123
  //#endregion
8111
8124
  //#region src/ai/fetchAllAgentFiles.ts
8112
- const PAGE_SIZE$9 = 20;
8125
+ const PAGE_SIZE$10 = 20;
8113
8126
  /**
8114
8127
  * Fetch all agent files in the organization
8115
8128
  *
@@ -8125,15 +8138,15 @@ async function fetchAllAgentFiles(client, options = {}) {
8125
8138
  do {
8126
8139
  const { agentFiles: { nodes } } = await makeGraphQLRequest(client, AGENT_FILES, {
8127
8140
  variables: {
8128
- first: PAGE_SIZE$9,
8141
+ first: PAGE_SIZE$10,
8129
8142
  offset,
8130
8143
  filterBy
8131
8144
  },
8132
8145
  logger
8133
8146
  });
8134
8147
  agentFiles.push(...nodes);
8135
- offset += PAGE_SIZE$9;
8136
- shouldContinue = nodes.length === PAGE_SIZE$9;
8148
+ offset += PAGE_SIZE$10;
8149
+ shouldContinue = nodes.length === PAGE_SIZE$10;
8137
8150
  } while (shouldContinue);
8138
8151
  return agentFiles.sort((a, b) => a.name.localeCompare(b.name));
8139
8152
  }
@@ -8174,7 +8187,7 @@ const UPDATE_AGENT_FUNCTIONS = gql`
8174
8187
  `;
8175
8188
  //#endregion
8176
8189
  //#region src/ai/fetchAllAgentFunctions.ts
8177
- const PAGE_SIZE$8 = 20;
8190
+ const PAGE_SIZE$9 = 20;
8178
8191
  /**
8179
8192
  * Fetch all agent functions in the organization
8180
8193
  *
@@ -8190,7 +8203,7 @@ async function fetchAllAgentFunctions(client, options = {}) {
8190
8203
  do {
8191
8204
  const { agentFunctions: { nodes } } = await makeGraphQLRequest(client, AGENT_FUNCTIONS, {
8192
8205
  variables: {
8193
- first: PAGE_SIZE$8,
8206
+ first: PAGE_SIZE$9,
8194
8207
  offset
8195
8208
  },
8196
8209
  logger
@@ -8199,8 +8212,8 @@ async function fetchAllAgentFunctions(client, options = {}) {
8199
8212
  ...node,
8200
8213
  parameters: JSON.parse(node.parameters)
8201
8214
  })));
8202
- offset += PAGE_SIZE$8;
8203
- shouldContinue = nodes.length === PAGE_SIZE$8;
8215
+ offset += PAGE_SIZE$9;
8216
+ shouldContinue = nodes.length === PAGE_SIZE$9;
8204
8217
  } while (shouldContinue);
8205
8218
  return agentFunctions.sort((a, b) => a.name.localeCompare(b.name));
8206
8219
  }
@@ -8265,7 +8278,7 @@ const UPDATE_AGENTS = gql`
8265
8278
  `;
8266
8279
  //#endregion
8267
8280
  //#region src/ai/fetchAllAgents.ts
8268
- const PAGE_SIZE$7 = 20;
8281
+ const PAGE_SIZE$8 = 20;
8269
8282
  /**
8270
8283
  * Fetch all agents in the organization
8271
8284
  *
@@ -8281,15 +8294,15 @@ async function fetchAllAgents(client, options = {}) {
8281
8294
  do {
8282
8295
  const { agents: { nodes } } = await makeGraphQLRequest(client, AGENTS, {
8283
8296
  variables: {
8284
- first: PAGE_SIZE$7,
8297
+ first: PAGE_SIZE$8,
8285
8298
  offset,
8286
8299
  filterBy
8287
8300
  },
8288
8301
  logger
8289
8302
  });
8290
8303
  agents.push(...nodes);
8291
- offset += PAGE_SIZE$7;
8292
- shouldContinue = nodes.length === PAGE_SIZE$7;
8304
+ offset += PAGE_SIZE$8;
8305
+ shouldContinue = nodes.length === PAGE_SIZE$8;
8293
8306
  } while (shouldContinue);
8294
8307
  return agents.sort((a, b) => a.name.localeCompare(b.name));
8295
8308
  }
@@ -8322,7 +8335,7 @@ const LARGE_LANGUAGE_MODELS = gql`
8322
8335
  `;
8323
8336
  //#endregion
8324
8337
  //#region src/ai/fetchLargeLanguageModels.ts
8325
- const PAGE_SIZE$6 = 20;
8338
+ const PAGE_SIZE$7 = 20;
8326
8339
  /**
8327
8340
  * Fetch all LargeLanguageModels in the organization
8328
8341
  *
@@ -8338,14 +8351,14 @@ async function fetchAllLargeLanguageModels(client, options = {}) {
8338
8351
  do {
8339
8352
  const { largeLanguageModels: { nodes } } = await makeGraphQLRequest(client, LARGE_LANGUAGE_MODELS, {
8340
8353
  variables: {
8341
- first: PAGE_SIZE$6,
8354
+ first: PAGE_SIZE$7,
8342
8355
  offset
8343
8356
  },
8344
8357
  logger
8345
8358
  });
8346
8359
  largeLanguageModels.push(...nodes);
8347
- offset += PAGE_SIZE$6;
8348
- shouldContinue = nodes.length === PAGE_SIZE$6;
8360
+ offset += PAGE_SIZE$7;
8361
+ shouldContinue = nodes.length === PAGE_SIZE$7;
8349
8362
  } while (shouldContinue);
8350
8363
  return largeLanguageModels.sort((a, b) => a.name.localeCompare(b.name));
8351
8364
  }
@@ -8371,7 +8384,7 @@ const PROMPT_THREADS = gql`
8371
8384
  `;
8372
8385
  //#endregion
8373
8386
  //#region src/ai/fetchPromptThreads.ts
8374
- const PAGE_SIZE$5 = 20;
8387
+ const PAGE_SIZE$6 = 20;
8375
8388
  /**
8376
8389
  * Fetch all PromptThreads in the organization
8377
8390
  *
@@ -8387,15 +8400,15 @@ async function fetchAllPromptThreads(client, options) {
8387
8400
  do {
8388
8401
  const { promptThreads: { nodes } } = await makeGraphQLRequest(client, PROMPT_THREADS, {
8389
8402
  variables: {
8390
- first: PAGE_SIZE$5,
8403
+ first: PAGE_SIZE$6,
8391
8404
  offset,
8392
8405
  filterBy
8393
8406
  },
8394
8407
  logger
8395
8408
  });
8396
8409
  promptThreads.push(...nodes);
8397
- offset += PAGE_SIZE$5;
8398
- shouldContinue = nodes.length === PAGE_SIZE$5;
8410
+ offset += PAGE_SIZE$6;
8411
+ shouldContinue = nodes.length === PAGE_SIZE$6;
8399
8412
  } while (shouldContinue);
8400
8413
  return promptThreads.sort((a, b) => a.threadId.localeCompare(b.threadId));
8401
8414
  }
@@ -8765,7 +8778,7 @@ const CREATE_ACTION_ITEMS = gql`
8765
8778
  `;
8766
8779
  //#endregion
8767
8780
  //#region src/assessments/fetchAllActionItems.ts
8768
- const PAGE_SIZE$4 = 20;
8781
+ const PAGE_SIZE$5 = 20;
8769
8782
  /**
8770
8783
  * Fetch all action items in the organization
8771
8784
  *
@@ -8781,7 +8794,7 @@ async function fetchAllActionItems(client, options = {}) {
8781
8794
  do {
8782
8795
  const { globalActionItems: { nodes } } = await makeGraphQLRequest(client, GLOBAL_ACTION_ITEMS, {
8783
8796
  variables: {
8784
- first: PAGE_SIZE$4,
8797
+ first: PAGE_SIZE$5,
8785
8798
  offset,
8786
8799
  filterBy: {
8787
8800
  ...filterBy,
@@ -8798,8 +8811,8 @@ async function fetchAllActionItems(client, options = {}) {
8798
8811
  notes: node.notes[0],
8799
8812
  link: node.links[0]
8800
8813
  })));
8801
- offset += PAGE_SIZE$4;
8802
- shouldContinue = nodes.length === PAGE_SIZE$4;
8814
+ offset += PAGE_SIZE$5;
8815
+ shouldContinue = nodes.length === PAGE_SIZE$5;
8803
8816
  } while (shouldContinue);
8804
8817
  return actionItems;
8805
8818
  }
@@ -9092,7 +9105,7 @@ const IMPORT_ONE_TRUST_ASSESSMENT_FORMS = gql`
9092
9105
  `;
9093
9106
  //#endregion
9094
9107
  //#region src/assessments/fetchAllAssessments.ts
9095
- const PAGE_SIZE$3 = 20;
9108
+ const PAGE_SIZE$4 = 20;
9096
9109
  /**
9097
9110
  * Fetch all assessments in the organization
9098
9111
  *
@@ -9107,14 +9120,14 @@ async function fetchAllAssessments(client, options = {}) {
9107
9120
  do {
9108
9121
  const { assessmentForms: { nodes } } = await makeGraphQLRequest(client, ASSESSMENTS, {
9109
9122
  variables: {
9110
- first: PAGE_SIZE$3,
9123
+ first: PAGE_SIZE$4,
9111
9124
  offset
9112
9125
  },
9113
9126
  logger
9114
9127
  });
9115
9128
  assessments.push(...nodes);
9116
- offset += PAGE_SIZE$3;
9117
- shouldContinue = nodes.length === PAGE_SIZE$3;
9129
+ offset += PAGE_SIZE$4;
9130
+ shouldContinue = nodes.length === PAGE_SIZE$4;
9118
9131
  } while (shouldContinue);
9119
9132
  return assessments.sort((a, b) => a.title.localeCompare(b.title));
9120
9133
  }
@@ -9503,7 +9516,7 @@ const CREATE_CODE_PACKAGE = gql`
9503
9516
  `;
9504
9517
  //#endregion
9505
9518
  //#region src/code-intelligence/fetchAllCodePackages.ts
9506
- const PAGE_SIZE$2 = 20;
9519
+ const PAGE_SIZE$3 = 20;
9507
9520
  /**
9508
9521
  * Fetch all code packages in the organization
9509
9522
  *
@@ -9519,14 +9532,14 @@ async function fetchAllCodePackages(client, options = {}) {
9519
9532
  do {
9520
9533
  const { codePackages: { nodes } } = await makeGraphQLRequest(client, CODE_PACKAGES, {
9521
9534
  variables: {
9522
- first: PAGE_SIZE$2,
9535
+ first: PAGE_SIZE$3,
9523
9536
  offset
9524
9537
  },
9525
9538
  logger
9526
9539
  });
9527
9540
  codePackages.push(...nodes);
9528
- offset += PAGE_SIZE$2;
9529
- shouldContinue = nodes.length === PAGE_SIZE$2;
9541
+ offset += PAGE_SIZE$3;
9542
+ shouldContinue = nodes.length === PAGE_SIZE$3;
9530
9543
  } while (shouldContinue);
9531
9544
  return codePackages.sort((a, b) => a.name.localeCompare(b.name));
9532
9545
  }
@@ -9599,7 +9612,7 @@ const CREATE_REPOSITORY = gql`
9599
9612
  `;
9600
9613
  //#endregion
9601
9614
  //#region src/code-intelligence/fetchAllRepositories.ts
9602
- const PAGE_SIZE$1 = 20;
9615
+ const PAGE_SIZE$2 = 20;
9603
9616
  /**
9604
9617
  * Fetch all repositories in the organization
9605
9618
  *
@@ -9615,14 +9628,14 @@ async function fetchAllRepositories(client, options = {}) {
9615
9628
  do {
9616
9629
  const { repositories: { nodes } } = await makeGraphQLRequest(client, REPOSITORIES, {
9617
9630
  variables: {
9618
- first: PAGE_SIZE$1,
9631
+ first: PAGE_SIZE$2,
9619
9632
  offset
9620
9633
  },
9621
9634
  logger
9622
9635
  });
9623
9636
  repositories.push(...nodes);
9624
- offset += PAGE_SIZE$1;
9625
- shouldContinue = nodes.length === PAGE_SIZE$1;
9637
+ offset += PAGE_SIZE$2;
9638
+ shouldContinue = nodes.length === PAGE_SIZE$2;
9626
9639
  } while (shouldContinue);
9627
9640
  return repositories.sort((a, b) => a.name.localeCompare(b.name));
9628
9641
  }
@@ -9707,7 +9720,7 @@ const CREATE_SOFTWARE_DEVELOPMENT_KIT = gql`
9707
9720
  `;
9708
9721
  //#endregion
9709
9722
  //#region src/code-intelligence/fetchAllSoftwareDevelopmentKits.ts
9710
- const PAGE_SIZE = 20;
9723
+ const PAGE_SIZE$1 = 20;
9711
9724
  /**
9712
9725
  * Fetch all software development kits in the organization
9713
9726
  *
@@ -9723,14 +9736,14 @@ async function fetchAllSoftwareDevelopmentKits(client, options = {}) {
9723
9736
  do {
9724
9737
  const { softwareDevelopmentKits: { nodes } } = await makeGraphQLRequest(client, SOFTWARE_DEVELOPMENT_KITS, {
9725
9738
  variables: {
9726
- first: PAGE_SIZE,
9739
+ first: PAGE_SIZE$1,
9727
9740
  offset
9728
9741
  },
9729
9742
  logger
9730
9743
  });
9731
9744
  softwareDevelopmentKits.push(...nodes);
9732
- offset += PAGE_SIZE;
9733
- shouldContinue = nodes.length === PAGE_SIZE;
9745
+ offset += PAGE_SIZE$1;
9746
+ shouldContinue = nodes.length === PAGE_SIZE$1;
9734
9747
  } while (shouldContinue);
9735
9748
  return softwareDevelopmentKits.sort((a, b) => a.name.localeCompare(b.name));
9736
9749
  }
@@ -9922,6 +9935,678 @@ async function syncSoftwareDevelopmentKits(client, softwareDevelopmentKits, opti
9922
9935
  };
9923
9936
  }
9924
9937
  //#endregion
9938
+ //#region src/custom-functions/buildCustomFunctionSignPayload.ts
9939
+ /**
9940
+ * Build the sign payload for a custom function config.
9941
+ *
9942
+ * @param input - The custom function config
9943
+ * @returns The plaintext sign payload
9944
+ */
9945
+ function buildCustomFunctionSignPayload(input) {
9946
+ return {
9947
+ code: input.code,
9948
+ context: {
9949
+ userDefinedEnv: input.env ?? {},
9950
+ allowedHosts: input.allowedHosts ?? [],
9951
+ ...input.allowThirdPartyImports !== void 0 ? { allowThirdPartyImports: input.allowThirdPartyImports } : {},
9952
+ ...input.timeoutMs !== void 0 ? { timeoutMs: input.timeoutMs } : {}
9953
+ }
9954
+ };
9955
+ }
9956
+ //#endregion
9957
+ //#region src/custom-functions/codeSigning.ts
9958
+ /**
9959
+ * Decode the payload of a JWT without verifying its signature.
9960
+ *
9961
+ * Custom function code and context JWTs are HMAC-signed by Sombra but their
9962
+ * payloads are readable base64url JSON. Since the JWTs are fetched over the
9963
+ * authenticated GraphQL API, decoding without verification is safe for the
9964
+ * purposes of change detection.
9965
+ *
9966
+ * @param token - The JWT string
9967
+ * @returns The decoded payload object, or undefined if the JWT is malformed
9968
+ */
9969
+ function decodeJwtPayload(token) {
9970
+ return jwt.decode(token, { json: true }) ?? void 0;
9971
+ }
9972
+ /**
9973
+ * Compare a desired sign payload against the signed code/context JWTs of an
9974
+ * existing custom function version.
9975
+ *
9976
+ * Environment variable *values* are encrypted server-side and cannot be
9977
+ * compared — only their names are diffed. Callers should offer a force flag to
9978
+ * re-push when only env values change.
9979
+ *
9980
+ * @param desired - The desired code and context
9981
+ * @param existing - The existing signed JWTs from the API
9982
+ * @returns The diff result
9983
+ */
9984
+ function diffCustomFunctionCode(desired, existing) {
9985
+ const changedFields = [];
9986
+ const codePayload = decodeJwtPayload(existing.signedCodeJwt);
9987
+ if ((codePayload === void 0 ? void 0 : Buffer.from(codePayload.base64Code, "base64").toString("utf-8")) !== desired.code) changedFields.push("code");
9988
+ const contextPayload = decodeJwtPayload(existing.signedCodeContextJwt);
9989
+ const existingHosts = [...contextPayload?.allowedHosts ?? []].sort();
9990
+ const desiredHosts = [...desired.context.allowedHosts].sort();
9991
+ if (JSON.stringify(existingHosts) !== JSON.stringify(desiredHosts)) changedFields.push("allowedHosts");
9992
+ if ((contextPayload?.allowThirdPartyImports ?? false) !== (desired.context.allowThirdPartyImports ?? false)) changedFields.push("allowThirdPartyImports");
9993
+ if (contextPayload?.timeoutMs !== desired.context.timeoutMs) changedFields.push("timeoutMs");
9994
+ const existingEnvNames = Object.keys(contextPayload?.userDefinedEncryptedEnv ?? {}).sort();
9995
+ const desiredEnvNames = Object.keys(desired.context.userDefinedEnv).sort();
9996
+ if (JSON.stringify(existingEnvNames) !== JSON.stringify(desiredEnvNames)) changedFields.push("env");
9997
+ return {
9998
+ changed: changedFields.length > 0,
9999
+ changedFields
10000
+ };
10001
+ }
10002
+ //#endregion
10003
+ //#region src/custom-functions/gqls/customFunction.ts
10004
+ const CUSTOM_FUNCTIONS = gql`
10005
+ query TranscendCliCustomFunctions($first: Int!, $offset: Int!, $text: String) {
10006
+ customFunctions(first: $first, offset: $offset, filterBy: { text: $text }) {
10007
+ nodes {
10008
+ id
10009
+ name
10010
+ description
10011
+ type
10012
+ lifecycleState
10013
+ sombraId
10014
+ dataSiloId
10015
+ signedCodeJwt
10016
+ signedCodeContextJwt
10017
+ hasPendingDraft
10018
+ activeVersion {
10019
+ id
10020
+ versionNumber
10021
+ lifecycleState
10022
+ signedCodeJwt
10023
+ }
10024
+ draftVersion {
10025
+ id
10026
+ versionNumber
10027
+ lifecycleState
10028
+ signedCodeJwt
10029
+ }
10030
+ }
10031
+ totalCount
10032
+ }
10033
+ }
10034
+ `;
10035
+ const CREATE_CUSTOM_FUNCTION = gql`
10036
+ mutation TranscendCliCreateCustomFunction($input: CreateCustomFunctionInput!) {
10037
+ createCustomFunction(input: $input) {
10038
+ customFunction {
10039
+ id
10040
+ name
10041
+ activeVersion {
10042
+ id
10043
+ versionNumber
10044
+ }
10045
+ draftVersion {
10046
+ id
10047
+ versionNumber
10048
+ }
10049
+ }
10050
+ success
10051
+ }
10052
+ }
10053
+ `;
10054
+ const UPDATE_STANDALONE_CUSTOM_FUNCTION = gql`
10055
+ mutation TranscendCliUpdateStandaloneCustomFunction(
10056
+ $input: UpdateStandaloneCustomFunctionInput!
10057
+ ) {
10058
+ updateStandaloneCustomFunction(input: $input) {
10059
+ customFunction {
10060
+ id
10061
+ name
10062
+ hasPendingDraft
10063
+ activeVersion {
10064
+ id
10065
+ versionNumber
10066
+ }
10067
+ draftVersion {
10068
+ id
10069
+ versionNumber
10070
+ }
10071
+ }
10072
+ success
10073
+ }
10074
+ }
10075
+ `;
10076
+ const CREATE_CUSTOM_FUNCTION_DATA_SILO = gql`
10077
+ mutation TranscendCliCreateCustomFunctionDataSilo($input: [CreateDataSilosInput!]!) {
10078
+ createDataSilos(input: $input) {
10079
+ dataSilos {
10080
+ id
10081
+ title
10082
+ }
10083
+ }
10084
+ }
10085
+ `;
10086
+ const DELETE_DATA_SILOS = gql`
10087
+ mutation TranscendCliDeleteDataSilos($input: DeleteDataSilosInput!) {
10088
+ deleteDataSilos(input: $input) {
10089
+ clientMutationId
10090
+ }
10091
+ }
10092
+ `;
10093
+ const RUN_CUSTOM_FUNCTION = gql`
10094
+ mutation TranscendCliRunCustomFunction($input: RunCustomFunctionInput!) {
10095
+ runCustomFunction(input: $input) {
10096
+ result {
10097
+ exitCode
10098
+ error {
10099
+ message
10100
+ stack
10101
+ }
10102
+ logs {
10103
+ message
10104
+ file
10105
+ }
10106
+ profile {
10107
+ timeMs
10108
+ }
10109
+ }
10110
+ }
10111
+ }
10112
+ `;
10113
+ const PROMOTE_CUSTOM_FUNCTION_VERSION = gql`
10114
+ mutation TranscendCliPromoteCustomFunctionVersion($input: PromoteCustomFunctionVersionInput!) {
10115
+ promoteCustomFunctionVersion(input: $input) {
10116
+ customFunction {
10117
+ id
10118
+ activeVersion {
10119
+ id
10120
+ versionNumber
10121
+ }
10122
+ }
10123
+ dependencyWarnings {
10124
+ dependencyType
10125
+ dependencyTitle
10126
+ message
10127
+ }
10128
+ success
10129
+ }
10130
+ }
10131
+ `;
10132
+ //#endregion
10133
+ //#region src/custom-functions/customFunctionDataSilo.ts
10134
+ /**
10135
+ * The integration/catalog name for custom function DSR integrations. Silos
10136
+ * created with this catalog get `customSiloConnectionStrategy =
10137
+ * CUSTOM_FUNCTION` and start `NOT_CONFIGURED` until a custom function is
10138
+ * attached — the same shell the Admin Dashboard creates for a new DSR
10139
+ * function.
10140
+ */
10141
+ const CUSTOM_FUNCTION_INTEGRATION_NAME = "customFunction";
10142
+ /**
10143
+ * Create the data silo (DSR integration) backing a new DSR custom function.
10144
+ *
10145
+ * The silo is an inert `customFunction`-catalog shell: it has no function
10146
+ * attached yet and stays `NOT_CONFIGURED` until `createCustomFunction` links
10147
+ * one (which flips it to `Connected`). The `customFunction` catalog requires
10148
+ * a Sombra gateway on create — the function's code runs on that gateway.
10149
+ *
10150
+ * @param client - GraphQL client authenticated with a Transcend API key
10151
+ * @param options - Options
10152
+ * @returns The created data silo
10153
+ */
10154
+ async function createCustomFunctionDataSilo(client, options) {
10155
+ const { title, sombraId, logger = NOOP_LOGGER } = options;
10156
+ const { createDataSilos: { dataSilos } } = await makeGraphQLRequest(client, CREATE_CUSTOM_FUNCTION_DATA_SILO, {
10157
+ variables: { input: [{
10158
+ name: CUSTOM_FUNCTION_INTEGRATION_NAME,
10159
+ title,
10160
+ sombraId
10161
+ }] },
10162
+ logger
10163
+ });
10164
+ const [dataSilo] = dataSilos;
10165
+ if (!dataSilo) throw new Error(`Failed to create a custom function data silo titled "${title}".`);
10166
+ return dataSilo;
10167
+ }
10168
+ /**
10169
+ * Delete a data silo. Used to roll back a just-created custom function data
10170
+ * silo when the function's test run fails before anything was linked to it.
10171
+ *
10172
+ * @param client - GraphQL client authenticated with a Transcend API key
10173
+ * @param dataSiloId - The data silo ID to delete
10174
+ * @param options - Options
10175
+ */
10176
+ async function deleteDataSilo(client, dataSiloId, options = {}) {
10177
+ const { logger = NOOP_LOGGER } = options;
10178
+ await makeGraphQLRequest(client, DELETE_DATA_SILOS, {
10179
+ variables: { input: { ids: [dataSiloId] } },
10180
+ logger
10181
+ });
10182
+ }
10183
+ //#endregion
10184
+ //#region src/custom-functions/fetchAllCustomFunctions.ts
10185
+ const PAGE_SIZE = 20;
10186
+ /**
10187
+ * Fetch all custom functions in the organization
10188
+ *
10189
+ * @param client - GraphQL client
10190
+ * @param options - Options
10191
+ * @returns All custom functions in the organization
10192
+ */
10193
+ async function fetchAllCustomFunctions(client, options = {}) {
10194
+ const { logger = NOOP_LOGGER, filterBy } = options;
10195
+ const { text } = filterBy ?? {};
10196
+ const customFunctions = [];
10197
+ let offset = 0;
10198
+ let shouldContinue = false;
10199
+ do {
10200
+ const { customFunctions: { nodes } } = await makeGraphQLRequest(client, CUSTOM_FUNCTIONS, {
10201
+ variables: {
10202
+ first: PAGE_SIZE,
10203
+ offset,
10204
+ text
10205
+ },
10206
+ logger
10207
+ });
10208
+ customFunctions.push(...nodes);
10209
+ offset += PAGE_SIZE;
10210
+ shouldContinue = nodes.length === PAGE_SIZE;
10211
+ } while (shouldContinue);
10212
+ return customFunctions.sort((a, b) => a.name.localeCompare(b.name));
10213
+ }
10214
+ //#endregion
10215
+ //#region src/custom-functions/injectDataSiloIntoDsrTestPayload.ts
10216
+ /**
10217
+ * Inject the resolved data silo into a DSR test payload.
10218
+ *
10219
+ * The backend's unsaved-DSR test path resolves the execution Sombra from
10220
+ * `extras.dataSilo.id`, so the payload must reference the function's actual
10221
+ * data silo — which the payload file cannot know for silos created during
10222
+ * the same push. The silo `id` is always overridden; other `extras.dataSilo`
10223
+ * fields from the payload file are preserved. The backend validates DSR
10224
+ * payloads against the full webhook notification codec, which requires
10225
+ * `title`, `description`, and `link` on the data silo — those are defaulted
10226
+ * when the payload file omits them.
10227
+ *
10228
+ * @param payload - The DSR test payload from the manifest
10229
+ * @param dataSilo - The resolved data silo
10230
+ * @returns The payload with `extras.dataSilo` pointing at the resolved silo
10231
+ */
10232
+ function injectDataSiloIntoDsrTestPayload(payload, dataSilo) {
10233
+ const record = payload;
10234
+ const extras = record.extras ?? {};
10235
+ const existingDataSilo = extras["dataSilo"] ?? {};
10236
+ return {
10237
+ ...record,
10238
+ extras: {
10239
+ ...extras,
10240
+ dataSilo: {
10241
+ title: dataSilo.title,
10242
+ description: "",
10243
+ link: "",
10244
+ ...existingDataSilo,
10245
+ id: dataSilo.id
10246
+ }
10247
+ }
10248
+ };
10249
+ }
10250
+ //#endregion
10251
+ //#region src/custom-functions/resolveEffectiveSombraId.ts
10252
+ /**
10253
+ * Resolve which Sombra gateway a custom function's code must be signed
10254
+ * against.
10255
+ *
10256
+ * Each custom function belongs to a single gateway, whose keys sign the code
10257
+ * and encrypt the env values — signing against any other gateway would
10258
+ * produce JWTs that fail verification at execution time. The gateway is
10259
+ * resolved as: the config's `sombraId`, else the existing function's
10260
+ * gateway, else the caller's default (e.g. a CLI flag), else `undefined`
10261
+ * meaning the organization's primary Sombra.
10262
+ *
10263
+ * A config that pins a different gateway than the existing function is an
10264
+ * error — the gateway of an existing function cannot be changed by a push.
10265
+ *
10266
+ * @param input - The custom function config
10267
+ * @param existing - The matching existing custom function, when there is one
10268
+ * @param defaultSombraId - Fallback gateway ID when neither the config nor the existing function specify one
10269
+ * @returns The Sombra gateway ID to sign against, or undefined for the primary gateway
10270
+ */
10271
+ function resolveEffectiveSombraId(input, existing, defaultSombraId) {
10272
+ if (input.sombraId && existing?.sombraId && input.sombraId !== existing.sombraId) throw new Error(`Custom function "${input.name}" specifies sombra-id "${input.sombraId}" but the existing function (id: ${existing.id}) belongs to Sombra gateway "${existing.sombraId}". A push cannot move a custom function between gateways — fix the sombra-id in the manifest, or remove it to keep the existing gateway.`);
10273
+ return input.sombraId ?? existing?.sombraId ?? defaultSombraId;
10274
+ }
10275
+ /**
10276
+ * Resolve the organization's primary Sombra gateway ID.
10277
+ *
10278
+ * @param client - GraphQL client authenticated with a Transcend API key
10279
+ * @param logger - Logger instance
10280
+ * @returns The primary Sombra ID
10281
+ */
10282
+ async function resolvePrimarySombraId(client, logger = NOOP_LOGGER) {
10283
+ const { organization } = await makeGraphQLRequest(client, ORGANIZATION, { logger });
10284
+ if (!organization.sombra?.id) throw new Error("Could not resolve the primary Sombra gateway of the organization, which is required to create a custom function. Specify a sombra-id on the manifest entry instead.");
10285
+ return organization.sombra.id;
10286
+ }
10287
+ //#endregion
10288
+ //#region src/custom-functions/resolveExistingCustomFunction.ts
10289
+ /**
10290
+ * Resolve which existing custom function a config refers to.
10291
+ *
10292
+ * When the config has an `id`, it must match an existing function. Otherwise
10293
+ * the function is matched by exact name; an ambiguous name (multiple existing
10294
+ * functions with the same name) is an error that the caller should resolve by
10295
+ * adding an `id` to the config.
10296
+ *
10297
+ * @param existing - All existing custom functions in the organization
10298
+ * @param input - The custom function config
10299
+ * @returns The matching custom function, or undefined when it should be created
10300
+ */
10301
+ function resolveExistingCustomFunction(existing, input) {
10302
+ if (input.id) {
10303
+ const match = existing.find(({ id }) => id === input.id);
10304
+ if (!match) throw new Error(`Custom function "${input.name}" specifies id "${input.id}" but no custom function with that ID exists in the organization. Remove the id to create a new function, or fix the ID.`);
10305
+ return match;
10306
+ }
10307
+ const matches = existing.filter(({ name }) => name === input.name);
10308
+ if (matches.length > 1) throw new Error(`Multiple custom functions are named "${input.name}" (ids: ${matches.map(({ id }) => id).join(", ")}). Add an \`id\` field to this manifest entry to disambiguate which one to update.`);
10309
+ return matches[0];
10310
+ }
10311
+ //#endregion
10312
+ //#region src/custom-functions/runCustomFunctionTest.ts
10313
+ /**
10314
+ * Whether an execution result counts as a passing test.
10315
+ *
10316
+ * Mirrors the Admin Dashboard's function editor: a run passes when it
10317
+ * produced no error and exited with a code <= 0 (negative codes are internal
10318
+ * success-with-metadata codes).
10319
+ *
10320
+ * @param result - The execution result
10321
+ * @returns True when the run passed
10322
+ */
10323
+ function didCustomFunctionTestPass(result) {
10324
+ return !result.error && result.exitCode <= 0;
10325
+ }
10326
+ /**
10327
+ * Test-run custom function code that has been signed but not yet saved.
10328
+ *
10329
+ * Sends the pre-signed code/context JWT pair to the `runCustomFunction`
10330
+ * mutation as a test run (`isCustomFunctionTestRun: true`). The backend
10331
+ * verifies JWT provenance against the target Sombra gateway, executes the
10332
+ * code on that gateway, and returns the execution result — nothing is
10333
+ * persisted.
10334
+ *
10335
+ * - GENERAL functions run against `sombraId` (or the organization's primary
10336
+ * Sombra) with the payload validated as a Maestro payload.
10337
+ * - DSR functions run against the Sombra of the data silo referenced by
10338
+ * `extras.dataSilo.id` in the payload; `payloadType` selects which export
10339
+ * is invoked (`DATA_POINT` → `default`, `REQUEST_ENRICHER` → `enricher`).
10340
+ *
10341
+ * Requires backend support for pre-signed JWTs on `runCustomFunction`; older
10342
+ * backends reject the JWT fields with a friendly upgrade error.
10343
+ *
10344
+ * @param client - GraphQL client authenticated with a Transcend API key
10345
+ * @param options - Options
10346
+ * @returns The execution result plus a `passed` boolean
10347
+ */
10348
+ async function runCustomFunctionTest(client, options) {
10349
+ const { type, signedCodeJwt, signedCodeContextJwt, payload, sombraId, payloadType, logger = NOOP_LOGGER } = options;
10350
+ let response;
10351
+ try {
10352
+ response = await makeGraphQLRequest(client, RUN_CUSTOM_FUNCTION, {
10353
+ variables: { input: {
10354
+ type,
10355
+ isCustomFunctionTestRun: true,
10356
+ payload: Buffer.from(JSON.stringify(payload), "utf-8").toString("base64"),
10357
+ signedCodeJwt,
10358
+ signedCodeContextJwt,
10359
+ ...sombraId !== void 0 ? { sombraId } : {},
10360
+ ...payloadType !== void 0 ? { payloadType } : {}
10361
+ } },
10362
+ logger
10363
+ });
10364
+ } catch (err) {
10365
+ const message = err.message ?? "";
10366
+ if (/signedCodeJwt|signedCodeContextJwt/.test(message) && /is not defined|Unknown argument|got invalid value/i.test(message)) throw new Error(`The Transcend backend does not support test-running custom functions from pre-signed JWTs yet. Re-run with tests skipped, or contact Transcend support. Underlying error: ${message}`);
10367
+ throw err;
10368
+ }
10369
+ const { result } = response.runCustomFunction;
10370
+ return {
10371
+ passed: didCustomFunctionTestPass(result),
10372
+ result
10373
+ };
10374
+ }
10375
+ //#endregion
10376
+ //#region src/custom-functions/signCustomFunctionCode.ts
10377
+ /**
10378
+ * Sign custom function code against the Sombra customer-ingress
10379
+ * `/v1/custom/sign` route.
10380
+ *
10381
+ * The route is authenticated by the sombra instance's bearer headers (the
10382
+ * Transcend API key, plus the Sombra internal key when self-hosting — see
10383
+ * `createSombraGotInstance`). Code and env values travel to the customer's
10384
+ * own Sombra gateway over TLS and never reach Transcend's backend in
10385
+ * plaintext.
10386
+ *
10387
+ * @param sombra - Got instance authenticated against the Sombra customer ingress
10388
+ * @param payload - The plaintext code and execution context to sign
10389
+ * @param options - Options
10390
+ * @returns The signed code and context JWTs to store via the GraphQL API
10391
+ */
10392
+ async function signCustomFunctionCode(sombra, payload, options = {}) {
10393
+ const { customFunctionId } = options;
10394
+ try {
10395
+ return await sombra.post("v1/custom/sign", { json: {
10396
+ code: payload.code,
10397
+ context: payload.context,
10398
+ ...customFunctionId ? { customFunction: { id: customFunctionId } } : {}
10399
+ } }).json();
10400
+ } catch (err) {
10401
+ if (err?.response?.statusCode === 404) throw new Error("The Sombra gateway does not support the /v1/custom/sign route. Upgrade your Sombra gateway to a version that supports custom function code signing.");
10402
+ throw err;
10403
+ }
10404
+ }
10405
+ //#endregion
10406
+ //#region src/custom-functions/syncCustomFunction.ts
10407
+ /**
10408
+ * Sync a custom function definition (metadata + code revision) to Transcend.
10409
+ *
10410
+ * - When no custom function with the given name exists, one is created.
10411
+ * - A new DSR function without a `dataSiloId` also gets its DSR integration
10412
+ * created: a `customFunction`-catalog data silo shell is created first (the
10413
+ * backend needs it to exist for the test run), the code is tested against
10414
+ * it, and on a passing test the function is created and linked. A failing
10415
+ * test rolls the silo back (deletes it).
10416
+ * - When one exists and the code/context changed, a new draft revision is
10417
+ * created and (unless `promote` is false) promoted to active.
10418
+ * - When only metadata changed (description, or name for id-pinned entries),
10419
+ * the function record is updated in place — no signing, no test runs, and
10420
+ * no new code revision.
10421
+ * - When nothing changed, the function is skipped (unless `force` is set).
10422
+ *
10423
+ * Code is signed against the Sombra customer-ingress `/v1/custom/sign` route
10424
+ * before being saved via the GraphQL API, so plaintext code and env values
10425
+ * never reach Transcend's backend.
10426
+ *
10427
+ * Environment variable values are encrypted server-side and cannot be diffed;
10428
+ * use `force` to re-push when only env values changed.
10429
+ *
10430
+ * @param client - GraphQL client authenticated with a Transcend API key
10431
+ * @param options - Options
10432
+ * @returns The sync result
10433
+ */
10434
+ async function syncCustomFunction(client, options) {
10435
+ const { input, sombra, defaultSombraId, existing: allExisting, promote = true, dryRun = false, force = false, testPayloads, logger = NOOP_LOGGER } = options;
10436
+ const type = input.type ?? CustomFunctionType.General;
10437
+ const existing = resolveExistingCustomFunction(allExisting, input);
10438
+ const effectiveSombraId = resolveEffectiveSombraId(input, existing, defaultSombraId);
10439
+ const signPayload = buildCustomFunctionSignPayload(input);
10440
+ let changedFields = [];
10441
+ let metadataOnly = false;
10442
+ if (existing) {
10443
+ const diff = diffCustomFunctionCode(signPayload, {
10444
+ signedCodeJwt: existing.signedCodeJwt,
10445
+ signedCodeContextJwt: existing.signedCodeContextJwt
10446
+ });
10447
+ changedFields = diff.changedFields;
10448
+ if (!diff.changed && !force) {
10449
+ const metadataChanges = [];
10450
+ if (input.name !== existing.name) metadataChanges.push("name");
10451
+ if (input.description !== void 0 && input.description !== (existing.description ?? "")) metadataChanges.push("description");
10452
+ if (metadataChanges.length === 0) {
10453
+ logger.info(`No changes detected for custom function "${input.name}" — skipping.`);
10454
+ return {
10455
+ outcome: "skipped",
10456
+ customFunctionId: existing.id,
10457
+ changedFields: [],
10458
+ promoted: false,
10459
+ ...existing.dataSiloId ? { dataSiloId: existing.dataSiloId } : {}
10460
+ };
10461
+ }
10462
+ metadataOnly = true;
10463
+ changedFields = metadataChanges;
10464
+ }
10465
+ }
10466
+ if (dryRun) return {
10467
+ outcome: existing ? "would-update" : "would-create",
10468
+ ...existing ? { customFunctionId: existing.id } : {},
10469
+ changedFields,
10470
+ promoted: false
10471
+ };
10472
+ if (existing && metadataOnly) {
10473
+ logger.info(`Updating metadata (${changedFields.join(", ")}) for custom function "${input.name}" — code is unchanged, no new revision.`);
10474
+ await makeGraphQLRequest(client, UPDATE_STANDALONE_CUSTOM_FUNCTION, {
10475
+ variables: { input: {
10476
+ id: existing.id,
10477
+ name: input.name,
10478
+ ...input.description !== void 0 ? { description: input.description } : {}
10479
+ } },
10480
+ logger
10481
+ });
10482
+ return {
10483
+ outcome: "metadata-updated",
10484
+ customFunctionId: existing.id,
10485
+ changedFields,
10486
+ promoted: false,
10487
+ ...existing.dataSiloId ? { dataSiloId: existing.dataSiloId } : {}
10488
+ };
10489
+ }
10490
+ if (!sombra) throw new Error("A Sombra customer-ingress client is required to push custom function code.");
10491
+ const { signedCodeJwt, signedCodeContextJwt } = await signCustomFunctionCode(sombra, signPayload, { customFunctionId: existing?.id });
10492
+ let dataSiloId = input.dataSiloId ?? existing?.dataSiloId ?? void 0;
10493
+ let createdDataSilo = false;
10494
+ if (type === CustomFunctionType.Dsr && !existing && dataSiloId === void 0) {
10495
+ const siloSombraId = effectiveSombraId ?? await resolvePrimarySombraId(client, logger);
10496
+ logger.info(`Creating DSR integration (data silo) for custom function "${input.name}"...`);
10497
+ dataSiloId = (await createCustomFunctionDataSilo(client, {
10498
+ title: input.name,
10499
+ sombraId: siloSombraId,
10500
+ logger
10501
+ })).id;
10502
+ createdDataSilo = true;
10503
+ }
10504
+ let testResults;
10505
+ if (testPayloads !== void 0 && testPayloads.length > 0) {
10506
+ logger.info(`Testing custom function "${input.name}" before push (${testPayloads.length} payload${testPayloads.length === 1 ? "" : "s"})...`);
10507
+ testResults = [];
10508
+ for (const { payload, payloadType } of testPayloads) {
10509
+ const run = await runCustomFunctionTest(client, {
10510
+ type,
10511
+ signedCodeJwt,
10512
+ signedCodeContextJwt,
10513
+ payload: type === CustomFunctionType.Dsr && dataSiloId !== void 0 ? injectDataSiloIntoDsrTestPayload(payload, {
10514
+ id: dataSiloId,
10515
+ title: input.name
10516
+ }) : payload,
10517
+ ...type === CustomFunctionType.General && effectiveSombraId !== void 0 ? { sombraId: effectiveSombraId } : {},
10518
+ ...type === CustomFunctionType.Dsr && payloadType !== void 0 ? { payloadType } : {},
10519
+ logger
10520
+ });
10521
+ testResults.push({
10522
+ ...run,
10523
+ ...payloadType !== void 0 ? { payloadType } : {}
10524
+ });
10525
+ }
10526
+ if (testResults.some(({ passed }) => !passed)) {
10527
+ if (createdDataSilo && dataSiloId !== void 0) {
10528
+ logger.info(`Rolling back DSR integration (data silo ${dataSiloId}) for "${input.name}" — test failed.`);
10529
+ await deleteDataSilo(client, dataSiloId, { logger });
10530
+ dataSiloId = void 0;
10531
+ }
10532
+ return {
10533
+ outcome: "test-failed",
10534
+ ...existing ? { customFunctionId: existing.id } : {},
10535
+ changedFields,
10536
+ promoted: false,
10537
+ testResults,
10538
+ ...createdDataSilo ? { createdDataSilo } : {}
10539
+ };
10540
+ }
10541
+ }
10542
+ if (!existing) {
10543
+ const createSombraId = type === CustomFunctionType.General ? effectiveSombraId ?? await resolvePrimarySombraId(client, logger) : void 0;
10544
+ if (type === CustomFunctionType.Dsr && !promote) logger.warn(`DSR custom functions are always created active — "${input.name}" will be created promoted despite promote being disabled.`);
10545
+ let response;
10546
+ try {
10547
+ response = await makeGraphQLRequest(client, CREATE_CUSTOM_FUNCTION, {
10548
+ variables: { input: {
10549
+ type,
10550
+ ...createSombraId !== void 0 ? { sombraId: createSombraId } : {},
10551
+ ...type === CustomFunctionType.Dsr ? { dataSiloId } : {},
10552
+ name: input.name,
10553
+ ...input.description !== void 0 ? { description: input.description } : {},
10554
+ ...type === CustomFunctionType.General ? { setActive: promote } : {},
10555
+ signedCodeJwt,
10556
+ signedCodeContextJwt
10557
+ } },
10558
+ logger
10559
+ });
10560
+ } catch (err) {
10561
+ if (createdDataSilo && dataSiloId !== void 0) {
10562
+ logger.warn(`Rolling back DSR integration (data silo ${dataSiloId}) for "${input.name}" — creating the custom function failed.`);
10563
+ await deleteDataSilo(client, dataSiloId, { logger });
10564
+ }
10565
+ throw err;
10566
+ }
10567
+ const { customFunction } = response.createCustomFunction;
10568
+ const version = customFunction.activeVersion ?? customFunction.draftVersion;
10569
+ return {
10570
+ outcome: "created",
10571
+ customFunctionId: customFunction.id,
10572
+ ...version ? { versionNumber: version.versionNumber } : {},
10573
+ changedFields,
10574
+ promoted: type === CustomFunctionType.Dsr ? true : promote,
10575
+ ...testResults ? { testResults } : {},
10576
+ ...dataSiloId !== void 0 ? { dataSiloId } : {},
10577
+ ...createdDataSilo ? { createdDataSilo } : {}
10578
+ };
10579
+ }
10580
+ const { updateStandaloneCustomFunction: { customFunction: updated } } = await makeGraphQLRequest(client, UPDATE_STANDALONE_CUSTOM_FUNCTION, {
10581
+ variables: { input: {
10582
+ id: existing.id,
10583
+ name: input.name,
10584
+ ...input.description !== void 0 ? { description: input.description } : {},
10585
+ signedCodeJwt,
10586
+ signedCodeContextJwt
10587
+ } },
10588
+ logger
10589
+ });
10590
+ const draft = updated.draftVersion;
10591
+ if (!draft) throw new Error(`Expected a draft version to be created for custom function "${input.name}" but none was returned.`);
10592
+ if (promote) await makeGraphQLRequest(client, PROMOTE_CUSTOM_FUNCTION_VERSION, {
10593
+ variables: { input: {
10594
+ customFunctionId: updated.id,
10595
+ versionId: draft.id
10596
+ } },
10597
+ logger
10598
+ });
10599
+ return {
10600
+ outcome: "updated",
10601
+ customFunctionId: updated.id,
10602
+ versionNumber: draft.versionNumber,
10603
+ changedFields,
10604
+ promoted: promote,
10605
+ ...testResults ? { testResults } : {},
10606
+ ...dataSiloId !== void 0 ? { dataSiloId } : {}
10607
+ };
10608
+ }
10609
+ //#endregion
9925
10610
  //#region src/index.ts
9926
10611
  function createMonorepoPackageDefinition(name, directory) {
9927
10612
  const packageNameParts = describePackageName(name);
@@ -9932,6 +10617,6 @@ function createMonorepoPackageDefinition(name, directory) {
9932
10617
  };
9933
10618
  }
9934
10619
  //#endregion
9935
- export { AIRGAP_BUNDLE_AGGREGATE_ANALYTICS, AIRGAP_BUNDLE_TIMESERIES_ANALYTICS, 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, CONSENT_WORKFLOW_TRIGGERS, COOKIES, COOKIE_STATS, CREATE_CODE_PACKAGE, CREATE_CONSENT_EXPERIENCE, CREATE_CONSENT_MANAGER, CREATE_CONSENT_PARTITION, CREATE_CONSENT_UI_THEME, CREATE_CONSENT_UI_VARIANT, CREATE_DATA_FLOWS, CREATE_DATA_SILOS, CREATE_DATA_SUBJECT, CREATE_ENRICHER, CREATE_IDENTIFIER, CREATE_OR_UPDATE_CONSENT_WORKFLOW_TRIGGER, CREATE_PROCESSING_PURPOSE_SUB_CATEGORY, ColumnIdentifierMap, ColumnMetadataMap, ColumnPurposeMap, ConsentPreferenceResponse, DATAPOINT_EXPORT, DATA_FLOWS, DATA_FLOW_STATS, DATA_POINTS, DATA_POINT_COUNT, DATA_SILOS, DATA_SILOS_ENRICHED, DATA_SILO_EXPORT, DATA_SILO_SOMBRA, DATA_SUBJECTS, DELETE_COOKIES, DELETE_DATA_FLOWS, DELETE_PRIVACY_CENTER_FOOTER_LINKS, DEPLOYED_PRIVACY_CENTER_URL, DEPLOY_CONSENT_MANAGER, DeletePreferenceRecordCliCsvRow, DeletePreferenceRecordsInput, DeletePreferenceRecordsResponse, ENRICHERS, EXPERIENCES, FETCH_CONSENT_MANAGER, FETCH_CONSENT_MANAGER_ID, FETCH_CONSENT_MANAGER_THEME, FETCH_CONSENT_UI_THEMES, FETCH_CONSENT_UI_VARIANTS, 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, PreferenceOptionValueInput, PreferenceState, PreferenceTopicSyncInput, PreferenceUpdateMap, PurposeInput, 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_CONSENT_UI_THEME, UPDATE_CONSENT_UI_VARIANT, 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_PRIVACY_CENTER_FOOTER_LINKS, UPDATE_PROCESSING_PURPOSE_SUB_CATEGORIES, addMessagesToPromptRun, assumeRole, buildConsentChunks, buildTranscendGraphQLClient, buildTranscendGraphQLClientGeneric, buildTriggerConditionFromPurposes, checkIfPendingPreferenceUpdatesAreNoOp, checkIfPendingPreferenceUpdatesCauseConflict, consentWindowHasAny, convertToDataSubjectAllowlist, convertToDataSubjectBlockList, createActionItemCollection, createActionItems, createAgent, createAgentFile, createAgentFunction, createApiKey, createBusinessEntity, createDataCategory, createDataFlows, createDataSubject, createMonorepoPackageDefinition, createOrUpdatePreferenceOptionValues, createPreferenceAccessTokens, createProcessingPurpose, createRepository, createSoftwareDevelopmentKit, createSombraGotInstance, createTeam, createTranscendConsentGotInstance, createVendor, deleteApiKey, deployConsentManager, fetchActiveSiloDiscoPlugin, fetchAirgapBundleAggregateAnalytics, fetchAirgapBundleTimeseriesAnalytics, fetchAllActionItemCollections, fetchAllActionItems, fetchAllActions, fetchAllAgentFiles, fetchAllAgentFunctions, fetchAllAgents, fetchAllApiKeys, fetchAllAssessments, fetchAllAttributeValues, fetchAllAttributes, fetchAllBusinessEntities, fetchAllCatalogs, fetchAllCodePackages, fetchAllConsentWorkflowTriggers, fetchAllCookies, fetchAllDataCategories, fetchAllDataFlows, fetchAllDataPoints, fetchAllDataSilos, fetchAllDataSubjects, fetchAllEnrichers, fetchAllIdentifiers, fetchAllLargeLanguageModels, fetchAllMessages, fetchAllPolicies, fetchAllPreferenceOptionValues, fetchAllPreferenceTopics, fetchAllPrivacyCenters, fetchAllProcessingActivities, fetchAllProcessingPurposes, fetchAllPromptThreads, fetchAllPurposes, fetchAllPurposesAndPreferences, fetchAllRepositories, fetchAllRequestAttributeKeys, fetchAllRequestEnrichers, fetchAllRequestIdentifierMetadata, fetchAllRequestIdentifiers, fetchAllSiloDiscoveryResults, fetchAllSoftwareDevelopmentKits, fetchAllSubDataPoints, fetchAllTeams, fetchAllTemplates, fetchAllUsers, fetchAllVendors, fetchAllWorkflowConfigs, fetchAndIndexCatalogs, fetchApiKeys, fetchConsentManager, fetchConsentManagerAnalyticsData, fetchConsentManagerExperiences, fetchConsentManagerId, fetchConsentManagerTheme, fetchConsentPreferences, fetchConsentPreferencesChunked, fetchConsentThemes, fetchConsentVariants, fetchEnrichedDataSilos, fetchIdentifiersAndCreateMissing, fetchParentOrganizationTeams, fetchPartitions, fetchPrivacyCenterId, fetchPrivacyCenterUrl, fetchRequestDataSilo, fetchRequestDataSilos, fetchRequestDataSilosCount, fetchRequestFilesForRequest, findEarliestDayWithData, findLatestDayWithData, formatAttributeValues, formatRegions, getBoundsFromConsentFilter, getComparisonTimeForRecord, getPreferenceIdentifiersFromRow, getPreferenceMetadataFromRow, getPreferenceUpdatesFromRow, getPreferencesForIdentifiers, getUniquePreferenceIdentifierNamesFromRow, getWorkflowConfigDisplayTitle, inferPolicyTypeFromTitle, isConsentWorkflowTriggerV2Mode, isTransientError, iterateConsentPages, loadReferenceData, loginUser, makeGraphQLRequest, parseAssessmentDisplayLogic, parseAssessmentRiskLogic, parsePurposesFromTriggerCondition, pickConsentChunkMode, resolveDisplayedChildOrganizationIds, resolveParentTeamIdsByName, resolveWorkflowConfigByTitle, resolveWorkflowConfigMatch, resolveWorkflowTitleFromId, retryRequestEnricher, setResourceAttributes, syncAction, syncActionItemCollections, syncActionItems, syncAgentFiles, syncAgentFunctions, syncAgents, syncAttribute, syncBusinessEntities, syncConsentManager, syncConsentManagerExperiences, syncConsentUiThemes, syncConsentUiVariants, syncConsentWorkflowTriggers, syncCookies, syncDataCategories, syncDataFlows, syncDataSiloDependencies, syncDataSubject, syncEnricher, syncIdentifier, syncIntlMessages, syncPartitions, syncPolicies, syncPreferenceOptionValues, syncPreferenceTopics, syncPrivacyCenter, syncPrivacyCenterFooterLinks, syncProcessingActivities, syncProcessingPurposes, syncPurposes, syncRepositories, syncSoftwareDevelopmentKits, syncTeams, syncTemplate, syncVendors, syncWorkflowConfigs, transformPreferenceRecordToCsv, updateActionItem, updateActionItemCollection, updateAgentFiles, updateAgentFunctions, updateAgents, updateBusinessEntities, updateConsentManagerToLatest, updateDataCategories, updateDataFlows, updateIntlMessages, updateOrCreateCookies, updatePolicies, updateProcessingPurposes, updateRepositories, updateSoftwareDevelopmentKits, updateTeam, updateVendors, uploadSiloDiscoveryResults, validateConsentWorkflowTriggerMode, validateSombraVersion, withTransientRetry, workflowConfigInputLabel, workflowConfigMatchKey, workflowRegionListKey };
10620
+ export { AIRGAP_BUNDLE_AGGREGATE_ANALYTICS, AIRGAP_BUNDLE_TIMESERIES_ANALYTICS, 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, CONSENT_WORKFLOW_TRIGGERS, COOKIES, COOKIE_STATS, CREATE_CODE_PACKAGE, CREATE_CONSENT_EXPERIENCE, CREATE_CONSENT_MANAGER, CREATE_CONSENT_PARTITION, CREATE_CONSENT_UI_THEME, CREATE_CONSENT_UI_VARIANT, CREATE_CUSTOM_FUNCTION, CREATE_CUSTOM_FUNCTION_DATA_SILO, CREATE_DATA_FLOWS, CREATE_DATA_SILOS, CREATE_DATA_SUBJECT, CREATE_ENRICHER, CREATE_IDENTIFIER, CREATE_OR_UPDATE_CONSENT_WORKFLOW_TRIGGER, CREATE_PROCESSING_PURPOSE_SUB_CATEGORY, CUSTOM_FUNCTIONS, CUSTOM_FUNCTION_INTEGRATION_NAME, ColumnIdentifierMap, ColumnMetadataMap, ColumnPurposeMap, ConsentPreferenceResponse, DATAPOINT_EXPORT, DATA_FLOWS, DATA_FLOW_STATS, DATA_POINTS, DATA_POINT_COUNT, DATA_SILOS, DATA_SILOS_ENRICHED, DATA_SILO_EXPORT, DATA_SILO_SOMBRA, DATA_SUBJECTS, DELETE_COOKIES, DELETE_DATA_FLOWS, DELETE_DATA_SILOS, DELETE_PRIVACY_CENTER_FOOTER_LINKS, DEPLOYED_PRIVACY_CENTER_URL, DEPLOY_CONSENT_MANAGER, DeletePreferenceRecordCliCsvRow, DeletePreferenceRecordsInput, DeletePreferenceRecordsResponse, ENRICHERS, EXPERIENCES, FETCH_CONSENT_MANAGER, FETCH_CONSENT_MANAGER_ID, FETCH_CONSENT_MANAGER_THEME, FETCH_CONSENT_UI_THEMES, FETCH_CONSENT_UI_VARIANTS, 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, PROMOTE_CUSTOM_FUNCTION_VERSION, PURPOSES, PendingSafePreferenceUpdates, PendingWithConflictPreferenceUpdates, PreferenceOptionValueInput, PreferenceState, PreferenceTopicSyncInput, PreferenceUpdateMap, PurposeInput, 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, RUN_CUSTOM_FUNCTION, 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_CONSENT_UI_THEME, UPDATE_CONSENT_UI_VARIANT, 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_PRIVACY_CENTER_FOOTER_LINKS, UPDATE_PROCESSING_PURPOSE_SUB_CATEGORIES, UPDATE_STANDALONE_CUSTOM_FUNCTION, addMessagesToPromptRun, assumeRole, buildConsentChunks, buildCustomFunctionSignPayload, buildTranscendGraphQLClient, buildTranscendGraphQLClientGeneric, buildTriggerConditionFromPurposes, checkIfPendingPreferenceUpdatesAreNoOp, checkIfPendingPreferenceUpdatesCauseConflict, consentWindowHasAny, convertToDataSubjectAllowlist, convertToDataSubjectBlockList, createActionItemCollection, createActionItems, createAgent, createAgentFile, createAgentFunction, createApiKey, createBusinessEntity, createCustomFunctionDataSilo, createDataCategory, createDataFlows, createDataSubject, createMonorepoPackageDefinition, createOrUpdatePreferenceOptionValues, createPreferenceAccessTokens, createProcessingPurpose, createRepository, createSoftwareDevelopmentKit, createSombraGotInstance, createTeam, createTranscendConsentGotInstance, createVendor, decodeJwtPayload, deleteApiKey, deleteDataSilo, deployConsentManager, didCustomFunctionTestPass, diffCustomFunctionCode, fetchActiveSiloDiscoPlugin, fetchAirgapBundleAggregateAnalytics, fetchAirgapBundleTimeseriesAnalytics, fetchAllActionItemCollections, fetchAllActionItems, fetchAllActions, fetchAllAgentFiles, fetchAllAgentFunctions, fetchAllAgents, fetchAllApiKeys, fetchAllAssessments, fetchAllAttributeValues, fetchAllAttributes, fetchAllBusinessEntities, fetchAllCatalogs, fetchAllCodePackages, fetchAllConsentWorkflowTriggers, fetchAllCookies, fetchAllCustomFunctions, fetchAllDataCategories, fetchAllDataFlows, fetchAllDataPoints, fetchAllDataSilos, fetchAllDataSubjects, fetchAllEnrichers, fetchAllIdentifiers, fetchAllLargeLanguageModels, fetchAllMessages, fetchAllPolicies, fetchAllPreferenceOptionValues, fetchAllPreferenceTopics, fetchAllPrivacyCenters, fetchAllProcessingActivities, fetchAllProcessingPurposes, fetchAllPromptThreads, fetchAllPurposes, fetchAllPurposesAndPreferences, fetchAllRepositories, fetchAllRequestAttributeKeys, fetchAllRequestEnrichers, fetchAllRequestIdentifierMetadata, fetchAllRequestIdentifiers, fetchAllSiloDiscoveryResults, fetchAllSoftwareDevelopmentKits, fetchAllSubDataPoints, fetchAllTeams, fetchAllTemplates, fetchAllUsers, fetchAllVendors, fetchAllWorkflowConfigs, fetchAndIndexCatalogs, fetchApiKeys, fetchConsentManager, fetchConsentManagerAnalyticsData, fetchConsentManagerExperiences, fetchConsentManagerId, fetchConsentManagerTheme, fetchConsentPreferences, fetchConsentPreferencesChunked, fetchConsentThemes, fetchConsentVariants, fetchEnrichedDataSilos, fetchIdentifiersAndCreateMissing, fetchParentOrganizationTeams, fetchPartitions, fetchPrivacyCenterId, fetchPrivacyCenterUrl, fetchRequestDataSilo, fetchRequestDataSilos, fetchRequestDataSilosCount, fetchRequestFilesForRequest, findEarliestDayWithData, findLatestDayWithData, formatAttributeValues, formatRegions, getBoundsFromConsentFilter, getComparisonTimeForRecord, getPreferenceIdentifiersFromRow, getPreferenceMetadataFromRow, getPreferenceUpdatesFromRow, getPreferencesForIdentifiers, getUniquePreferenceIdentifierNamesFromRow, getWorkflowConfigDisplayTitle, inferPolicyTypeFromTitle, injectDataSiloIntoDsrTestPayload, isConsentWorkflowTriggerV2Mode, isTransientError, iterateConsentPages, loadReferenceData, loginUser, makeGraphQLRequest, parseAssessmentDisplayLogic, parseAssessmentRiskLogic, parsePurposesFromTriggerCondition, pickConsentChunkMode, resolveDisplayedChildOrganizationIds, resolveEffectiveSombraId, resolveExistingCustomFunction, resolveParentTeamIdsByName, resolvePrimarySombraId, resolveWorkflowConfigByTitle, resolveWorkflowConfigMatch, resolveWorkflowTitleFromId, retryRequestEnricher, runCustomFunctionTest, setResourceAttributes, signCustomFunctionCode, syncAction, syncActionItemCollections, syncActionItems, syncAgentFiles, syncAgentFunctions, syncAgents, syncAttribute, syncBusinessEntities, syncConsentManager, syncConsentManagerExperiences, syncConsentUiThemes, syncConsentUiVariants, syncConsentWorkflowTriggers, syncCookies, syncCustomFunction, syncDataCategories, syncDataFlows, syncDataSiloDependencies, syncDataSubject, syncEnricher, syncIdentifier, syncIntlMessages, syncPartitions, syncPolicies, syncPreferenceOptionValues, syncPreferenceTopics, syncPrivacyCenter, syncPrivacyCenterFooterLinks, syncProcessingActivities, syncProcessingPurposes, syncPurposes, syncRepositories, syncSoftwareDevelopmentKits, syncTeams, syncTemplate, syncVendors, syncWorkflowConfigs, transformPreferenceRecordToCsv, updateActionItem, updateActionItemCollection, updateAgentFiles, updateAgentFunctions, updateAgents, updateBusinessEntities, updateConsentManagerToLatest, updateDataCategories, updateDataFlows, updateIntlMessages, updateOrCreateCookies, updatePolicies, updateProcessingPurposes, updateRepositories, updateSoftwareDevelopmentKits, updateTeam, updateVendors, uploadSiloDiscoveryResults, validateConsentWorkflowTriggerMode, validateSombraVersion, withTransientRetry, workflowConfigInputLabel, workflowConfigMatchKey, workflowRegionListKey };
9936
10621
 
9937
10622
  //# sourceMappingURL=index.mjs.map