@keboola/api-client 47.0.0 → 49.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 +10 -4
- package/API-SURFACE.md +6 -3
- package/CHANGELOG.md +65 -0
- package/README.md +1 -1
- package/dist/{adminRoles-CvdIUkiC.d.ts → adminRoles-BX1gk3At.d.ts} +2 -2
- package/dist/{adminRoles-DGM8SuuF.d.cts → adminRoles-BbxFgfX-.d.cts} +2 -2
- package/dist/ai/index.cjs +0 -5
- package/dist/ai/index.cjs.map +1 -1
- package/dist/ai/index.d.cts +2 -3
- package/dist/ai/index.d.ts +2 -3
- package/dist/ai/index.js +0 -5
- package/dist/ai/index.js.map +1 -1
- package/dist/ai/types.d.cts +2 -2
- package/dist/ai/types.d.ts +2 -2
- package/dist/{appLogs-xW0-JQXg.d.ts → appLogs-DI2Y4imY.d.ts} +2 -2
- package/dist/{appLogs-Cxhm2Rkn.d.cts → appLogs-IhRA3xyv.d.cts} +2 -2
- package/dist/apps/index.cjs +3 -3
- package/dist/apps/index.cjs.map +1 -1
- package/dist/apps/index.d.cts +6 -3
- package/dist/apps/index.d.ts +6 -3
- package/dist/apps/index.js +3 -3
- package/dist/apps/index.js.map +1 -1
- package/dist/apps/types.d.cts +2 -2
- package/dist/apps/types.d.ts +2 -2
- package/dist/assets/index.d.cts +1 -1
- package/dist/assets/index.d.ts +1 -1
- package/dist/auth/index.d.cts +1 -1
- package/dist/auth/index.d.ts +1 -1
- package/dist/auth/types.d.cts +1 -1
- package/dist/auth/types.d.ts +1 -1
- package/dist/{authClient-Bso5UaXS.d.ts → authClient-6Aau_4Zt.d.ts} +4 -4
- package/dist/{authClient-aud2dUZd.d.cts → authClient-B3P6WtWW.d.cts} +4 -4
- package/dist/billing/index.cjs +0 -1
- package/dist/billing/index.cjs.map +1 -1
- package/dist/billing/index.d.cts +27 -27
- package/dist/billing/index.d.ts +27 -27
- package/dist/billing/index.js +0 -1
- package/dist/billing/index.js.map +1 -1
- package/dist/billing/types.d.cts +26 -22
- package/dist/billing/types.d.ts +26 -22
- package/dist/chat/index.d.cts +2 -2
- package/dist/chat/index.d.ts +2 -2
- package/dist/chat/types.d.cts +1 -1
- package/dist/chat/types.d.ts +1 -1
- package/dist/componentsMcp/index.d.cts +1 -1
- package/dist/componentsMcp/index.d.ts +1 -1
- package/dist/componentsMcp/types.d.cts +1 -1
- package/dist/componentsMcp/types.d.ts +1 -1
- package/dist/{configurations-DcpUlC8I.js → configurations-B44z6BSO.js} +2 -2
- package/dist/{configurations-DcpUlC8I.js.map → configurations-B44z6BSO.js.map} +1 -1
- package/dist/{configurations-Chg_JwJ1.js → configurations-CL0ouUMa.js} +3 -3
- package/dist/configurations-CL0ouUMa.js.map +1 -0
- package/dist/{configurations-BTRHVSRq.cjs → configurations-D9J3jh3g.cjs} +3 -3
- package/dist/configurations-D9J3jh3g.cjs.map +1 -0
- package/dist/{configurations-D_Rbs0Wl.cjs → configurations-Dkxsa3Uf.cjs} +2 -2
- package/dist/{configurations-D_Rbs0Wl.cjs.map → configurations-Dkxsa3Uf.cjs.map} +1 -1
- package/dist/constants/index.cjs +4 -1
- package/dist/constants/index.d.cts +4 -3
- package/dist/constants/index.d.ts +4 -3
- package/dist/constants/index.js +2 -2
- package/dist/{constants-a0jswUeK.cjs → constants-DErcRkWl.cjs} +95 -2
- package/dist/constants-DErcRkWl.cjs.map +1 -0
- package/dist/{constants-CA4UN2Xv.js → constants-VpSwBtCb.js} +78 -3
- package/dist/constants-VpSwBtCb.js.map +1 -0
- package/dist/dataScience/index.d.cts +2 -2
- package/dist/dataScience/index.d.ts +2 -2
- package/dist/dataScience/types.d.cts +2 -2
- package/dist/dataScience/types.d.ts +2 -2
- package/dist/developerPortal/index.d.cts +2 -2
- package/dist/developerPortal/index.d.ts +2 -2
- package/dist/developerPortal/types.d.cts +1 -1
- package/dist/developerPortal/types.d.ts +1 -1
- package/dist/domain/permissions/index.cjs +8 -43
- package/dist/domain/permissions/index.d.cts +7 -3
- package/dist/domain/permissions/index.d.ts +7 -3
- package/dist/domain/permissions/index.js +3 -39
- package/dist/domain/storageTable/index.d.cts +1 -1
- package/dist/domain/storageTable/index.d.ts +1 -1
- package/dist/editor/index.d.cts +2 -2
- package/dist/editor/index.d.ts +2 -2
- package/dist/editor/types.d.cts +1 -1
- package/dist/editor/types.d.ts +1 -1
- package/dist/encryption/index.d.cts +1 -1
- package/dist/encryption/index.d.ts +1 -1
- package/dist/encryption/types.d.cts +1 -1
- package/dist/encryption/types.d.ts +1 -1
- package/dist/import/index.d.cts +3 -3
- package/dist/import/index.d.ts +3 -3
- package/dist/{index-DTysQ_yn.d.cts → index-BM_fXKq5.d.cts} +5 -5
- package/dist/{index-XaPb6unB.d.cts → index-BPMr8PQJ.d.ts} +271 -35
- package/dist/{index-BnPmXDVP.d.ts → index-BT88-GpA.d.ts} +73 -3
- package/dist/{index-x_kS_5x_.d.cts → index-BVjhAkXW.d.cts} +4 -4
- package/dist/{index-CkwZ5x7E.d.cts → index-Be2dNJ_N.d.cts} +336 -169
- package/dist/{index-C2OAOK0s.d.ts → index-BiZR9BjN.d.ts} +4 -4
- package/dist/{index-B_MzjCeE.d.ts → index-C6oPUTWZ.d.ts} +3 -3
- package/dist/{index-r6YSe8B-.d.ts → index-CL4iKFic.d.cts} +271 -35
- package/dist/{index-URgNfi5L.d.cts → index-CbZQCDkD.d.cts} +3 -3
- package/dist/{index-XG5cO-4H.d.cts → index-CrrHvDiX.d.cts} +18 -13
- package/dist/{index-ZYvgoqgW.d.cts → index-CtQl-Iqw.d.cts} +4 -4
- package/dist/{index-BIP0PoMW.d.ts → index-D6JMbJ9b.d.ts} +18 -13
- package/dist/{index-Ds0tViQS.d.cts → index-DGKCTQkb.d.cts} +3 -3
- package/dist/{index-BeOd45XE.d.ts → index-DReKz9Zt.d.ts} +4 -4
- package/dist/{index-DUB0BwQv.d.cts → index-DYNVbgm8.d.cts} +4 -4
- package/dist/{index-DloFSSj3.d.ts → index-DhZTIejy.d.ts} +3 -3
- package/dist/{index-BGEuaZqI.d.cts → index-Dkb8CynB.d.cts} +21 -5
- package/dist/{index-_Va9wynk.d.ts → index-DorowSay.d.ts} +21 -5
- package/dist/{index-8ZjY7YD8.d.cts → index-PqJGDHHl.d.cts} +73 -3
- package/dist/{index-HSkjm3QW.d.ts → index-XcnkRVb0.d.ts} +5 -5
- package/dist/{index-Dp-a2DdI.d.ts → index-dgu6udMy.d.ts} +4 -4
- package/dist/{index-P1vR966i.d.ts → index-fMoM8SeH.d.cts} +4 -4
- package/dist/{index-P1vR966i.d.cts → index-fMoM8SeH.d.ts} +4 -4
- package/dist/{index-CAWy1qjR.d.ts → index-uGRdAORl.d.ts} +336 -169
- package/dist/index.cjs +458 -259
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.js +455 -260
- package/dist/index.js.map +1 -1
- package/dist/kaiAgent/index.cjs +1 -1
- package/dist/kaiAgent/index.d.cts +3 -3
- package/dist/kaiAgent/index.d.ts +3 -3
- 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-CBPbMwBh.js → kaiAgent-CYvrS8oZ.js} +12 -3
- package/dist/kaiAgent-CYvrS8oZ.js.map +1 -0
- package/dist/{kaiAgent-BmfUG8bB.cjs → kaiAgent-N2qbUFZm.cjs} +12 -3
- package/dist/kaiAgent-N2qbUFZm.cjs.map +1 -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.cjs +14 -0
- package/dist/management/types.cjs.map +1 -0
- package/dist/management/types.d.cts +2 -2
- package/dist/management/types.d.ts +2 -2
- package/dist/management/types.js +12 -1
- package/dist/management/types.js.map +1 -0
- package/dist/{management-BUGPJ1Bu.cjs → management-B1o6RpKF.cjs} +15 -14
- package/dist/management-B1o6RpKF.cjs.map +1 -0
- package/dist/{management-DAg2obYt.js → management-C9w3DNhs.js} +15 -14
- package/dist/management-C9w3DNhs.js.map +1 -0
- package/dist/metastore/index.d.cts +1 -1
- package/dist/metastore/index.d.ts +1 -1
- package/dist/metastore/types.d.cts +1 -1
- package/dist/metastore/types.d.ts +1 -1
- package/dist/microsoftGraph/index.d.cts +2 -2
- package/dist/microsoftGraph/index.d.ts +2 -2
- package/dist/microsoftGraph/types.d.cts +1 -1
- package/dist/microsoftGraph/types.d.ts +1 -1
- package/dist/{middleware-DU_5pFDW.cjs → middleware-CEP6uu_D.cjs} +4 -4
- package/dist/middleware-CEP6uu_D.cjs.map +1 -0
- package/dist/{middleware-CWaLMlG1.js → middleware-GOfx8Apu.js} +4 -4
- package/dist/middleware-GOfx8Apu.js.map +1 -0
- package/dist/notifications/index.d.cts +2 -2
- package/dist/notifications/index.d.ts +2 -2
- package/dist/notifications/types.d.cts +1 -1
- package/dist/notifications/types.d.ts +1 -1
- package/dist/oauth/index.d.cts +2 -2
- package/dist/oauth/index.d.ts +2 -2
- package/dist/oauth/types.d.cts +1 -1
- package/dist/oauth/types.d.ts +1 -1
- package/dist/omnisearch/index.d.cts +2 -2
- package/dist/omnisearch/index.d.ts +2 -2
- package/dist/omnisearch/types.d.cts +1 -1
- package/dist/omnisearch/types.d.ts +1 -1
- package/dist/project-ClH22nzH.js +86 -0
- package/dist/project-ClH22nzH.js.map +1 -0
- package/dist/{project-BMmfPhXg.d.ts → project-DTfBtIJs.d.ts} +4 -3
- package/dist/project-Rh4nXiWh.cjs +139 -0
- package/dist/project-Rh4nXiWh.cjs.map +1 -0
- package/dist/{project-dxCJbFay.d.cts → project-vOnvjo80.d.cts} +4 -3
- package/dist/queryService/index.d.cts +1 -1
- package/dist/queryService/index.d.ts +1 -1
- package/dist/queryService/types.d.cts +1 -1
- package/dist/queryService/types.d.ts +1 -1
- package/dist/queue/index.d.cts +3 -3
- package/dist/queue/index.d.ts +3 -3
- package/dist/queue/types.d.cts +1 -1
- package/dist/queue/types.d.ts +1 -1
- package/dist/scheduler/index.d.cts +2 -2
- package/dist/scheduler/index.d.ts +2 -2
- 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 +2 -2
- package/dist/sdk/configurations/index.d.ts +2 -2
- package/dist/sdk/configurations/index.js +1 -1
- package/dist/sdk/developerPortal/index.cjs +1 -1
- package/dist/sdk/developerPortal/index.d.cts +3 -3
- package/dist/sdk/developerPortal/index.d.ts +3 -3
- package/dist/sdk/developerPortal/index.js +1 -1
- package/dist/sdk/kaiMemory/index.d.cts +1 -1
- package/dist/sdk/kaiMemory/index.d.ts +1 -1
- package/dist/sdk/kaiMemory/types.d.cts +1 -1
- package/dist/sdk/kaiMemory/types.d.ts +1 -1
- package/dist/sdk/queryService/index.d.cts +1 -1
- package/dist/sdk/queryService/index.d.ts +1 -1
- package/dist/sdk/semanticLayer/index.d.cts +1 -1
- package/dist/sdk/semanticLayer/index.d.ts +1 -1
- package/dist/sdk/semanticLayer/types.d.cts +1 -1
- package/dist/sdk/semanticLayer/types.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/status/index.d.cts +1 -1
- package/dist/status/index.d.ts +1 -1
- package/dist/storage/index.cjs +4 -1
- package/dist/storage/index.d.cts +3 -3
- package/dist/storage/index.d.ts +3 -3
- package/dist/storage/index.js +2 -2
- package/dist/storage/types.d.cts +6 -6
- package/dist/storage/types.d.ts +6 -6
- package/dist/{storage-DyR7hDdv.js → storage-CChfKlrb.js} +31 -3
- package/dist/storage-CChfKlrb.js.map +1 -0
- package/dist/{storage-yovv11k6.cjs → storage-Ci9gXgcw.cjs} +48 -2
- package/dist/storage-Ci9gXgcw.cjs.map +1 -0
- package/dist/stream/index.d.cts +2 -2
- package/dist/stream/index.d.ts +2 -2
- package/dist/stream/types.d.cts +1 -1
- package/dist/stream/types.d.ts +1 -1
- package/dist/syncActions/index.d.cts +2 -2
- package/dist/syncActions/index.d.ts +2 -2
- package/dist/syncActions/types.d.cts +1 -1
- package/dist/syncActions/types.d.ts +1 -1
- package/dist/telemetry/index.d.cts +2 -2
- package/dist/telemetry/index.d.ts +2 -2
- package/dist/telemetry/types.d.cts +1 -1
- package/dist/telemetry/types.d.ts +1 -1
- package/dist/{types-DHlXKVEM.d.ts → types-0R9-osUJ.d.ts} +3 -3
- package/dist/{types-CBrNIgEy.d.ts → types-302-NBaU.d.ts} +3 -3
- package/dist/{types-4HmtNuJf.d.ts → types-45O2dU2w.d.ts} +2 -2
- package/dist/{types-CZCPdPqv.d.cts → types-BAsYMltG.d.cts} +3 -3
- package/dist/{types-BiBBKcin.d.ts → types-BM6rri7-.d.ts} +3 -3
- package/dist/{types-BNPvFLgC.d.ts → types-BOT6TgOS.d.ts} +3 -4
- package/dist/{types-BiTn_JVW.d.cts → types-BT5e9TSQ.d.ts} +117 -37
- package/dist/{types-C2j6Jsie.d.ts → types-BUirSne-.d.ts} +3 -3
- package/dist/{types-BoH7NFCh.d.ts → types-BWzt1ju_.d.ts} +3 -3
- package/dist/{types-BjEiUOL6.d.ts → types-BXybSjn-.d.ts} +2 -2
- package/dist/{types-BIDKSQdc.d.ts → types-BZ--6pIt.d.ts} +169 -31
- package/dist/{types-B2ZLjagf.d.ts → types-BjwbzqJd.d.ts} +2 -2
- package/dist/{types-B6ozaDkl.d.cts → types-BnmsuDfH.d.cts} +2 -2
- package/dist/{types-Bx0TSdwF.d.cts → types-BrpIEj_N.d.ts} +2 -2
- package/dist/{types-BG0oWq8u.d.cts → types-C614wC5h.d.cts} +2 -2
- package/dist/{types-4CjbcUdD.d.cts → types-CTS2NSIb.d.cts} +2 -2
- package/dist/{types-BZBU3mwz.d.cts → types-CY8X39qv.d.cts} +3 -3
- package/dist/{types-Cw9UISvM.d.ts → types-CeqZuOEC.d.ts} +2 -2
- package/dist/{types-C3IQu1gV.d.ts → types-CfXqFz2e.d.ts} +5 -3
- package/dist/{types-BKIcow3B.d.cts → types-ChLWY8aU.d.cts} +2 -2
- package/dist/{types-B_3zoXA1.d.cts → types-CjNl7O7f.d.cts} +3 -3
- package/dist/{types-BwsE-pFo.d.cts → types-CkJxMoTk.d.cts} +2 -2
- package/dist/{types--qQPfxWt.d.cts → types-CpJhWBmH.d.cts} +2 -2
- package/dist/{types-DgIzXY-Y.d.ts → types-D2Pb_4FA.d.cts} +2 -2
- package/dist/{types-7DBpH7Rf.d.ts → types-D53zBV25.d.ts} +2 -2
- package/dist/{types-Dg8a7m7f.d.ts → types-D9ZKJYZk.d.ts} +2 -2
- package/dist/{types-BXgINefw.d.ts → types-DODAZKEm.d.ts} +2 -2
- package/dist/{types-BBbzWczQ.d.cts → types-DV7K07oX.d.cts} +3 -4
- package/dist/{types-TRJiPqJr.d.cts → types-DbXV0g8U.d.cts} +2 -2
- package/dist/{types-BcQ3j8xK.d.ts → types-DjadPty5.d.ts} +2 -2
- package/dist/{types-DWJVbskE.d.ts → types-DlhNay1n.d.ts} +2 -2
- package/dist/{types-DBJ8c3hN.d.cts → types-DmzSFOhK.d.cts} +2 -2
- package/dist/{types-B_1plf0y.d.cts → types-DpbrGDRf.d.cts} +2 -2
- package/dist/{types-ituiCs8g.d.ts → types-DqOxIujY.d.ts} +2 -2
- package/dist/{types-D8w9lyb8.d.cts → types-Duurgaqk.d.cts} +7 -3
- package/dist/{types-C7t_6FLh.d.ts → types-Dy6EdWPG.d.ts} +2 -2
- package/dist/{types-kbyIaA7p.d.cts → types-HmK8iKp5.d.cts} +3 -3
- package/dist/{types-BdF6NDvo.d.cts → types-JZ0Bdlpk.d.cts} +2 -2
- package/dist/{types-OkQWmonU.d.cts → types-O6XM48J8.d.cts} +2 -2
- package/dist/{types-CEw2IzWk.d.ts → types-RogkWzOu.d.ts} +2 -2
- package/dist/{types-C2JMisvL.d.ts → types-TmrPVMhy.d.cts} +117 -37
- package/dist/{types-ij6BpTzR.d.ts → types-_zKX6JmD.d.ts} +2 -2
- package/dist/{types-L50Y6ATu.d.cts → types-dn6MHur3.d.cts} +5 -3
- package/dist/{types-4bSZLxq3.d.cts → types-jN2KmMet.d.cts} +169 -31
- package/dist/{types-D51g4h9w.d.cts → types-jfPoUlO8.d.cts} +2 -2
- package/dist/{types-CMKIdreQ.d.cts → types-ptynVnkv.d.cts} +3 -3
- package/dist/{types-COQOzyac.d.ts → types-tdIo5FpR.d.ts} +7 -3
- package/dist/{types-DPDq8C4q.d.cts → types-vvw_H7wp.d.cts} +2 -2
- package/dist/vault/index.d.cts +1 -1
- package/dist/vault/index.d.ts +1 -1
- package/dist/vault/types.d.cts +1 -1
- package/dist/vault/types.d.ts +1 -1
- package/package.json +1 -1
- package/surface/ai.md +0 -1
- package/surface/apps.md +7 -7
- package/surface/billing.md +2 -2
- package/surface/kaiAgent.md +5 -4
- package/surface/management.md +3 -1
- package/surface/storage.md +3 -2
- package/dist/configurations-BTRHVSRq.cjs.map +0 -1
- package/dist/configurations-Chg_JwJ1.js.map +0 -1
- package/dist/constants-CA4UN2Xv.js.map +0 -1
- package/dist/constants-a0jswUeK.cjs.map +0 -1
- package/dist/domain/permissions/index.cjs.map +0 -1
- package/dist/domain/permissions/index.js.map +0 -1
- package/dist/kaiAgent-BmfUG8bB.cjs.map +0 -1
- package/dist/kaiAgent-CBPbMwBh.js.map +0 -1
- package/dist/management-BUGPJ1Bu.cjs.map +0 -1
- package/dist/management-DAg2obYt.js.map +0 -1
- package/dist/middleware-CWaLMlG1.js.map +0 -1
- package/dist/middleware-DU_5pFDW.cjs.map +0 -1
- package/dist/project-BXLFrWJ6.js +0 -45
- package/dist/project-BXLFrWJ6.js.map +0 -1
- package/dist/project-CpgplgCr.cjs +0 -62
- package/dist/project-CpgplgCr.cjs.map +0 -1
- package/dist/storage-DyR7hDdv.js.map +0 -1
- package/dist/storage-yovv11k6.cjs.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { l as OpenapiReturnType } from "../index-
|
|
1
|
+
import { l as OpenapiReturnType } from "../index-CL4iKFic.cjs";
|
|
2
2
|
import { n as paths } from "../schema-BUyMwQnM.cjs";
|
|
3
3
|
//#region src/clients/microsoftGraph/types.d.ts
|
|
4
4
|
type User = OpenapiReturnType<paths['/me']['get']>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { l as OpenapiReturnType } from "../index-
|
|
1
|
+
import { l as OpenapiReturnType } from "../index-BPMr8PQJ.js";
|
|
2
2
|
import { n as paths } from "../schema-BUyMwQnM.js";
|
|
3
3
|
//#region src/clients/microsoftGraph/types.d.ts
|
|
4
4
|
type User = OpenapiReturnType<paths['/me']['get']>;
|
|
@@ -8,9 +8,9 @@ const isUnauthorized = (error) => error instanceof require_createFetchClient.Api
|
|
|
8
8
|
* - Anonymous (`null` token): passes through untouched, so `login` / `refresh` work.
|
|
9
9
|
* - A `forceRefresh` answering `null` stops the replay.
|
|
10
10
|
*/
|
|
11
|
-
const createBearerAuthMiddleware = (
|
|
11
|
+
const createBearerAuthMiddleware = (source) => {
|
|
12
12
|
return (next) => async (request) => {
|
|
13
|
-
const token = await
|
|
13
|
+
const token = await source.getAccessToken({ forceRefresh: false });
|
|
14
14
|
if (token === null) return next(request);
|
|
15
15
|
const retryRequest = request.request.clone();
|
|
16
16
|
request.request.headers.set(require_createFetchClient.HttpHeader.AUTHORIZATION, `Bearer ${token}`);
|
|
@@ -18,7 +18,7 @@ const createBearerAuthMiddleware = (credential) => {
|
|
|
18
18
|
return await next(request);
|
|
19
19
|
} catch (error) {
|
|
20
20
|
if (!isUnauthorized(error)) throw error;
|
|
21
|
-
const refreshed = await
|
|
21
|
+
const refreshed = await source.getAccessToken({ forceRefresh: true });
|
|
22
22
|
if (refreshed === null) throw error;
|
|
23
23
|
retryRequest.headers.set(require_createFetchClient.HttpHeader.AUTHORIZATION, `Bearer ${refreshed}`);
|
|
24
24
|
return await next({
|
|
@@ -42,4 +42,4 @@ Object.defineProperty(exports, "isUnauthorized", {
|
|
|
42
42
|
}
|
|
43
43
|
});
|
|
44
44
|
|
|
45
|
-
//# sourceMappingURL=middleware-
|
|
45
|
+
//# sourceMappingURL=middleware-CEP6uu_D.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"middleware-CEP6uu_D.cjs","names":["ApiError","HttpStatus","HttpHeader"],"sources":["../src/keboola/bearer/credentials/middleware.ts"],"sourcesContent":["import { ApiError } from '../../../errors';\nimport { HttpHeader, type MiddlewareFn } from '../../../fetchClient';\nimport { HttpStatus } from '../../../internal';\n\nexport const isUnauthorized = (error: unknown): boolean =>\n error instanceof ApiError && error.response.status === HttpStatus.UNAUTHORIZED;\n\n/** Where the middleware gets its token; whether the credential behind it is dead is not its call. */\nexport type AccessTokenSource = {\n /** `null` while anonymous — nothing to stamp. */\n getAccessToken: (options?: { forceRefresh?: boolean }) => Promise<string | null>;\n};\n\n/**\n * Bearer auth: stamps the access token; on a 401, force-refreshes and replays once.\n *\n * - A replay that still 401s passes on, not as expiry: an unreachable project gets the same 401.\n * - Anonymous (`null` token): passes through untouched, so `login` / `refresh` work.\n * - A `forceRefresh` answering `null` stops the replay.\n */\nexport const createBearerAuthMiddleware = (source: AccessTokenSource): MiddlewareFn => {\n return (next) => async (request) => {\n const token = await source.getAccessToken({ forceRefresh: false });\n if (token === null) return next(request);\n\n // Cloned for the replay: the first attempt may consume the body.\n const retryRequest = request.request.clone();\n request.request.headers.set(HttpHeader.AUTHORIZATION, `Bearer ${token}`);\n\n try {\n return await next(request);\n } catch (error) {\n if (!isUnauthorized(error)) throw error;\n\n const refreshed = await source.getAccessToken({ forceRefresh: true });\n // Went anonymous mid-flight — surface the original 401.\n if (refreshed === null) throw error;\n retryRequest.headers.set(HttpHeader.AUTHORIZATION, `Bearer ${refreshed}`);\n\n return await next({ ...request, request: retryRequest });\n }\n };\n};\n"],"mappings":";;AAIA,MAAa,kBAAkB,UAC7B,iBAAiBA,0BAAAA,YAAY,MAAM,SAAS,WAAWC,0BAAAA,WAAW;;;;;;;;AAepE,MAAa,8BAA8B,WAA4C;CACrF,QAAQ,SAAS,OAAO,YAAY;EAClC,MAAM,QAAQ,MAAM,OAAO,eAAe,EAAE,cAAc,MAAM,CAAC;EACjE,IAAI,UAAU,MAAM,OAAO,KAAK,OAAO;EAGvC,MAAM,eAAe,QAAQ,QAAQ,MAAM;EAC3C,QAAQ,QAAQ,QAAQ,IAAIC,0BAAAA,WAAW,eAAe,UAAU,OAAO;EAEvE,IAAI;GACF,OAAO,MAAM,KAAK,OAAO;EAC3B,SAAS,OAAO;GACd,IAAI,CAAC,eAAe,KAAK,GAAG,MAAM;GAElC,MAAM,YAAY,MAAM,OAAO,eAAe,EAAE,cAAc,KAAK,CAAC;GAEpE,IAAI,cAAc,MAAM,MAAM;GAC9B,aAAa,QAAQ,IAAIA,0BAAAA,WAAW,eAAe,UAAU,WAAW;GAExE,OAAO,MAAM,KAAK;IAAE,GAAG;IAAS,SAAS;GAAa,CAAC;EACzD;CACF;AACF"}
|
|
@@ -8,9 +8,9 @@ const isUnauthorized = (error) => error instanceof ApiError && error.response.st
|
|
|
8
8
|
* - Anonymous (`null` token): passes through untouched, so `login` / `refresh` work.
|
|
9
9
|
* - A `forceRefresh` answering `null` stops the replay.
|
|
10
10
|
*/
|
|
11
|
-
const createBearerAuthMiddleware = (
|
|
11
|
+
const createBearerAuthMiddleware = (source) => {
|
|
12
12
|
return (next) => async (request) => {
|
|
13
|
-
const token = await
|
|
13
|
+
const token = await source.getAccessToken({ forceRefresh: false });
|
|
14
14
|
if (token === null) return next(request);
|
|
15
15
|
const retryRequest = request.request.clone();
|
|
16
16
|
request.request.headers.set(HttpHeader.AUTHORIZATION, `Bearer ${token}`);
|
|
@@ -18,7 +18,7 @@ const createBearerAuthMiddleware = (credential) => {
|
|
|
18
18
|
return await next(request);
|
|
19
19
|
} catch (error) {
|
|
20
20
|
if (!isUnauthorized(error)) throw error;
|
|
21
|
-
const refreshed = await
|
|
21
|
+
const refreshed = await source.getAccessToken({ forceRefresh: true });
|
|
22
22
|
if (refreshed === null) throw error;
|
|
23
23
|
retryRequest.headers.set(HttpHeader.AUTHORIZATION, `Bearer ${refreshed}`);
|
|
24
24
|
return await next({
|
|
@@ -31,4 +31,4 @@ const createBearerAuthMiddleware = (credential) => {
|
|
|
31
31
|
//#endregion
|
|
32
32
|
export { isUnauthorized as n, createBearerAuthMiddleware as t };
|
|
33
33
|
|
|
34
|
-
//# sourceMappingURL=middleware-
|
|
34
|
+
//# sourceMappingURL=middleware-GOfx8Apu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"middleware-GOfx8Apu.js","names":[],"sources":["../src/keboola/bearer/credentials/middleware.ts"],"sourcesContent":["import { ApiError } from '../../../errors';\nimport { HttpHeader, type MiddlewareFn } from '../../../fetchClient';\nimport { HttpStatus } from '../../../internal';\n\nexport const isUnauthorized = (error: unknown): boolean =>\n error instanceof ApiError && error.response.status === HttpStatus.UNAUTHORIZED;\n\n/** Where the middleware gets its token; whether the credential behind it is dead is not its call. */\nexport type AccessTokenSource = {\n /** `null` while anonymous — nothing to stamp. */\n getAccessToken: (options?: { forceRefresh?: boolean }) => Promise<string | null>;\n};\n\n/**\n * Bearer auth: stamps the access token; on a 401, force-refreshes and replays once.\n *\n * - A replay that still 401s passes on, not as expiry: an unreachable project gets the same 401.\n * - Anonymous (`null` token): passes through untouched, so `login` / `refresh` work.\n * - A `forceRefresh` answering `null` stops the replay.\n */\nexport const createBearerAuthMiddleware = (source: AccessTokenSource): MiddlewareFn => {\n return (next) => async (request) => {\n const token = await source.getAccessToken({ forceRefresh: false });\n if (token === null) return next(request);\n\n // Cloned for the replay: the first attempt may consume the body.\n const retryRequest = request.request.clone();\n request.request.headers.set(HttpHeader.AUTHORIZATION, `Bearer ${token}`);\n\n try {\n return await next(request);\n } catch (error) {\n if (!isUnauthorized(error)) throw error;\n\n const refreshed = await source.getAccessToken({ forceRefresh: true });\n // Went anonymous mid-flight — surface the original 401.\n if (refreshed === null) throw error;\n retryRequest.headers.set(HttpHeader.AUTHORIZATION, `Bearer ${refreshed}`);\n\n return await next({ ...request, request: retryRequest });\n }\n };\n};\n"],"mappings":";;AAIA,MAAa,kBAAkB,UAC7B,iBAAiB,YAAY,MAAM,SAAS,WAAW,WAAW;;;;;;;;AAepE,MAAa,8BAA8B,WAA4C;CACrF,QAAQ,SAAS,OAAO,YAAY;EAClC,MAAM,QAAQ,MAAM,OAAO,eAAe,EAAE,cAAc,MAAM,CAAC;EACjE,IAAI,UAAU,MAAM,OAAO,KAAK,OAAO;EAGvC,MAAM,eAAe,QAAQ,QAAQ,MAAM;EAC3C,QAAQ,QAAQ,QAAQ,IAAI,WAAW,eAAe,UAAU,OAAO;EAEvE,IAAI;GACF,OAAO,MAAM,KAAK,OAAO;EAC3B,SAAS,OAAO;GACd,IAAI,CAAC,eAAe,KAAK,GAAG,MAAM;GAElC,MAAM,YAAY,MAAM,OAAO,eAAe,EAAE,cAAc,KAAK,CAAC;GAEpE,IAAI,cAAc,MAAM,MAAM;GAC9B,aAAa,QAAQ,IAAI,WAAW,eAAe,UAAU,WAAW;GAExE,OAAO,MAAM,KAAK;IAAE,GAAG;IAAS,SAAS;GAAa,CAAC;EACzD;CACF;AACF"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as ClientInitOptions } from "../types-
|
|
2
|
-
import { a as SubscriptionId, n as ListSubscriptionsQuery, s as components, t as CreateSubscriptionBody } from "../types-
|
|
1
|
+
import { n as ClientInitOptions } from "../types-O6XM48J8.cjs";
|
|
2
|
+
import { a as SubscriptionId, n as ListSubscriptionsQuery, s as components, t as CreateSubscriptionBody } from "../types-DmzSFOhK.cjs";
|
|
3
3
|
//#region src/clients/notifications/notificationsClient.d.ts
|
|
4
4
|
declare const createNotificationsClient: ({ baseUrl, middlewares, auth }: ClientInitOptions) => {
|
|
5
5
|
healthCheck: (signal?: AbortSignal) => Promise<unknown>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as ClientInitOptions } from "../types-
|
|
2
|
-
import { a as SubscriptionId, n as ListSubscriptionsQuery, s as components, t as CreateSubscriptionBody } from "../types-
|
|
1
|
+
import { n as ClientInitOptions } from "../types-CeqZuOEC.js";
|
|
2
|
+
import { a as SubscriptionId, n as ListSubscriptionsQuery, s as components, t as CreateSubscriptionBody } from "../types-DlhNay1n.js";
|
|
3
3
|
//#region src/clients/notifications/notificationsClient.d.ts
|
|
4
4
|
declare const createNotificationsClient: ({ baseUrl, middlewares, auth }: ClientInitOptions) => {
|
|
5
5
|
healthCheck: (signal?: AbortSignal) => Promise<unknown>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as SubscriptionId, i as SubscriptionFilter, n as ListSubscriptionsQuery, o as SubscriptionRecipient, r as ProjectSubscription, t as CreateSubscriptionBody } from "../types-
|
|
1
|
+
import { a as SubscriptionId, i as SubscriptionFilter, n as ListSubscriptionsQuery, o as SubscriptionRecipient, r as ProjectSubscription, t as CreateSubscriptionBody } from "../types-DmzSFOhK.cjs";
|
|
2
2
|
export { CreateSubscriptionBody, ListSubscriptionsQuery, ProjectSubscription, SubscriptionFilter, SubscriptionId, SubscriptionRecipient };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as SubscriptionId, i as SubscriptionFilter, n as ListSubscriptionsQuery, o as SubscriptionRecipient, r as ProjectSubscription, t as CreateSubscriptionBody } from "../types-
|
|
1
|
+
import { a as SubscriptionId, i as SubscriptionFilter, n as ListSubscriptionsQuery, o as SubscriptionRecipient, r as ProjectSubscription, t as CreateSubscriptionBody } from "../types-DlhNay1n.js";
|
|
2
2
|
export { CreateSubscriptionBody, ListSubscriptionsQuery, ProjectSubscription, SubscriptionFilter, SubscriptionId, SubscriptionRecipient };
|
package/dist/oauth/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as ClientInitOptions } from "../types-
|
|
2
|
-
import { a as CredentialInput, c as GetCredentialsInput, r as CreateCredentialInput } from "../types-
|
|
1
|
+
import { n as ClientInitOptions } from "../types-O6XM48J8.cjs";
|
|
2
|
+
import { a as CredentialInput, c as GetCredentialsInput, r as CreateCredentialInput } from "../types-CTS2NSIb.cjs";
|
|
3
3
|
//#region src/clients/oauth/oauthClient.d.ts
|
|
4
4
|
declare const createOauthClient: ({ baseUrl, middlewares, auth }: ClientInitOptions) => {
|
|
5
5
|
healthCheck: (signal?: AbortSignal) => Promise<unknown>;
|
package/dist/oauth/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as ClientInitOptions } from "../types-
|
|
2
|
-
import { a as CredentialInput, c as GetCredentialsInput, r as CreateCredentialInput } from "../types-
|
|
1
|
+
import { n as ClientInitOptions } from "../types-CeqZuOEC.js";
|
|
2
|
+
import { a as CredentialInput, c as GetCredentialsInput, r as CreateCredentialInput } from "../types-BjwbzqJd.js";
|
|
3
3
|
//#region src/clients/oauth/oauthClient.d.ts
|
|
4
4
|
declare const createOauthClient: ({ baseUrl, middlewares, auth }: ClientInitOptions) => {
|
|
5
5
|
healthCheck: (signal?: AbortSignal) => Promise<unknown>;
|
package/dist/oauth/types.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as CredentialInput, c as GetCredentialsInput, i as Credential, n as CreateCredentialBody, o as CredentialPath, r as CreateCredentialInput, s as OrganizationConnection, t as ComponentPath } from "../types-
|
|
1
|
+
import { a as CredentialInput, c as GetCredentialsInput, i as Credential, n as CreateCredentialBody, o as CredentialPath, r as CreateCredentialInput, s as OrganizationConnection, t as ComponentPath } from "../types-CTS2NSIb.cjs";
|
|
2
2
|
export { ComponentPath, CreateCredentialBody, CreateCredentialInput, Credential, CredentialInput, CredentialPath, type GetCredentialsInput, OrganizationConnection };
|
package/dist/oauth/types.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as CredentialInput, c as GetCredentialsInput, i as Credential, n as CreateCredentialBody, o as CredentialPath, r as CreateCredentialInput, s as OrganizationConnection, t as ComponentPath } from "../types-
|
|
1
|
+
import { a as CredentialInput, c as GetCredentialsInput, i as Credential, n as CreateCredentialBody, o as CredentialPath, r as CreateCredentialInput, s as OrganizationConnection, t as ComponentPath } from "../types-BjwbzqJd.js";
|
|
2
2
|
export { ComponentPath, CreateCredentialBody, CreateCredentialInput, Credential, CredentialInput, CredentialPath, type GetCredentialsInput, OrganizationConnection };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as ClientInitOptions } from "../types-
|
|
2
|
-
import { h as components, m as TablesLineageResponse, n as GetTablesLineageQuery, t as GetProjectsLineageQuery } from "../types-
|
|
1
|
+
import { n as ClientInitOptions } from "../types-O6XM48J8.cjs";
|
|
2
|
+
import { h as components, m as TablesLineageResponse, n as GetTablesLineageQuery, t as GetProjectsLineageQuery } from "../types-vvw_H7wp.cjs";
|
|
3
3
|
//#region src/clients/omnisearch/omnisearchClient.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* Omnisearch — data lineage.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as ClientInitOptions } from "../types-
|
|
2
|
-
import { h as components, m as TablesLineageResponse, n as GetTablesLineageQuery, t as GetProjectsLineageQuery } from "../types-
|
|
1
|
+
import { n as ClientInitOptions } from "../types-CeqZuOEC.js";
|
|
2
|
+
import { h as components, m as TablesLineageResponse, n as GetTablesLineageQuery, t as GetProjectsLineageQuery } from "../types-D9ZKJYZk.js";
|
|
3
3
|
//#region src/clients/omnisearch/omnisearchClient.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* Omnisearch — data lineage.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as LineageMetadata, c as LineageTable, d as ProjectsLineageResponse, f as TableLineageRelation, i as LineageConfiguration, l as ProjectLineageRelation, m as TablesLineageResponse, n as GetTablesLineageQuery, o as LineageProject, p as TablesLineage, r as LineageBucket, s as LineageSource, t as GetProjectsLineageQuery, u as ProjectsLineage } from "../types-
|
|
1
|
+
import { a as LineageMetadata, c as LineageTable, d as ProjectsLineageResponse, f as TableLineageRelation, i as LineageConfiguration, l as ProjectLineageRelation, m as TablesLineageResponse, n as GetTablesLineageQuery, o as LineageProject, p as TablesLineage, r as LineageBucket, s as LineageSource, t as GetProjectsLineageQuery, u as ProjectsLineage } from "../types-vvw_H7wp.cjs";
|
|
2
2
|
export { GetProjectsLineageQuery, GetTablesLineageQuery, LineageBucket, LineageConfiguration, LineageMetadata, LineageProject, LineageSource, LineageTable, ProjectLineageRelation, ProjectsLineage, ProjectsLineageResponse, TableLineageRelation, TablesLineage, TablesLineageResponse };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as LineageMetadata, c as LineageTable, d as ProjectsLineageResponse, f as TableLineageRelation, i as LineageConfiguration, l as ProjectLineageRelation, m as TablesLineageResponse, n as GetTablesLineageQuery, o as LineageProject, p as TablesLineage, r as LineageBucket, s as LineageSource, t as GetProjectsLineageQuery, u as ProjectsLineage } from "../types-
|
|
1
|
+
import { a as LineageMetadata, c as LineageTable, d as ProjectsLineageResponse, f as TableLineageRelation, i as LineageConfiguration, l as ProjectLineageRelation, m as TablesLineageResponse, n as GetTablesLineageQuery, o as LineageProject, p as TablesLineage, r as LineageBucket, s as LineageSource, t as GetProjectsLineageQuery, u as ProjectsLineage } from "../types-D9ZKJYZk.js";
|
|
2
2
|
export { GetProjectsLineageQuery, GetTablesLineageQuery, LineageBucket, LineageConfiguration, LineageMetadata, LineageProject, LineageSource, LineageTable, ProjectLineageRelation, ProjectsLineage, ProjectsLineageResponse, TableLineageRelation, TablesLineage, TablesLineageResponse };
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { t as AdminRole } from "./adminRoles-B40yBcmq.js";
|
|
2
|
+
import { D as PermissionDeniedError, x as isAdminOrShare } from "./configurations-CL0ouUMa.js";
|
|
3
|
+
//#region src/domain/permissions/organization.ts
|
|
4
|
+
/**
|
|
5
|
+
* Whether this token's admin is a member of the organization owning the project.
|
|
6
|
+
*
|
|
7
|
+
* - A limited token has no `admin` block despite the type saying required.
|
|
8
|
+
* - Prefer `isOrganizationAdmin` for authorization decisions.
|
|
9
|
+
*/
|
|
10
|
+
const isOrganizationMember = (token) => token.isMasterToken && (token.admin?.isOrganizationMember ?? false);
|
|
11
|
+
/**
|
|
12
|
+
* `isOrganizationMember` AND `admin`/`share`.
|
|
13
|
+
*
|
|
14
|
+
* - An org member with a `readOnly` or `guest` role on this project still cannot write.
|
|
15
|
+
*/
|
|
16
|
+
const isOrganizationAdmin = (token) => isOrganizationMember(token) && isAdminOrShare(token);
|
|
17
|
+
const assertCanAdministerOrganization = (token) => {
|
|
18
|
+
if (!isOrganizationAdmin(token)) throw new PermissionDeniedError({
|
|
19
|
+
action: "administer-organization",
|
|
20
|
+
reason: token.isMasterToken ? `role '${token.admin?.role ?? "none"}' with isOrganizationMember=${token.admin?.isOrganizationMember ?? false} may not administer organization settings` : "a limited (non-master) token may not administer organization settings"
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Whether this token may write Kai's spend caps: project cap, default and per-user limits.
|
|
25
|
+
*
|
|
26
|
+
* - Org-admin only, stricter than `canWriteKaiSettings`: caps commit the org's money.
|
|
27
|
+
* - A project whose own admin could raise its cap has no cap.
|
|
28
|
+
*/
|
|
29
|
+
const canWriteKaiSpendCaps = (token) => isOrganizationAdmin(token);
|
|
30
|
+
const assertCanWriteKaiSpendCaps = (token) => {
|
|
31
|
+
if (!canWriteKaiSpendCaps(token)) throw new PermissionDeniedError({
|
|
32
|
+
action: "write-kai-spend-caps",
|
|
33
|
+
reason: token.isMasterToken ? `role '${token.admin?.role ?? "none"}' with isOrganizationMember=${token.admin?.isOrganizationMember ?? false} may not change Kai spend caps` : "a limited (non-master) token may not change Kai spend caps"
|
|
34
|
+
});
|
|
35
|
+
};
|
|
36
|
+
//#endregion
|
|
37
|
+
//#region src/domain/permissions/storage.ts
|
|
38
|
+
/** Mirrors Connection's `CanListShareOptions` voter: the `share` role, or organization membership. */
|
|
39
|
+
const canListSharingTargets = (token) => isOrganizationMember(token) || token.isMasterToken && token.admin?.role === AdminRole.Share;
|
|
40
|
+
//#endregion
|
|
41
|
+
//#region src/domain/project.ts
|
|
42
|
+
const hasFeature = (token, ...feature) => {
|
|
43
|
+
if (feature.length === 0) return false;
|
|
44
|
+
const projectFeatureSet = new Set(token.owner.features);
|
|
45
|
+
return feature.every((x) => projectFeatureSet.has(x));
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* The admin's features as the Storage token carries them.
|
|
49
|
+
*
|
|
50
|
+
* - The same list `createAdminAccount` reads from the Manage token: Connection serialises both
|
|
51
|
+
* from the admin row, so prefer the account where one is at hand — it also knows `isSuperAdmin`.
|
|
52
|
+
*/
|
|
53
|
+
const hasAdminFeature = (token, ...feature) => {
|
|
54
|
+
if (feature.length === 0) return false;
|
|
55
|
+
const adminFeatureSet = new Set(token.admin?.features ?? []);
|
|
56
|
+
return feature.every((x) => adminFeatureSet.has(x));
|
|
57
|
+
};
|
|
58
|
+
const createProject = ({ sapiToken }) => {
|
|
59
|
+
const { owner, admin } = sapiToken;
|
|
60
|
+
const projectFeatureSet = new Set(owner.features);
|
|
61
|
+
const adminFeatureSet = new Set(admin?.features ?? []);
|
|
62
|
+
const hasFeature = (...feature) => {
|
|
63
|
+
if (feature.length === 0) return false;
|
|
64
|
+
return feature.every((x) => projectFeatureSet.has(x));
|
|
65
|
+
};
|
|
66
|
+
const hasAdminFeature = (...feature) => {
|
|
67
|
+
if (feature.length === 0) return false;
|
|
68
|
+
return feature.every((x) => adminFeatureSet.has(x));
|
|
69
|
+
};
|
|
70
|
+
const hasBackend = (backend) => {
|
|
71
|
+
if (backend === "bigquery") return owner.hasBigquery;
|
|
72
|
+
if (backend === "snowflake") return owner.hasSnowflake;
|
|
73
|
+
return false;
|
|
74
|
+
};
|
|
75
|
+
return {
|
|
76
|
+
hasFeature,
|
|
77
|
+
hasAdminFeature,
|
|
78
|
+
hasBackend,
|
|
79
|
+
canListSharingTargets: canListSharingTargets(sapiToken),
|
|
80
|
+
sapiToken
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
//#endregion
|
|
84
|
+
export { assertCanAdministerOrganization as a, isOrganizationAdmin as c, canListSharingTargets as i, isOrganizationMember as l, hasAdminFeature as n, assertCanWriteKaiSpendCaps as o, hasFeature as r, canWriteKaiSpendCaps as s, createProject as t };
|
|
85
|
+
|
|
86
|
+
//# sourceMappingURL=project-ClH22nzH.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project-ClH22nzH.js","names":[],"sources":["../src/domain/permissions/organization.ts","../src/domain/permissions/storage.ts","../src/domain/project.ts"],"sourcesContent":["/**\n * @module domain/permissions/organization\n *\n * Organization-scope predicates, read from `admin.isOrganizationMember`, not the project role.\n * - In Keboola, org membership is org administration of every project the org owns.\n * - `isOrganizationMember` is a raw signal; nothing asserts on bare membership.\n */\nimport type { StorageToken } from '../../clients/storage/tokens/types';\n\nimport { isAdminOrShare } from './admin';\nimport { PermissionDeniedError } from './errors';\n\n/**\n * Whether this token's admin is a member of the organization owning the project.\n *\n * - A limited token has no `admin` block despite the type saying required.\n * - Prefer `isOrganizationAdmin` for authorization decisions.\n */\nexport const isOrganizationMember = (token: StorageToken): boolean =>\n token.isMasterToken && (token.admin?.isOrganizationMember ?? false);\n\n/**\n * `isOrganizationMember` AND `admin`/`share`.\n *\n * - An org member with a `readOnly` or `guest` role on this project still cannot write.\n */\nexport const isOrganizationAdmin = (token: StorageToken): boolean =>\n isOrganizationMember(token) && isAdminOrShare(token);\n\nexport const assertCanAdministerOrganization = (token: StorageToken): void => {\n if (!isOrganizationAdmin(token)) {\n throw new PermissionDeniedError({\n action: 'administer-organization',\n reason: token.isMasterToken\n ? `role '${token.admin?.role ?? 'none'}' with isOrganizationMember=${token.admin?.isOrganizationMember ?? false} may not administer organization settings`\n : 'a limited (non-master) token may not administer organization settings',\n });\n }\n};\n\n/**\n * Whether this token may write Kai's spend caps: project cap, default and per-user limits.\n *\n * - Org-admin only, stricter than `canWriteKaiSettings`: caps commit the org's money.\n * - A project whose own admin could raise its cap has no cap.\n */\nexport const canWriteKaiSpendCaps = (token: StorageToken): boolean => isOrganizationAdmin(token);\n\nexport const assertCanWriteKaiSpendCaps = (token: StorageToken): void => {\n if (!canWriteKaiSpendCaps(token)) {\n throw new PermissionDeniedError({\n action: 'write-kai-spend-caps',\n reason: token.isMasterToken\n ? `role '${token.admin?.role ?? 'none'}' with isOrganizationMember=${token.admin?.isOrganizationMember ?? false} may not change Kai spend caps`\n : 'a limited (non-master) token may not change Kai spend caps',\n });\n }\n};\n","/**\n * @module domain/permissions/storage\n *\n * Storage-scope predicates.\n */\nimport type { StorageToken } from '../../clients/storage/tokens/types';\nimport { AdminRole } from '../../constants/adminRoles';\n\nimport { isOrganizationMember } from './organization';\n\n/** Mirrors Connection's `CanListShareOptions` voter: the `share` role, or organization membership. */\nexport const canListSharingTargets = (token: StorageToken): boolean =>\n isOrganizationMember(token) || (token.isMasterToken && token.admin?.role === AdminRole.Share);\n","import type { Backend, StorageToken } from '../clients/storage/tokens/types';\n\nimport { canListSharingTargets } from './permissions/storage';\n\ntype Options = {\n sapiToken: StorageToken;\n};\n\nexport const hasFeature = (token: StorageToken, ...feature: string[]): boolean => {\n if (feature.length === 0) return false;\n const projectFeatureSet = new Set(token.owner.features);\n return feature.every((x) => projectFeatureSet.has(x));\n};\n\n/**\n * The admin's features as the Storage token carries them.\n *\n * - The same list `createAdminAccount` reads from the Manage token: Connection serialises both\n * from the admin row, so prefer the account where one is at hand — it also knows `isSuperAdmin`.\n */\nexport const hasAdminFeature = (token: StorageToken, ...feature: string[]): boolean => {\n if (feature.length === 0) return false;\n const adminFeatureSet = new Set(token.admin?.features ?? []);\n return feature.every((x) => adminFeatureSet.has(x));\n};\n\nexport const createProject = ({ sapiToken }: Options) => {\n const { owner, admin } = sapiToken;\n const projectFeatureSet = new Set(owner.features);\n // `verify` omits `admin` for a token created via `POST /v2/storage/tokens`, even though the type\n // declares it: an admin-less token holds no admin features, rather than failing to build at all.\n const adminFeatureSet = new Set(admin?.features ?? []);\n\n const hasFeature = (...feature: string[]) => {\n if (feature.length === 0) return false;\n return feature.every((x) => projectFeatureSet.has(x));\n };\n\n // Same list as `createAdminAccount`'s; prefer the account where one is at hand.\n const hasAdminFeature = (...feature: string[]) => {\n if (feature.length === 0) return false;\n return feature.every((x) => adminFeatureSet.has(x));\n };\n\n const hasBackend = (backend: Backend): boolean => {\n if (backend === 'bigquery') return owner.hasBigquery;\n if (backend === 'snowflake') return owner.hasSnowflake;\n return false;\n };\n\n return {\n hasFeature,\n hasAdminFeature,\n hasBackend,\n canListSharingTargets: canListSharingTargets(sapiToken),\n sapiToken,\n };\n};\n\nexport type Project = ReturnType<typeof createProject>;\n"],"mappings":";;;;;;;;;AAkBA,MAAa,wBAAwB,UACnC,MAAM,kBAAkB,MAAM,OAAO,wBAAwB;;;;;;AAO/D,MAAa,uBAAuB,UAClC,qBAAqB,KAAK,KAAK,eAAe,KAAK;AAErD,MAAa,mCAAmC,UAA8B;CAC5E,IAAI,CAAC,oBAAoB,KAAK,GAC5B,MAAM,IAAI,sBAAsB;EAC9B,QAAQ;EACR,QAAQ,MAAM,gBACV,SAAS,MAAM,OAAO,QAAQ,OAAO,8BAA8B,MAAM,OAAO,wBAAwB,MAAM,6CAC9G;CACN,CAAC;AAEL;;;;;;;AAQA,MAAa,wBAAwB,UAAiC,oBAAoB,KAAK;AAE/F,MAAa,8BAA8B,UAA8B;CACvE,IAAI,CAAC,qBAAqB,KAAK,GAC7B,MAAM,IAAI,sBAAsB;EAC9B,QAAQ;EACR,QAAQ,MAAM,gBACV,SAAS,MAAM,OAAO,QAAQ,OAAO,8BAA8B,MAAM,OAAO,wBAAwB,MAAM,kCAC9G;CACN,CAAC;AAEL;;;;AC9CA,MAAa,yBAAyB,UACpC,qBAAqB,KAAK,KAAM,MAAM,iBAAiB,MAAM,OAAO,SAAS,UAAU;;;ACJzF,MAAa,cAAc,OAAqB,GAAG,YAA+B;CAChF,IAAI,QAAQ,WAAW,GAAG,OAAO;CACjC,MAAM,oBAAoB,IAAI,IAAI,MAAM,MAAM,QAAQ;CACtD,OAAO,QAAQ,OAAO,MAAM,kBAAkB,IAAI,CAAC,CAAC;AACtD;;;;;;;AAQA,MAAa,mBAAmB,OAAqB,GAAG,YAA+B;CACrF,IAAI,QAAQ,WAAW,GAAG,OAAO;CACjC,MAAM,kBAAkB,IAAI,IAAI,MAAM,OAAO,YAAY,CAAC,CAAC;CAC3D,OAAO,QAAQ,OAAO,MAAM,gBAAgB,IAAI,CAAC,CAAC;AACpD;AAEA,MAAa,iBAAiB,EAAE,gBAAyB;CACvD,MAAM,EAAE,OAAO,UAAU;CACzB,MAAM,oBAAoB,IAAI,IAAI,MAAM,QAAQ;CAGhD,MAAM,kBAAkB,IAAI,IAAI,OAAO,YAAY,CAAC,CAAC;CAErD,MAAM,cAAc,GAAG,YAAsB;EAC3C,IAAI,QAAQ,WAAW,GAAG,OAAO;EACjC,OAAO,QAAQ,OAAO,MAAM,kBAAkB,IAAI,CAAC,CAAC;CACtD;CAGA,MAAM,mBAAmB,GAAG,YAAsB;EAChD,IAAI,QAAQ,WAAW,GAAG,OAAO;EACjC,OAAO,QAAQ,OAAO,MAAM,gBAAgB,IAAI,CAAC,CAAC;CACpD;CAEA,MAAM,cAAc,YAA8B;EAChD,IAAI,YAAY,YAAY,OAAO,MAAM;EACzC,IAAI,YAAY,aAAa,OAAO,MAAM;EAC1C,OAAO;CACT;CAEA,OAAO;EACL;EACA;EACA;EACA,uBAAuB,sBAAsB,SAAS;EACtD;CACF;AACF"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Lr as paths, c as OpenapiQueryType, l as OpenapiReturnType, r as OpenapiBodyType, s as OpenapiPathType } from "./index-
|
|
2
|
-
import "./adminRoles-
|
|
1
|
+
import { Lr as paths, c as OpenapiQueryType, l as OpenapiReturnType, r as OpenapiBodyType, s as OpenapiPathType } from "./index-BPMr8PQJ.js";
|
|
2
|
+
import "./adminRoles-BX1gk3At.js";
|
|
3
3
|
import { t as Backend } from "./backends-DKBz5OxE.js";
|
|
4
4
|
//#region src/clients/storage/tokens/types.d.ts
|
|
5
5
|
type ProjectId = number;
|
|
@@ -66,9 +66,10 @@ declare const createProject: ({ sapiToken }: Options) => {
|
|
|
66
66
|
hasFeature: (...feature: string[]) => boolean;
|
|
67
67
|
hasAdminFeature: (...feature: string[]) => boolean;
|
|
68
68
|
hasBackend: (backend: Backend) => boolean;
|
|
69
|
+
canListSharingTargets: boolean;
|
|
69
70
|
sapiToken: StorageToken;
|
|
70
71
|
};
|
|
71
72
|
type Project = ReturnType<typeof createProject>;
|
|
72
73
|
//#endregion
|
|
73
74
|
export { UpdateTokenInput as _, CreateTokenResponse as a, GetTokenEventsPath as c, ShareTokenInput as d, ShareTokenPath as f, UpdateTokenBody as g, TokenListItem as h, CreateTokenBody as i, ProjectId as l, StorageTokenRaw as m, hasAdminFeature as n, CreateTokenSchemaBody as o, StorageToken as p, hasFeature as r, GetTokenEventsInput as s, Project as t, ShareTokenBody as u, UpdateTokenPath as v, UpdateTokenSchemaBody as y };
|
|
74
|
-
//# sourceMappingURL=project-
|
|
75
|
+
//# sourceMappingURL=project-DTfBtIJs.d.ts.map
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
const require_adminRoles = require("./adminRoles-CO7J5qAy.cjs");
|
|
2
|
+
const require_configurations = require("./configurations-D9J3jh3g.cjs");
|
|
3
|
+
//#region src/domain/permissions/organization.ts
|
|
4
|
+
/**
|
|
5
|
+
* Whether this token's admin is a member of the organization owning the project.
|
|
6
|
+
*
|
|
7
|
+
* - A limited token has no `admin` block despite the type saying required.
|
|
8
|
+
* - Prefer `isOrganizationAdmin` for authorization decisions.
|
|
9
|
+
*/
|
|
10
|
+
const isOrganizationMember = (token) => token.isMasterToken && (token.admin?.isOrganizationMember ?? false);
|
|
11
|
+
/**
|
|
12
|
+
* `isOrganizationMember` AND `admin`/`share`.
|
|
13
|
+
*
|
|
14
|
+
* - An org member with a `readOnly` or `guest` role on this project still cannot write.
|
|
15
|
+
*/
|
|
16
|
+
const isOrganizationAdmin = (token) => isOrganizationMember(token) && require_configurations.isAdminOrShare(token);
|
|
17
|
+
const assertCanAdministerOrganization = (token) => {
|
|
18
|
+
if (!isOrganizationAdmin(token)) throw new require_configurations.PermissionDeniedError({
|
|
19
|
+
action: "administer-organization",
|
|
20
|
+
reason: token.isMasterToken ? `role '${token.admin?.role ?? "none"}' with isOrganizationMember=${token.admin?.isOrganizationMember ?? false} may not administer organization settings` : "a limited (non-master) token may not administer organization settings"
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Whether this token may write Kai's spend caps: project cap, default and per-user limits.
|
|
25
|
+
*
|
|
26
|
+
* - Org-admin only, stricter than `canWriteKaiSettings`: caps commit the org's money.
|
|
27
|
+
* - A project whose own admin could raise its cap has no cap.
|
|
28
|
+
*/
|
|
29
|
+
const canWriteKaiSpendCaps = (token) => isOrganizationAdmin(token);
|
|
30
|
+
const assertCanWriteKaiSpendCaps = (token) => {
|
|
31
|
+
if (!canWriteKaiSpendCaps(token)) throw new require_configurations.PermissionDeniedError({
|
|
32
|
+
action: "write-kai-spend-caps",
|
|
33
|
+
reason: token.isMasterToken ? `role '${token.admin?.role ?? "none"}' with isOrganizationMember=${token.admin?.isOrganizationMember ?? false} may not change Kai spend caps` : "a limited (non-master) token may not change Kai spend caps"
|
|
34
|
+
});
|
|
35
|
+
};
|
|
36
|
+
//#endregion
|
|
37
|
+
//#region src/domain/permissions/storage.ts
|
|
38
|
+
/** Mirrors Connection's `CanListShareOptions` voter: the `share` role, or organization membership. */
|
|
39
|
+
const canListSharingTargets = (token) => isOrganizationMember(token) || token.isMasterToken && token.admin?.role === require_adminRoles.AdminRole.Share;
|
|
40
|
+
//#endregion
|
|
41
|
+
//#region src/domain/project.ts
|
|
42
|
+
const hasFeature = (token, ...feature) => {
|
|
43
|
+
if (feature.length === 0) return false;
|
|
44
|
+
const projectFeatureSet = new Set(token.owner.features);
|
|
45
|
+
return feature.every((x) => projectFeatureSet.has(x));
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* The admin's features as the Storage token carries them.
|
|
49
|
+
*
|
|
50
|
+
* - The same list `createAdminAccount` reads from the Manage token: Connection serialises both
|
|
51
|
+
* from the admin row, so prefer the account where one is at hand — it also knows `isSuperAdmin`.
|
|
52
|
+
*/
|
|
53
|
+
const hasAdminFeature = (token, ...feature) => {
|
|
54
|
+
if (feature.length === 0) return false;
|
|
55
|
+
const adminFeatureSet = new Set(token.admin?.features ?? []);
|
|
56
|
+
return feature.every((x) => adminFeatureSet.has(x));
|
|
57
|
+
};
|
|
58
|
+
const createProject = ({ sapiToken }) => {
|
|
59
|
+
const { owner, admin } = sapiToken;
|
|
60
|
+
const projectFeatureSet = new Set(owner.features);
|
|
61
|
+
const adminFeatureSet = new Set(admin?.features ?? []);
|
|
62
|
+
const hasFeature = (...feature) => {
|
|
63
|
+
if (feature.length === 0) return false;
|
|
64
|
+
return feature.every((x) => projectFeatureSet.has(x));
|
|
65
|
+
};
|
|
66
|
+
const hasAdminFeature = (...feature) => {
|
|
67
|
+
if (feature.length === 0) return false;
|
|
68
|
+
return feature.every((x) => adminFeatureSet.has(x));
|
|
69
|
+
};
|
|
70
|
+
const hasBackend = (backend) => {
|
|
71
|
+
if (backend === "bigquery") return owner.hasBigquery;
|
|
72
|
+
if (backend === "snowflake") return owner.hasSnowflake;
|
|
73
|
+
return false;
|
|
74
|
+
};
|
|
75
|
+
return {
|
|
76
|
+
hasFeature,
|
|
77
|
+
hasAdminFeature,
|
|
78
|
+
hasBackend,
|
|
79
|
+
canListSharingTargets: canListSharingTargets(sapiToken),
|
|
80
|
+
sapiToken
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
//#endregion
|
|
84
|
+
Object.defineProperty(exports, "assertCanAdministerOrganization", {
|
|
85
|
+
enumerable: true,
|
|
86
|
+
get: function() {
|
|
87
|
+
return assertCanAdministerOrganization;
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
Object.defineProperty(exports, "assertCanWriteKaiSpendCaps", {
|
|
91
|
+
enumerable: true,
|
|
92
|
+
get: function() {
|
|
93
|
+
return assertCanWriteKaiSpendCaps;
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
Object.defineProperty(exports, "canListSharingTargets", {
|
|
97
|
+
enumerable: true,
|
|
98
|
+
get: function() {
|
|
99
|
+
return canListSharingTargets;
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
Object.defineProperty(exports, "canWriteKaiSpendCaps", {
|
|
103
|
+
enumerable: true,
|
|
104
|
+
get: function() {
|
|
105
|
+
return canWriteKaiSpendCaps;
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
Object.defineProperty(exports, "createProject", {
|
|
109
|
+
enumerable: true,
|
|
110
|
+
get: function() {
|
|
111
|
+
return createProject;
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
Object.defineProperty(exports, "hasAdminFeature", {
|
|
115
|
+
enumerable: true,
|
|
116
|
+
get: function() {
|
|
117
|
+
return hasAdminFeature;
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
Object.defineProperty(exports, "hasFeature", {
|
|
121
|
+
enumerable: true,
|
|
122
|
+
get: function() {
|
|
123
|
+
return hasFeature;
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
Object.defineProperty(exports, "isOrganizationAdmin", {
|
|
127
|
+
enumerable: true,
|
|
128
|
+
get: function() {
|
|
129
|
+
return isOrganizationAdmin;
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
Object.defineProperty(exports, "isOrganizationMember", {
|
|
133
|
+
enumerable: true,
|
|
134
|
+
get: function() {
|
|
135
|
+
return isOrganizationMember;
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
//# sourceMappingURL=project-Rh4nXiWh.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project-Rh4nXiWh.cjs","names":["isAdminOrShare","PermissionDeniedError","AdminRole"],"sources":["../src/domain/permissions/organization.ts","../src/domain/permissions/storage.ts","../src/domain/project.ts"],"sourcesContent":["/**\n * @module domain/permissions/organization\n *\n * Organization-scope predicates, read from `admin.isOrganizationMember`, not the project role.\n * - In Keboola, org membership is org administration of every project the org owns.\n * - `isOrganizationMember` is a raw signal; nothing asserts on bare membership.\n */\nimport type { StorageToken } from '../../clients/storage/tokens/types';\n\nimport { isAdminOrShare } from './admin';\nimport { PermissionDeniedError } from './errors';\n\n/**\n * Whether this token's admin is a member of the organization owning the project.\n *\n * - A limited token has no `admin` block despite the type saying required.\n * - Prefer `isOrganizationAdmin` for authorization decisions.\n */\nexport const isOrganizationMember = (token: StorageToken): boolean =>\n token.isMasterToken && (token.admin?.isOrganizationMember ?? false);\n\n/**\n * `isOrganizationMember` AND `admin`/`share`.\n *\n * - An org member with a `readOnly` or `guest` role on this project still cannot write.\n */\nexport const isOrganizationAdmin = (token: StorageToken): boolean =>\n isOrganizationMember(token) && isAdminOrShare(token);\n\nexport const assertCanAdministerOrganization = (token: StorageToken): void => {\n if (!isOrganizationAdmin(token)) {\n throw new PermissionDeniedError({\n action: 'administer-organization',\n reason: token.isMasterToken\n ? `role '${token.admin?.role ?? 'none'}' with isOrganizationMember=${token.admin?.isOrganizationMember ?? false} may not administer organization settings`\n : 'a limited (non-master) token may not administer organization settings',\n });\n }\n};\n\n/**\n * Whether this token may write Kai's spend caps: project cap, default and per-user limits.\n *\n * - Org-admin only, stricter than `canWriteKaiSettings`: caps commit the org's money.\n * - A project whose own admin could raise its cap has no cap.\n */\nexport const canWriteKaiSpendCaps = (token: StorageToken): boolean => isOrganizationAdmin(token);\n\nexport const assertCanWriteKaiSpendCaps = (token: StorageToken): void => {\n if (!canWriteKaiSpendCaps(token)) {\n throw new PermissionDeniedError({\n action: 'write-kai-spend-caps',\n reason: token.isMasterToken\n ? `role '${token.admin?.role ?? 'none'}' with isOrganizationMember=${token.admin?.isOrganizationMember ?? false} may not change Kai spend caps`\n : 'a limited (non-master) token may not change Kai spend caps',\n });\n }\n};\n","/**\n * @module domain/permissions/storage\n *\n * Storage-scope predicates.\n */\nimport type { StorageToken } from '../../clients/storage/tokens/types';\nimport { AdminRole } from '../../constants/adminRoles';\n\nimport { isOrganizationMember } from './organization';\n\n/** Mirrors Connection's `CanListShareOptions` voter: the `share` role, or organization membership. */\nexport const canListSharingTargets = (token: StorageToken): boolean =>\n isOrganizationMember(token) || (token.isMasterToken && token.admin?.role === AdminRole.Share);\n","import type { Backend, StorageToken } from '../clients/storage/tokens/types';\n\nimport { canListSharingTargets } from './permissions/storage';\n\ntype Options = {\n sapiToken: StorageToken;\n};\n\nexport const hasFeature = (token: StorageToken, ...feature: string[]): boolean => {\n if (feature.length === 0) return false;\n const projectFeatureSet = new Set(token.owner.features);\n return feature.every((x) => projectFeatureSet.has(x));\n};\n\n/**\n * The admin's features as the Storage token carries them.\n *\n * - The same list `createAdminAccount` reads from the Manage token: Connection serialises both\n * from the admin row, so prefer the account where one is at hand — it also knows `isSuperAdmin`.\n */\nexport const hasAdminFeature = (token: StorageToken, ...feature: string[]): boolean => {\n if (feature.length === 0) return false;\n const adminFeatureSet = new Set(token.admin?.features ?? []);\n return feature.every((x) => adminFeatureSet.has(x));\n};\n\nexport const createProject = ({ sapiToken }: Options) => {\n const { owner, admin } = sapiToken;\n const projectFeatureSet = new Set(owner.features);\n // `verify` omits `admin` for a token created via `POST /v2/storage/tokens`, even though the type\n // declares it: an admin-less token holds no admin features, rather than failing to build at all.\n const adminFeatureSet = new Set(admin?.features ?? []);\n\n const hasFeature = (...feature: string[]) => {\n if (feature.length === 0) return false;\n return feature.every((x) => projectFeatureSet.has(x));\n };\n\n // Same list as `createAdminAccount`'s; prefer the account where one is at hand.\n const hasAdminFeature = (...feature: string[]) => {\n if (feature.length === 0) return false;\n return feature.every((x) => adminFeatureSet.has(x));\n };\n\n const hasBackend = (backend: Backend): boolean => {\n if (backend === 'bigquery') return owner.hasBigquery;\n if (backend === 'snowflake') return owner.hasSnowflake;\n return false;\n };\n\n return {\n hasFeature,\n hasAdminFeature,\n hasBackend,\n canListSharingTargets: canListSharingTargets(sapiToken),\n sapiToken,\n };\n};\n\nexport type Project = ReturnType<typeof createProject>;\n"],"mappings":";;;;;;;;;AAkBA,MAAa,wBAAwB,UACnC,MAAM,kBAAkB,MAAM,OAAO,wBAAwB;;;;;;AAO/D,MAAa,uBAAuB,UAClC,qBAAqB,KAAK,KAAKA,uBAAAA,eAAe,KAAK;AAErD,MAAa,mCAAmC,UAA8B;CAC5E,IAAI,CAAC,oBAAoB,KAAK,GAC5B,MAAM,IAAIC,uBAAAA,sBAAsB;EAC9B,QAAQ;EACR,QAAQ,MAAM,gBACV,SAAS,MAAM,OAAO,QAAQ,OAAO,8BAA8B,MAAM,OAAO,wBAAwB,MAAM,6CAC9G;CACN,CAAC;AAEL;;;;;;;AAQA,MAAa,wBAAwB,UAAiC,oBAAoB,KAAK;AAE/F,MAAa,8BAA8B,UAA8B;CACvE,IAAI,CAAC,qBAAqB,KAAK,GAC7B,MAAM,IAAIA,uBAAAA,sBAAsB;EAC9B,QAAQ;EACR,QAAQ,MAAM,gBACV,SAAS,MAAM,OAAO,QAAQ,OAAO,8BAA8B,MAAM,OAAO,wBAAwB,MAAM,kCAC9G;CACN,CAAC;AAEL;;;;AC9CA,MAAa,yBAAyB,UACpC,qBAAqB,KAAK,KAAM,MAAM,iBAAiB,MAAM,OAAO,SAASC,mBAAAA,UAAU;;;ACJzF,MAAa,cAAc,OAAqB,GAAG,YAA+B;CAChF,IAAI,QAAQ,WAAW,GAAG,OAAO;CACjC,MAAM,oBAAoB,IAAI,IAAI,MAAM,MAAM,QAAQ;CACtD,OAAO,QAAQ,OAAO,MAAM,kBAAkB,IAAI,CAAC,CAAC;AACtD;;;;;;;AAQA,MAAa,mBAAmB,OAAqB,GAAG,YAA+B;CACrF,IAAI,QAAQ,WAAW,GAAG,OAAO;CACjC,MAAM,kBAAkB,IAAI,IAAI,MAAM,OAAO,YAAY,CAAC,CAAC;CAC3D,OAAO,QAAQ,OAAO,MAAM,gBAAgB,IAAI,CAAC,CAAC;AACpD;AAEA,MAAa,iBAAiB,EAAE,gBAAyB;CACvD,MAAM,EAAE,OAAO,UAAU;CACzB,MAAM,oBAAoB,IAAI,IAAI,MAAM,QAAQ;CAGhD,MAAM,kBAAkB,IAAI,IAAI,OAAO,YAAY,CAAC,CAAC;CAErD,MAAM,cAAc,GAAG,YAAsB;EAC3C,IAAI,QAAQ,WAAW,GAAG,OAAO;EACjC,OAAO,QAAQ,OAAO,MAAM,kBAAkB,IAAI,CAAC,CAAC;CACtD;CAGA,MAAM,mBAAmB,GAAG,YAAsB;EAChD,IAAI,QAAQ,WAAW,GAAG,OAAO;EACjC,OAAO,QAAQ,OAAO,MAAM,gBAAgB,IAAI,CAAC,CAAC;CACpD;CAEA,MAAM,cAAc,YAA8B;EAChD,IAAI,YAAY,YAAY,OAAO,MAAM;EACzC,IAAI,YAAY,aAAa,OAAO,MAAM;EAC1C,OAAO;CACT;CAEA,OAAO;EACL;EACA;EACA;EACA,uBAAuB,sBAAsB,SAAS;EACtD;CACF;AACF"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Lr as paths, c as OpenapiQueryType, l as OpenapiReturnType, r as OpenapiBodyType, s as OpenapiPathType } from "./index-
|
|
2
|
-
import "./adminRoles-
|
|
1
|
+
import { Lr as paths, c as OpenapiQueryType, l as OpenapiReturnType, r as OpenapiBodyType, s as OpenapiPathType } from "./index-CL4iKFic.cjs";
|
|
2
|
+
import "./adminRoles-BbxFgfX-.cjs";
|
|
3
3
|
import { t as Backend } from "./backends-DKBz5OxE.cjs";
|
|
4
4
|
//#region src/clients/storage/tokens/types.d.ts
|
|
5
5
|
type ProjectId = number;
|
|
@@ -66,9 +66,10 @@ declare const createProject: ({ sapiToken }: Options) => {
|
|
|
66
66
|
hasFeature: (...feature: string[]) => boolean;
|
|
67
67
|
hasAdminFeature: (...feature: string[]) => boolean;
|
|
68
68
|
hasBackend: (backend: Backend) => boolean;
|
|
69
|
+
canListSharingTargets: boolean;
|
|
69
70
|
sapiToken: StorageToken;
|
|
70
71
|
};
|
|
71
72
|
type Project = ReturnType<typeof createProject>;
|
|
72
73
|
//#endregion
|
|
73
74
|
export { UpdateTokenInput as _, CreateTokenResponse as a, GetTokenEventsPath as c, ShareTokenInput as d, ShareTokenPath as f, UpdateTokenBody as g, TokenListItem as h, CreateTokenBody as i, ProjectId as l, StorageTokenRaw as m, hasAdminFeature as n, CreateTokenSchemaBody as o, StorageToken as p, hasFeature as r, GetTokenEventsInput as s, Project as t, ShareTokenBody as u, UpdateTokenPath as v, UpdateTokenSchemaBody as y };
|
|
74
|
-
//# sourceMappingURL=project-
|
|
75
|
+
//# sourceMappingURL=project-vOnvjo80.d.cts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { S as createQueryServiceClient } from "../index-
|
|
1
|
+
import { S as createQueryServiceClient } from "../index-Be2dNJ_N.cjs";
|
|
2
2
|
export { createQueryServiceClient };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { S as createQueryServiceClient } from "../index-
|
|
1
|
+
import { S as createQueryServiceClient } from "../index-uGRdAORl.js";
|
|
2
2
|
export { createQueryServiceClient };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as PostQueryBody, G as GetExportResultsQuery, J as GetQueryJobPath, K as GetQueriesHistoryQuery, Q as PostCancelQueryJobPath, U as QueryJobPollOptions, W as ExportResultsResponse, X as GetQueryResutsQuery, Y as GetQueryResultsPath, Z as JobStatusResponse, et as PostQueryPath, nt as QueryResult, q as GetQueriesPath, rt as Statements, tt as QueryJobStatus } from "../index-Be2dNJ_N.cjs";
|
|
2
2
|
export { ExportResultsResponse, GetExportResultsQuery, GetQueriesHistoryQuery, GetQueriesPath, GetQueryJobPath, GetQueryResultsPath, GetQueryResutsQuery, JobStatusResponse, PostCancelQueryJobPath, PostQueryBody, PostQueryPath, type QueryJobPollOptions, QueryJobStatus, QueryResult, Statements };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as PostQueryBody, G as GetExportResultsQuery, J as GetQueryJobPath, K as GetQueriesHistoryQuery, Q as PostCancelQueryJobPath, U as QueryJobPollOptions, W as ExportResultsResponse, X as GetQueryResutsQuery, Y as GetQueryResultsPath, Z as JobStatusResponse, et as PostQueryPath, nt as QueryResult, q as GetQueriesPath, rt as Statements, tt as QueryJobStatus } from "../index-uGRdAORl.js";
|
|
2
2
|
export { ExportResultsResponse, GetExportResultsQuery, GetQueriesHistoryQuery, GetQueriesPath, GetQueryJobPath, GetQueryResultsPath, GetQueryResutsQuery, JobStatusResponse, PostCancelQueryJobPath, PostQueryBody, PostQueryPath, type QueryJobPollOptions, QueryJobStatus, QueryResult, Statements };
|
package/dist/queue/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Br as CreateJobBody, Hr as KillJobPath, Jr as SearchGroupedJobsQuery, Qr as components, Vr as GetQueueJobPath, Wr as OrchestrationRerunPlanPath, Xr as SearchJobsQuery, qr as SearchAllJobsQuery } from "../index-
|
|
2
|
-
import {
|
|
3
|
-
import { n as ClientInitOptions } from "../types-
|
|
1
|
+
import { Br as CreateJobBody, Hr as KillJobPath, Jr as SearchGroupedJobsQuery, Qr as components, Vr as GetQueueJobPath, Wr as OrchestrationRerunPlanPath, Xr as SearchJobsQuery, qr as SearchAllJobsQuery } from "../index-CL4iKFic.cjs";
|
|
2
|
+
import { Xt as Poller } from "../index-Be2dNJ_N.cjs";
|
|
3
|
+
import { n as ClientInitOptions } from "../types-O6XM48J8.cjs";
|
|
4
4
|
//#region src/clients/queue/queueClient.d.ts
|
|
5
5
|
declare const createQueueClient: ({ baseUrl, middlewares, auth }: ClientInitOptions) => {
|
|
6
6
|
healthCheck: (signal?: AbortSignal) => Promise<unknown>;
|
package/dist/queue/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Br as CreateJobBody, Hr as KillJobPath, Jr as SearchGroupedJobsQuery, Qr as components, Vr as GetQueueJobPath, Wr as OrchestrationRerunPlanPath, Xr as SearchJobsQuery, qr as SearchAllJobsQuery } from "../index-
|
|
2
|
-
import {
|
|
3
|
-
import { n as ClientInitOptions } from "../types-
|
|
1
|
+
import { Br as CreateJobBody, Hr as KillJobPath, Jr as SearchGroupedJobsQuery, Qr as components, Vr as GetQueueJobPath, Wr as OrchestrationRerunPlanPath, Xr as SearchJobsQuery, qr as SearchAllJobsQuery } from "../index-BPMr8PQJ.js";
|
|
2
|
+
import { Xt as Poller } from "../index-uGRdAORl.js";
|
|
3
|
+
import { n as ClientInitOptions } from "../types-CeqZuOEC.js";
|
|
4
4
|
//#region src/clients/queue/queueClient.d.ts
|
|
5
5
|
declare const createQueueClient: ({ baseUrl, middlewares, auth }: ClientInitOptions) => {
|
|
6
6
|
healthCheck: (signal?: AbortSignal) => Promise<unknown>;
|
package/dist/queue/types.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Br as CreateJobBody, Gr as QueueJob, Hr as KillJobPath, Jr as SearchGroupedJobsQuery, Kr as QueueJobStatus, Ur as OrchestrationRerunPlan, Vr as GetQueueJobPath, Wr as OrchestrationRerunPlanPath, Xr as SearchJobsQuery, Yr as SearchGroupedJobsResponse, Zr as SearchJobsResponse, qr as SearchAllJobsQuery } from "../index-
|
|
1
|
+
import { Br as CreateJobBody, Gr as QueueJob, Hr as KillJobPath, Jr as SearchGroupedJobsQuery, Kr as QueueJobStatus, Ur as OrchestrationRerunPlan, Vr as GetQueueJobPath, Wr as OrchestrationRerunPlanPath, Xr as SearchJobsQuery, Yr as SearchGroupedJobsResponse, Zr as SearchJobsResponse, qr as SearchAllJobsQuery } from "../index-CL4iKFic.cjs";
|
|
2
2
|
export { CreateJobBody, GetQueueJobPath, KillJobPath, OrchestrationRerunPlan, OrchestrationRerunPlanPath, QueueJob, QueueJobStatus, SearchAllJobsQuery, SearchGroupedJobsQuery, SearchGroupedJobsResponse, SearchJobsQuery, SearchJobsResponse };
|
package/dist/queue/types.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Br as CreateJobBody, Gr as QueueJob, Hr as KillJobPath, Jr as SearchGroupedJobsQuery, Kr as QueueJobStatus, Ur as OrchestrationRerunPlan, Vr as GetQueueJobPath, Wr as OrchestrationRerunPlanPath, Xr as SearchJobsQuery, Yr as SearchGroupedJobsResponse, Zr as SearchJobsResponse, qr as SearchAllJobsQuery } from "../index-
|
|
1
|
+
import { Br as CreateJobBody, Gr as QueueJob, Hr as KillJobPath, Jr as SearchGroupedJobsQuery, Kr as QueueJobStatus, Ur as OrchestrationRerunPlan, Vr as GetQueueJobPath, Wr as OrchestrationRerunPlanPath, Xr as SearchJobsQuery, Yr as SearchGroupedJobsResponse, Zr as SearchJobsResponse, qr as SearchAllJobsQuery } from "../index-BPMr8PQJ.js";
|
|
2
2
|
export { CreateJobBody, GetQueueJobPath, KillJobPath, OrchestrationRerunPlan, OrchestrationRerunPlanPath, QueueJob, QueueJobStatus, SearchAllJobsQuery, SearchGroupedJobsQuery, SearchGroupedJobsResponse, SearchJobsQuery, SearchJobsResponse };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as ClientInitOptions } from "../types-
|
|
2
|
-
import { a as SchedulePath, n as ConfigurationPath, r as GetSchedulesQuery, t as ActivateScheduleBody } from "../types-
|
|
1
|
+
import { n as ClientInitOptions } from "../types-O6XM48J8.cjs";
|
|
2
|
+
import { a as SchedulePath, n as ConfigurationPath, r as GetSchedulesQuery, t as ActivateScheduleBody } from "../types-C614wC5h.cjs";
|
|
3
3
|
//#region src/clients/scheduler/schedulerClient.d.ts
|
|
4
4
|
declare const createSchedulerClient: ({ baseUrl, middlewares, auth }: ClientInitOptions) => {
|
|
5
5
|
healthCheck: (signal?: AbortSignal) => Promise<unknown>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as ClientInitOptions } from "../types-
|
|
2
|
-
import { a as SchedulePath, n as ConfigurationPath, r as GetSchedulesQuery, t as ActivateScheduleBody } from "../types-
|
|
1
|
+
import { n as ClientInitOptions } from "../types-CeqZuOEC.js";
|
|
2
|
+
import { a as SchedulePath, n as ConfigurationPath, r as GetSchedulesQuery, t as ActivateScheduleBody } from "../types-45O2dU2w.js";
|
|
3
3
|
//#region src/clients/scheduler/schedulerClient.d.ts
|
|
4
4
|
declare const createSchedulerClient: ({ baseUrl, middlewares, auth }: ClientInitOptions) => {
|
|
5
5
|
healthCheck: (signal?: AbortSignal) => Promise<unknown>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as SchedulePath, i as Schedule, n as ConfigurationPath, o as Schedules, r as GetSchedulesQuery, t as ActivateScheduleBody } from "../types-
|
|
1
|
+
import { a as SchedulePath, i as Schedule, n as ConfigurationPath, o as Schedules, r as GetSchedulesQuery, t as ActivateScheduleBody } from "../types-C614wC5h.cjs";
|
|
2
2
|
export { ActivateScheduleBody, ConfigurationPath, GetSchedulesQuery, Schedule, SchedulePath, Schedules };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as SchedulePath, i as Schedule, n as ConfigurationPath, o as Schedules, r as GetSchedulesQuery, t as ActivateScheduleBody } from "../types-
|
|
1
|
+
import { a as SchedulePath, i as Schedule, n as ConfigurationPath, o as Schedules, r as GetSchedulesQuery, t as ActivateScheduleBody } from "../types-45O2dU2w.js";
|
|
2
2
|
export { ActivateScheduleBody, ConfigurationPath, GetSchedulesQuery, Schedule, SchedulePath, Schedules };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_configurations = require("../../configurations-
|
|
2
|
+
const require_configurations = require("../../configurations-Dkxsa3Uf.cjs");
|
|
3
3
|
exports.createConfigurationSdk = require_configurations.createConfigurationSdk;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as Project } from "../../project-
|
|
1
|
+
import { It as createDefaultBranch, Mo as BaseComponentConfig, Uo as CreateConfigurationInput, Vo as ConfigurationPath, dt as RegisteredComponentId, ft as registry, ps as UpdateConfigurationInput, t as createEncryptionClient, y as createStorageClient } from "../../index-Be2dNJ_N.cjs";
|
|
2
|
+
import { t as Project } from "../../project-vOnvjo80.cjs";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
//#region src/sdks/configurations/configurationsSdk.d.ts
|
|
5
5
|
type ConfigurationSdkContext = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as Project } from "../../project-
|
|
1
|
+
import { It as createDefaultBranch, Mo as BaseComponentConfig, Uo as CreateConfigurationInput, Vo as ConfigurationPath, dt as RegisteredComponentId, ft as registry, ps as UpdateConfigurationInput, t as createEncryptionClient, y as createStorageClient } from "../../index-uGRdAORl.js";
|
|
2
|
+
import { t as Project } from "../../project-DTfBtIJs.js";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
//#region src/sdks/configurations/configurationsSdk.d.ts
|
|
5
5
|
type ConfigurationSdkContext = {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as createConfigurationSdk } from "../../configurations-
|
|
1
|
+
import { t as createConfigurationSdk } from "../../configurations-B44z6BSO.js";
|
|
2
2
|
export { createConfigurationSdk };
|