@keboola/api-client 32.0.0 → 34.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/AGENTS.md +82 -4
- package/API-SURFACE.md +19 -2
- package/CHANGELOG.md +465 -0
- package/dist/{ManagementClientAuthError-B-tyPlyG.cjs → ManagementClientAuthError-DD4u0EU7.cjs} +2 -2
- package/dist/{ManagementClientAuthError-B-tyPlyG.cjs.map → ManagementClientAuthError-DD4u0EU7.cjs.map} +1 -1
- package/dist/{ManagementClientAuthError-BAFNvOdf.js → ManagementClientAuthError-ey-f03vy.js} +2 -2
- package/dist/{ManagementClientAuthError-BAFNvOdf.js.map → ManagementClientAuthError-ey-f03vy.js.map} +1 -1
- package/dist/{ValidationError-CzPWydEb.js → ValidationError-BekhphAq.js} +11 -7
- package/dist/ValidationError-BekhphAq.js.map +1 -0
- package/dist/{ValidationError-h5qvwahi.cjs → ValidationError-CLVJCCwH.cjs} +16 -6
- package/dist/ValidationError-CLVJCCwH.cjs.map +1 -0
- package/dist/ai/index.cjs +2 -2
- package/dist/ai/index.d.cts +2 -2
- package/dist/ai/index.d.ts +2 -2
- package/dist/ai/index.js +2 -2
- package/dist/ai/types.d.cts +1 -1
- package/dist/ai/types.d.ts +1 -1
- package/dist/{appLogs-NIEDTDHf.cjs → appLogs-BjfUoWzs.cjs} +2 -2
- package/dist/{appLogs-NIEDTDHf.cjs.map → appLogs-BjfUoWzs.cjs.map} +1 -1
- package/dist/{appLogs-DX_WTBCa.d.ts → appLogs-Ch7DYpzx.d.ts} +2 -2
- package/dist/{appLogs-BAaaGYKg.d.cts → appLogs-D5A13Y0y.d.cts} +2 -2
- package/dist/{appLogs-DTLE6HTy.js → appLogs-xsVkTriU.js} +2 -2
- package/dist/{appLogs-DTLE6HTy.js.map → appLogs-xsVkTriU.js.map} +1 -1
- package/dist/apps/index.cjs +3 -3
- package/dist/apps/index.d.cts +3 -3
- package/dist/apps/index.d.ts +3 -3
- package/dist/apps/index.js +3 -3
- package/dist/apps/types.d.cts +2 -2
- package/dist/apps/types.d.ts +2 -2
- package/dist/assets/index.cjs +1 -1
- package/dist/assets/index.d.cts +1 -1
- package/dist/assets/index.d.ts +1 -1
- package/dist/assets/index.js +1 -1
- package/dist/auth/index.cjs +1 -1
- package/dist/auth/index.d.cts +1 -1
- package/dist/auth/index.d.ts +1 -1
- package/dist/auth/index.js +1 -1
- package/dist/auth/types.d.cts +2 -2
- package/dist/auth/types.d.ts +2 -2
- package/dist/{auth-DP-6TFiM.cjs → auth-JQ33o3nU.cjs} +2 -2
- package/dist/{auth-DP-6TFiM.cjs.map → auth-JQ33o3nU.cjs.map} +1 -1
- package/dist/{auth-DtbQaeDj.js → auth-aItmDu45.js} +2 -2
- package/dist/{auth-DtbQaeDj.js.map → auth-aItmDu45.js.map} +1 -1
- package/dist/{authClient-DhfzOUaa.d.cts → authClient-CTHNs6Tq.d.cts} +6 -6
- package/dist/{authClient--BtZgjIc.js → authClient-D7W9vWPR.js} +43 -9
- package/dist/authClient-D7W9vWPR.js.map +1 -0
- package/dist/{authClient-CtfyVHRD.d.ts → authClient-D8i3JTM-.d.ts} +6 -6
- package/dist/{authClient-b7uec7sw.cjs → authClient-_PpvGgZJ.cjs} +43 -9
- package/dist/authClient-_PpvGgZJ.cjs.map +1 -0
- package/dist/billing/index.cjs +46 -0
- package/dist/billing/index.cjs.map +1 -0
- package/dist/billing/index.d.cts +48 -0
- package/dist/billing/index.d.ts +48 -0
- package/dist/billing/index.js +45 -0
- package/dist/billing/index.js.map +1 -0
- package/dist/billing/types.cjs +0 -0
- package/dist/billing/types.d.cts +635 -0
- package/dist/billing/types.d.ts +635 -0
- package/dist/billing/types.js +1 -0
- package/dist/chat/index.cjs +3 -3
- package/dist/chat/index.d.cts +2 -2
- package/dist/chat/index.d.ts +2 -2
- package/dist/chat/index.js +3 -3
- package/dist/chat/types.cjs +18 -0
- package/dist/chat/types.cjs.map +1 -1
- package/dist/chat/types.d.cts +2 -2
- package/dist/chat/types.d.ts +2 -2
- package/dist/chat/types.js +18 -1
- package/dist/chat/types.js.map +1 -1
- package/dist/{configurations-d7SZmw69.js → configurations-BVvcimzo.js} +17 -2
- package/dist/configurations-BVvcimzo.js.map +1 -0
- package/dist/{configurations-CqwAxiQL.cjs → configurations-CyFF9Dtu.cjs} +22 -1
- package/dist/configurations-CyFF9Dtu.cjs.map +1 -0
- package/dist/{configurations-ZwBXilW-.js → configurations-VtNE0nrT.js} +2 -2
- package/dist/{configurations-ZwBXilW-.js.map → configurations-VtNE0nrT.js.map} +1 -1
- package/dist/{configurations-Ck-mNB_E.cjs → configurations-zkNjr73Q.cjs} +2 -2
- package/dist/{configurations-Ck-mNB_E.cjs.map → configurations-zkNjr73Q.cjs.map} +1 -1
- package/dist/constants/index.cjs +1 -1
- package/dist/constants/index.d.cts +1 -1
- package/dist/constants/index.d.ts +1 -1
- package/dist/constants/index.js +1 -1
- package/dist/{constants-lIfSdTzS.cjs → constants-C4DlsF_M.cjs} +3 -2
- package/dist/constants-C4DlsF_M.cjs.map +1 -0
- package/dist/{constants-ByEwVtGf.js → constants-wfbFsqqN.js} +3 -2
- package/dist/constants-wfbFsqqN.js.map +1 -0
- package/dist/{createFetchClient-BRfTjBLV.cjs → createFetchClient-DgMiqTJ8.cjs} +26 -4
- package/dist/createFetchClient-DgMiqTJ8.cjs.map +1 -0
- package/dist/{createFetchClient-BbG46bL0.js → createFetchClient-U-ZrwPl2.js} +15 -5
- package/dist/createFetchClient-U-ZrwPl2.js.map +1 -0
- package/dist/{createGenericFetchClient-DHs-i7_O.cjs → createGenericFetchClient-o3cPJeRn.cjs} +2 -2
- package/dist/{createGenericFetchClient-DHs-i7_O.cjs.map → createGenericFetchClient-o3cPJeRn.cjs.map} +1 -1
- package/dist/{createGenericFetchClient-BHYQLZhe.js → createGenericFetchClient-rxvUUbap.js} +2 -2
- package/dist/{createGenericFetchClient-BHYQLZhe.js.map → createGenericFetchClient-rxvUUbap.js.map} +1 -1
- package/dist/{createOpenapiFetchClient-Bn6_Pn0H.js → createOpenapiFetchClient-BVSc9ibR.js} +2 -2
- package/dist/{createOpenapiFetchClient-Bn6_Pn0H.js.map → createOpenapiFetchClient-BVSc9ibR.js.map} +1 -1
- package/dist/{createOpenapiFetchClient-CyDUFxHB.cjs → createOpenapiFetchClient-DhUU3M1W.cjs} +2 -2
- package/dist/{createOpenapiFetchClient-CyDUFxHB.cjs.map → createOpenapiFetchClient-DhUU3M1W.cjs.map} +1 -1
- package/dist/{credential-d2RDcXRB.js → credential-CihSf_xs.js} +7 -4
- package/dist/credential-CihSf_xs.js.map +1 -0
- package/dist/{credential-DOXH7XRS.cjs → credential-DVWvJFJs.cjs} +7 -4
- package/dist/credential-DVWvJFJs.cjs.map +1 -0
- package/dist/dataScience/index.cjs +2 -2
- package/dist/dataScience/index.d.cts +2 -2
- package/dist/dataScience/index.d.ts +2 -2
- package/dist/dataScience/index.js +2 -2
- package/dist/dataScience/types.d.cts +2 -2
- package/dist/dataScience/types.d.ts +2 -2
- package/dist/{dataScience-wexHEIue.cjs → dataScience-0Rl_EuV_.cjs} +5 -5
- package/dist/{dataScience-wexHEIue.cjs.map → dataScience-0Rl_EuV_.cjs.map} +1 -1
- package/dist/{dataScience-Sm8iONhP.js → dataScience-C1gO5zUn.js} +5 -5
- package/dist/{dataScience-Sm8iONhP.js.map → dataScience-C1gO5zUn.js.map} +1 -1
- package/dist/developerPortal/index.cjs +1 -1
- package/dist/developerPortal/index.d.cts +2 -2
- package/dist/developerPortal/index.d.ts +2 -2
- package/dist/developerPortal/index.js +1 -1
- package/dist/developerPortal/types.d.cts +1 -1
- package/dist/developerPortal/types.d.ts +1 -1
- package/dist/{developerPortalClient-DywKpDlW.js → developerPortalClient-C_48z8BN.js} +3 -3
- package/dist/{developerPortalClient-DywKpDlW.js.map → developerPortalClient-C_48z8BN.js.map} +1 -1
- package/dist/{developerPortalClient-CgTSzLoG.cjs → developerPortalClient-ki0XS_OD.cjs} +3 -3
- package/dist/{developerPortalClient-CgTSzLoG.cjs.map → developerPortalClient-ki0XS_OD.cjs.map} +1 -1
- package/dist/domain/permissions/index.cjs +2 -1
- package/dist/domain/permissions/index.d.cts +18 -3
- package/dist/domain/permissions/index.d.ts +18 -3
- package/dist/domain/permissions/index.js +2 -2
- package/dist/editor/index.cjs +2 -2
- package/dist/editor/index.d.cts +2 -2
- package/dist/editor/index.d.ts +2 -2
- package/dist/editor/index.js +2 -2
- package/dist/editor/types.d.cts +1 -1
- package/dist/editor/types.d.ts +1 -1
- package/dist/emitter-dLF1Fyfg.d.cts +11 -0
- package/dist/emitter-dLF1Fyfg.d.ts +11 -0
- package/dist/encryption/index.cjs +1 -1
- package/dist/encryption/index.d.cts +1 -1
- package/dist/encryption/index.d.ts +1 -1
- package/dist/encryption/index.js +1 -1
- package/dist/encryption/types.d.cts +1 -1
- package/dist/encryption/types.d.ts +1 -1
- package/dist/import/index.cjs +1 -1
- package/dist/import/index.d.cts +3 -3
- package/dist/import/index.d.ts +3 -3
- package/dist/import/index.js +1 -1
- package/dist/{import-C0-y1GQK.cjs → import-C83w7BKz.cjs} +3 -3
- package/dist/{import-C0-y1GQK.cjs.map → import-C83w7BKz.cjs.map} +1 -1
- package/dist/{import-SQuurg1G.js → import-CROEK82b.js} +3 -3
- package/dist/{import-SQuurg1G.js.map → import-CROEK82b.js.map} +1 -1
- package/dist/{index-fHfc_VqS.d.ts → index-3LUk2rpD.d.ts} +4 -4
- package/dist/{index-Dbzjvy5h.d.ts → index-6Xe81qN3.d.ts} +5 -5
- package/dist/{index-Bjk-tCpG.d.cts → index-BLx14ZI4.d.cts} +306 -205
- package/dist/{index-DiHHyMEo.d.cts → index-BgLnWTZU.d.cts} +6 -6
- package/dist/{index-Bc_hXWae.d.ts → index-BuegqrS1.d.ts} +3 -3
- package/dist/{index-GDdFZCXp.d.ts → index-C77vTm2K.d.ts} +4 -4
- package/dist/{index-CXtdQ7be.d.cts → index-CW3Pj7DY.d.cts} +4 -4
- package/dist/{index-Bg1P6Bb2.d.ts → index-CqgtL2NU.d.ts} +6 -6
- package/dist/{index-DeKPpYQy.d.ts → index-D8rcUbnk.d.ts} +3 -3
- package/dist/{index-FhKX7Cv1.d.ts → index-DFBFa3SS.d.ts} +306 -205
- package/dist/{index-eAlN694c.d.cts → index-DR4QqItd.d.cts} +3 -3
- package/dist/{index-Gn1H63Hk.d.cts → index-DXSmFkol.d.cts} +4 -4
- package/dist/{index-D_7yCRKy.d.cts → index-Dodwl64k.d.cts} +69 -36
- package/dist/{index-DqOAjqxN.d.cts → index-DppA4k3b.d.cts} +5 -5
- package/dist/{index-C7e3wBt9.d.cts → index-Dx52hNLP.d.cts} +3 -3
- package/dist/{index-BKh0prif.d.cts → index-GjcJTCbz.d.cts} +4 -4
- package/dist/{index-CQrKS7PV.d.cts → index-KuQ79Mnz.d.ts} +14 -3
- package/dist/{index-Ctqkm3Fx.d.ts → index-P-iT5THa.d.ts} +69 -36
- package/dist/{index-CeJOmN-P.d.ts → index-V7XKUQm9.d.cts} +14 -3
- package/dist/{index-tKsiUarj.d.ts → index-pXN4LWUX.d.ts} +4 -4
- package/dist/index.cjs +353 -57
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -6
- package/dist/index.d.ts +7 -6
- package/dist/index.js +331 -37
- package/dist/index.js.map +1 -1
- package/dist/isLoginPageRedirect-B0EmRsHr.cjs +25 -0
- package/dist/isLoginPageRedirect-B0EmRsHr.cjs.map +1 -0
- package/dist/isLoginPageRedirect-BTTAedW-.js +20 -0
- package/dist/isLoginPageRedirect-BTTAedW-.js.map +1 -0
- package/dist/{jobStatus-kQ9JqF8t.cjs → jobStatus-0_Y3Sr4i.cjs} +37 -20
- package/dist/jobStatus-0_Y3Sr4i.cjs.map +1 -0
- package/dist/{jobStatus-DbMupQEK.js → jobStatus-PSZJMTiA.js} +35 -18
- package/dist/jobStatus-PSZJMTiA.js.map +1 -0
- package/dist/kaiAgent/index.cjs +1 -1
- package/dist/kaiAgent/index.d.cts +2 -210
- package/dist/kaiAgent/index.d.ts +2 -210
- package/dist/kaiAgent/index.js +1 -1
- package/dist/kaiAgent/types.d.cts +1 -1
- package/dist/kaiAgent/types.d.ts +1 -1
- package/dist/{kaiAgent-HDaFS9BR.js → kaiAgent-8LNzGhZc.js} +48 -4
- package/dist/kaiAgent-8LNzGhZc.js.map +1 -0
- package/dist/{kaiAgent-4OiIK1C2.cjs → kaiAgent-B_TaUPRt.cjs} +48 -4
- package/dist/kaiAgent-B_TaUPRt.cjs.map +1 -0
- package/dist/kaiAgentClient-BJj_2aqt.d.ts +250 -0
- package/dist/kaiAgentClient-DhTaM3GC.d.cts +250 -0
- package/dist/management/index.cjs +1 -1
- package/dist/management/index.d.cts +1 -1
- package/dist/management/index.d.ts +1 -1
- package/dist/management/index.js +1 -1
- package/dist/management/types.d.cts +2 -2
- package/dist/management/types.d.ts +2 -2
- package/dist/{management-DfjwQo7z.cjs → management-BoxlRNg2.cjs} +53 -10
- package/dist/management-BoxlRNg2.cjs.map +1 -0
- package/dist/{management-CIFhu1Nm.js → management-Bp440RsV.js} +53 -10
- package/dist/management-Bp440RsV.js.map +1 -0
- package/dist/metastore/index.cjs +1 -1
- package/dist/metastore/index.d.cts +1 -1
- package/dist/metastore/index.d.ts +1 -1
- package/dist/metastore/index.js +1 -1
- package/dist/metastore/types.d.cts +1 -1
- package/dist/metastore/types.d.ts +1 -1
- package/dist/{metastore-Dq2NS6jb.cjs → metastore-BYYWTb3m.cjs} +4 -4
- package/dist/{metastore-Dq2NS6jb.cjs.map → metastore-BYYWTb3m.cjs.map} +1 -1
- package/dist/{metastore-CrXkKufo.js → metastore-VCDRVhUT.js} +4 -4
- package/dist/{metastore-CrXkKufo.js.map → metastore-VCDRVhUT.js.map} +1 -1
- package/dist/microsoftGraph/index.cjs +2 -2
- package/dist/microsoftGraph/index.d.cts +2 -2
- package/dist/microsoftGraph/index.d.ts +2 -2
- package/dist/microsoftGraph/index.js +2 -2
- package/dist/microsoftGraph/types.d.cts +1 -1
- package/dist/microsoftGraph/types.d.ts +1 -1
- package/dist/notifications/index.cjs +3 -3
- package/dist/notifications/index.d.cts +2 -2
- package/dist/notifications/index.d.ts +2 -2
- package/dist/notifications/index.js +3 -3
- package/dist/notifications/types.d.cts +1 -1
- package/dist/notifications/types.d.ts +1 -1
- package/dist/oauth/index.cjs +1 -1
- package/dist/oauth/index.d.cts +2 -2
- package/dist/oauth/index.d.ts +2 -2
- package/dist/oauth/index.js +1 -1
- package/dist/oauth/types.d.cts +1 -1
- package/dist/oauth/types.d.ts +1 -1
- package/dist/{oauth-CFwSNz37.js → oauth--asfePw-.js} +5 -5
- package/dist/{oauth-CFwSNz37.js.map → oauth--asfePw-.js.map} +1 -1
- package/dist/{oauth-CkW5gln-.cjs → oauth-B8yqG6Sy.cjs} +5 -5
- package/dist/{oauth-CkW5gln-.cjs.map → oauth-B8yqG6Sy.cjs.map} +1 -1
- package/dist/omnisearch/index.cjs +2 -2
- package/dist/omnisearch/index.d.cts +2 -2
- package/dist/omnisearch/index.d.ts +2 -2
- package/dist/omnisearch/index.js +2 -2
- package/dist/omnisearch/types.d.cts +1 -1
- package/dist/omnisearch/types.d.ts +1 -1
- package/dist/{project-BOGaVs-q.d.ts → project-C2wvX0xZ.d.ts} +2 -2
- package/dist/{project-BnQkL8cb.d.cts → project-hePfzUY0.d.cts} +2 -2
- package/dist/queryService/index.cjs +1 -1
- package/dist/queryService/index.d.cts +1 -1
- package/dist/queryService/index.d.ts +1 -1
- package/dist/queryService/index.js +1 -1
- package/dist/queryService/types.d.cts +1 -1
- package/dist/queryService/types.d.ts +1 -1
- package/dist/{queryService-BLaGbpm-.cjs → queryService-BVtjkXy1.cjs} +6 -6
- package/dist/{queryService-BLaGbpm-.cjs.map → queryService-BVtjkXy1.cjs.map} +1 -1
- package/dist/{queryService-DK-jUnET.js → queryService-Ca65E5KH.js} +6 -6
- package/dist/{queryService-DK-jUnET.js.map → queryService-Ca65E5KH.js.map} +1 -1
- package/dist/queue/index.cjs +1 -1
- package/dist/queue/index.d.cts +3 -3
- package/dist/queue/index.d.ts +3 -3
- package/dist/queue/index.js +1 -1
- package/dist/queue/types.d.cts +1 -1
- package/dist/queue/types.d.ts +1 -1
- package/dist/{queue-DViSQ-eq.js → queue-DyotLFJi.js} +5 -5
- package/dist/{queue-DViSQ-eq.js.map → queue-DyotLFJi.js.map} +1 -1
- package/dist/{queue-B7TY4JLf.cjs → queue-OJJUUqc2.cjs} +5 -5
- package/dist/{queue-B7TY4JLf.cjs.map → queue-OJJUUqc2.cjs.map} +1 -1
- package/dist/scheduler/index.cjs +3 -3
- package/dist/scheduler/index.d.cts +2 -2
- package/dist/scheduler/index.d.ts +2 -2
- package/dist/scheduler/index.js +3 -3
- package/dist/scheduler/types.d.cts +1 -1
- package/dist/scheduler/types.d.ts +1 -1
- package/dist/sdk/configurations/index.cjs +1 -1
- package/dist/sdk/configurations/index.d.cts +4 -4
- package/dist/sdk/configurations/index.d.ts +4 -4
- package/dist/sdk/configurations/index.js +1 -1
- package/dist/sdk/developerPortal/index.cjs +5 -5
- package/dist/sdk/developerPortal/index.cjs.map +1 -1
- package/dist/sdk/developerPortal/index.d.cts +5 -4
- package/dist/sdk/developerPortal/index.d.ts +5 -4
- package/dist/sdk/developerPortal/index.js +4 -4
- package/dist/sdk/queryService/index.cjs +2 -2
- package/dist/sdk/queryService/index.d.cts +1 -1
- package/dist/sdk/queryService/index.d.ts +1 -1
- package/dist/sdk/queryService/index.js +2 -2
- package/dist/sdk/semanticLayer/index.cjs +21 -359
- package/dist/sdk/semanticLayer/index.d.cts +35 -13
- package/dist/sdk/semanticLayer/index.d.ts +35 -13
- package/dist/sdk/semanticLayer/index.js +2 -347
- package/dist/sdk/semanticLayer/types.d.cts +2 -2
- package/dist/sdk/semanticLayer/types.d.ts +2 -2
- package/dist/sdk/storage/index.d.cts +1 -1
- package/dist/sdk/storage/index.d.ts +1 -1
- package/dist/sdk/tag/index.d.cts +2 -2
- package/dist/sdk/tag/index.d.ts +2 -2
- package/dist/sdk/tag/types.d.cts +1 -1
- package/dist/sdk/tag/types.d.ts +1 -1
- package/dist/sdk/vault/index.d.cts +1 -1
- package/dist/sdk/vault/index.d.ts +1 -1
- package/dist/semanticLayer-CSqmtHRo.js +692 -0
- package/dist/semanticLayer-CSqmtHRo.js.map +1 -0
- package/dist/semanticLayer-E0Vilu8u.cjs +811 -0
- package/dist/semanticLayer-E0Vilu8u.cjs.map +1 -0
- package/dist/{serviceIds-fHLDwOg9.d.ts → serviceIds-DRcoTnSd.d.cts} +2 -1
- package/dist/{serviceIds-fHLDwOg9.d.cts → serviceIds-DRcoTnSd.d.ts} +2 -1
- package/dist/status/index.cjs +1 -1
- package/dist/status/index.d.cts +1 -1
- package/dist/status/index.d.ts +1 -1
- package/dist/status/index.js +1 -1
- package/dist/storage/index.cjs +6 -5
- package/dist/storage/index.d.cts +3 -3
- package/dist/storage/index.d.ts +3 -3
- package/dist/storage/index.js +6 -6
- package/dist/storage/types.d.cts +3 -3
- package/dist/storage/types.d.ts +3 -3
- package/dist/{storage-CihHwZ7z.cjs → storage-BKm7cztt.cjs} +7 -7
- package/dist/{storage-CihHwZ7z.cjs.map → storage-BKm7cztt.cjs.map} +1 -1
- package/dist/{storage-kgxscFEg.js → storage-LYwFQPNO.js} +7 -7
- package/dist/{storage-kgxscFEg.js.map → storage-LYwFQPNO.js.map} +1 -1
- package/dist/store-C9FQCHGe.js +74 -0
- package/dist/store-C9FQCHGe.js.map +1 -0
- package/dist/store-xS-Cu_VS.cjs +85 -0
- package/dist/store-xS-Cu_VS.cjs.map +1 -0
- package/dist/stream/index.cjs +3 -3
- package/dist/stream/index.d.cts +2 -2
- package/dist/stream/index.d.ts +2 -2
- package/dist/stream/index.js +3 -3
- package/dist/stream/types.d.cts +1 -1
- package/dist/stream/types.d.ts +1 -1
- package/dist/syncActions/index.cjs +1 -1
- package/dist/syncActions/index.d.cts +1 -1
- package/dist/syncActions/index.d.ts +1 -1
- package/dist/syncActions/index.js +1 -1
- package/dist/syncActions/types.d.cts +1 -1
- package/dist/syncActions/types.d.ts +1 -1
- package/dist/{syncActions-CevF_TEb.cjs → syncActions-OEZdVffK.cjs} +6 -6
- package/dist/{syncActions-CevF_TEb.cjs.map → syncActions-OEZdVffK.cjs.map} +1 -1
- package/dist/{syncActions-B75t0NwP.js → syncActions-QeBhIVhG.js} +6 -6
- package/dist/{syncActions-B75t0NwP.js.map → syncActions-QeBhIVhG.js.map} +1 -1
- package/dist/telemetry/index.cjs +38 -2
- package/dist/telemetry/index.cjs.map +1 -0
- package/dist/telemetry/index.d.cts +15 -8
- package/dist/telemetry/index.d.ts +15 -8
- package/dist/telemetry/index.js +37 -1
- package/dist/telemetry/index.js.map +1 -0
- package/dist/telemetry/types.d.cts +2 -2
- package/dist/telemetry/types.d.ts +2 -2
- package/dist/{types-D1uloiuY.d.cts → types-3eUgOA7I.d.cts} +2 -2
- package/dist/{types-CvkqEvhv.d.cts → types-52irAt99.d.cts} +2 -2
- package/dist/{types-CyHZ1ZQe.d.ts → types-B2U9cFcx.d.ts} +2 -2
- package/dist/{types-Av2egS_l.d.ts → types-B3GOGUJ7.d.cts} +753 -45
- package/dist/{types-BH9ljNmj.d.cts → types-BEe50G2r.d.cts} +2 -2
- package/dist/{types-BlCoTm7n.d.ts → types-BH5LLeJy.d.ts} +2 -2
- package/dist/{types-BptQ7jpP.d.cts → types-BMeDOB_D.d.ts} +753 -45
- package/dist/{types-MbcIiKDI.d.cts → types-BOqD3Hqy.d.cts} +3 -3
- package/dist/{types-DeSd3gqW.d.ts → types-BQsOHNI0.d.ts} +3 -3
- package/dist/{types-DNXC_-fA.d.cts → types-BQvv4RaI.d.cts} +2 -2
- package/dist/{types-BnaAo7xn.d.ts → types-BTWIPEiU.d.ts} +2 -2
- package/dist/{types-C1vhYcic.d.cts → types-BW2BXUB4.d.cts} +2 -2
- package/dist/{types-CXTqFYah.d.ts → types-BrYkBQo4.d.ts} +37 -6
- package/dist/{types-BZBdLUpH.d.ts → types-BsxLGDoC.d.cts} +2 -2
- package/dist/{types-BMQW-2Yw.d.ts → types-BupPADSm.d.ts} +737 -80
- package/dist/{types-COc-nind.d.cts → types-Bxhh2SJr.d.ts} +2 -2
- package/dist/{types-ByWD2oeV.d.ts → types-BztF4HeB.d.ts} +2 -2
- package/dist/{types-dybUhlU2.d.ts → types-C0_2KZ-A.d.ts} +2 -2
- package/dist/types-C2vefB4D.d.ts +218 -0
- package/dist/{types-CkcMoXRk.d.ts → types-CBgLCkYe.d.ts} +3 -3
- package/dist/{types-Cz1dj_TM.d.ts → types-CKiW3n6v.d.ts} +2 -2
- package/dist/{types-CcuG9cid.d.cts → types-COL1kVEB.d.cts} +2 -2
- package/dist/types-CPB-eF82.d.ts +289 -0
- package/dist/{types-BoV9M5Xg.d.cts → types-CW6lCqrC.d.cts} +2 -2
- package/dist/{types-CPanB0p7.d.cts → types-CaYtinmA.d.cts} +3 -3
- package/dist/{types-De_DA2ga.d.ts → types-CcrvrAJX.d.ts} +2 -2
- package/dist/{types-DwpRt3e9.d.ts → types-Ct0YPy2w.d.ts} +2 -2
- package/dist/{types-B4jdPHoL.d.cts → types-Cz83RiVu.d.cts} +2 -2
- package/dist/{types-DlbiVsVo.d.cts → types-D8Rrz51O.d.cts} +2 -2
- package/dist/{types-CyiRYRVq.d.cts → types-DARv_P6O.d.cts} +3 -3
- package/dist/{types-DuiUN0h8.d.ts → types-DBOSvWtD.d.ts} +2 -2
- package/dist/{types-D6jKxUv_.d.ts → types-DEc55spK.d.ts} +45 -4
- package/dist/{types-cDU_J45_.d.cts → types-DNxOHnZI.d.cts} +2 -2
- package/dist/{types-GuWtMCMn.d.cts → types-DPS8nwkV.d.cts} +2 -2
- package/dist/{types-Di8VIZwQ.d.ts → types-DYzJ6K2e.d.ts} +2 -2
- package/dist/{types-BI2jI-3-.d.cts → types-DZk3XHiN.d.cts} +3 -3
- package/dist/{types-Dfc58bPE.d.ts → types-DajzGOKB.d.ts} +2 -2
- package/dist/{types-C2CLlR4i.d.ts → types-DfvdbRPL.d.ts} +2 -2
- package/dist/{types-CpALS017.d.ts → types-DhDNS-5B.d.ts} +21 -3
- package/dist/{types-BV2BDccJ.d.cts → types-DjrRmQUe.d.cts} +45 -4
- package/dist/{types-sVYo0o9_.d.ts → types-Dmu-8g4O.d.ts} +3 -3
- package/dist/{types-COIsNoTQ.d.cts → types-DqxIx9Pi.d.cts} +2 -2
- package/dist/{types-Cj4bLPp5.d.cts → types-Jw10xuOW.d.cts} +37 -6
- package/dist/{types-CJHi0zdD.d.cts → types-M46WuBSm.d.cts} +2 -2
- package/dist/{types-zA3H84SM.d.cts → types-N3EChotg.d.cts} +2 -2
- package/dist/{types-Bpnpa2Wt.d.ts → types-OaD-cbbl.d.ts} +3 -3
- package/dist/{types-BREGN3qo.d.cts → types-_RhBCj4_.d.cts} +2 -2
- package/dist/{types-CGH_lfxS.d.cts → types-bGQb4Jtl.d.cts} +21 -3
- package/dist/{types-iNlsdRkx.d.cts → types-f8W_j6qD.d.cts} +737 -80
- package/dist/types-fX4gbxfV.d.cts +218 -0
- package/dist/types-g3vU7hcg.d.cts +289 -0
- package/dist/{types-D-qI9ne4.d.ts → types-l9o4gFsI.d.ts} +2 -2
- package/dist/{types-EJEoI3ZK.d.ts → types-nrviNdzZ.d.ts} +2 -2
- package/dist/{types-BTbczawY.d.ts → types-zZBxJ0P-.d.ts} +2 -2
- package/dist/{validateConnectionStatus-V9q6Nl6u.cjs → validateConnectionStatus-CsvYmCOI.cjs} +5 -4
- package/dist/validateConnectionStatus-CsvYmCOI.cjs.map +1 -0
- package/dist/{validateConnectionStatus-BrLXkoSI.js → validateConnectionStatus-olE2sQ3U.js} +5 -4
- package/dist/{validateConnectionStatus-BrLXkoSI.js.map → validateConnectionStatus-olE2sQ3U.js.map} +1 -1
- package/dist/vault/index.cjs +4 -4
- package/dist/vault/index.d.cts +1 -1
- package/dist/vault/index.d.ts +1 -1
- package/dist/vault/index.js +4 -4
- package/dist/vault/types.d.cts +1 -1
- package/dist/vault/types.d.ts +1 -1
- package/package.json +30 -4
- package/surface/auth.md +2 -2
- package/surface/billing.md +9 -0
- package/surface/kaiAgent.md +7 -4
- package/surface/management.md +13 -3
- package/surface/telemetry.md +2 -4
- package/dist/ValidationError-CzPWydEb.js.map +0 -1
- package/dist/ValidationError-h5qvwahi.cjs.map +0 -1
- package/dist/authClient--BtZgjIc.js.map +0 -1
- package/dist/authClient-b7uec7sw.cjs.map +0 -1
- package/dist/configurations-CqwAxiQL.cjs.map +0 -1
- package/dist/configurations-d7SZmw69.js.map +0 -1
- package/dist/constants-ByEwVtGf.js.map +0 -1
- package/dist/constants-lIfSdTzS.cjs.map +0 -1
- package/dist/createFetchClient-BRfTjBLV.cjs.map +0 -1
- package/dist/createFetchClient-BbG46bL0.js.map +0 -1
- package/dist/createStore-BNiCRQXa.js +0 -148
- package/dist/createStore-BNiCRQXa.js.map +0 -1
- package/dist/createStore-MQbboXcB.cjs +0 -177
- package/dist/createStore-MQbboXcB.cjs.map +0 -1
- package/dist/credential-DOXH7XRS.cjs.map +0 -1
- package/dist/credential-d2RDcXRB.js.map +0 -1
- package/dist/jobStatus-DbMupQEK.js.map +0 -1
- package/dist/jobStatus-kQ9JqF8t.cjs.map +0 -1
- package/dist/kaiAgent-4OiIK1C2.cjs.map +0 -1
- package/dist/kaiAgent-HDaFS9BR.js.map +0 -1
- package/dist/management-CIFhu1Nm.js.map +0 -1
- package/dist/management-DfjwQo7z.cjs.map +0 -1
- package/dist/sdk/semanticLayer/index.cjs.map +0 -1
- package/dist/sdk/semanticLayer/index.js.map +0 -1
- package/dist/telemetry-DwlSLVAU.cjs +0 -29
- package/dist/telemetry-DwlSLVAU.cjs.map +0 -1
- package/dist/telemetry-FXpodtJN.js +0 -24
- package/dist/telemetry-FXpodtJN.js.map +0 -1
- package/dist/types-B2vmg_UF.d.cts +0 -148
- package/dist/types-RfaldD4P.d.ts +0 -148
- package/dist/types-lFsTSkhe.d.cts +0 -14
- package/dist/types-lFsTSkhe.d.ts +0 -14
- package/dist/validateConnectionStatus-V9q6Nl6u.cjs.map +0 -1
|
@@ -0,0 +1,692 @@
|
|
|
1
|
+
import { t as concurrent } from "./concurrent-CH9fbNr3.js";
|
|
2
|
+
import { t as generateUUID } from "./generateUUID-Dr8l-aoc.js";
|
|
3
|
+
import { i as parseOrThrow, n as formatValidationIssues } from "./ValidationError-BekhphAq.js";
|
|
4
|
+
import { z } from "zod";
|
|
5
|
+
//#region src/sdks/semanticLayer/errorMessage.ts
|
|
6
|
+
/**
|
|
7
|
+
* The message out of a metastore error body.
|
|
8
|
+
*
|
|
9
|
+
* - The metastore reports what is actually wrong with a write only inside `errors[].message`
|
|
10
|
+
* (`missing property 'fqn'`). The HTTP status and the response's own message say no more than
|
|
11
|
+
* "Validation failed", so a caller that renders those alone tells a user nothing actionable.
|
|
12
|
+
* - Every shape that is not that envelope returns `undefined` rather than a placeholder, so the
|
|
13
|
+
* caller keeps its own fallback (`?? error.message`) instead of rendering a stand-in for one.
|
|
14
|
+
* - Only the first error: the metastore reports fields one at a time, so a list would be a list
|
|
15
|
+
* of one.
|
|
16
|
+
*/
|
|
17
|
+
const metastoreErrorMessage = (data) => {
|
|
18
|
+
if (typeof data !== "object" || data === null) return void 0;
|
|
19
|
+
const errors = data.errors;
|
|
20
|
+
if (!Array.isArray(errors)) return void 0;
|
|
21
|
+
const first = errors[0];
|
|
22
|
+
if (typeof first !== "object" || first === null) return void 0;
|
|
23
|
+
const message = first.message;
|
|
24
|
+
return typeof message === "string" && message ? message : void 0;
|
|
25
|
+
};
|
|
26
|
+
//#endregion
|
|
27
|
+
//#region src/sdks/semanticLayer/vocabulary.ts
|
|
28
|
+
/**
|
|
29
|
+
* The closed value sets the metastore accepts inside a semantic object's `data`.
|
|
30
|
+
*
|
|
31
|
+
* - Each one is the single runtime source for a union in `./types`, which derives the type from
|
|
32
|
+
* the array here. A value cannot exist in the type and be missing from the list a dropdown or
|
|
33
|
+
* a validator is built from.
|
|
34
|
+
* - The addressing vocabulary (`SEMANTIC_OBJECT_TYPE`, `MODEL_CHILD_OBJECT_TYPES`) is a
|
|
35
|
+
* different axis — which object a call targets, not what may sit inside one — and stays beside
|
|
36
|
+
* the SDK methods that take it.
|
|
37
|
+
* - This file imports nothing: `./types` reads it, never the reverse.
|
|
38
|
+
*/
|
|
39
|
+
/**
|
|
40
|
+
* The dialects the metastore accepts, exactly as it spells them. A lowercase value is
|
|
41
|
+
* rejected with `422 value must be one of 'Snowflake', 'BigQuery'`, which surfaces only as a
|
|
42
|
+
* generic "Validation failed" — so callers need the real set rather than a bare `string`.
|
|
43
|
+
*
|
|
44
|
+
* `SemanticModelData.sql_dialect` stays `string` for now: narrowing it would break any caller
|
|
45
|
+
* passing a `string` variable, which is a major bump. Validate against this instead.
|
|
46
|
+
*/
|
|
47
|
+
const SQL_DIALECTS = ["Snowflake", "BigQuery"];
|
|
48
|
+
/** The metastore's constraint kinds. */
|
|
49
|
+
const CONSTRAINT_TYPES = [
|
|
50
|
+
"inequality",
|
|
51
|
+
"equality",
|
|
52
|
+
"range",
|
|
53
|
+
"composition",
|
|
54
|
+
"exclusion",
|
|
55
|
+
"temporal",
|
|
56
|
+
"conditional"
|
|
57
|
+
];
|
|
58
|
+
/**
|
|
59
|
+
* What a dataset field is for.
|
|
60
|
+
*
|
|
61
|
+
* - Enumerated, unlike a field's `type`: the metastore takes any type string, but only these
|
|
62
|
+
* four roles.
|
|
63
|
+
*/
|
|
64
|
+
const FIELD_ROLES = [
|
|
65
|
+
"key",
|
|
66
|
+
"dimension",
|
|
67
|
+
"measure",
|
|
68
|
+
"timestamp"
|
|
69
|
+
];
|
|
70
|
+
/**
|
|
71
|
+
* How loudly a violated constraint reports.
|
|
72
|
+
*
|
|
73
|
+
* - An unset severity is stored as `warning`, so a reader renders that rather than nothing.
|
|
74
|
+
*/
|
|
75
|
+
const CONSTRAINT_SEVERITIES = [
|
|
76
|
+
"error",
|
|
77
|
+
"warning",
|
|
78
|
+
"info"
|
|
79
|
+
];
|
|
80
|
+
/**
|
|
81
|
+
* What a constraint's rule is evaluated per.
|
|
82
|
+
*
|
|
83
|
+
* - An unset scope is stored as `global`.
|
|
84
|
+
*/
|
|
85
|
+
const CONSTRAINT_SCOPES = [
|
|
86
|
+
"global",
|
|
87
|
+
"per_location",
|
|
88
|
+
"per_date",
|
|
89
|
+
"per_category"
|
|
90
|
+
];
|
|
91
|
+
/** The comparisons a constraint's `ruleExpression` can make. */
|
|
92
|
+
const RULE_OPERATORS = [
|
|
93
|
+
"<",
|
|
94
|
+
"<=",
|
|
95
|
+
"=",
|
|
96
|
+
">=",
|
|
97
|
+
">",
|
|
98
|
+
"!=",
|
|
99
|
+
"between",
|
|
100
|
+
"in",
|
|
101
|
+
"sum_equals",
|
|
102
|
+
"ratio_between"
|
|
103
|
+
];
|
|
104
|
+
/** The join a relationship stands for. */
|
|
105
|
+
const RELATIONSHIP_JOIN_TYPES = ["left", "inner"];
|
|
106
|
+
//#endregion
|
|
107
|
+
//#region src/sdks/semanticLayer/schemas.ts
|
|
108
|
+
/**
|
|
109
|
+
* Runtime validators for the semantic-layer payload shapes.
|
|
110
|
+
*
|
|
111
|
+
* These exist because the metastore's validation errors are opaque — a missing or misspelled
|
|
112
|
+
* field surfaces only as a generic "Validation failed", and a wrong `sql_dialect` casing as a
|
|
113
|
+
* 422 that names neither the field nor the accepted values. Parsing first turns those into a
|
|
114
|
+
* message that says what is wrong.
|
|
115
|
+
*
|
|
116
|
+
* **Only the fields the SDK types mark as required are declared.** The metastore owns each
|
|
117
|
+
* object type's full schema, so every schema is a `looseObject`: unknown fields pass through
|
|
118
|
+
* untouched rather than being stripped or rejected. Re-declaring the optional fields here
|
|
119
|
+
* would create a second source of truth that silently drops whatever the metastore adds next.
|
|
120
|
+
*
|
|
121
|
+
* The SDK does **not** parse on its own writes — these are for callers that accept untrusted
|
|
122
|
+
* or hand-authored input (an agent's tool call, a form submission) and want to fail early.
|
|
123
|
+
* `modelUUID` is omitted throughout: the SDK injects it, so callers never supply it.
|
|
124
|
+
*/
|
|
125
|
+
const semanticModelSchema = z.looseObject({
|
|
126
|
+
name: z.string().min(1),
|
|
127
|
+
sql_dialect: z.enum(SQL_DIALECTS)
|
|
128
|
+
});
|
|
129
|
+
const semanticDatasetSchema = z.looseObject({
|
|
130
|
+
name: z.string().min(1),
|
|
131
|
+
tableId: z.string().min(1),
|
|
132
|
+
fqn: z.string().min(1)
|
|
133
|
+
});
|
|
134
|
+
const semanticMetricSchema = z.looseObject({
|
|
135
|
+
name: z.string().min(1),
|
|
136
|
+
sql: z.string().min(1)
|
|
137
|
+
});
|
|
138
|
+
const semanticRelationshipSchema = z.looseObject({
|
|
139
|
+
from: z.string().min(1),
|
|
140
|
+
to: z.string().min(1),
|
|
141
|
+
on: z.string().min(1)
|
|
142
|
+
});
|
|
143
|
+
const semanticGlossarySchema = z.looseObject({
|
|
144
|
+
term: z.string().min(1),
|
|
145
|
+
definition: z.string().min(1)
|
|
146
|
+
});
|
|
147
|
+
const semanticConstraintSchema = z.looseObject({
|
|
148
|
+
name: z.string().min(1),
|
|
149
|
+
constraintType: z.enum(CONSTRAINT_TYPES),
|
|
150
|
+
metrics: z.array(z.string()),
|
|
151
|
+
rule: z.string().min(1)
|
|
152
|
+
});
|
|
153
|
+
/** Keyed by object type so a caller can pick the schema from a `SemanticChildObjectType`. */
|
|
154
|
+
const SEMANTIC_CHILD_OBJECT_SCHEMAS = {
|
|
155
|
+
"semantic-dataset": semanticDatasetSchema,
|
|
156
|
+
"semantic-metric": semanticMetricSchema,
|
|
157
|
+
"semantic-relationship": semanticRelationshipSchema,
|
|
158
|
+
"semantic-glossary": semanticGlossarySchema,
|
|
159
|
+
"semantic-constraint": semanticConstraintSchema
|
|
160
|
+
};
|
|
161
|
+
//#endregion
|
|
162
|
+
//#region src/sdks/semanticLayer/readSchemas.ts
|
|
163
|
+
/**
|
|
164
|
+
* What a read of the metastore is allowed to hand back, per object type.
|
|
165
|
+
*
|
|
166
|
+
* - Every schema is annotated with the type it must produce, so the compiler rejects a schema that
|
|
167
|
+
* omits a field `./types` declares or makes a required one optional. The declared type and the
|
|
168
|
+
* parser cannot drift apart.
|
|
169
|
+
* - `looseObject` throughout: a field the metastore adds still reaches a caller at runtime, exactly
|
|
170
|
+
* as it did when this boundary asserted instead of parsing.
|
|
171
|
+
* - The metastore validates each object type on write — that is where its opaque "Validation
|
|
172
|
+
* failed" and `sql_dialect` 422s come from — so a stored object already satisfies these. Parsing
|
|
173
|
+
* is the net under that, for an object written before a schema version tightened and for the
|
|
174
|
+
* day the two schemas disagree.
|
|
175
|
+
* - An **optional** enum that arrives with a value outside the list reads as absent rather than
|
|
176
|
+
* taking its object down: a new `role` the metastore starts issuing must not delete the dataset
|
|
177
|
+
* carrying it. A **required** enum has no such reading — `constraintType` decides what a
|
|
178
|
+
* constraint means — so an unknown value drops the object.
|
|
179
|
+
*/
|
|
180
|
+
const aiMetadataSchema = z.looseObject({
|
|
181
|
+
synonyms: z.array(z.string()).optional(),
|
|
182
|
+
keywords: z.array(z.string()).optional(),
|
|
183
|
+
antiKeywords: z.array(z.string()).optional(),
|
|
184
|
+
hints: z.array(z.string()).optional(),
|
|
185
|
+
warnings: z.array(z.string()).optional()
|
|
186
|
+
});
|
|
187
|
+
const fieldSchema = z.looseObject({
|
|
188
|
+
name: z.string(),
|
|
189
|
+
description: z.string().optional(),
|
|
190
|
+
type: z.string().optional(),
|
|
191
|
+
role: z.enum(FIELD_ROLES).optional().catch(void 0),
|
|
192
|
+
values: z.array(z.string()).optional(),
|
|
193
|
+
ai: aiMetadataSchema.optional()
|
|
194
|
+
});
|
|
195
|
+
/**
|
|
196
|
+
* A dataset's `fields`, where a malformed column is dropped rather than the whole dataset.
|
|
197
|
+
*
|
|
198
|
+
* - `name` is required and `schemas.ts` does not validate `fields` on write, so this SDK can
|
|
199
|
+
* store a nameless column that a strict read would then hide the entire table over.
|
|
200
|
+
* - The same rule as the collection one level up: a drop never takes its container with it.
|
|
201
|
+
*/
|
|
202
|
+
const datasetFieldsSchema = z.array(z.unknown()).transform((items) => items.flatMap((element, index) => {
|
|
203
|
+
const result = fieldSchema.safeParse(element);
|
|
204
|
+
if (result.success) return [result.data];
|
|
205
|
+
console.warn(`semanticLayerSdk: dropped field #${index} from a semantic-dataset, it does not match its declared shape`, formatValidationIssues(result.error.issues));
|
|
206
|
+
return [];
|
|
207
|
+
}));
|
|
208
|
+
const ruleExpressionSchema = z.looseObject({
|
|
209
|
+
operator: z.enum(RULE_OPERATORS).optional().catch(void 0),
|
|
210
|
+
left: z.string().optional(),
|
|
211
|
+
right: z.string().optional(),
|
|
212
|
+
bounds: z.looseObject({
|
|
213
|
+
min: z.number().optional(),
|
|
214
|
+
max: z.number().optional()
|
|
215
|
+
}).optional()
|
|
216
|
+
});
|
|
217
|
+
const validationQuerySchema = z.looseObject({
|
|
218
|
+
default: z.string().optional(),
|
|
219
|
+
snowflake: z.string().optional(),
|
|
220
|
+
bigquery: z.string().optional()
|
|
221
|
+
});
|
|
222
|
+
const semanticModelReadSchema = z.looseObject({
|
|
223
|
+
name: z.string(),
|
|
224
|
+
description: z.string().optional(),
|
|
225
|
+
sql_dialect: z.string()
|
|
226
|
+
});
|
|
227
|
+
/** Keyed by object type so a read can pick the schema from a `SemanticChildObjectType`. */
|
|
228
|
+
const SEMANTIC_CHILD_OBJECT_READ_SCHEMAS = {
|
|
229
|
+
"semantic-dataset": z.looseObject({
|
|
230
|
+
modelUUID: z.string(),
|
|
231
|
+
name: z.string(),
|
|
232
|
+
tableId: z.string(),
|
|
233
|
+
fqn: z.string(),
|
|
234
|
+
description: z.string().optional(),
|
|
235
|
+
grain: z.string().optional(),
|
|
236
|
+
primaryKey: z.array(z.string()).optional(),
|
|
237
|
+
fields: datasetFieldsSchema.optional(),
|
|
238
|
+
ai: aiMetadataSchema.optional()
|
|
239
|
+
}),
|
|
240
|
+
"semantic-metric": z.looseObject({
|
|
241
|
+
modelUUID: z.string(),
|
|
242
|
+
name: z.string(),
|
|
243
|
+
sql: z.string(),
|
|
244
|
+
dataset: z.string().optional(),
|
|
245
|
+
description: z.string().optional()
|
|
246
|
+
}),
|
|
247
|
+
"semantic-relationship": z.looseObject({
|
|
248
|
+
modelUUID: z.string(),
|
|
249
|
+
name: z.string().optional(),
|
|
250
|
+
from: z.string(),
|
|
251
|
+
to: z.string(),
|
|
252
|
+
on: z.string(),
|
|
253
|
+
type: z.enum(RELATIONSHIP_JOIN_TYPES).optional().catch(void 0)
|
|
254
|
+
}),
|
|
255
|
+
"semantic-glossary": z.looseObject({
|
|
256
|
+
modelUUID: z.string(),
|
|
257
|
+
term: z.string(),
|
|
258
|
+
definition: z.string(),
|
|
259
|
+
seeAlso: z.array(z.string()).optional()
|
|
260
|
+
}),
|
|
261
|
+
"semantic-constraint": z.looseObject({
|
|
262
|
+
modelUUID: z.string(),
|
|
263
|
+
name: z.string(),
|
|
264
|
+
displayName: z.string().optional(),
|
|
265
|
+
description: z.string().optional(),
|
|
266
|
+
constraintType: z.enum(CONSTRAINT_TYPES),
|
|
267
|
+
metrics: z.array(z.string()),
|
|
268
|
+
datasets: z.array(z.string()).optional(),
|
|
269
|
+
rule: z.string(),
|
|
270
|
+
ruleExpression: ruleExpressionSchema.optional(),
|
|
271
|
+
validationQuery: validationQuerySchema.optional(),
|
|
272
|
+
severity: z.enum(CONSTRAINT_SEVERITIES).optional().catch(void 0),
|
|
273
|
+
errorMessage: z.string().optional(),
|
|
274
|
+
remediation: z.string().optional(),
|
|
275
|
+
isActive: z.boolean().optional(),
|
|
276
|
+
scope: z.enum(CONSTRAINT_SCOPES).optional().catch(void 0),
|
|
277
|
+
owner: z.string().optional(),
|
|
278
|
+
tags: z.array(z.string()).optional()
|
|
279
|
+
})
|
|
280
|
+
};
|
|
281
|
+
const semanticObjectMetaSchema = z.looseObject({
|
|
282
|
+
name: z.string().optional(),
|
|
283
|
+
branch: z.string().optional(),
|
|
284
|
+
projectId: z.number().optional(),
|
|
285
|
+
organizationId: z.string().optional(),
|
|
286
|
+
revision: z.number().optional(),
|
|
287
|
+
schemaVersion: z.string().optional(),
|
|
288
|
+
createdAt: z.string().optional(),
|
|
289
|
+
lastUpdated: z.string().optional(),
|
|
290
|
+
revisionCreatedAt: z.string().optional()
|
|
291
|
+
});
|
|
292
|
+
/**
|
|
293
|
+
* The envelope every read comes wrapped in, mapped to the `SemanticObject` the SDK returns.
|
|
294
|
+
*
|
|
295
|
+
* `meta` is absent on nothing we have seen, but every field inside it is optional, so an envelope
|
|
296
|
+
* that omits it is a normalization rather than a failure — the alternative is dropping an object
|
|
297
|
+
* over audit fields no caller requires. `null` normalizes the same way: a serializer that writes
|
|
298
|
+
* an absent object as `null` must not be a different outcome from one that omits the key.
|
|
299
|
+
*/
|
|
300
|
+
const semanticObjectReadSchema = (dataSchema) => z.object({
|
|
301
|
+
id: z.string(),
|
|
302
|
+
attributes: dataSchema,
|
|
303
|
+
meta: semanticObjectMetaSchema.nullish()
|
|
304
|
+
}).transform(({ id, attributes, meta }) => ({
|
|
305
|
+
uuid: id,
|
|
306
|
+
data: attributes,
|
|
307
|
+
meta: meta ?? {}
|
|
308
|
+
}));
|
|
309
|
+
//#endregion
|
|
310
|
+
//#region src/sdks/semanticLayer/semanticLayerSdk.ts
|
|
311
|
+
/**
|
|
312
|
+
* Thrown by `deleteModel` when the child cascade partially fails. Every child delete has
|
|
313
|
+
* settled by the time this is thrown — nothing keeps deleting in the background — and the
|
|
314
|
+
* model itself was kept, so the exact remaining state is knowable: `deletedChildren` are gone,
|
|
315
|
+
* `failedChildren` (and the model) still exist. `errors` carries the per-child rejection
|
|
316
|
+
* reasons, AggregateError-style.
|
|
317
|
+
*/
|
|
318
|
+
var SemanticLayerCascadeDeleteError = class extends AggregateError {
|
|
319
|
+
modelUUID;
|
|
320
|
+
deletedChildren;
|
|
321
|
+
failedChildren;
|
|
322
|
+
constructor({ modelUUID, deletedChildren, failedChildren }) {
|
|
323
|
+
const total = deletedChildren.length + failedChildren.length;
|
|
324
|
+
super(failedChildren.map((failure) => failure.error), `The model was kept because ${failedChildren.length} of its ${total} child objects could not be deleted (${deletedChildren.length} deleted).`);
|
|
325
|
+
this.name = "SemanticLayerCascadeDeleteError";
|
|
326
|
+
this.modelUUID = modelUUID;
|
|
327
|
+
this.deletedChildren = deletedChildren;
|
|
328
|
+
this.failedChildren = failedChildren;
|
|
329
|
+
}
|
|
330
|
+
};
|
|
331
|
+
/**
|
|
332
|
+
* Thrown by `listModelChildren` when a read that has to be complete was not.
|
|
333
|
+
*
|
|
334
|
+
* - A dropped object is invisible to the caller, and two of this SDK's answers cannot survive
|
|
335
|
+
* that: what a delete would destroy, and whether a model still has children.
|
|
336
|
+
* - So this one read fails closed where a display read degrades. `deleteModel` calls it before
|
|
337
|
+
* the cascade starts, so nothing is deleted when it throws.
|
|
338
|
+
* - `unreadable` lists what could not be parsed. `modelUUID` is `null` when that field is itself
|
|
339
|
+
* part of what failed — an object that cannot name its model is counted against every model,
|
|
340
|
+
* because the alternative is deleting the model it turns out to belong to.
|
|
341
|
+
*/
|
|
342
|
+
var SemanticLayerUnreadableChildrenError = class extends Error {
|
|
343
|
+
modelUUID;
|
|
344
|
+
unreadable;
|
|
345
|
+
constructor({ modelUUID, unreadable }) {
|
|
346
|
+
super(`${unreadable.length} child object(s) of the model could not be read, so what it holds is unknown and nothing was deleted.`);
|
|
347
|
+
this.name = "SemanticLayerUnreadableChildrenError";
|
|
348
|
+
this.modelUUID = modelUUID;
|
|
349
|
+
this.unreadable = unreadable;
|
|
350
|
+
}
|
|
351
|
+
};
|
|
352
|
+
const SEMANTIC_OBJECT_TYPE = {
|
|
353
|
+
MODEL: "semantic-model",
|
|
354
|
+
DATASET: "semantic-dataset",
|
|
355
|
+
METRIC: "semantic-metric",
|
|
356
|
+
RELATIONSHIP: "semantic-relationship",
|
|
357
|
+
GLOSSARY: "semantic-glossary",
|
|
358
|
+
CONSTRAINT: "semantic-constraint"
|
|
359
|
+
};
|
|
360
|
+
/**
|
|
361
|
+
* `readonly` because this drives `createModelTree`, `listModelChildren` and `deleteModel` —
|
|
362
|
+
* a consumer-side `.push()` would silently change what a cascade delete touches.
|
|
363
|
+
*/
|
|
364
|
+
const MODEL_CHILD_OBJECT_TYPES = [
|
|
365
|
+
SEMANTIC_OBJECT_TYPE.DATASET,
|
|
366
|
+
SEMANTIC_OBJECT_TYPE.METRIC,
|
|
367
|
+
SEMANTIC_OBJECT_TYPE.RELATIONSHIP,
|
|
368
|
+
SEMANTIC_OBJECT_TYPE.GLOSSARY,
|
|
369
|
+
SEMANTIC_OBJECT_TYPE.CONSTRAINT
|
|
370
|
+
];
|
|
371
|
+
const DEFAULT_BRANCH = "main";
|
|
372
|
+
const WRITE_CONCURRENCY = 5;
|
|
373
|
+
const mapObject = (item) => ({
|
|
374
|
+
uuid: item.id,
|
|
375
|
+
data: item.attributes,
|
|
376
|
+
meta: item.meta
|
|
377
|
+
});
|
|
378
|
+
/**
|
|
379
|
+
* The UUID of an envelope that failed to parse, read off the raw value.
|
|
380
|
+
*
|
|
381
|
+
* There is no parse result to read it from. `null` — no `id`, not a string, or not an object at
|
|
382
|
+
* all — means the object is unaddressable: nothing can fetch, fix or delete it by UUID.
|
|
383
|
+
*/
|
|
384
|
+
const envelopeId = (value) => {
|
|
385
|
+
if (typeof value !== "object" || value === null) return null;
|
|
386
|
+
const { id } = value;
|
|
387
|
+
return typeof id === "string" && id !== "" ? id : null;
|
|
388
|
+
};
|
|
389
|
+
/**
|
|
390
|
+
* The model a *dropped* envelope claims, read off the raw value.
|
|
391
|
+
*
|
|
392
|
+
* `listObjects` scopes a collection by the parsed `data.modelUUID`, which an object that failed
|
|
393
|
+
* to parse has none of. `null` — the field is missing, not a string, or the envelope is not an
|
|
394
|
+
* object — means "cannot be attributed", and every caller here treats that as "could be this
|
|
395
|
+
* model's".
|
|
396
|
+
*/
|
|
397
|
+
const envelopeModelUUID = (value) => {
|
|
398
|
+
if (typeof value !== "object" || value === null) return null;
|
|
399
|
+
const { attributes } = value;
|
|
400
|
+
if (typeof attributes !== "object" || attributes === null) return null;
|
|
401
|
+
const { modelUUID } = attributes;
|
|
402
|
+
return typeof modelUUID === "string" && modelUUID !== "" ? modelUUID : null;
|
|
403
|
+
};
|
|
404
|
+
const deriveOptionalObjectName = (data) => {
|
|
405
|
+
if (typeof data.name === "string") return data.name;
|
|
406
|
+
if (typeof data.term === "string") return data.term;
|
|
407
|
+
};
|
|
408
|
+
const deriveObjectName = (data) => deriveOptionalObjectName(data) ?? generateUUID();
|
|
409
|
+
/**
|
|
410
|
+
* The label a UI shows for an object, as opposed to the identifier it is addressed by.
|
|
411
|
+
*
|
|
412
|
+
* Constraints carry an optional `displayName`; kbc-ui's constraint tables already render
|
|
413
|
+
* `displayName ?? name`, so a confirmation listing what a cascade delete would destroy has to
|
|
414
|
+
* agree with them or it names objects the user can't find on screen.
|
|
415
|
+
*
|
|
416
|
+
* Deliberately **not** used for lookup: `displayName` is optional and not unique, so matching on
|
|
417
|
+
* it would make `findObjectsByName` ambiguous for callers that resolve a write target by name.
|
|
418
|
+
*/
|
|
419
|
+
const deriveObjectLabel = (data) => {
|
|
420
|
+
if (typeof data.displayName === "string" && data.displayName !== "") return data.displayName;
|
|
421
|
+
return deriveOptionalObjectName(data);
|
|
422
|
+
};
|
|
423
|
+
const createSemanticLayerSdk = ({ metastoreClient }) => {
|
|
424
|
+
/**
|
|
425
|
+
* Every object of one type, parsed rather than asserted.
|
|
426
|
+
*
|
|
427
|
+
* - Each element is validated against the shape `./types` declares for it, so a caller that
|
|
428
|
+
* reads a field the type marks required gets a string and not a `TypeError` in render.
|
|
429
|
+
* - An element that does not match is dropped and the reason logged — the metastore validates
|
|
430
|
+
* these on write, so one that fails here is genuinely broken, and a half-formed object is
|
|
431
|
+
* worse to hand a caller than no object.
|
|
432
|
+
* - A drop never takes the collection with it: a model with one malformed metric still lists
|
|
433
|
+
* the other nine.
|
|
434
|
+
* - A response that is not a collection at all is a different failure and throws, because
|
|
435
|
+
* reading it as an empty list would render "this project has no metrics".
|
|
436
|
+
*/
|
|
437
|
+
const _listObjects = async (objectType, dataSchema, signal) => {
|
|
438
|
+
const response = await metastoreClient.repository.getMetaObjects({ objectType }, signal);
|
|
439
|
+
const items = parseOrThrow(z.array(z.unknown()), response.data);
|
|
440
|
+
const schema = semanticObjectReadSchema(dataSchema);
|
|
441
|
+
const objects = [];
|
|
442
|
+
const unreadable = [];
|
|
443
|
+
for (const item of items) {
|
|
444
|
+
const result = schema.safeParse(item);
|
|
445
|
+
if (result.success) {
|
|
446
|
+
objects.push(result.data);
|
|
447
|
+
continue;
|
|
448
|
+
}
|
|
449
|
+
unreadable.push({
|
|
450
|
+
objectType,
|
|
451
|
+
objectUUID: envelopeId(item),
|
|
452
|
+
modelUUID: envelopeModelUUID(item)
|
|
453
|
+
});
|
|
454
|
+
console.warn(`semanticLayerSdk: dropped ${objectType} "${envelopeId(item) ?? "<no id>"}" from the metastore response, it does not match its declared shape`, formatValidationIssues(result.error.issues));
|
|
455
|
+
}
|
|
456
|
+
return {
|
|
457
|
+
objects,
|
|
458
|
+
unreadable
|
|
459
|
+
};
|
|
460
|
+
};
|
|
461
|
+
const listModels = async (signal) => (await _listObjects(SEMANTIC_OBJECT_TYPE.MODEL, semanticModelReadSchema, signal)).objects;
|
|
462
|
+
const createModel = async (data, meta = {}) => {
|
|
463
|
+
const response = await metastoreClient.repository.createMetaObject({
|
|
464
|
+
objectType: SEMANTIC_OBJECT_TYPE.MODEL,
|
|
465
|
+
data,
|
|
466
|
+
branch: DEFAULT_BRANCH,
|
|
467
|
+
...meta,
|
|
468
|
+
name: data.name
|
|
469
|
+
});
|
|
470
|
+
return mapObject(response.data);
|
|
471
|
+
};
|
|
472
|
+
const updateModel = async (modelUUID, data, meta = {}) => {
|
|
473
|
+
const response = await metastoreClient.repository.updateMetaObject({
|
|
474
|
+
objectType: SEMANTIC_OBJECT_TYPE.MODEL,
|
|
475
|
+
UUID: modelUUID,
|
|
476
|
+
data,
|
|
477
|
+
...meta,
|
|
478
|
+
...data.name ? { name: data.name } : {}
|
|
479
|
+
});
|
|
480
|
+
return mapObject(response.data);
|
|
481
|
+
};
|
|
482
|
+
/**
|
|
483
|
+
* One child collection, scoped to a model, with what the scoping could not account for.
|
|
484
|
+
*
|
|
485
|
+
* - An object that parsed is this model's when its `modelUUID` matches.
|
|
486
|
+
* - An object that did not parse is this model's when the raw envelope says so — and also when
|
|
487
|
+
* the envelope cannot say, since a dropped object that names no model could be anyone's.
|
|
488
|
+
*/
|
|
489
|
+
const _listChildObjects = async (objectType, modelUUID, signal) => {
|
|
490
|
+
const { objects, unreadable } = await _listObjects(objectType, SEMANTIC_CHILD_OBJECT_READ_SCHEMAS[objectType], signal);
|
|
491
|
+
return {
|
|
492
|
+
objects: objects.filter((object) => object.data.modelUUID === modelUUID),
|
|
493
|
+
unreadable: unreadable.filter((ref) => ref.modelUUID === null || ref.modelUUID === modelUUID)
|
|
494
|
+
};
|
|
495
|
+
};
|
|
496
|
+
const listObjects = async (objectType, modelUUID, signal) => (await _listChildObjects(objectType, modelUUID, signal)).objects;
|
|
497
|
+
/**
|
|
498
|
+
* Find a model's child objects by their user-facing name.
|
|
499
|
+
*
|
|
500
|
+
* Returns every match rather than resolving to one, because a name is not unique: the caller
|
|
501
|
+
* decides whether that's an error (an agent needs an unambiguous target) or a choice to offer
|
|
502
|
+
* (a UI can render a picker). Glossary entries key on `term`, so both are matched.
|
|
503
|
+
*/
|
|
504
|
+
const findObjectsByName = async (objectType, name, modelUUID, signal) => {
|
|
505
|
+
return (await listObjects(objectType, modelUUID, signal)).filter((object) => deriveOptionalObjectName(object.data) === name);
|
|
506
|
+
};
|
|
507
|
+
const createObject = async (objectType, data, meta = {}) => {
|
|
508
|
+
const response = await metastoreClient.repository.createMetaObject({
|
|
509
|
+
objectType,
|
|
510
|
+
data,
|
|
511
|
+
branch: DEFAULT_BRANCH,
|
|
512
|
+
...meta,
|
|
513
|
+
name: deriveObjectName(data)
|
|
514
|
+
});
|
|
515
|
+
return mapObject(response.data);
|
|
516
|
+
};
|
|
517
|
+
const createObjects = async (objectType, items, meta = {}) => concurrent({
|
|
518
|
+
items,
|
|
519
|
+
process: async (data) => createObject(objectType, data, meta),
|
|
520
|
+
concurrency: WRITE_CONCURRENCY
|
|
521
|
+
});
|
|
522
|
+
const createModelTree = async (model, children, meta = {}) => {
|
|
523
|
+
const createdModel = await createModel(model, meta);
|
|
524
|
+
const items = MODEL_CHILD_OBJECT_TYPES.flatMap((objectType) => (children[objectType] ?? []).map((data) => ({
|
|
525
|
+
objectType,
|
|
526
|
+
data: {
|
|
527
|
+
...data,
|
|
528
|
+
modelUUID: createdModel.uuid
|
|
529
|
+
}
|
|
530
|
+
})));
|
|
531
|
+
return {
|
|
532
|
+
model: createdModel,
|
|
533
|
+
children: await concurrent({
|
|
534
|
+
items,
|
|
535
|
+
process: async ({ objectType, data }) => createObject(objectType, data, meta),
|
|
536
|
+
concurrency: WRITE_CONCURRENCY
|
|
537
|
+
})
|
|
538
|
+
};
|
|
539
|
+
};
|
|
540
|
+
const updateObject = async (objectType, objectUUID, data, meta = {}) => {
|
|
541
|
+
const name = deriveOptionalObjectName(data);
|
|
542
|
+
const response = await metastoreClient.repository.updateMetaObject({
|
|
543
|
+
objectType,
|
|
544
|
+
UUID: objectUUID,
|
|
545
|
+
data,
|
|
546
|
+
...meta,
|
|
547
|
+
...name ? { name } : {}
|
|
548
|
+
});
|
|
549
|
+
return mapObject(response.data);
|
|
550
|
+
};
|
|
551
|
+
const deleteObject = async (objectType, objectUUID) => {
|
|
552
|
+
await metastoreClient.repository.deleteMetaObject({
|
|
553
|
+
objectType,
|
|
554
|
+
UUID: objectUUID
|
|
555
|
+
});
|
|
556
|
+
};
|
|
557
|
+
/**
|
|
558
|
+
* Every child object of a model, across all five types, flattened.
|
|
559
|
+
*
|
|
560
|
+
* `deleteModel` uses this to find what to remove; callers can use it to say what a delete
|
|
561
|
+
* would destroy *before* asking the user to confirm. Each entry's `name` is the object's
|
|
562
|
+
* display label (a constraint's `displayName` in preference to its `name`, matching what the
|
|
563
|
+
* SL tables render), so a confirmation lists objects as the user sees them on screen.
|
|
564
|
+
*
|
|
565
|
+
* Costs five list requests: the metastore has no per-model filter, so the collections are
|
|
566
|
+
* fetched whole and filtered client-side.
|
|
567
|
+
*
|
|
568
|
+
* **Throws `SemanticLayerUnreadableChildrenError` rather than degrading.** The list reads
|
|
569
|
+
* degrade — one malformed metric does not hide the other nine — but this answer is what
|
|
570
|
+
* `deleteModel` and every "what would this destroy?" confirmation is built on, and a short
|
|
571
|
+
* list there deletes the object it left out. An unreadable child is counted against the model
|
|
572
|
+
* whenever the raw envelope names it, and against every model when it cannot.
|
|
573
|
+
*/
|
|
574
|
+
const listModelChildren = async (modelUUID, signal) => {
|
|
575
|
+
const perType = await Promise.all(MODEL_CHILD_OBJECT_TYPES.map(async (objectType) => {
|
|
576
|
+
const { objects, unreadable } = await _listChildObjects(objectType, modelUUID, signal);
|
|
577
|
+
return {
|
|
578
|
+
children: objects.map((object) => ({
|
|
579
|
+
objectType,
|
|
580
|
+
objectUUID: object.uuid,
|
|
581
|
+
name: deriveObjectLabel(object.data)
|
|
582
|
+
})),
|
|
583
|
+
unreadable
|
|
584
|
+
};
|
|
585
|
+
}));
|
|
586
|
+
const unreadable = perType.flatMap((result) => result.unreadable);
|
|
587
|
+
if (unreadable.length > 0) throw new SemanticLayerUnreadableChildrenError({
|
|
588
|
+
modelUUID,
|
|
589
|
+
unreadable
|
|
590
|
+
});
|
|
591
|
+
return perType.flatMap((result) => result.children);
|
|
592
|
+
};
|
|
593
|
+
/**
|
|
594
|
+
* Cascade delete: every child object first, the model itself only once its whole tree is
|
|
595
|
+
* gone. Child deletes all settle — a failing child never aborts the others, so no delete
|
|
596
|
+
* runs on detached after this rejects — and a partial failure surfaces as
|
|
597
|
+
* `SemanticLayerCascadeDeleteError`, which says exactly which children were deleted and
|
|
598
|
+
* which survived. The model is kept on any child failure so it never orphans children.
|
|
599
|
+
*
|
|
600
|
+
* The same holds for a child that could not be *read*: `listModelChildren` throws before the
|
|
601
|
+
* cascade starts, so an object the read boundary dropped keeps the model alive rather than
|
|
602
|
+
* being silently left behind pointing at a model that no longer exists.
|
|
603
|
+
*/
|
|
604
|
+
const deleteModel = async (modelUUID) => {
|
|
605
|
+
const children = await listModelChildren(modelUUID);
|
|
606
|
+
const outcomes = await concurrent({
|
|
607
|
+
items: children,
|
|
608
|
+
process: async (child) => {
|
|
609
|
+
try {
|
|
610
|
+
await deleteObject(child.objectType, child.objectUUID);
|
|
611
|
+
return {
|
|
612
|
+
ok: true,
|
|
613
|
+
child
|
|
614
|
+
};
|
|
615
|
+
} catch (error) {
|
|
616
|
+
return {
|
|
617
|
+
ok: false,
|
|
618
|
+
child,
|
|
619
|
+
error
|
|
620
|
+
};
|
|
621
|
+
}
|
|
622
|
+
},
|
|
623
|
+
concurrency: WRITE_CONCURRENCY
|
|
624
|
+
});
|
|
625
|
+
const deletedChildren = [];
|
|
626
|
+
const failedChildren = [];
|
|
627
|
+
for (const outcome of outcomes) if (outcome.ok) deletedChildren.push(outcome.child);
|
|
628
|
+
else failedChildren.push({
|
|
629
|
+
...outcome.child,
|
|
630
|
+
error: outcome.error
|
|
631
|
+
});
|
|
632
|
+
if (failedChildren.length > 0) throw new SemanticLayerCascadeDeleteError({
|
|
633
|
+
modelUUID,
|
|
634
|
+
deletedChildren,
|
|
635
|
+
failedChildren
|
|
636
|
+
});
|
|
637
|
+
await metastoreClient.repository.deleteMetaObject({
|
|
638
|
+
objectType: SEMANTIC_OBJECT_TYPE.MODEL,
|
|
639
|
+
UUID: modelUUID
|
|
640
|
+
});
|
|
641
|
+
};
|
|
642
|
+
/**
|
|
643
|
+
* Replace the sibling projects granted GET/consumption access to a `targeted`-scope object.
|
|
644
|
+
*
|
|
645
|
+
* Passing an empty array clears every grant, leaving the object visible to its owning project
|
|
646
|
+
* only. A grant conveys read access alone — the target projects can consume the definition but
|
|
647
|
+
* never edit it, which is enforced metastore-side rather than here.
|
|
648
|
+
*/
|
|
649
|
+
const replaceTargetProjects = async (objectType, objectUUID, targetProjectIds) => {
|
|
650
|
+
await metastoreClient.repository.replaceTargetProjects({
|
|
651
|
+
objectType,
|
|
652
|
+
UUID: objectUUID,
|
|
653
|
+
targetProjectIds
|
|
654
|
+
});
|
|
655
|
+
};
|
|
656
|
+
/**
|
|
657
|
+
* Step a project-scoped object up to the organization scope, in place.
|
|
658
|
+
*
|
|
659
|
+
* The object keeps its UUID and revision history; the step-up writes a new revision whose
|
|
660
|
+
* `project_id` is null. Requires the caller to hold the organization-admin role for the target
|
|
661
|
+
* organization — a project-admin gets 403 from the metastore, which callers should surface
|
|
662
|
+
* rather than pre-empt (the same person is often both).
|
|
663
|
+
*/
|
|
664
|
+
const promoteToOrganizationScope = async (objectType, objectUUID) => {
|
|
665
|
+
const response = await metastoreClient.repository.updateMetaObject({
|
|
666
|
+
objectType,
|
|
667
|
+
UUID: objectUUID,
|
|
668
|
+
scope: "organization"
|
|
669
|
+
});
|
|
670
|
+
return mapObject(response.data);
|
|
671
|
+
};
|
|
672
|
+
return {
|
|
673
|
+
listModels,
|
|
674
|
+
createModel,
|
|
675
|
+
updateModel,
|
|
676
|
+
deleteModel,
|
|
677
|
+
listModelChildren,
|
|
678
|
+
listObjects,
|
|
679
|
+
findObjectsByName,
|
|
680
|
+
createObject,
|
|
681
|
+
createObjects,
|
|
682
|
+
createModelTree,
|
|
683
|
+
updateObject,
|
|
684
|
+
deleteObject,
|
|
685
|
+
replaceTargetProjects,
|
|
686
|
+
promoteToOrganizationScope
|
|
687
|
+
};
|
|
688
|
+
};
|
|
689
|
+
//#endregion
|
|
690
|
+
export { RELATIONSHIP_JOIN_TYPES as _, createSemanticLayerSdk as a, metastoreErrorMessage as b, semanticDatasetSchema as c, semanticModelSchema as d, semanticRelationshipSchema as f, FIELD_ROLES as g, CONSTRAINT_TYPES as h, SemanticLayerUnreadableChildrenError as i, semanticGlossarySchema as l, CONSTRAINT_SEVERITIES as m, SEMANTIC_OBJECT_TYPE as n, SEMANTIC_CHILD_OBJECT_SCHEMAS as o, CONSTRAINT_SCOPES as p, SemanticLayerCascadeDeleteError as r, semanticConstraintSchema as s, MODEL_CHILD_OBJECT_TYPES as t, semanticMetricSchema as u, RULE_OPERATORS as v, SQL_DIALECTS as y };
|
|
691
|
+
|
|
692
|
+
//# sourceMappingURL=semanticLayer-CSqmtHRo.js.map
|