@spottoai/types-package 1.0.2-beta.354 → 1.0.2-beta.357

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.
Files changed (203) hide show
  1. package/README.md +37 -0
  2. package/dist/aws/commitments-planning.d.ts +3 -0
  3. package/dist/aws/commitments-planning.d.ts.map +1 -0
  4. package/dist/aws/commitments-planning.js +6 -0
  5. package/dist/aws/commitments-planning.js.map +1 -0
  6. package/dist/aws/relationships.d.ts +4 -0
  7. package/dist/aws/relationships.d.ts.map +1 -0
  8. package/dist/aws/relationships.js +6 -0
  9. package/dist/aws/relationships.js.map +1 -0
  10. package/dist/azure/billingArtifactCanonicalization.d.ts +28 -0
  11. package/dist/azure/billingArtifactCanonicalization.d.ts.map +1 -0
  12. package/dist/azure/billingArtifactCanonicalization.js +291 -0
  13. package/dist/azure/billingArtifactCanonicalization.js.map +1 -0
  14. package/dist/azure/billingArtifactEvidence.d.ts +39 -0
  15. package/dist/azure/billingArtifactEvidence.d.ts.map +1 -0
  16. package/dist/azure/billingArtifactEvidence.js +29 -0
  17. package/dist/azure/billingArtifactEvidence.js.map +1 -0
  18. package/dist/azure/billingArtifactGeneration.d.ts +114 -0
  19. package/dist/azure/billingArtifactGeneration.d.ts.map +1 -0
  20. package/dist/azure/billingArtifactGeneration.js +238 -0
  21. package/dist/azure/billingArtifactGeneration.js.map +1 -0
  22. package/dist/azure/billingPlots.d.ts +22 -0
  23. package/dist/azure/billingPlots.d.ts.map +1 -1
  24. package/dist/azure/billingPlots.js +186 -0
  25. package/dist/azure/billingPlots.js.map +1 -1
  26. package/dist/azure/views.d.ts +62 -1
  27. package/dist/azure/views.d.ts.map +1 -1
  28. package/dist/azure/views.js +152 -1
  29. package/dist/azure/views.js.map +1 -1
  30. package/dist/common/artifactControlData.d.ts +12 -0
  31. package/dist/common/artifactControlData.d.ts.map +1 -0
  32. package/dist/common/artifactControlData.js +102 -0
  33. package/dist/common/artifactControlData.js.map +1 -0
  34. package/dist/common/artifactEvidence.d.ts +144 -0
  35. package/dist/common/artifactEvidence.d.ts.map +1 -0
  36. package/dist/common/artifactEvidence.js +181 -0
  37. package/dist/common/artifactEvidence.js.map +1 -0
  38. package/dist/common/artifactEvidenceValidation.d.ts +16 -0
  39. package/dist/common/artifactEvidenceValidation.d.ts.map +1 -0
  40. package/dist/common/artifactEvidenceValidation.js +31 -0
  41. package/dist/common/artifactEvidenceValidation.js.map +1 -0
  42. package/dist/common/artifactGeneration.d.ts +4 -2
  43. package/dist/common/artifactGeneration.d.ts.map +1 -1
  44. package/dist/common/artifactGeneration.js.map +1 -1
  45. package/dist/common/capabilityPassport.d.ts +6 -11
  46. package/dist/common/capabilityPassport.d.ts.map +1 -1
  47. package/dist/common/capabilityPassport.js +2 -10
  48. package/dist/common/capabilityPassport.js.map +1 -1
  49. package/dist/esm/accounts/accounts.js +115 -0
  50. package/dist/esm/accounts/azureSpSetup.js +1 -0
  51. package/dist/esm/accounts/azureSpSetupDurable.js +1 -0
  52. package/dist/esm/accounts/index.js +5 -0
  53. package/dist/esm/accounts/readPermissions.js +198 -0
  54. package/dist/esm/accounts/validation.js +1 -0
  55. package/dist/esm/accounts/writePermissions.js +43 -0
  56. package/dist/esm/ai/index.js +2 -0
  57. package/dist/esm/assessments/artifact.js +1 -0
  58. package/dist/esm/assessments/catalogue.js +12 -0
  59. package/dist/esm/assessments/common.js +1 -0
  60. package/dist/esm/assessments/evidence.js +1 -0
  61. package/dist/esm/assessments/export.js +1 -0
  62. package/dist/esm/assessments/index.js +10 -0
  63. package/dist/esm/assessments/queue.js +2 -0
  64. package/dist/esm/assessments/review.js +1 -0
  65. package/dist/esm/assessments/run.js +1 -0
  66. package/dist/esm/assessments/sow.js +1 -0
  67. package/dist/esm/assessments/status.js +23 -0
  68. package/dist/esm/aws/commitments-planning.js +1 -0
  69. package/dist/esm/aws/commitmentsPlanningValidation.js +121 -0
  70. package/dist/esm/aws/estates.js +21 -0
  71. package/dist/esm/aws/index.js +18 -0
  72. package/dist/esm/aws/onboarding.js +1 -0
  73. package/dist/esm/aws/pluginPublicArtifactBodyValidation.js +217 -0
  74. package/dist/esm/aws/pluginPublicArtifactEvidence.js +1 -0
  75. package/dist/esm/aws/pluginPublicArtifactManifestValidation.js +255 -0
  76. package/dist/esm/aws/pluginPublicArtifactSectionValidation.js +464 -0
  77. package/dist/esm/aws/pluginPublicArtifactValidation.js +2 -0
  78. package/dist/esm/aws/pluginPublicArtifactValidationHelpers.js +216 -0
  79. package/dist/esm/aws/pluginPublicArtifacts.js +109 -0
  80. package/dist/esm/aws/portalCommitmentsPlanningPublicArtifactValidation.js +509 -0
  81. package/dist/esm/aws/portalCommitmentsPlanningPublicArtifacts.js +1 -0
  82. package/dist/esm/aws/portalPublicArtifactCurrentValidation.js +328 -0
  83. package/dist/esm/aws/portalPublicArtifactEvidenceValidation.js +294 -0
  84. package/dist/esm/aws/portalPublicArtifactHistoryAiValidation.js +368 -0
  85. package/dist/esm/aws/portalPublicArtifactHistoryTypes.js +40 -0
  86. package/dist/esm/aws/portalPublicArtifactNestedEvidence.js +1 -0
  87. package/dist/esm/aws/portalPublicArtifactNestedEvidenceValidation.js +397 -0
  88. package/dist/esm/aws/portalPublicArtifactValidation.js +2 -0
  89. package/dist/esm/aws/portalPublicArtifactValidationCommon.js +139 -0
  90. package/dist/esm/aws/portalPublicArtifacts.js +73 -0
  91. package/dist/esm/aws/portalRelationshipPublicArtifactValidation.js +334 -0
  92. package/dist/esm/aws/portalRelationshipPublicArtifacts.js +59 -0
  93. package/dist/esm/aws/portalRelationshipResourceNodeTypes.js +1 -0
  94. package/dist/esm/aws/portalRelationshipResourceNodeValidation.js +368 -0
  95. package/dist/esm/aws/publicArtifacts.js +13 -0
  96. package/dist/esm/aws/relationships.js +1 -0
  97. package/dist/esm/aws/requests.js +19 -0
  98. package/dist/esm/azure/activityLogs.js +2 -0
  99. package/dist/esm/azure/advisorScore.js +1 -0
  100. package/dist/esm/azure/benefits.js +1 -0
  101. package/dist/esm/azure/billingArtifactCanonicalization.js +281 -0
  102. package/dist/esm/azure/billingArtifactEvidence.js +23 -0
  103. package/dist/esm/azure/billingArtifactGeneration.js +229 -0
  104. package/dist/esm/azure/billingGeneration.js +1 -0
  105. package/dist/esm/azure/billingPlots.js +187 -0
  106. package/dist/esm/azure/budgets.js +1 -0
  107. package/dist/esm/azure/commitmentsPlanning.js +1 -0
  108. package/dist/esm/azure/common.js +1 -0
  109. package/dist/esm/azure/configs.js +1 -0
  110. package/dist/esm/azure/costComposition.js +1 -0
  111. package/dist/esm/azure/dataProtection.js +5 -0
  112. package/dist/esm/azure/governance.js +14 -0
  113. package/dist/esm/azure/licensing.js +1 -0
  114. package/dist/esm/azure/metrics.js +1 -0
  115. package/dist/esm/azure/payloads.js +1 -0
  116. package/dist/esm/azure/portalArtifacts.js +1 -0
  117. package/dist/esm/azure/prices.js +1 -0
  118. package/dist/esm/azure/publicIpAddresses.js +2 -0
  119. package/dist/esm/azure/recommendationAudit.js +16 -0
  120. package/dist/esm/azure/recommendationState.js +1 -0
  121. package/dist/esm/azure/recommendationTracks.js +40 -0
  122. package/dist/esm/azure/recommendationWorkflow.js +13 -0
  123. package/dist/esm/azure/recommendations.js +10 -0
  124. package/dist/esm/azure/regulatoryCompliance.js +6 -0
  125. package/dist/esm/azure/relationships.js +2 -0
  126. package/dist/esm/azure/reportingTemplates.js +1 -0
  127. package/dist/esm/azure/reports.js +12 -0
  128. package/dist/esm/azure/resourceHealth.js +12 -0
  129. package/dist/esm/azure/resourceOptimization.js +1 -0
  130. package/dist/esm/azure/resources.js +1 -0
  131. package/dist/esm/azure/reviewChecklist.js +1 -0
  132. package/dist/esm/azure/secureScore.js +1 -0
  133. package/dist/esm/azure/security.js +1 -0
  134. package/dist/esm/azure/serviceRetirement.js +1 -0
  135. package/dist/esm/azure/serviceRetirementState.js +1 -0
  136. package/dist/esm/azure/serviceRetirementWorkManagement.js +1 -0
  137. package/dist/esm/azure/storage-inventory.js +1 -0
  138. package/dist/esm/azure/subscriptions.js +1 -0
  139. package/dist/esm/azure/views.js +181 -0
  140. package/dist/esm/azure/workManagement.js +4 -0
  141. package/dist/esm/common/artifactControlData.js +95 -0
  142. package/dist/esm/common/artifactEvidence.js +173 -0
  143. package/dist/esm/common/artifactEvidenceValidation.js +24 -0
  144. package/dist/esm/common/artifactGeneration.js +1 -0
  145. package/dist/esm/common/capabilityPassport.js +206 -0
  146. package/dist/esm/common/index.js +7 -0
  147. package/dist/esm/common/pagination.js +1 -0
  148. package/dist/esm/common/provider.js +11 -0
  149. package/dist/esm/common/providerSyncProgress.js +1 -0
  150. package/dist/esm/common/relationships.js +1 -0
  151. package/dist/esm/common/syncProgress.js +1 -0
  152. package/dist/esm/company/billingAccount.js +1 -0
  153. package/dist/esm/company/company.js +1 -0
  154. package/dist/esm/company/companyHierarchy.js +1 -0
  155. package/dist/esm/company/companyNotes.js +38 -0
  156. package/dist/esm/company/customProperties.js +1 -0
  157. package/dist/esm/company/index.js +6 -0
  158. package/dist/esm/company/notification.js +43 -0
  159. package/dist/esm/company/survey.js +1 -0
  160. package/dist/esm/customProperties/customProperties.js +1 -0
  161. package/dist/esm/customProperties/index.js +1 -0
  162. package/dist/esm/entries/aws.js +3 -0
  163. package/dist/esm/entries/commitments-planning.js +3 -0
  164. package/dist/esm/entries/provider.js +3 -0
  165. package/dist/esm/entries/recommendations.js +3 -0
  166. package/dist/esm/entries/relationships.js +3 -0
  167. package/dist/esm/entries/root.js +3 -0
  168. package/dist/esm/events/actionGroups.js +1 -0
  169. package/dist/esm/events/alertDefinitionRun.js +1 -0
  170. package/dist/esm/events/baseAlert.js +1 -0
  171. package/dist/esm/events/cost.js +1 -0
  172. package/dist/esm/events/costAnomalies.js +1 -0
  173. package/dist/esm/events/costViews.js +1 -0
  174. package/dist/esm/events/eventStatus.js +1 -0
  175. package/dist/esm/events/index.js +8 -0
  176. package/dist/esm/events/quickAlerts.js +2 -0
  177. package/dist/esm/features-and-permissions/access.js +1 -0
  178. package/dist/esm/features-and-permissions/index.js +1 -0
  179. package/dist/esm/feedbacks/feedback.js +1 -0
  180. package/dist/esm/identity/apikey.js +1 -0
  181. package/dist/esm/identity/index.js +1 -0
  182. package/dist/esm/index.js +57 -0
  183. package/dist/esm/index.vite.js +48 -0
  184. package/dist/esm/integrations/autotask.js +1 -0
  185. package/dist/esm/integrations/azureDevOps.js +1 -0
  186. package/dist/esm/integrations/github.js +1 -0
  187. package/dist/esm/integrations/halo.js +1 -0
  188. package/dist/esm/integrations/index.js +5 -0
  189. package/dist/esm/integrations/integrationTickets.js +1 -0
  190. package/dist/esm/package.json +3 -0
  191. package/dist/esm/scheduler/index.js +1 -0
  192. package/dist/esm/scheduler/scheduler.js +1 -0
  193. package/dist/esm/tags/index.js +1 -0
  194. package/dist/esm/tags/tags.js +6 -0
  195. package/dist/esm/unknown/services.js +1 -0
  196. package/dist/esm/users/companyUser.js +2 -0
  197. package/dist/esm/users/index.js +2 -0
  198. package/dist/esm/users/user.js +1 -0
  199. package/dist/index.d.ts +3 -0
  200. package/dist/index.d.ts.map +1 -1
  201. package/dist/index.js +3 -0
  202. package/dist/index.js.map +1 -1
  203. package/package.json +25 -7
@@ -0,0 +1,95 @@
1
+ const FORBIDDEN_SENSITIVE_FIELDS = new Set([
2
+ 'accountkey',
3
+ 'accesskey',
4
+ 'accesstoken',
5
+ 'apikey',
6
+ 'authorization',
7
+ 'clientsecret',
8
+ 'connectionstring',
9
+ 'credential',
10
+ 'credentials',
11
+ 'password',
12
+ 'refreshtoken',
13
+ 'sastoken',
14
+ 'secret',
15
+ 'sharedaccesssignature',
16
+ 'token',
17
+ ]);
18
+ const PHYSICAL_REFERENCE_FIELDS = new Set([
19
+ 'artifactpath',
20
+ 'blobpath',
21
+ 'bloburi',
22
+ 'bloburl',
23
+ 'containerpath',
24
+ 'containeruri',
25
+ 'containerurl',
26
+ 'filepath',
27
+ 'filesystempath',
28
+ 'inputmanifestpath',
29
+ 'manifestpath',
30
+ 'outputmanifestpath',
31
+ 'path',
32
+ 'physicalpath',
33
+ 'physicaluri',
34
+ 'physicalurl',
35
+ 'sourcepath',
36
+ 'sourceuri',
37
+ 'sourceurl',
38
+ 'storagepath',
39
+ 'storageuri',
40
+ 'storageurl',
41
+ 'uri',
42
+ 'url',
43
+ ]);
44
+ const PERCENT_ENCODED_BYTE_PATTERN = /%[0-9A-Fa-f]{2}/;
45
+ const URI_SCHEME_PATTERN = /^[A-Za-z][A-Za-z0-9+.-]*:/;
46
+ const isRecord = (value) => typeof value === 'object' && value !== null && !Array.isArray(value);
47
+ const hasControlCharacters = (value) => Array.from(value).some(character => character.charCodeAt(0) < 32 || character.charCodeAt(0) === 127);
48
+ const normalizeFieldName = (key) => key.replace(/[-_\s]/g, '').toLowerCase();
49
+ const hasDotTraversal = (value) => value.split(/[\\/]/).some(segment => segment === '.' || segment === '..');
50
+ const isForbiddenReferenceValue = (value, allowUriScheme = false) => hasControlCharacters(value) ||
51
+ PERCENT_ENCODED_BYTE_PATTERN.test(value) ||
52
+ (!allowUriScheme && URI_SCHEME_PATTERN.test(value)) ||
53
+ value.startsWith('/') ||
54
+ value.startsWith('\\\\') ||
55
+ /^[A-Za-z]:[\\/]/.test(value) ||
56
+ hasDotTraversal(value);
57
+ const isSafeAzureResourceId = (key, value) => {
58
+ if (key !== 'resourceId' || typeof value !== 'string' || hasControlCharacters(value) || value.includes('\\'))
59
+ return false;
60
+ const segments = value.split('/');
61
+ return (segments.length >= 3 &&
62
+ segments[0] === '' &&
63
+ segments[1].toLowerCase() === 'subscriptions' &&
64
+ segments
65
+ .slice(2)
66
+ .every(segment => segment.trim() === segment && segment.length > 0 && !/[?#%]/.test(segment) && segment !== '.' && segment !== '..'));
67
+ };
68
+ /** Marks a structurally validated schema field whose logical reference name is allowed. */
69
+ export const allowedArtifactReferenceField = (object, key) => isRecord(object) ? [{ object, key }] : [];
70
+ /** Marks a structurally validated identity field whose value is allowed by its owning schema. */
71
+ export const allowedArtifactIdentityField = (object, key) => isRecord(object) ? [{ object, key, allowUriScheme: true }] : [];
72
+ /** Rejects exact normalized sensitive fields and physical-reference control data recursively. */
73
+ export const containsForbiddenArtifactControlData = (value, allowedReferenceFields = []) => {
74
+ if (typeof value === 'string')
75
+ return isForbiddenReferenceValue(value);
76
+ if (Array.isArray(value))
77
+ return value.some(child => containsForbiddenArtifactControlData(child, allowedReferenceFields));
78
+ if (!isRecord(value))
79
+ return false;
80
+ return Object.entries(value).some(([key, child]) => {
81
+ if (hasControlCharacters(key))
82
+ return true;
83
+ const normalizedKey = normalizeFieldName(key);
84
+ if (FORBIDDEN_SENSITIVE_FIELDS.has(normalizedKey))
85
+ return true;
86
+ const allowedField = allowedReferenceFields.find(field => field.object === value && field.key === key);
87
+ if (allowedField?.allowUriScheme && typeof child === 'string')
88
+ return isForbiddenReferenceValue(child, true);
89
+ if (PHYSICAL_REFERENCE_FIELDS.has(normalizedKey) && !allowedField)
90
+ return true;
91
+ if (isSafeAzureResourceId(key, child))
92
+ return false;
93
+ return containsForbiddenArtifactControlData(child, allowedReferenceFields);
94
+ });
95
+ };
@@ -0,0 +1,173 @@
1
+ import { hasValidOptionalArtifactRevisionComponents, isStrictLogicalArtifactReference } from './artifactEvidenceValidation.js';
2
+ const SUPPORT_VERDICTS = new Set(['supported', 'unsupported', 'unknown']);
3
+ const APPLICABILITY_VERDICTS = new Set(['applicable', 'not-applicable', 'unknown']);
4
+ const ATTEMPT_OUTCOMES = new Set([
5
+ 'not-attempted',
6
+ 'queued',
7
+ 'running',
8
+ 'succeeded',
9
+ 'failed',
10
+ 'cancelled',
11
+ 'timed-out',
12
+ 'dead-lettered',
13
+ 'superseded',
14
+ ]);
15
+ const COVERAGE_VERDICTS = new Set(['complete', 'partial', 'none', 'unknown']);
16
+ const EMPTY_EVIDENCE_VERDICTS = new Set(['populated', 'complete-empty', 'not-observed', 'unknown']);
17
+ const FRESHNESS_VERDICTS = new Set(['current', 'stale', 'expired', 'unknown']);
18
+ const EVIDENCE_VERDICTS = new Set(['complete', 'partial', 'insufficient', 'conflicting']);
19
+ const PROCESSING_LIFECYCLES = new Set(['queued', 'running', 'succeeded', 'failed', 'cancelled', 'timed-out', 'dead-lettered', 'superseded']);
20
+ const PUBLICATION_VERDICTS = new Set(['completed', 'partial', 'suppressed', 'superseded', 'quarantined']);
21
+ const PROVIDERS = new Set(['azure', 'aws']);
22
+ const DATE_BASES = new Set(['utc', 'billing-calendar', 'company-local']);
23
+ const SHA256_PATTERN = /^[a-f0-9]{64}$/;
24
+ const isRecord = (value) => typeof value === 'object' && value !== null && !Array.isArray(value);
25
+ const isNonEmptyString = (value) => typeof value === 'string' && value.trim().length > 0;
26
+ const isNonNegativeInteger = (value) => Number.isInteger(value) && value >= 0;
27
+ const isPositiveInteger = (value) => Number.isInteger(value) && value > 0;
28
+ const isStringIn = (value, values) => typeof value === 'string' && values.has(value);
29
+ const isCanonicalIsoTimestamp = (value) => {
30
+ if (!isNonEmptyString(value))
31
+ return false;
32
+ const timestamp = Date.parse(value);
33
+ return Number.isFinite(timestamp) && new Date(timestamp).toISOString() === value;
34
+ };
35
+ const isArtifactDecisionIssue = (value) => isRecord(value) &&
36
+ isNonEmptyString(value.code) &&
37
+ typeof value.blocking === 'boolean' &&
38
+ (value.dependency === undefined || isNonEmptyString(value.dependency));
39
+ const isObservedRange = (value) => {
40
+ if (!isRecord(value) ||
41
+ !isCanonicalIsoTimestamp(value.fromInclusive) ||
42
+ !isCanonicalIsoTimestamp(value.throughExclusive) ||
43
+ Date.parse(value.throughExclusive) <= Date.parse(value.fromInclusive) ||
44
+ !isStringIn(value.dateBasis, DATE_BASES)) {
45
+ return false;
46
+ }
47
+ return value.timeZone === undefined || isNonEmptyString(value.timeZone);
48
+ };
49
+ const isArtifactDependencyDescriptor = (value) => {
50
+ if (!isRecord(value) ||
51
+ !isNonEmptyString(value.name) ||
52
+ typeof value.required !== 'boolean' ||
53
+ !isStringIn(value.support, SUPPORT_VERDICTS) ||
54
+ !isStringIn(value.applicability, APPLICABILITY_VERDICTS) ||
55
+ !isStringIn(value.attempt, ATTEMPT_OUTCOMES) ||
56
+ !isStringIn(value.coverage, COVERAGE_VERDICTS) ||
57
+ !isStringIn(value.emptyEvidence, EMPTY_EVIDENCE_VERDICTS) ||
58
+ !isStringIn(value.freshness, FRESHNESS_VERDICTS) ||
59
+ !isStringIn(value.evidence, EVIDENCE_VERDICTS) ||
60
+ !isStringIn(value.publication, PUBLICATION_VERDICTS)) {
61
+ return false;
62
+ }
63
+ if (value.generationId !== undefined && !isNonEmptyString(value.generationId))
64
+ return false;
65
+ if (value.digest !== undefined && (typeof value.digest !== 'string' || !SHA256_PATTERN.test(value.digest)))
66
+ return false;
67
+ if (!hasValidOptionalArtifactRevisionComponents(value))
68
+ return false;
69
+ if (value.observedRange !== undefined && !isObservedRange(value.observedRange))
70
+ return false;
71
+ if (value.completeThrough !== undefined && !isCanonicalIsoTimestamp(value.completeThrough))
72
+ return false;
73
+ if (value.reasonCode !== undefined && !isNonEmptyString(value.reasonCode))
74
+ return false;
75
+ if (value.acceptedRowCount !== undefined && !isNonNegativeInteger(value.acceptedRowCount))
76
+ return false;
77
+ if (value.emptyEvidence === 'complete-empty') {
78
+ if (value.attempt !== 'succeeded' ||
79
+ value.coverage !== 'complete' ||
80
+ value.acceptedRowCount !== 0 ||
81
+ !isStrictLogicalArtifactReference(value.emptyProofRef)) {
82
+ return false;
83
+ }
84
+ }
85
+ else if (value.emptyProofRef !== undefined) {
86
+ return false;
87
+ }
88
+ if (value.publication === 'completed') {
89
+ return (value.support === 'supported' &&
90
+ value.applicability === 'applicable' &&
91
+ value.attempt === 'succeeded' &&
92
+ value.coverage === 'complete' &&
93
+ (value.emptyEvidence === 'populated' || value.emptyEvidence === 'complete-empty') &&
94
+ value.evidence === 'complete');
95
+ }
96
+ return true;
97
+ };
98
+ const isArtifactClaimDependencyDecision = (value) => {
99
+ if (!isRecord(value) ||
100
+ !isNonEmptyString(value.claimId) ||
101
+ !Array.isArray(value.sectionPaths) ||
102
+ !value.sectionPaths.every(isNonEmptyString) ||
103
+ !Array.isArray(value.requiredDependencies) ||
104
+ !value.requiredDependencies.every(isNonEmptyString) ||
105
+ !isStringIn(value.evidence, EVIDENCE_VERDICTS) ||
106
+ !isStringIn(value.publication, PUBLICATION_VERDICTS) ||
107
+ !Array.isArray(value.issues) ||
108
+ !value.issues.every(isArtifactDecisionIssue)) {
109
+ return false;
110
+ }
111
+ return value.publication !== 'completed' || (value.evidence === 'complete' && !value.issues.some(issue => issue.blocking));
112
+ };
113
+ const hasUniqueValues = (values) => new Set(values).size === values.length;
114
+ /** Dependency-free runtime rejection boundary for provider-neutral publication decisions. */
115
+ export const isArtifactPublicationDecision = (value) => {
116
+ if (!isRecord(value) ||
117
+ !isStringIn(value.processing, PROCESSING_LIFECYCLES) ||
118
+ !isStringIn(value.evidence, EVIDENCE_VERDICTS) ||
119
+ !isStringIn(value.publication, PUBLICATION_VERDICTS) ||
120
+ !Array.isArray(value.dependencies) ||
121
+ !value.dependencies.every(isArtifactDependencyDescriptor) ||
122
+ !Array.isArray(value.claims) ||
123
+ !value.claims.every(isArtifactClaimDependencyDecision) ||
124
+ !Array.isArray(value.issues) ||
125
+ !value.issues.every(isArtifactDecisionIssue)) {
126
+ return false;
127
+ }
128
+ const dependencyNames = value.dependencies.map(dependency => dependency.name);
129
+ const claimIds = value.claims.map(claim => claim.claimId);
130
+ if (!hasUniqueValues(dependencyNames) || !hasUniqueValues(claimIds))
131
+ return false;
132
+ if (!value.claims.every(claim => hasUniqueValues(claim.requiredDependencies)))
133
+ return false;
134
+ if (value.publication !== 'completed')
135
+ return true;
136
+ const completedDependencies = new Set(value.dependencies.filter(dependency => dependency.publication === 'completed').map(dependency => dependency.name));
137
+ return (value.processing === 'succeeded' &&
138
+ (value.evidence === 'complete' || value.evidence === 'partial') &&
139
+ value.dependencies.every(dependency => !dependency.required || dependency.publication === 'completed') &&
140
+ value.claims.every(claim => claim.publication === 'completed' && claim.requiredDependencies.every(dependency => completedDependencies.has(dependency))) &&
141
+ !value.issues.some(issue => issue.blocking));
142
+ };
143
+ /** Checks the provider-neutral ownership shape used by observe- and enforce-mode artifacts. */
144
+ export const isArtifactOwnershipBinding = (value) => isRecord(value) &&
145
+ isStringIn(value.provider, PROVIDERS) &&
146
+ isNonEmptyString(value.tenantId) &&
147
+ isNonEmptyString(value.companyId) &&
148
+ isNonEmptyString(value.cloudAccountId) &&
149
+ isNonEmptyString(value.accountId) &&
150
+ (value.ownershipEpochRevision === undefined || isPositiveInteger(value.ownershipEpochRevision));
151
+ /** Checks that an ownership binding is valid for enforce-mode publication. */
152
+ export const isEnforceableArtifactOwnershipBinding = (value) => isArtifactOwnershipBinding(value) && value.ownershipEpochRevision !== undefined;
153
+ /**
154
+ * Compares ownership first, then source and policy revisions component-wise.
155
+ * Callers must validate both vectors before comparison; this function deliberately compares the supplied values without adding a second validation policy.
156
+ */
157
+ export const compareArtifactRevisionVector = (left, right) => {
158
+ if (left.ownershipEpochRevision === undefined || right.ownershipEpochRevision === undefined)
159
+ return 'unenforceable';
160
+ if (left.ownershipEpochRevision > right.ownershipEpochRevision)
161
+ return 'newer-ownership';
162
+ if (left.ownershipEpochRevision < right.ownershipEpochRevision)
163
+ return 'older-ownership';
164
+ const sourceComparison = Math.sign(left.sourceRevision - right.sourceRevision);
165
+ const policyComparison = Math.sign(left.policyRevision - right.policyRevision);
166
+ if (sourceComparison === 0 && policyComparison === 0)
167
+ return 'equal';
168
+ if (sourceComparison >= 0 && policyComparison >= 0)
169
+ return 'newer';
170
+ if (sourceComparison <= 0 && policyComparison <= 0)
171
+ return 'older';
172
+ return 'incomparable';
173
+ };
@@ -0,0 +1,24 @@
1
+ const hasControlCharacters = (value) => Array.from(value).some(character => character.charCodeAt(0) < 32 || character.charCodeAt(0) === 127);
2
+ /** Validates a generation-relative logical artifact reference without accepting physical-path encodings. */
3
+ export const isStrictLogicalArtifactReference = (value) => {
4
+ if (typeof value !== 'string' || value.trim() !== value || value.length === 0 || hasControlCharacters(value))
5
+ return false;
6
+ if (value.startsWith('/') || value.includes('\\') || value.includes('%') || value.includes('?') || value.includes('#'))
7
+ return false;
8
+ if (/^[A-Za-z][A-Za-z0-9+.-]*:/.test(value) || /^[A-Za-z]:[\\/]/.test(value))
9
+ return false;
10
+ const segments = value.split('/');
11
+ return segments.length >= 2 && segments.every(segment => segment.length > 0 && segment !== '.' && segment !== '..');
12
+ };
13
+ const isRecord = (value) => typeof value === 'object' && value !== null && !Array.isArray(value);
14
+ const isPositiveSafeInteger = (value) => Number.isSafeInteger(value) && Number(value) > 0;
15
+ /** Validates the positive source/policy revision vector shared by evidence producers and consumers. */
16
+ export const isArtifactRevisionVector = (value) => isRecord(value) &&
17
+ isPositiveSafeInteger(value.sourceRevision) &&
18
+ isPositiveSafeInteger(value.policyRevision) &&
19
+ (value.ownershipEpochRevision === undefined || isPositiveSafeInteger(value.ownershipEpochRevision));
20
+ /** Validates optional dependency revision components using the shared revision-vector rules. */
21
+ export const hasValidOptionalArtifactRevisionComponents = (value) => isArtifactRevisionVector({
22
+ sourceRevision: value.sourceRevision === undefined ? 1 : value.sourceRevision,
23
+ policyRevision: value.policyRevision === undefined ? 1 : value.policyRevision,
24
+ });
@@ -0,0 +1 @@
1
+ export const ARTIFACT_GENERATION_SCHEMA_VERSION = 1;
@@ -0,0 +1,206 @@
1
+ import { isArtifactOwnershipBinding, } from './artifactEvidence.js';
2
+ export const CAPABILITY_PASSPORT_SCHEMA_VERSION = 1;
3
+ export const CAPABILITY_REASON_CODES = [
4
+ 'not-requested',
5
+ 'permission-denied',
6
+ 'not-found',
7
+ 'throttled',
8
+ 'timeout',
9
+ 'pagination-incomplete',
10
+ 'source-partial',
11
+ 'source-empty',
12
+ 'source-unsupported',
13
+ 'retained-last-known-good',
14
+ 'currency-unresolved',
15
+ 'unknown',
16
+ ];
17
+ const REASON_CODES = new Set(CAPABILITY_REASON_CODES);
18
+ const AGREEMENT_TYPES = new Set(['EA', 'MCA', 'CSP', 'PAYG-MOSP', 'sponsored-trial', 'unknown']);
19
+ const AGREEMENT_SOURCES = new Set(['observed', 'configured', 'unknown']);
20
+ const AVAILABILITY_VALUES = new Set(['available', 'partial', 'missing', 'unavailable', 'unknown']);
21
+ const EMPTY_EVIDENCE_VALUES = new Set(['populated', 'complete-empty', 'not-observed', 'unknown']);
22
+ const PROVIDER_OUTCOMES = new Set(['accepted', 'authoritatively-unsupported', 'unknown']);
23
+ const ATTEMPT_OUTCOMES = new Set(['succeeded', 'failed', 'partial']);
24
+ const SHA256_PATTERN = /^[a-f0-9]{64}$/;
25
+ const isRecord = (value) => typeof value === 'object' && value !== null && !Array.isArray(value);
26
+ const isNonEmptyString = (value) => typeof value === 'string' && value.trim().length > 0;
27
+ const isNonNegativeInteger = (value) => Number.isInteger(value) && value >= 0;
28
+ const isPositiveInteger = (value) => Number.isInteger(value) && value > 0;
29
+ const isCanonicalIsoTimestamp = (value) => {
30
+ if (!isNonEmptyString(value))
31
+ return false;
32
+ const timestamp = Date.parse(value);
33
+ return Number.isFinite(timestamp) && new Date(timestamp).toISOString() === value;
34
+ };
35
+ const isLogicalArtifactRef = (value) => {
36
+ if (!isNonEmptyString(value) || value.startsWith('/') || value.includes('://') || value.includes('?') || value.includes('#'))
37
+ return false;
38
+ if (value.includes('\\'))
39
+ return false;
40
+ const segments = value.split('/');
41
+ return segments.length >= 2 && segments.every(segment => segment.length > 0 && segment !== '.' && segment !== '..');
42
+ };
43
+ const isSubscriptionBoundResourceId = (value, subscriptionId) => {
44
+ if (!isNonEmptyString(value))
45
+ return false;
46
+ const segments = value.split('/');
47
+ return (segments.length >= 4 &&
48
+ segments[0] === '' &&
49
+ segments[1]?.toLowerCase() === 'subscriptions' &&
50
+ segments[2]?.toLowerCase() === subscriptionId.toLowerCase());
51
+ };
52
+ const isReasonCode = (value) => typeof value === 'string' && REASON_CODES.has(value);
53
+ const isImmutableSourceGeneration = (value) => {
54
+ if (!isRecord(value))
55
+ return false;
56
+ if (!isLogicalArtifactRef(value.artifactRef) ||
57
+ !isNonEmptyString(value.generationId) ||
58
+ typeof value.sha256 !== 'string' ||
59
+ !SHA256_PATTERN.test(value.sha256) ||
60
+ !isPositiveInteger(value.schemaVersion) ||
61
+ !isCanonicalIsoTimestamp(value.producedAt)) {
62
+ return false;
63
+ }
64
+ return value.completeThrough === undefined || isCanonicalIsoTimestamp(value.completeThrough);
65
+ };
66
+ const isScopeBinding = (value, ownership) => {
67
+ if (!isRecord(value) || value.provider !== ownership.provider || value.tenantId !== ownership.tenantId)
68
+ return false;
69
+ if (value.kind === 'tenant')
70
+ return true;
71
+ if (value.kind === 'billing-account')
72
+ return isNonEmptyString(value.billingAccountId);
73
+ if (value.kind === 'customer')
74
+ return isNonEmptyString(value.customerId);
75
+ if (value.kind === 'subscription')
76
+ return value.subscriptionId === ownership.subscriptionId;
77
+ return (value.kind === 'resource' &&
78
+ value.subscriptionId === ownership.subscriptionId &&
79
+ isSubscriptionBoundResourceId(value.normalizedResourceId, ownership.subscriptionId));
80
+ };
81
+ const isAttempt = (value) => {
82
+ if (!isRecord(value))
83
+ return false;
84
+ if (value.status === 'not-attempted')
85
+ return isReasonCode(value.reasonCode);
86
+ if (value.status !== 'attempted' || !isCanonicalIsoTimestamp(value.startedAt) || !isCanonicalIsoTimestamp(value.completedAt))
87
+ return false;
88
+ if (Date.parse(value.completedAt) < Date.parse(value.startedAt) || typeof value.outcome !== 'string' || !ATTEMPT_OUTCOMES.has(value.outcome)) {
89
+ return false;
90
+ }
91
+ return Array.isArray(value.reasonCodes) && value.reasonCodes.every(isReasonCode);
92
+ };
93
+ const isFreshness = (value) => {
94
+ if (!isRecord(value))
95
+ return false;
96
+ if (value.status === 'unknown')
97
+ return true;
98
+ if ((value.status !== 'current' && value.status !== 'stale') || !isCanonicalIsoTimestamp(value.observedAt))
99
+ return false;
100
+ if (value.completeThrough !== undefined && !isCanonicalIsoTimestamp(value.completeThrough))
101
+ return false;
102
+ return value.status !== 'stale' || isNonEmptyString(value.maximumAge);
103
+ };
104
+ const isObservation = (value, ownership) => {
105
+ if (!isRecord(value))
106
+ return false;
107
+ if (!isNonEmptyString(value.observationId) || !isNonEmptyString(value.capability) || !isScopeBinding(value.scope, ownership))
108
+ return false;
109
+ if (!isAttempt(value.attempt) || typeof value.providerSurfaceOutcome !== 'string' || !PROVIDER_OUTCOMES.has(value.providerSurfaceOutcome)) {
110
+ return false;
111
+ }
112
+ if (typeof value.availability !== 'string' || !AVAILABILITY_VALUES.has(value.availability))
113
+ return false;
114
+ if (typeof value.emptyEvidence !== 'string' || !EMPTY_EVIDENCE_VALUES.has(value.emptyEvidence) || !isFreshness(value.freshness))
115
+ return false;
116
+ if (value.sourceGeneration !== undefined && !isImmutableSourceGeneration(value.sourceGeneration))
117
+ return false;
118
+ if (value.coverageRef !== undefined && !isLogicalArtifactRef(value.coverageRef))
119
+ return false;
120
+ if (value.emptyEvidence === 'complete-empty') {
121
+ if (value.availability !== 'available' || value.attempt.status !== 'attempted' || value.attempt.outcome !== 'succeeded')
122
+ return false;
123
+ }
124
+ if (value.limits !== undefined) {
125
+ if (!isRecord(value.limits))
126
+ return false;
127
+ if (value.limits.expectedPages !== undefined && !isNonNegativeInteger(value.limits.expectedPages))
128
+ return false;
129
+ if (value.limits.receivedPages !== undefined && !isNonNegativeInteger(value.limits.receivedPages))
130
+ return false;
131
+ if (value.limits.throttled !== undefined && typeof value.limits.throttled !== 'boolean')
132
+ return false;
133
+ if (value.limits.retainedLastKnownGood !== undefined && typeof value.limits.retainedLastKnownGood !== 'boolean')
134
+ return false;
135
+ }
136
+ return true;
137
+ };
138
+ const isOwnership = (value) => isArtifactOwnershipBinding(value) && 'subscriptionId' in value && isNonEmptyString(value.subscriptionId);
139
+ const isObservationSet = (value, ownership) => {
140
+ if (!isRecord(value) || !isNonNegativeInteger(value.totalCount))
141
+ return false;
142
+ if (value.mode === 'inline') {
143
+ if (!Array.isArray(value.items) || value.items.length !== value.totalCount || !value.items.every(item => isObservation(item, ownership))) {
144
+ return false;
145
+ }
146
+ const observationIds = value.items.map(item => item.observationId);
147
+ return new Set(observationIds).size === observationIds.length;
148
+ }
149
+ if (value.mode !== 'sharded' ||
150
+ !isNonNegativeInteger(value.shardCount) ||
151
+ !isLogicalArtifactRef(value.indexRef) ||
152
+ !Array.isArray(value.shards) ||
153
+ value.shards.length !== value.shardCount) {
154
+ return false;
155
+ }
156
+ let total = 0;
157
+ const refs = new Set();
158
+ for (const shard of value.shards) {
159
+ if (!isRecord(shard) ||
160
+ !isLogicalArtifactRef(shard.artifactRef) ||
161
+ typeof shard.sha256 !== 'string' ||
162
+ !SHA256_PATTERN.test(shard.sha256) ||
163
+ !isPositiveInteger(shard.itemCount) ||
164
+ refs.has(shard.artifactRef)) {
165
+ return false;
166
+ }
167
+ refs.add(shard.artifactRef);
168
+ total += shard.itemCount;
169
+ }
170
+ return total === value.totalCount;
171
+ };
172
+ /** Dependency-free runtime rejection boundary for Capability Passport schema v1. */
173
+ export const isCapabilityPassport = (value) => {
174
+ if (!isRecord(value) || value.schemaVersion !== CAPABILITY_PASSPORT_SCHEMA_VERSION)
175
+ return false;
176
+ if (!isNonEmptyString(value.passportId) || !isNonEmptyString(value.runId) || !isCanonicalIsoTimestamp(value.generatedAt))
177
+ return false;
178
+ if (!isOwnership(value.ownership))
179
+ return false;
180
+ if (!isRecord(value.agreementObservation))
181
+ return false;
182
+ if (typeof value.agreementObservation.type !== 'string' ||
183
+ !AGREEMENT_TYPES.has(value.agreementObservation.type) ||
184
+ typeof value.agreementObservation.source !== 'string' ||
185
+ !AGREEMENT_SOURCES.has(value.agreementObservation.source) ||
186
+ (value.agreementObservation.sourceGeneration !== undefined && !isImmutableSourceGeneration(value.agreementObservation.sourceGeneration))) {
187
+ return false;
188
+ }
189
+ if (!isObservationSet(value.observations, value.ownership))
190
+ return false;
191
+ if (!isRecord(value.producerVersions) || Object.keys(value.producerVersions).length === 0)
192
+ return false;
193
+ if (!Object.entries(value.producerVersions).every(([name, version]) => isNonEmptyString(name) && isNonEmptyString(version)))
194
+ return false;
195
+ if (!Array.isArray(value.issues) ||
196
+ !value.issues.every(issue => isRecord(issue) && isReasonCode(issue.reasonCode) && (issue.observationId === undefined || isNonEmptyString(issue.observationId)))) {
197
+ return false;
198
+ }
199
+ if (value.observations.mode === 'inline') {
200
+ const observationIds = new Set(value.observations.items.map(item => item.observationId));
201
+ if (!value.issues.every(issue => issue.observationId === undefined || (isNonEmptyString(issue.observationId) && observationIds.has(issue.observationId)))) {
202
+ return false;
203
+ }
204
+ }
205
+ return true;
206
+ };
@@ -0,0 +1,7 @@
1
+ export * from './artifactGeneration.js';
2
+ export * from './capabilityPassport.js';
3
+ export * from './pagination.js';
4
+ export * from './provider.js';
5
+ export * from './providerSyncProgress.js';
6
+ export * from './relationships.js';
7
+ export * from './syncProgress.js';
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,11 @@
1
+ export var ProviderName;
2
+ (function (ProviderName) {
3
+ ProviderName["Azure"] = "azure";
4
+ ProviderName["Aws"] = "aws";
5
+ })(ProviderName || (ProviderName = {}));
6
+ /** Provider-owned resource boundary kind used by indexed scope records. */
7
+ export var ProviderScopeType;
8
+ (function (ProviderScopeType) {
9
+ ProviderScopeType["Subscription"] = "subscription";
10
+ ProviderScopeType["Account"] = "account";
11
+ })(ProviderScopeType || (ProviderScopeType = {}));
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,38 @@
1
+ export const COMPANY_NOTE_SCHEMA_VERSION = 1;
2
+ export const COMPANY_NOTES_FEATURE_KEY = 'company_notes';
3
+ export const COMPANY_NOTES_VIEW_PERMISSION_KEY = 'company_notes.view';
4
+ export const COMPANY_NOTES_MANAGE_PERMISSION_KEY = 'company_notes.manage';
5
+ export const COMPANY_NOTES_PERMISSION_KEYS = [COMPANY_NOTES_VIEW_PERMISSION_KEY, COMPANY_NOTES_MANAGE_PERMISSION_KEY];
6
+ export const COMPANY_NOTE_ORDINARY_CATEGORIES = ['general', 'meeting'];
7
+ export const COMPANY_NOTE_CONTEXT_CATEGORIES = [
8
+ 'company-profile',
9
+ 'security',
10
+ 'architecture',
11
+ 'operations',
12
+ 'finops',
13
+ 'performance',
14
+ 'reliability',
15
+ 'roadmap',
16
+ ];
17
+ export const COMPANY_NOTE_CONTEXT_CATEGORY_ORDER = COMPANY_NOTE_CONTEXT_CATEGORIES;
18
+ export const COMPANY_NOTE_CATEGORIES = [...COMPANY_NOTE_ORDINARY_CATEGORIES, ...COMPANY_NOTE_CONTEXT_CATEGORIES];
19
+ export const COMPANY_NOTE_MEETING_TEMPLATE_KEY = 'meeting-v1';
20
+ export const COMPANY_NOTE_CONTEXT_TEMPLATE_KEYS = [
21
+ 'company-profile-v1',
22
+ 'security-v1',
23
+ 'architecture-v1',
24
+ 'operations-v1',
25
+ 'finops-v1',
26
+ 'performance-v1',
27
+ 'reliability-v1',
28
+ 'roadmap-v1',
29
+ ];
30
+ export const COMPANY_NOTE_TEMPLATE_KEYS = [COMPANY_NOTE_MEETING_TEMPLATE_KEY, ...COMPANY_NOTE_CONTEXT_TEMPLATE_KEYS];
31
+ export const COMPANY_NOTES_AI_MODES = [
32
+ 'general-note',
33
+ 'template-draft',
34
+ 'section-draft',
35
+ 'coach-selection',
36
+ 'company-research',
37
+ ];
38
+ export const COMPANY_NOTES_AI_SOURCE_MODES = ['spotto-only', 'public-research'];
@@ -0,0 +1 @@
1
+ export * from '../customProperties/index.js';
@@ -0,0 +1,6 @@
1
+ export * from './company.js';
2
+ export * from './companyHierarchy.js';
3
+ export * from './notification.js';
4
+ export * from './survey.js';
5
+ export * from './billingAccount.js';
6
+ export * from './companyNotes.js';
@@ -0,0 +1,43 @@
1
+ /** Bitmask constants for resources */
2
+ export const RECOMMENDATION_FLAGS = {
3
+ /** 001 */
4
+ PRIORITIZED: 1,
5
+ /** 010 */
6
+ DISMISSED: 2,
7
+ /** 100 */
8
+ NEW: 4,
9
+ /** 1000 */
10
+ IMPLEMENTED: 8,
11
+ };
12
+ /** Bitmask constants for users */
13
+ export const USER_FLAGS = {
14
+ /** 001 */
15
+ INVITE_ACCEPTED: 1,
16
+ };
17
+ /** Bitmask constants for cloud accounts */
18
+ export const CLOUD_ACCOUNT_FLAGS = {
19
+ /** 001 */
20
+ SYNC_COMPLETED: 1,
21
+ };
22
+ export const COST_ANOMALY_FLAGS = {
23
+ /** 001 */
24
+ DETECTED: 1,
25
+ };
26
+ export const SHARING_FLAGS = {
27
+ SHARE_CREATED: 1,
28
+ };
29
+ /** Helper functions for bitmask operations */
30
+ export const hasFlag = (value, flag) => (value & flag) !== 0;
31
+ export const addFlag = (value, flag) => value | flag;
32
+ export const removeFlag = (value, flag) => value & ~flag;
33
+ /** Array helper functions */
34
+ export const hasArrayFlag = (array, flag) => array.includes(flag);
35
+ export const addArrayFlag = (array, flag) => (array.includes(flag) ? array : [...array, flag]);
36
+ export const removeArrayFlag = (array, flag) => array.filter(f => f !== flag);
37
+ /** Get individual flags from resources array */
38
+ export const getRecommendationsFlags = (array) => ({
39
+ new: hasArrayFlag(array, RECOMMENDATION_FLAGS.NEW),
40
+ dismissed: hasArrayFlag(array, RECOMMENDATION_FLAGS.DISMISSED),
41
+ prioritized: hasArrayFlag(array, RECOMMENDATION_FLAGS.PRIORITIZED),
42
+ implemented: hasArrayFlag(array, RECOMMENDATION_FLAGS.IMPLEMENTED),
43
+ });
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export * from './customProperties.js';
@@ -0,0 +1,3 @@
1
+ export * from '../aws/index.js';
2
+ import * as namespace from '../aws/index.js';
3
+ export default namespace;