@intlayer/design-system 4.1.7 → 4.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.vite/manifest.json +12 -12
- package/dist/components/Auth/ExternalsLoginButtons/ExternalsLoginButtons.cjs +2 -1
- package/dist/components/Auth/ExternalsLoginButtons/ExternalsLoginButtons.cjs.map +1 -1
- package/dist/components/Auth/ExternalsLoginButtons/ExternalsLoginButtons.mjs +2 -1
- package/dist/components/Auth/ExternalsLoginButtons/ExternalsLoginButtons.mjs.map +1 -1
- package/dist/components/Auth/useAuth/useOAuth2.d.ts +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.cjs +2 -2
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.mjs +2 -2
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.cjs +2 -2
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.mjs +2 -2
- package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.cjs +2 -2
- package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.mjs +2 -2
- package/dist/{index-CKhNmnU1.cjs → index-NyRxk54x.cjs} +2 -4
- package/dist/index-NyRxk54x.cjs.map +1 -0
- package/dist/{index-B0Lvoony.js → index-ikcnTPvJ.js} +2 -4
- package/dist/index-ikcnTPvJ.js.map +1 -0
- package/package.json +22 -19
- package/dist/CodeBlockShiki-BlmZyrr7.cjs +0 -29
- package/dist/CodeBlockShiki-BlmZyrr7.cjs.map +0 -1
- package/dist/CodeBlockShiki-CcpV9SVi.js +0 -29
- package/dist/CodeBlockShiki-CcpV9SVi.js.map +0 -1
- package/dist/CopyButton-Cxu3goRg.cjs +0 -59
- package/dist/CopyButton-Cxu3goRg.cjs.map +0 -1
- package/dist/CopyButton-DlcDlf6U.js +0 -60
- package/dist/CopyButton-DlcDlf6U.js.map +0 -1
- package/dist/Form-0D7KBafQ.cjs +0 -311
- package/dist/Form-0D7KBafQ.cjs.map +0 -1
- package/dist/Form-7BqwvjVI.cjs +0 -320
- package/dist/Form-7BqwvjVI.cjs.map +0 -1
- package/dist/Form-B2UufQRJ.cjs +0 -319
- package/dist/Form-B2UufQRJ.cjs.map +0 -1
- package/dist/Form-BB0kpER9.cjs +0 -301
- package/dist/Form-BB0kpER9.cjs.map +0 -1
- package/dist/Form-BDcoNTLV.cjs +0 -300
- package/dist/Form-BDcoNTLV.cjs.map +0 -1
- package/dist/Form-BTogr-fp.js +0 -312
- package/dist/Form-BTogr-fp.js.map +0 -1
- package/dist/Form-BVkkvSKP.js +0 -312
- package/dist/Form-BVkkvSKP.js.map +0 -1
- package/dist/Form-Be6Uhb5-.js +0 -312
- package/dist/Form-Be6Uhb5-.js.map +0 -1
- package/dist/Form-BmQQnl-6.js +0 -312
- package/dist/Form-BmQQnl-6.js.map +0 -1
- package/dist/Form-BoWOdiwq.js +0 -321
- package/dist/Form-BoWOdiwq.js.map +0 -1
- package/dist/Form-Bp_ubH9I.cjs +0 -311
- package/dist/Form-Bp_ubH9I.cjs.map +0 -1
- package/dist/Form-BtqRbgLu.cjs +0 -311
- package/dist/Form-BtqRbgLu.cjs.map +0 -1
- package/dist/Form-COVZyto7.cjs +0 -311
- package/dist/Form-COVZyto7.cjs.map +0 -1
- package/dist/Form-CVD_3nCD.js +0 -312
- package/dist/Form-CVD_3nCD.js.map +0 -1
- package/dist/Form-Cfklj1_H.js +0 -320
- package/dist/Form-Cfklj1_H.js.map +0 -1
- package/dist/Form-ClAAiVNm.cjs +0 -311
- package/dist/Form-ClAAiVNm.cjs.map +0 -1
- package/dist/Form-DGLgTAdY.js +0 -302
- package/dist/Form-DGLgTAdY.js.map +0 -1
- package/dist/Form-DhsgC7kB.js +0 -301
- package/dist/Form-DhsgC7kB.js.map +0 -1
- package/dist/Form-Dv0uHqbL.cjs +0 -320
- package/dist/Form-Dv0uHqbL.cjs.map +0 -1
- package/dist/Form-OK9zfg6E.js +0 -321
- package/dist/Form-OK9zfg6E.js.map +0 -1
- package/dist/components/ContentEditor/ContentEditorCode.cjs +0 -78
- package/dist/components/ContentEditor/ContentEditorCode.cjs.map +0 -1
- package/dist/components/ContentEditor/ContentEditorCode.d.ts +0 -11
- package/dist/components/ContentEditor/ContentEditorCode.d.ts.map +0 -1
- package/dist/components/ContentEditor/ContentEditorCode.mjs +0 -78
- package/dist/components/ContentEditor/ContentEditorCode.mjs.map +0 -1
- package/dist/components/DictionaryEditor/useEditedContentStore.cjs +0 -490
- package/dist/components/DictionaryEditor/useEditedContentStore.cjs.map +0 -1
- package/dist/components/DictionaryEditor/useEditedContentStore.d.ts +0 -28
- package/dist/components/DictionaryEditor/useEditedContentStore.d.ts.map +0 -1
- package/dist/components/DictionaryEditor/useEditedContentStore.mjs +0 -490
- package/dist/components/DictionaryEditor/useEditedContentStore.mjs.map +0 -1
- package/dist/components/DictionaryEditor/useEditionPanelStore.cjs +0 -15
- package/dist/components/DictionaryEditor/useEditionPanelStore.cjs.map +0 -1
- package/dist/components/DictionaryEditor/useEditionPanelStore.d.ts +0 -15
- package/dist/components/DictionaryEditor/useEditionPanelStore.d.ts.map +0 -1
- package/dist/components/DictionaryEditor/useEditionPanelStore.mjs +0 -15
- package/dist/components/DictionaryEditor/useEditionPanelStore.mjs.map +0 -1
- package/dist/components/DictionaryFieldEditor/LocaleSelector/LocaleSelector.d.ts +0 -8
- package/dist/components/DictionaryFieldEditor/LocaleSelector/LocaleSelector.d.ts.map +0 -1
- package/dist/components/DictionaryFieldEditor/LocaleSelector/LocaleSelectorContext.d.ts +0 -13
- package/dist/components/DictionaryFieldEditor/LocaleSelector/LocaleSelectorContext.d.ts.map +0 -1
- package/dist/components/DictionaryFieldEditor/LocaleSelector/localeSelector.content.d.ts +0 -9
- package/dist/components/DictionaryFieldEditor/LocaleSelector/localeSelector.content.d.ts.map +0 -1
- package/dist/components/DropDown/types.cjs +0 -2
- package/dist/components/DropDown/types.cjs.map +0 -1
- package/dist/components/DropDown/types.d.ts +0 -19
- package/dist/components/DropDown/types.d.ts.map +0 -1
- package/dist/components/DropDown/types.mjs +0 -2
- package/dist/components/DropDown/types.mjs.map +0 -1
- package/dist/components/IDE/CodeBlock.cjs +0 -54
- package/dist/components/IDE/CodeBlock.cjs.map +0 -1
- package/dist/components/IDE/CodeBlock.d.ts +0 -12
- package/dist/components/IDE/CodeBlock.d.ts.map +0 -1
- package/dist/components/IDE/CodeBlock.mjs +0 -54
- package/dist/components/IDE/CodeBlock.mjs.map +0 -1
- package/dist/components/IDE/CodeBlockLoader.cjs +0 -28
- package/dist/components/IDE/CodeBlockLoader.cjs.map +0 -1
- package/dist/components/IDE/CodeBlockLoader.d.ts +0 -4
- package/dist/components/IDE/CodeBlockLoader.d.ts.map +0 -1
- package/dist/components/IDE/CodeBlockLoader.mjs +0 -28
- package/dist/components/IDE/CodeBlockLoader.mjs.map +0 -1
- package/dist/components/IDE/CodeBlockShiki.d.ts +0 -3
- package/dist/components/IDE/CodeBlockShiki.d.ts.map +0 -1
- package/dist/components/IDE/CodeRender copy.cjs +0 -141
- package/dist/components/IDE/CodeRender copy.cjs.map +0 -1
- package/dist/components/IDE/CodeRender copy.d.ts +0 -14
- package/dist/components/IDE/CodeRender copy.d.ts.map +0 -1
- package/dist/components/IDE/CodeRender copy.mjs +0 -141
- package/dist/components/IDE/CodeRender copy.mjs.map +0 -1
- package/dist/components/IDE/CodeRender.cjs +0 -49
- package/dist/components/IDE/CodeRender.cjs.map +0 -1
- package/dist/components/IDE/CodeRender.d.ts +0 -9
- package/dist/components/IDE/CodeRender.d.ts.map +0 -1
- package/dist/components/IDE/CodeRender.mjs +0 -49
- package/dist/components/IDE/CodeRender.mjs.map +0 -1
- package/dist/components/IDE/CodeRenderer.cjs +0 -27
- package/dist/components/IDE/CodeRenderer.cjs.map +0 -1
- package/dist/components/IDE/CodeRenderer.d.ts +0 -5
- package/dist/components/IDE/CodeRenderer.d.ts.map +0 -1
- package/dist/components/IDE/CodeRenderer.mjs +0 -27
- package/dist/components/IDE/CodeRenderer.mjs.map +0 -1
- package/dist/components/IDE/EditableCodeBlock.d.ts +0 -9
- package/dist/components/IDE/EditableCodeBlock.d.ts.map +0 -1
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSelectorContext.d.ts +0 -13
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSelectorContext.d.ts.map +0 -1
- package/dist/design-system.css +0 -235
- package/dist/index-Ai6eeqZH.js +0 -702
- package/dist/index-Ai6eeqZH.js.map +0 -1
- package/dist/index-B-VAyQ9R.js +0 -673
- package/dist/index-B-VAyQ9R.js.map +0 -1
- package/dist/index-B0Lvoony.js.map +0 -1
- package/dist/index-B1nU1-65.cjs +0 -690
- package/dist/index-B1nU1-65.cjs.map +0 -1
- package/dist/index-B2UElBcQ.cjs +0 -200
- package/dist/index-B2UElBcQ.cjs.map +0 -1
- package/dist/index-BIV0x_z2.js +0 -206
- package/dist/index-BIV0x_z2.js.map +0 -1
- package/dist/index-BIyA5LAs.js +0 -691
- package/dist/index-BIyA5LAs.js.map +0 -1
- package/dist/index-BMzh1_UJ.js +0 -201
- package/dist/index-BMzh1_UJ.js.map +0 -1
- package/dist/index-BNH9wXVj.cjs +0 -205
- package/dist/index-BNH9wXVj.cjs.map +0 -1
- package/dist/index-BbqOa6BU.cjs +0 -701
- package/dist/index-BbqOa6BU.cjs.map +0 -1
- package/dist/index-BdTa-9zc.js +0 -201
- package/dist/index-BdTa-9zc.js.map +0 -1
- package/dist/index-BqZwP4Lr.js +0 -691
- package/dist/index-BqZwP4Lr.js.map +0 -1
- package/dist/index-BtZWYJhL.cjs +0 -200
- package/dist/index-BtZWYJhL.cjs.map +0 -1
- package/dist/index-Buecpjbh.cjs +0 -690
- package/dist/index-Buecpjbh.cjs.map +0 -1
- package/dist/index-CDEJjmId.js +0 -694
- package/dist/index-CDEJjmId.js.map +0 -1
- package/dist/index-CKhNmnU1.cjs.map +0 -1
- package/dist/index-CTAyk6RY.cjs +0 -693
- package/dist/index-CTAyk6RY.cjs.map +0 -1
- package/dist/index-CVC2sfEj.js +0 -693
- package/dist/index-CVC2sfEj.js.map +0 -1
- package/dist/index-CVz0RdK6.js +0 -691
- package/dist/index-CVz0RdK6.js.map +0 -1
- package/dist/index-CjF2ksU7.cjs +0 -693
- package/dist/index-CjF2ksU7.cjs.map +0 -1
- package/dist/index-CuQs5759.cjs +0 -692
- package/dist/index-CuQs5759.cjs.map +0 -1
- package/dist/index-D69JRZcQ.js +0 -206
- package/dist/index-D69JRZcQ.js.map +0 -1
- package/dist/index-D9oaKvKC.js +0 -201
- package/dist/index-D9oaKvKC.js.map +0 -1
- package/dist/index-DFc7og1d.cjs +0 -671
- package/dist/index-DFc7og1d.cjs.map +0 -1
- package/dist/index-DTCehvKe.cjs +0 -200
- package/dist/index-DTCehvKe.cjs.map +0 -1
- package/dist/index-D_MDocy7.cjs +0 -690
- package/dist/index-D_MDocy7.cjs.map +0 -1
- package/dist/index-DcWYZrJW.js +0 -672
- package/dist/index-DcWYZrJW.js.map +0 -1
- package/dist/index-Djo2Jnua.cjs +0 -693
- package/dist/index-Djo2Jnua.cjs.map +0 -1
- package/dist/index-LFTthFne.js +0 -694
- package/dist/index-LFTthFne.js.map +0 -1
- package/dist/index-SOIahRpS.cjs +0 -205
- package/dist/index-SOIahRpS.cjs.map +0 -1
- package/dist/index-T-TjVQoD.js +0 -671
- package/dist/index-T-TjVQoD.js.map +0 -1
- package/dist/index-f8_VC6c8.cjs +0 -672
- package/dist/index-f8_VC6c8.cjs.map +0 -1
- package/dist/index-llGIfxqV.cjs +0 -670
- package/dist/index-llGIfxqV.cjs.map +0 -1
- package/dist/index-xZoGTokf.js +0 -694
- package/dist/index-xZoGTokf.js.map +0 -1
- package/dist/jsx-runtime-CL03FswV.cjs +0 -506
- package/dist/jsx-runtime-CL03FswV.cjs.map +0 -1
- package/dist/jsx-runtime-DaNGiM0W.js +0 -945
- package/dist/jsx-runtime-DaNGiM0W.js.map +0 -1
- package/dist/jsx-runtime-XHKiWCTo.cjs +0 -944
- package/dist/jsx-runtime-XHKiWCTo.cjs.map +0 -1
- package/dist/jsx-runtime-kmx34TxC.js +0 -507
- package/dist/jsx-runtime-kmx34TxC.js.map +0 -1
- package/dist/libs/index.cjs +0 -6
- package/dist/libs/index.cjs.map +0 -1
- package/dist/libs/index.d.ts +0 -2
- package/dist/libs/index.d.ts.map +0 -1
- package/dist/libs/index.mjs +0 -6
- package/dist/libs/index.mjs.map +0 -1
- package/dist/libs/intlayer-api/ai.cjs +0 -64
- package/dist/libs/intlayer-api/ai.cjs.map +0 -1
- package/dist/libs/intlayer-api/ai.d.ts +0 -18
- package/dist/libs/intlayer-api/ai.d.ts.map +0 -1
- package/dist/libs/intlayer-api/ai.mjs +0 -64
- package/dist/libs/intlayer-api/ai.mjs.map +0 -1
- package/dist/libs/intlayer-api/auth.cjs +0 -141
- package/dist/libs/intlayer-api/auth.cjs.map +0 -1
- package/dist/libs/intlayer-api/auth.d.ts +0 -38
- package/dist/libs/intlayer-api/auth.d.ts.map +0 -1
- package/dist/libs/intlayer-api/auth.mjs +0 -141
- package/dist/libs/intlayer-api/auth.mjs.map +0 -1
- package/dist/libs/intlayer-api/dictionary.cjs +0 -78
- package/dist/libs/intlayer-api/dictionary.cjs.map +0 -1
- package/dist/libs/intlayer-api/dictionary.d.ts +0 -22
- package/dist/libs/intlayer-api/dictionary.d.ts.map +0 -1
- package/dist/libs/intlayer-api/dictionary.mjs +0 -78
- package/dist/libs/intlayer-api/dictionary.mjs.map +0 -1
- package/dist/libs/intlayer-api/fetcher.cjs +0 -73
- package/dist/libs/intlayer-api/fetcher.cjs.map +0 -1
- package/dist/libs/intlayer-api/fetcher.d.ts +0 -70
- package/dist/libs/intlayer-api/fetcher.d.ts.map +0 -1
- package/dist/libs/intlayer-api/fetcher.mjs +0 -73
- package/dist/libs/intlayer-api/fetcher.mjs.map +0 -1
- package/dist/libs/intlayer-api/index.cjs +0 -24
- package/dist/libs/intlayer-api/index.cjs.map +0 -1
- package/dist/libs/intlayer-api/index.d.ts +0 -157
- package/dist/libs/intlayer-api/index.d.ts.map +0 -1
- package/dist/libs/intlayer-api/index.mjs +0 -24
- package/dist/libs/intlayer-api/index.mjs.map +0 -1
- package/dist/libs/intlayer-api/organization.cjs +0 -96
- package/dist/libs/intlayer-api/organization.cjs.map +0 -1
- package/dist/libs/intlayer-api/organization.d.ts +0 -26
- package/dist/libs/intlayer-api/organization.d.ts.map +0 -1
- package/dist/libs/intlayer-api/organization.mjs +0 -96
- package/dist/libs/intlayer-api/organization.mjs.map +0 -1
- package/dist/libs/intlayer-api/project.cjs +0 -110
- package/dist/libs/intlayer-api/project.cjs.map +0 -1
- package/dist/libs/intlayer-api/project.d.ts +0 -28
- package/dist/libs/intlayer-api/project.d.ts.map +0 -1
- package/dist/libs/intlayer-api/project.mjs +0 -110
- package/dist/libs/intlayer-api/project.mjs.map +0 -1
- package/dist/libs/intlayer-api/stripe.cjs +0 -31
- package/dist/libs/intlayer-api/stripe.cjs.map +0 -1
- package/dist/libs/intlayer-api/stripe.d.ts +0 -8
- package/dist/libs/intlayer-api/stripe.d.ts.map +0 -1
- package/dist/libs/intlayer-api/stripe.mjs +0 -31
- package/dist/libs/intlayer-api/stripe.mjs.map +0 -1
- package/dist/libs/intlayer-api/tag.cjs +0 -52
- package/dist/libs/intlayer-api/tag.cjs.map +0 -1
- package/dist/libs/intlayer-api/tag.d.ts +0 -16
- package/dist/libs/intlayer-api/tag.d.ts.map +0 -1
- package/dist/libs/intlayer-api/tag.mjs +0 -52
- package/dist/libs/intlayer-api/tag.mjs.map +0 -1
- package/dist/libs/intlayer-api/user.cjs +0 -70
- package/dist/libs/intlayer-api/user.cjs.map +0 -1
- package/dist/libs/intlayer-api/user.d.ts +0 -22
- package/dist/libs/intlayer-api/user.d.ts.map +0 -1
- package/dist/libs/intlayer-api/user.mjs +0 -70
- package/dist/libs/intlayer-api/user.mjs.map +0 -1
- package/dist/navigation-CE0LMHcY.cjs +0 -8538
- package/dist/navigation-CE0LMHcY.cjs.map +0 -1
- package/dist/navigation-DFabQmdZ.js +0 -914
- package/dist/navigation-DFabQmdZ.js.map +0 -1
- package/dist/navigation-DRtAVQJF.js +0 -8521
- package/dist/navigation-DRtAVQJF.js.map +0 -1
- package/dist/navigation-a7EfWhxz.cjs +0 -913
- package/dist/navigation-a7EfWhxz.cjs.map +0 -1
- package/dist/shallow-lhDIFtEp.cjs +0 -48
- package/dist/shallow-lhDIFtEp.cjs.map +0 -1
- package/dist/shallow-m9BpCkKh.js +0 -49
- package/dist/shallow-m9BpCkKh.js.map +0 -1
- package/dist/useGetAllDictionaries-B1sqs2IB.cjs +0 -34
- package/dist/useGetAllDictionaries-B1sqs2IB.cjs.map +0 -1
- package/dist/useGetAllDictionaries-BbH8vTkY.js +0 -35
- package/dist/useGetAllDictionaries-BbH8vTkY.js.map +0 -1
- package/dist/useGetAllDictionaries-Bgkytpa2.cjs +0 -34
- package/dist/useGetAllDictionaries-Bgkytpa2.cjs.map +0 -1
- package/dist/useGetAllDictionaries-D8ma3h41.cjs +0 -33
- package/dist/useGetAllDictionaries-D8ma3h41.cjs.map +0 -1
- package/dist/useGetAllDictionaries-DHgHEbD5.js +0 -34
- package/dist/useGetAllDictionaries-DHgHEbD5.js.map +0 -1
- package/dist/useGetAllDictionaries-DUzm0rIa.js +0 -35
- package/dist/useGetAllDictionaries-DUzm0rIa.js.map +0 -1
- package/dist/utils/dictionary.cjs +0 -158
- package/dist/utils/dictionary.cjs.map +0 -1
- package/dist/utils/dictionary.d.ts +0 -7
- package/dist/utils/dictionary.d.ts.map +0 -1
- package/dist/utils/dictionary.mjs +0 -158
- package/dist/utils/dictionary.mjs.map +0 -1
- /package/dist/components/IDE/{CodeBlockclient.d.ts → CodeBlockClient.d.ts} +0 -0
- /package/dist/components/IDE/{CodeBlockclient.d.ts.map → CodeBlockClient.d.ts.map} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../../src/libs/intlayer-api/index.ts"],"sourcesContent":["import { type IntlayerConfig } from '@intlayer/config/client';\nimport { getAiAPI } from './ai';\nimport { getAuthAPI } from './auth';\nimport { getDictionaryAPI } from './dictionary';\nimport type { FetcherOptions } from './fetcher';\nimport { getOrganizationAPI } from './organization';\nimport { getProjectAPI } from './project';\nimport { getStripeAPI } from './stripe';\nimport { getTagAPI } from './tag';\nimport { getUserAPI } from './user';\n\nexport const getIntlayerAPI = (\n authAPIOptions: FetcherOptions = {},\n intlayerConfig?: IntlayerConfig\n) => ({\n organization: getOrganizationAPI(authAPIOptions, intlayerConfig),\n project: getProjectAPI(authAPIOptions, intlayerConfig),\n user: getUserAPI(authAPIOptions, intlayerConfig),\n auth: getAuthAPI(authAPIOptions, intlayerConfig),\n dictionary: getDictionaryAPI(authAPIOptions, intlayerConfig),\n stripe: getStripeAPI(authAPIOptions, intlayerConfig),\n ai: getAiAPI(authAPIOptions, intlayerConfig),\n tag: getTagAPI(authAPIOptions, intlayerConfig),\n});\n\nexport const intlayerAPI = getIntlayerAPI();\n"],"names":[],"mappings":";;;;;;;;AAWO,MAAM,iBAAiB,CAC5B,iBAAiC,IACjC,oBACI;AAAA,EACJ,cAAc,mBAAmB,gBAAgB,cAAc;AAAA,EAC/D,SAAS,cAAc,gBAAgB,cAAc;AAAA,EACrD,MAAM,WAAW,gBAAgB,cAAc;AAAA,EAC/C,MAAM,WAAW,gBAAgB,cAAc;AAAA,EAC/C,YAAY,iBAAiB,gBAAgB,cAAc;AAAA,EAC3D,QAAQ,aAAa,gBAAgB,cAAc;AAAA,EACnD,IAAI,SAAS,gBAAgB,cAAc;AAAA,EAC3C,KAAK,UAAU,gBAAgB,cAAc;AAC/C;AAEO,MAAM,cAAc,eAAe;"}
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const client = require("@intlayer/config/client");
|
|
4
|
-
const libs_intlayerApi_fetcher = require("./fetcher.cjs");
|
|
5
|
-
const getOrganizationAPI = (authAPIOptions = {}, intlayerConfig) => {
|
|
6
|
-
const { backendURL } = (intlayerConfig ?? client.getConfiguration()).editor;
|
|
7
|
-
const ORGANIZATION_API_ROUTE = `${backendURL}/api/organization`;
|
|
8
|
-
const getOrganizations = async (filters, otherOptions = {}) => await libs_intlayerApi_fetcher.fetcher(
|
|
9
|
-
ORGANIZATION_API_ROUTE,
|
|
10
|
-
authAPIOptions,
|
|
11
|
-
otherOptions,
|
|
12
|
-
{
|
|
13
|
-
params: filters
|
|
14
|
-
}
|
|
15
|
-
);
|
|
16
|
-
const getOrganization = async (organizationId, otherOptions = {}) => await libs_intlayerApi_fetcher.fetcher(
|
|
17
|
-
`${ORGANIZATION_API_ROUTE}/${String(organizationId)}`,
|
|
18
|
-
authAPIOptions,
|
|
19
|
-
otherOptions
|
|
20
|
-
);
|
|
21
|
-
const addOrganization = async (organization, otherOptions = {}) => await libs_intlayerApi_fetcher.fetcher(
|
|
22
|
-
ORGANIZATION_API_ROUTE,
|
|
23
|
-
authAPIOptions,
|
|
24
|
-
otherOptions,
|
|
25
|
-
{
|
|
26
|
-
method: "POST",
|
|
27
|
-
body: organization
|
|
28
|
-
}
|
|
29
|
-
);
|
|
30
|
-
const updateOrganization = async (organization, otherOptions = {}) => libs_intlayerApi_fetcher.fetcher(
|
|
31
|
-
ORGANIZATION_API_ROUTE,
|
|
32
|
-
authAPIOptions,
|
|
33
|
-
otherOptions,
|
|
34
|
-
{
|
|
35
|
-
method: "PUT",
|
|
36
|
-
body: organization
|
|
37
|
-
}
|
|
38
|
-
);
|
|
39
|
-
const updateOrganizationMembers = async (body, otherOptions = {}) => libs_intlayerApi_fetcher.fetcher(
|
|
40
|
-
`${ORGANIZATION_API_ROUTE}/members`,
|
|
41
|
-
authAPIOptions,
|
|
42
|
-
otherOptions,
|
|
43
|
-
{
|
|
44
|
-
method: "PUT",
|
|
45
|
-
body
|
|
46
|
-
}
|
|
47
|
-
);
|
|
48
|
-
const addOrganizationMember = async (body, otherOptions = {}) => libs_intlayerApi_fetcher.fetcher(
|
|
49
|
-
`${ORGANIZATION_API_ROUTE}/member`,
|
|
50
|
-
authAPIOptions,
|
|
51
|
-
otherOptions,
|
|
52
|
-
{
|
|
53
|
-
method: "POST",
|
|
54
|
-
body
|
|
55
|
-
}
|
|
56
|
-
);
|
|
57
|
-
const deleteOrganization = async (otherOptions = {}) => await libs_intlayerApi_fetcher.fetcher(
|
|
58
|
-
ORGANIZATION_API_ROUTE,
|
|
59
|
-
authAPIOptions,
|
|
60
|
-
otherOptions,
|
|
61
|
-
{
|
|
62
|
-
method: "DELETE"
|
|
63
|
-
}
|
|
64
|
-
);
|
|
65
|
-
const selectOrganization = async (organizationId, otherOptions = {}) => await libs_intlayerApi_fetcher.fetcher(
|
|
66
|
-
`${ORGANIZATION_API_ROUTE}/${String(organizationId)}`,
|
|
67
|
-
authAPIOptions,
|
|
68
|
-
otherOptions,
|
|
69
|
-
{
|
|
70
|
-
method: "PUT"
|
|
71
|
-
}
|
|
72
|
-
);
|
|
73
|
-
const unselectOrganization = async (otherOptions = {}) => await libs_intlayerApi_fetcher.fetcher(
|
|
74
|
-
`${ORGANIZATION_API_ROUTE}/logout`,
|
|
75
|
-
authAPIOptions,
|
|
76
|
-
otherOptions,
|
|
77
|
-
{
|
|
78
|
-
method: "POST"
|
|
79
|
-
}
|
|
80
|
-
);
|
|
81
|
-
return {
|
|
82
|
-
getOrganizations,
|
|
83
|
-
getOrganization,
|
|
84
|
-
addOrganization,
|
|
85
|
-
addOrganizationMember,
|
|
86
|
-
updateOrganization,
|
|
87
|
-
updateOrganizationMembers,
|
|
88
|
-
deleteOrganization,
|
|
89
|
-
selectOrganization,
|
|
90
|
-
unselectOrganization
|
|
91
|
-
};
|
|
92
|
-
};
|
|
93
|
-
const organizationAPI = getOrganizationAPI();
|
|
94
|
-
exports.getOrganizationAPI = getOrganizationAPI;
|
|
95
|
-
exports.organizationAPI = organizationAPI;
|
|
96
|
-
//# sourceMappingURL=organization.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"organization.cjs","sources":["../../../src/libs/intlayer-api/organization.ts"],"sourcesContent":["import type {\n AddOrganizationBody,\n AddOrganizationResult,\n DeleteOrganizationResult,\n GetOrganizationParam,\n GetOrganizationResult,\n GetOrganizationsParams,\n GetOrganizationsResult,\n UpdateOrganizationBody,\n UpdateOrganizationResult,\n SelectOrganizationParam,\n SelectOrganizationResult,\n UnselectOrganizationResult,\n UpdateOrganizationMembersBody,\n UpdateOrganizationMembersResult,\n AddOrganizationMemberBody,\n AddOrganizationMemberResult,\n} from '@intlayer/backend';\nimport { getConfiguration, type IntlayerConfig } from '@intlayer/config/client';\nimport { fetcher, type FetcherOptions } from './fetcher';\n\nexport const getOrganizationAPI = (\n authAPIOptions: FetcherOptions = {},\n intlayerConfig?: IntlayerConfig\n) => {\n const { backendURL } = (intlayerConfig ?? getConfiguration()).editor;\n const ORGANIZATION_API_ROUTE = `${backendURL}/api/organization`;\n\n /**\n * Retrieves a list of organizations based on filters and pagination.\n * @param filters - Filters and pagination options.\n */\n const getOrganizations = async (\n filters?: GetOrganizationsParams,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetOrganizationsResult>(\n ORGANIZATION_API_ROUTE,\n authAPIOptions,\n otherOptions,\n {\n params: filters,\n }\n );\n\n /**\n * Retrieves an organization by its ID.\n * @param organizationId - Organization ID.\n */\n const getOrganization = async (\n organizationId: GetOrganizationParam['organizationId'],\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetOrganizationResult>(\n `${ORGANIZATION_API_ROUTE}/${String(organizationId)}`,\n authAPIOptions,\n otherOptions\n );\n\n /**\n * Adds a new organization to the database.\n * @param organization - Organization data.\n */\n const addOrganization = async (\n organization: AddOrganizationBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<AddOrganizationResult>(\n ORGANIZATION_API_ROUTE,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body: organization,\n }\n );\n\n /**\n * Updates an existing organization in the database.\n * @param organization - Updated organization data.\n */\n const updateOrganization = async (\n organization: UpdateOrganizationBody,\n otherOptions: FetcherOptions = {}\n ) =>\n fetcher<UpdateOrganizationResult>(\n ORGANIZATION_API_ROUTE,\n authAPIOptions,\n otherOptions,\n {\n method: 'PUT',\n body: organization,\n }\n );\n\n /**\n * Update members to the organization in the database.\n * @param body - Updated organization members data.\n */\n const updateOrganizationMembers = async (\n body: UpdateOrganizationMembersBody,\n otherOptions: FetcherOptions = {}\n ) =>\n fetcher<UpdateOrganizationMembersResult>(\n `${ORGANIZATION_API_ROUTE}/members`,\n authAPIOptions,\n otherOptions,\n {\n method: 'PUT',\n body,\n }\n );\n\n /**\n * Add member to the organization in the database.\n * @param body - Updated organization members data.\n */\n const addOrganizationMember = async (\n body: AddOrganizationMemberBody,\n otherOptions: FetcherOptions = {}\n ) =>\n fetcher<AddOrganizationMemberResult>(\n `${ORGANIZATION_API_ROUTE}/member`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body,\n }\n );\n\n /**\n * Deletes an organization from the database by its ID.\n * @param organizationId - Organization ID.\n */\n const deleteOrganization = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<DeleteOrganizationResult>(\n ORGANIZATION_API_ROUTE,\n authAPIOptions,\n otherOptions,\n {\n method: 'DELETE',\n }\n );\n\n /**\n * Select an organization from the database by its ID.\n * @param organizationId - Organization ID.\n */\n const selectOrganization = async (\n organizationId: SelectOrganizationParam['organizationId'],\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<SelectOrganizationResult>(\n `${ORGANIZATION_API_ROUTE}/${String(organizationId)}`,\n authAPIOptions,\n otherOptions,\n {\n method: 'PUT',\n }\n );\n\n /**\n * Unselect an organization from the database by its ID.\n * @param organizationId - Organization ID.\n */\n const unselectOrganization = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<UnselectOrganizationResult>(\n `${ORGANIZATION_API_ROUTE}/logout`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n }\n );\n\n return {\n getOrganizations,\n getOrganization,\n addOrganization,\n addOrganizationMember,\n updateOrganization,\n updateOrganizationMembers,\n deleteOrganization,\n selectOrganization,\n unselectOrganization,\n };\n};\n\nexport const organizationAPI = getOrganizationAPI();\n"],"names":["getConfiguration","fetcher"],"mappings":";;;;AAqBO,MAAM,qBAAqB,CAChC,iBAAiC,IACjC,mBACG;AACH,QAAM,EAAE,WAAgB,KAAA,kBAAkBA,OAAAA,iBAAoB,GAAA;AACxD,QAAA,yBAAyB,GAAG,UAAU;AAM5C,QAAM,mBAAmB,OACvB,SACA,eAA+B,CAAA,MAE/B,MAAMC,yBAAA;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,MACE,QAAQ;AAAA,IAAA;AAAA,EAEZ;AAMF,QAAM,kBAAkB,OACtB,gBACA,eAA+B,CAAA,MAE/B,MAAMA,yBAAA;AAAA,IACJ,GAAG,sBAAsB,IAAI,OAAO,cAAc,CAAC;AAAA,IACnD;AAAA,IACA;AAAA,EACF;AAMF,QAAM,kBAAkB,OACtB,cACA,eAA+B,CAAA,MAE/B,MAAMA,yBAAA;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,MACE,QAAQ;AAAA,MACR,MAAM;AAAA,IAAA;AAAA,EAEV;AAMF,QAAM,qBAAqB,OACzB,cACA,eAA+B,CAE/B,MAAAA,yBAAA;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,MACE,QAAQ;AAAA,MACR,MAAM;AAAA,IAAA;AAAA,EAEV;AAMF,QAAM,4BAA4B,OAChC,MACA,eAA+B,CAE/B,MAAAA,yBAAA;AAAA,IACE,GAAG,sBAAsB;AAAA,IACzB;AAAA,IACA;AAAA,IACA;AAAA,MACE,QAAQ;AAAA,MACR;AAAA,IAAA;AAAA,EAEJ;AAMF,QAAM,wBAAwB,OAC5B,MACA,eAA+B,CAE/B,MAAAA,yBAAA;AAAA,IACE,GAAG,sBAAsB;AAAA,IACzB;AAAA,IACA;AAAA,IACA;AAAA,MACE,QAAQ;AAAA,MACR;AAAA,IAAA;AAAA,EAEJ;AAMF,QAAM,qBAAqB,OAAO,eAA+B,CAAA,MAC/D,MAAMA,yBAAA;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,MACE,QAAQ;AAAA,IAAA;AAAA,EAEZ;AAMF,QAAM,qBAAqB,OACzB,gBACA,eAA+B,CAAA,MAE/B,MAAMA,yBAAA;AAAA,IACJ,GAAG,sBAAsB,IAAI,OAAO,cAAc,CAAC;AAAA,IACnD;AAAA,IACA;AAAA,IACA;AAAA,MACE,QAAQ;AAAA,IAAA;AAAA,EAEZ;AAMF,QAAM,uBAAuB,OAAO,eAA+B,CAAA,MACjE,MAAMA,yBAAA;AAAA,IACJ,GAAG,sBAAsB;AAAA,IACzB;AAAA,IACA;AAAA,IACA;AAAA,MACE,QAAQ;AAAA,IAAA;AAAA,EAEZ;AAEK,SAAA;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;AAEO,MAAM,kBAAkB,mBAAmB;;;"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { AddOrganizationBody, AddOrganizationResult, DeleteOrganizationResult, GetOrganizationParam, GetOrganizationResult, GetOrganizationsParams, GetOrganizationsResult, UpdateOrganizationBody, UpdateOrganizationResult, SelectOrganizationParam, SelectOrganizationResult, UnselectOrganizationResult, UpdateOrganizationMembersBody, UpdateOrganizationMembersResult, AddOrganizationMemberBody, AddOrganizationMemberResult } from '@intlayer/backend';
|
|
2
|
-
import { IntlayerConfig } from '@intlayer/config/client';
|
|
3
|
-
import { FetcherOptions } from './fetcher';
|
|
4
|
-
export declare const getOrganizationAPI: (authAPIOptions?: FetcherOptions, intlayerConfig?: IntlayerConfig) => {
|
|
5
|
-
getOrganizations: (filters?: GetOrganizationsParams, otherOptions?: FetcherOptions) => Promise<GetOrganizationsResult>;
|
|
6
|
-
getOrganization: (organizationId: GetOrganizationParam["organizationId"], otherOptions?: FetcherOptions) => Promise<GetOrganizationResult>;
|
|
7
|
-
addOrganization: (organization: AddOrganizationBody, otherOptions?: FetcherOptions) => Promise<AddOrganizationResult>;
|
|
8
|
-
addOrganizationMember: (body: AddOrganizationMemberBody, otherOptions?: FetcherOptions) => Promise<AddOrganizationMemberResult>;
|
|
9
|
-
updateOrganization: (organization: UpdateOrganizationBody, otherOptions?: FetcherOptions) => Promise<UpdateOrganizationResult>;
|
|
10
|
-
updateOrganizationMembers: (body: UpdateOrganizationMembersBody, otherOptions?: FetcherOptions) => Promise<UpdateOrganizationMembersResult>;
|
|
11
|
-
deleteOrganization: (otherOptions?: FetcherOptions) => Promise<DeleteOrganizationResult>;
|
|
12
|
-
selectOrganization: (organizationId: SelectOrganizationParam["organizationId"], otherOptions?: FetcherOptions) => Promise<SelectOrganizationResult>;
|
|
13
|
-
unselectOrganization: (otherOptions?: FetcherOptions) => Promise<UnselectOrganizationResult>;
|
|
14
|
-
};
|
|
15
|
-
export declare const organizationAPI: {
|
|
16
|
-
getOrganizations: (filters?: GetOrganizationsParams, otherOptions?: FetcherOptions) => Promise<GetOrganizationsResult>;
|
|
17
|
-
getOrganization: (organizationId: GetOrganizationParam["organizationId"], otherOptions?: FetcherOptions) => Promise<GetOrganizationResult>;
|
|
18
|
-
addOrganization: (organization: AddOrganizationBody, otherOptions?: FetcherOptions) => Promise<AddOrganizationResult>;
|
|
19
|
-
addOrganizationMember: (body: AddOrganizationMemberBody, otherOptions?: FetcherOptions) => Promise<AddOrganizationMemberResult>;
|
|
20
|
-
updateOrganization: (organization: UpdateOrganizationBody, otherOptions?: FetcherOptions) => Promise<UpdateOrganizationResult>;
|
|
21
|
-
updateOrganizationMembers: (body: UpdateOrganizationMembersBody, otherOptions?: FetcherOptions) => Promise<UpdateOrganizationMembersResult>;
|
|
22
|
-
deleteOrganization: (otherOptions?: FetcherOptions) => Promise<DeleteOrganizationResult>;
|
|
23
|
-
selectOrganization: (organizationId: SelectOrganizationParam["organizationId"], otherOptions?: FetcherOptions) => Promise<SelectOrganizationResult>;
|
|
24
|
-
unselectOrganization: (otherOptions?: FetcherOptions) => Promise<UnselectOrganizationResult>;
|
|
25
|
-
};
|
|
26
|
-
//# sourceMappingURL=organization.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"organization.d.ts","sourceRoot":"","sources":["../../../src/libs/intlayer-api/organization.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,mBAAmB,EACnB,qBAAqB,EACrB,wBAAwB,EACxB,oBAAoB,EACpB,qBAAqB,EACrB,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,EACtB,wBAAwB,EACxB,uBAAuB,EACvB,wBAAwB,EACxB,0BAA0B,EAC1B,6BAA6B,EAC7B,+BAA+B,EAC/B,yBAAyB,EACzB,2BAA2B,EAC5B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAoB,KAAK,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAChF,OAAO,EAAW,KAAK,cAAc,EAAE,MAAM,WAAW,CAAC;AAEzD,eAAO,MAAM,kBAAkB,oBACb,cAAc,mBACb,cAAc;iCAUnB,sBAAsB,iBAClB,cAAc;sCAgBZ,oBAAoB,CAAC,gBAAgB,CAAC,iBACxC,cAAc;oCAad,mBAAmB,iBACnB,cAAc;kCAqDtB,yBAAyB,iBACjB,cAAc;uCArCd,sBAAsB,iBACtB,cAAc;sCAiBtB,6BAA6B,iBACrB,cAAc;wCAkCkB,cAAc;yCAe5C,uBAAuB,CAAC,gBAAgB,CAAC,iBAC3C,cAAc;0CAeoB,cAAc;CAqBjE,CAAC;AAEF,eAAO,MAAM,eAAe;iCA5Jd,sBAAsB,iBAClB,cAAc;sCAgBZ,oBAAoB,CAAC,gBAAgB,CAAC,iBACxC,cAAc;oCAad,mBAAmB,iBACnB,cAAc;kCAqDtB,yBAAyB,iBACjB,cAAc;uCArCd,sBAAsB,iBACtB,cAAc;sCAiBtB,6BAA6B,iBACrB,cAAc;wCAkCkB,cAAc;yCAe5C,uBAAuB,CAAC,gBAAgB,CAAC,iBAC3C,cAAc;0CAeoB,cAAc;CAuBf,CAAC"}
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
import { getConfiguration } from "@intlayer/config/client";
|
|
2
|
-
import { fetcher } from "./fetcher.mjs";
|
|
3
|
-
const getOrganizationAPI = (authAPIOptions = {}, intlayerConfig) => {
|
|
4
|
-
const { backendURL } = (intlayerConfig ?? getConfiguration()).editor;
|
|
5
|
-
const ORGANIZATION_API_ROUTE = `${backendURL}/api/organization`;
|
|
6
|
-
const getOrganizations = async (filters, otherOptions = {}) => await fetcher(
|
|
7
|
-
ORGANIZATION_API_ROUTE,
|
|
8
|
-
authAPIOptions,
|
|
9
|
-
otherOptions,
|
|
10
|
-
{
|
|
11
|
-
params: filters
|
|
12
|
-
}
|
|
13
|
-
);
|
|
14
|
-
const getOrganization = async (organizationId, otherOptions = {}) => await fetcher(
|
|
15
|
-
`${ORGANIZATION_API_ROUTE}/${String(organizationId)}`,
|
|
16
|
-
authAPIOptions,
|
|
17
|
-
otherOptions
|
|
18
|
-
);
|
|
19
|
-
const addOrganization = async (organization, otherOptions = {}) => await fetcher(
|
|
20
|
-
ORGANIZATION_API_ROUTE,
|
|
21
|
-
authAPIOptions,
|
|
22
|
-
otherOptions,
|
|
23
|
-
{
|
|
24
|
-
method: "POST",
|
|
25
|
-
body: organization
|
|
26
|
-
}
|
|
27
|
-
);
|
|
28
|
-
const updateOrganization = async (organization, otherOptions = {}) => fetcher(
|
|
29
|
-
ORGANIZATION_API_ROUTE,
|
|
30
|
-
authAPIOptions,
|
|
31
|
-
otherOptions,
|
|
32
|
-
{
|
|
33
|
-
method: "PUT",
|
|
34
|
-
body: organization
|
|
35
|
-
}
|
|
36
|
-
);
|
|
37
|
-
const updateOrganizationMembers = async (body, otherOptions = {}) => fetcher(
|
|
38
|
-
`${ORGANIZATION_API_ROUTE}/members`,
|
|
39
|
-
authAPIOptions,
|
|
40
|
-
otherOptions,
|
|
41
|
-
{
|
|
42
|
-
method: "PUT",
|
|
43
|
-
body
|
|
44
|
-
}
|
|
45
|
-
);
|
|
46
|
-
const addOrganizationMember = async (body, otherOptions = {}) => fetcher(
|
|
47
|
-
`${ORGANIZATION_API_ROUTE}/member`,
|
|
48
|
-
authAPIOptions,
|
|
49
|
-
otherOptions,
|
|
50
|
-
{
|
|
51
|
-
method: "POST",
|
|
52
|
-
body
|
|
53
|
-
}
|
|
54
|
-
);
|
|
55
|
-
const deleteOrganization = async (otherOptions = {}) => await fetcher(
|
|
56
|
-
ORGANIZATION_API_ROUTE,
|
|
57
|
-
authAPIOptions,
|
|
58
|
-
otherOptions,
|
|
59
|
-
{
|
|
60
|
-
method: "DELETE"
|
|
61
|
-
}
|
|
62
|
-
);
|
|
63
|
-
const selectOrganization = async (organizationId, otherOptions = {}) => await fetcher(
|
|
64
|
-
`${ORGANIZATION_API_ROUTE}/${String(organizationId)}`,
|
|
65
|
-
authAPIOptions,
|
|
66
|
-
otherOptions,
|
|
67
|
-
{
|
|
68
|
-
method: "PUT"
|
|
69
|
-
}
|
|
70
|
-
);
|
|
71
|
-
const unselectOrganization = async (otherOptions = {}) => await fetcher(
|
|
72
|
-
`${ORGANIZATION_API_ROUTE}/logout`,
|
|
73
|
-
authAPIOptions,
|
|
74
|
-
otherOptions,
|
|
75
|
-
{
|
|
76
|
-
method: "POST"
|
|
77
|
-
}
|
|
78
|
-
);
|
|
79
|
-
return {
|
|
80
|
-
getOrganizations,
|
|
81
|
-
getOrganization,
|
|
82
|
-
addOrganization,
|
|
83
|
-
addOrganizationMember,
|
|
84
|
-
updateOrganization,
|
|
85
|
-
updateOrganizationMembers,
|
|
86
|
-
deleteOrganization,
|
|
87
|
-
selectOrganization,
|
|
88
|
-
unselectOrganization
|
|
89
|
-
};
|
|
90
|
-
};
|
|
91
|
-
const organizationAPI = getOrganizationAPI();
|
|
92
|
-
export {
|
|
93
|
-
getOrganizationAPI,
|
|
94
|
-
organizationAPI
|
|
95
|
-
};
|
|
96
|
-
//# sourceMappingURL=organization.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"organization.mjs","sources":["../../../src/libs/intlayer-api/organization.ts"],"sourcesContent":["import type {\n AddOrganizationBody,\n AddOrganizationResult,\n DeleteOrganizationResult,\n GetOrganizationParam,\n GetOrganizationResult,\n GetOrganizationsParams,\n GetOrganizationsResult,\n UpdateOrganizationBody,\n UpdateOrganizationResult,\n SelectOrganizationParam,\n SelectOrganizationResult,\n UnselectOrganizationResult,\n UpdateOrganizationMembersBody,\n UpdateOrganizationMembersResult,\n AddOrganizationMemberBody,\n AddOrganizationMemberResult,\n} from '@intlayer/backend';\nimport { getConfiguration, type IntlayerConfig } from '@intlayer/config/client';\nimport { fetcher, type FetcherOptions } from './fetcher';\n\nexport const getOrganizationAPI = (\n authAPIOptions: FetcherOptions = {},\n intlayerConfig?: IntlayerConfig\n) => {\n const { backendURL } = (intlayerConfig ?? getConfiguration()).editor;\n const ORGANIZATION_API_ROUTE = `${backendURL}/api/organization`;\n\n /**\n * Retrieves a list of organizations based on filters and pagination.\n * @param filters - Filters and pagination options.\n */\n const getOrganizations = async (\n filters?: GetOrganizationsParams,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetOrganizationsResult>(\n ORGANIZATION_API_ROUTE,\n authAPIOptions,\n otherOptions,\n {\n params: filters,\n }\n );\n\n /**\n * Retrieves an organization by its ID.\n * @param organizationId - Organization ID.\n */\n const getOrganization = async (\n organizationId: GetOrganizationParam['organizationId'],\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetOrganizationResult>(\n `${ORGANIZATION_API_ROUTE}/${String(organizationId)}`,\n authAPIOptions,\n otherOptions\n );\n\n /**\n * Adds a new organization to the database.\n * @param organization - Organization data.\n */\n const addOrganization = async (\n organization: AddOrganizationBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<AddOrganizationResult>(\n ORGANIZATION_API_ROUTE,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body: organization,\n }\n );\n\n /**\n * Updates an existing organization in the database.\n * @param organization - Updated organization data.\n */\n const updateOrganization = async (\n organization: UpdateOrganizationBody,\n otherOptions: FetcherOptions = {}\n ) =>\n fetcher<UpdateOrganizationResult>(\n ORGANIZATION_API_ROUTE,\n authAPIOptions,\n otherOptions,\n {\n method: 'PUT',\n body: organization,\n }\n );\n\n /**\n * Update members to the organization in the database.\n * @param body - Updated organization members data.\n */\n const updateOrganizationMembers = async (\n body: UpdateOrganizationMembersBody,\n otherOptions: FetcherOptions = {}\n ) =>\n fetcher<UpdateOrganizationMembersResult>(\n `${ORGANIZATION_API_ROUTE}/members`,\n authAPIOptions,\n otherOptions,\n {\n method: 'PUT',\n body,\n }\n );\n\n /**\n * Add member to the organization in the database.\n * @param body - Updated organization members data.\n */\n const addOrganizationMember = async (\n body: AddOrganizationMemberBody,\n otherOptions: FetcherOptions = {}\n ) =>\n fetcher<AddOrganizationMemberResult>(\n `${ORGANIZATION_API_ROUTE}/member`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body,\n }\n );\n\n /**\n * Deletes an organization from the database by its ID.\n * @param organizationId - Organization ID.\n */\n const deleteOrganization = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<DeleteOrganizationResult>(\n ORGANIZATION_API_ROUTE,\n authAPIOptions,\n otherOptions,\n {\n method: 'DELETE',\n }\n );\n\n /**\n * Select an organization from the database by its ID.\n * @param organizationId - Organization ID.\n */\n const selectOrganization = async (\n organizationId: SelectOrganizationParam['organizationId'],\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<SelectOrganizationResult>(\n `${ORGANIZATION_API_ROUTE}/${String(organizationId)}`,\n authAPIOptions,\n otherOptions,\n {\n method: 'PUT',\n }\n );\n\n /**\n * Unselect an organization from the database by its ID.\n * @param organizationId - Organization ID.\n */\n const unselectOrganization = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<UnselectOrganizationResult>(\n `${ORGANIZATION_API_ROUTE}/logout`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n }\n );\n\n return {\n getOrganizations,\n getOrganization,\n addOrganization,\n addOrganizationMember,\n updateOrganization,\n updateOrganizationMembers,\n deleteOrganization,\n selectOrganization,\n unselectOrganization,\n };\n};\n\nexport const organizationAPI = getOrganizationAPI();\n"],"names":[],"mappings":";;AAqBO,MAAM,qBAAqB,CAChC,iBAAiC,IACjC,mBACG;AACH,QAAM,EAAE,WAAgB,KAAA,kBAAkB,iBAAoB,GAAA;AACxD,QAAA,yBAAyB,GAAG,UAAU;AAM5C,QAAM,mBAAmB,OACvB,SACA,eAA+B,CAAA,MAE/B,MAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,MACE,QAAQ;AAAA,IAAA;AAAA,EAEZ;AAMF,QAAM,kBAAkB,OACtB,gBACA,eAA+B,CAAA,MAE/B,MAAM;AAAA,IACJ,GAAG,sBAAsB,IAAI,OAAO,cAAc,CAAC;AAAA,IACnD;AAAA,IACA;AAAA,EACF;AAMF,QAAM,kBAAkB,OACtB,cACA,eAA+B,CAAA,MAE/B,MAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,MACE,QAAQ;AAAA,MACR,MAAM;AAAA,IAAA;AAAA,EAEV;AAMF,QAAM,qBAAqB,OACzB,cACA,eAA+B,CAE/B,MAAA;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,MACE,QAAQ;AAAA,MACR,MAAM;AAAA,IAAA;AAAA,EAEV;AAMF,QAAM,4BAA4B,OAChC,MACA,eAA+B,CAE/B,MAAA;AAAA,IACE,GAAG,sBAAsB;AAAA,IACzB;AAAA,IACA;AAAA,IACA;AAAA,MACE,QAAQ;AAAA,MACR;AAAA,IAAA;AAAA,EAEJ;AAMF,QAAM,wBAAwB,OAC5B,MACA,eAA+B,CAE/B,MAAA;AAAA,IACE,GAAG,sBAAsB;AAAA,IACzB;AAAA,IACA;AAAA,IACA;AAAA,MACE,QAAQ;AAAA,MACR;AAAA,IAAA;AAAA,EAEJ;AAMF,QAAM,qBAAqB,OAAO,eAA+B,CAAA,MAC/D,MAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,MACE,QAAQ;AAAA,IAAA;AAAA,EAEZ;AAMF,QAAM,qBAAqB,OACzB,gBACA,eAA+B,CAAA,MAE/B,MAAM;AAAA,IACJ,GAAG,sBAAsB,IAAI,OAAO,cAAc,CAAC;AAAA,IACnD;AAAA,IACA;AAAA,IACA;AAAA,MACE,QAAQ;AAAA,IAAA;AAAA,EAEZ;AAMF,QAAM,uBAAuB,OAAO,eAA+B,CAAA,MACjE,MAAM;AAAA,IACJ,GAAG,sBAAsB;AAAA,IACzB;AAAA,IACA;AAAA,IACA;AAAA,MACE,QAAQ;AAAA,IAAA;AAAA,EAEZ;AAEK,SAAA;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;AAEO,MAAM,kBAAkB,mBAAmB;"}
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const client = require("@intlayer/config/client");
|
|
4
|
-
const libs_intlayerApi_fetcher = require("./fetcher.cjs");
|
|
5
|
-
const getProjectAPI = (authAPIOptions = {}, intlayerConfig) => {
|
|
6
|
-
const { backendURL } = (intlayerConfig ?? client.getConfiguration()).editor;
|
|
7
|
-
const PROJECT_API_ROUTE = `${backendURL}/api/project`;
|
|
8
|
-
const getProjects = async (filters, otherOptions = {}) => await libs_intlayerApi_fetcher.fetcher(
|
|
9
|
-
PROJECT_API_ROUTE,
|
|
10
|
-
authAPIOptions,
|
|
11
|
-
otherOptions,
|
|
12
|
-
{
|
|
13
|
-
params: filters
|
|
14
|
-
}
|
|
15
|
-
);
|
|
16
|
-
const addProject = async (project, otherOptions = {}) => await libs_intlayerApi_fetcher.fetcher(
|
|
17
|
-
`${PROJECT_API_ROUTE}`,
|
|
18
|
-
authAPIOptions,
|
|
19
|
-
otherOptions,
|
|
20
|
-
{
|
|
21
|
-
method: "POST",
|
|
22
|
-
body: project
|
|
23
|
-
}
|
|
24
|
-
);
|
|
25
|
-
const updateProject = async (project, otherOptions = {}) => await libs_intlayerApi_fetcher.fetcher(
|
|
26
|
-
`${PROJECT_API_ROUTE}`,
|
|
27
|
-
authAPIOptions,
|
|
28
|
-
otherOptions,
|
|
29
|
-
{
|
|
30
|
-
method: "PUT",
|
|
31
|
-
body: project
|
|
32
|
-
}
|
|
33
|
-
);
|
|
34
|
-
const updateProjectMembers = async (body, otherOptions = {}) => await libs_intlayerApi_fetcher.fetcher(
|
|
35
|
-
`${PROJECT_API_ROUTE}/members`,
|
|
36
|
-
authAPIOptions,
|
|
37
|
-
otherOptions,
|
|
38
|
-
{
|
|
39
|
-
method: "PUT",
|
|
40
|
-
body
|
|
41
|
-
}
|
|
42
|
-
);
|
|
43
|
-
const deleteProject = async (otherOptions = {}) => await libs_intlayerApi_fetcher.fetcher(
|
|
44
|
-
`${PROJECT_API_ROUTE}`,
|
|
45
|
-
authAPIOptions,
|
|
46
|
-
otherOptions,
|
|
47
|
-
{
|
|
48
|
-
method: "DELETE"
|
|
49
|
-
}
|
|
50
|
-
);
|
|
51
|
-
const selectProject = async (projectId, otherOptions = {}) => await libs_intlayerApi_fetcher.fetcher(
|
|
52
|
-
`${PROJECT_API_ROUTE}/${String(projectId)}`,
|
|
53
|
-
authAPIOptions,
|
|
54
|
-
otherOptions,
|
|
55
|
-
{
|
|
56
|
-
method: "PUT"
|
|
57
|
-
}
|
|
58
|
-
);
|
|
59
|
-
const unselectProject = async (otherOptions = {}) => await libs_intlayerApi_fetcher.fetcher(
|
|
60
|
-
`${PROJECT_API_ROUTE}/logout`,
|
|
61
|
-
authAPIOptions,
|
|
62
|
-
otherOptions,
|
|
63
|
-
{
|
|
64
|
-
method: "POST"
|
|
65
|
-
}
|
|
66
|
-
);
|
|
67
|
-
const addNewAccessKey = async (accessKey, otherOptions = {}) => await libs_intlayerApi_fetcher.fetcher(
|
|
68
|
-
`${PROJECT_API_ROUTE}/access_key`,
|
|
69
|
-
authAPIOptions,
|
|
70
|
-
otherOptions,
|
|
71
|
-
{
|
|
72
|
-
method: "POST",
|
|
73
|
-
body: accessKey
|
|
74
|
-
}
|
|
75
|
-
);
|
|
76
|
-
const deleteAccessKey = async (clientId, otherOptions = {}) => await libs_intlayerApi_fetcher.fetcher(
|
|
77
|
-
`${PROJECT_API_ROUTE}/access_key`,
|
|
78
|
-
authAPIOptions,
|
|
79
|
-
otherOptions,
|
|
80
|
-
{
|
|
81
|
-
method: "DELETE",
|
|
82
|
-
body: { clientId }
|
|
83
|
-
}
|
|
84
|
-
);
|
|
85
|
-
const refreshAccessKey = async (clientId, otherOptions = {}) => await libs_intlayerApi_fetcher.fetcher(
|
|
86
|
-
`${PROJECT_API_ROUTE}/access_key`,
|
|
87
|
-
authAPIOptions,
|
|
88
|
-
otherOptions,
|
|
89
|
-
{
|
|
90
|
-
method: "PATCH",
|
|
91
|
-
body: { clientId }
|
|
92
|
-
}
|
|
93
|
-
);
|
|
94
|
-
return {
|
|
95
|
-
getProjects,
|
|
96
|
-
addProject,
|
|
97
|
-
updateProject,
|
|
98
|
-
updateProjectMembers,
|
|
99
|
-
deleteProject,
|
|
100
|
-
selectProject,
|
|
101
|
-
unselectProject,
|
|
102
|
-
addNewAccessKey,
|
|
103
|
-
deleteAccessKey,
|
|
104
|
-
refreshAccessKey
|
|
105
|
-
};
|
|
106
|
-
};
|
|
107
|
-
const projectAPI = getProjectAPI();
|
|
108
|
-
exports.getProjectAPI = getProjectAPI;
|
|
109
|
-
exports.projectAPI = projectAPI;
|
|
110
|
-
//# sourceMappingURL=project.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"project.cjs","sources":["../../../src/libs/intlayer-api/project.ts"],"sourcesContent":["import type {\n AddProjectBody,\n AddProjectResult,\n DeleteProjectResult,\n GetProjectsParams,\n GetProjectsResult,\n UpdateProjectBody,\n UpdateProjectResult,\n SelectProjectParam,\n SelectProjectResult,\n UnselectProjectResult,\n AddNewAccessKeyBody,\n AddNewAccessKeyResponse,\n DeleteAccessKeyBody,\n DeleteAccessKeyResponse,\n RefreshAccessKeyBody,\n RefreshAccessKeyResponse,\n UpdateProjectMembersBody,\n UpdateProjectMembersResult,\n} from '@intlayer/backend';\nimport { getConfiguration, type IntlayerConfig } from '@intlayer/config/client';\nimport { fetcher, type FetcherOptions } from './fetcher';\n\nexport const getProjectAPI = (\n authAPIOptions: FetcherOptions = {},\n intlayerConfig?: IntlayerConfig\n) => {\n const { backendURL } = (intlayerConfig ?? getConfiguration()).editor;\n const PROJECT_API_ROUTE = `${backendURL}/api/project`;\n\n /**\n * Retrieves a list of projects based on filters and pagination.\n * @param filters - Filters and pagination options.\n */\n const getProjects = async (\n filters?: GetProjectsParams,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetProjectsResult>(\n PROJECT_API_ROUTE,\n authAPIOptions,\n otherOptions,\n {\n params: filters,\n }\n );\n\n /**\n * Adds a new project to the database.\n * @param project - Project data.\n */\n const addProject = async (\n project: AddProjectBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<AddProjectResult>(\n `${PROJECT_API_ROUTE}`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body: project,\n }\n );\n\n /**\n * Updates an existing project in the database.\n * @param project - Updated project data.\n */\n const updateProject = async (\n project: UpdateProjectBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<UpdateProjectResult>(\n `${PROJECT_API_ROUTE}`,\n authAPIOptions,\n otherOptions,\n {\n method: 'PUT',\n body: project,\n }\n );\n\n /**\n * Updates project members in the database.\n * @param project - Updated project data.\n */\n const updateProjectMembers = async (\n body: UpdateProjectMembersBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<UpdateProjectMembersResult>(\n `${PROJECT_API_ROUTE}/members`,\n authAPIOptions,\n otherOptions,\n {\n method: 'PUT',\n body,\n }\n );\n\n /**\n * Deletes a project from the database by its ID.\n * @param id - Project ID.\n */\n const deleteProject = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<DeleteProjectResult>(\n `${PROJECT_API_ROUTE}`,\n authAPIOptions,\n otherOptions,\n {\n method: 'DELETE',\n }\n );\n\n /**\n * Select a project from the database by its ID.\n * @param projectId - Organization ID.\n */\n const selectProject = async (\n projectId: SelectProjectParam['projectId'],\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<SelectProjectResult>(\n `${PROJECT_API_ROUTE}/${String(projectId)}`,\n authAPIOptions,\n otherOptions,\n {\n method: 'PUT',\n }\n );\n\n /**\n * Unselect a project from the database by its ID.\n * @param projectId - Project ID.\n */\n const unselectProject = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<UnselectProjectResult>(\n `${PROJECT_API_ROUTE}/logout`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n }\n );\n\n /**\n * Add a new access key to a project.\n * @param accessKey - Access key data.\n * @param otherOptions - Fetcher options.\n * @returns The new access key.\n */\n const addNewAccessKey = async (\n accessKey: AddNewAccessKeyBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<AddNewAccessKeyResponse>(\n `${PROJECT_API_ROUTE}/access_key`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body: accessKey,\n }\n );\n\n /**\n * Delete a project access key.\n * @param clientId - Access key client ID.\n * @param otherOptions - Fetcher options.\n * @returns The deleted project.\n */\n const deleteAccessKey = async (\n clientId: DeleteAccessKeyBody['clientId'],\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<DeleteAccessKeyResponse>(\n `${PROJECT_API_ROUTE}/access_key`,\n authAPIOptions,\n otherOptions,\n {\n method: 'DELETE',\n body: { clientId },\n }\n );\n\n /**\n * Refreshes an access key from a project.\n * @param clientId - The ID of the client to refresh.\n * @param projectId - The ID of the project to refresh the access key from.\n * @returns The new access key.\n */\n const refreshAccessKey = async (\n clientId: RefreshAccessKeyBody['clientId'],\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<RefreshAccessKeyResponse>(\n `${PROJECT_API_ROUTE}/access_key`,\n authAPIOptions,\n otherOptions,\n {\n method: 'PATCH',\n body: { clientId },\n }\n );\n\n return {\n getProjects,\n addProject,\n updateProject,\n updateProjectMembers,\n deleteProject,\n selectProject,\n unselectProject,\n addNewAccessKey,\n deleteAccessKey,\n refreshAccessKey,\n };\n};\n\nexport const projectAPI = getProjectAPI();\n"],"names":["getConfiguration","fetcher"],"mappings":";;;;AAuBO,MAAM,gBAAgB,CAC3B,iBAAiC,IACjC,mBACG;AACH,QAAM,EAAE,WAAgB,KAAA,kBAAkBA,OAAAA,iBAAoB,GAAA;AACxD,QAAA,oBAAoB,GAAG,UAAU;AAMvC,QAAM,cAAc,OAClB,SACA,eAA+B,CAAA,MAE/B,MAAMC,yBAAA;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,MACE,QAAQ;AAAA,IAAA;AAAA,EAEZ;AAMF,QAAM,aAAa,OACjB,SACA,eAA+B,CAAA,MAE/B,MAAMA,yBAAA;AAAA,IACJ,GAAG,iBAAiB;AAAA,IACpB;AAAA,IACA;AAAA,IACA;AAAA,MACE,QAAQ;AAAA,MACR,MAAM;AAAA,IAAA;AAAA,EAEV;AAMF,QAAM,gBAAgB,OACpB,SACA,eAA+B,CAAA,MAE/B,MAAMA,yBAAA;AAAA,IACJ,GAAG,iBAAiB;AAAA,IACpB;AAAA,IACA;AAAA,IACA;AAAA,MACE,QAAQ;AAAA,MACR,MAAM;AAAA,IAAA;AAAA,EAEV;AAMF,QAAM,uBAAuB,OAC3B,MACA,eAA+B,CAAA,MAE/B,MAAMA,yBAAA;AAAA,IACJ,GAAG,iBAAiB;AAAA,IACpB;AAAA,IACA;AAAA,IACA;AAAA,MACE,QAAQ;AAAA,MACR;AAAA,IAAA;AAAA,EAEJ;AAMF,QAAM,gBAAgB,OAAO,eAA+B,CAAA,MAC1D,MAAMA,yBAAA;AAAA,IACJ,GAAG,iBAAiB;AAAA,IACpB;AAAA,IACA;AAAA,IACA;AAAA,MACE,QAAQ;AAAA,IAAA;AAAA,EAEZ;AAMF,QAAM,gBAAgB,OACpB,WACA,eAA+B,CAAA,MAE/B,MAAMA,yBAAA;AAAA,IACJ,GAAG,iBAAiB,IAAI,OAAO,SAAS,CAAC;AAAA,IACzC;AAAA,IACA;AAAA,IACA;AAAA,MACE,QAAQ;AAAA,IAAA;AAAA,EAEZ;AAMF,QAAM,kBAAkB,OAAO,eAA+B,CAAA,MAC5D,MAAMA,yBAAA;AAAA,IACJ,GAAG,iBAAiB;AAAA,IACpB;AAAA,IACA;AAAA,IACA;AAAA,MACE,QAAQ;AAAA,IAAA;AAAA,EAEZ;AAQF,QAAM,kBAAkB,OACtB,WACA,eAA+B,CAAA,MAE/B,MAAMA,yBAAA;AAAA,IACJ,GAAG,iBAAiB;AAAA,IACpB;AAAA,IACA;AAAA,IACA;AAAA,MACE,QAAQ;AAAA,MACR,MAAM;AAAA,IAAA;AAAA,EAEV;AAQF,QAAM,kBAAkB,OACtB,UACA,eAA+B,CAAA,MAE/B,MAAMA,yBAAA;AAAA,IACJ,GAAG,iBAAiB;AAAA,IACpB;AAAA,IACA;AAAA,IACA;AAAA,MACE,QAAQ;AAAA,MACR,MAAM,EAAE,SAAS;AAAA,IAAA;AAAA,EAErB;AAQF,QAAM,mBAAmB,OACvB,UACA,eAA+B,CAAA,MAE/B,MAAMA,yBAAA;AAAA,IACJ,GAAG,iBAAiB;AAAA,IACpB;AAAA,IACA;AAAA,IACA;AAAA,MACE,QAAQ;AAAA,MACR,MAAM,EAAE,SAAS;AAAA,IAAA;AAAA,EAErB;AAEK,SAAA;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;AAEO,MAAM,aAAa,cAAc;;;"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { AddProjectBody, AddProjectResult, DeleteProjectResult, GetProjectsParams, GetProjectsResult, UpdateProjectBody, UpdateProjectResult, SelectProjectParam, SelectProjectResult, UnselectProjectResult, AddNewAccessKeyBody, AddNewAccessKeyResponse, DeleteAccessKeyBody, DeleteAccessKeyResponse, RefreshAccessKeyBody, RefreshAccessKeyResponse, UpdateProjectMembersBody, UpdateProjectMembersResult } from '@intlayer/backend';
|
|
2
|
-
import { IntlayerConfig } from '@intlayer/config/client';
|
|
3
|
-
import { FetcherOptions } from './fetcher';
|
|
4
|
-
export declare const getProjectAPI: (authAPIOptions?: FetcherOptions, intlayerConfig?: IntlayerConfig) => {
|
|
5
|
-
getProjects: (filters?: GetProjectsParams, otherOptions?: FetcherOptions) => Promise<GetProjectsResult>;
|
|
6
|
-
addProject: (project: AddProjectBody, otherOptions?: FetcherOptions) => Promise<AddProjectResult>;
|
|
7
|
-
updateProject: (project: UpdateProjectBody, otherOptions?: FetcherOptions) => Promise<UpdateProjectResult>;
|
|
8
|
-
updateProjectMembers: (body: UpdateProjectMembersBody, otherOptions?: FetcherOptions) => Promise<UpdateProjectMembersResult>;
|
|
9
|
-
deleteProject: (otherOptions?: FetcherOptions) => Promise<DeleteProjectResult>;
|
|
10
|
-
selectProject: (projectId: SelectProjectParam["projectId"], otherOptions?: FetcherOptions) => Promise<SelectProjectResult>;
|
|
11
|
-
unselectProject: (otherOptions?: FetcherOptions) => Promise<UnselectProjectResult>;
|
|
12
|
-
addNewAccessKey: (accessKey: AddNewAccessKeyBody, otherOptions?: FetcherOptions) => Promise<AddNewAccessKeyResponse>;
|
|
13
|
-
deleteAccessKey: (clientId: DeleteAccessKeyBody["clientId"], otherOptions?: FetcherOptions) => Promise<DeleteAccessKeyResponse>;
|
|
14
|
-
refreshAccessKey: (clientId: RefreshAccessKeyBody["clientId"], otherOptions?: FetcherOptions) => Promise<RefreshAccessKeyResponse>;
|
|
15
|
-
};
|
|
16
|
-
export declare const projectAPI: {
|
|
17
|
-
getProjects: (filters?: GetProjectsParams, otherOptions?: FetcherOptions) => Promise<GetProjectsResult>;
|
|
18
|
-
addProject: (project: AddProjectBody, otherOptions?: FetcherOptions) => Promise<AddProjectResult>;
|
|
19
|
-
updateProject: (project: UpdateProjectBody, otherOptions?: FetcherOptions) => Promise<UpdateProjectResult>;
|
|
20
|
-
updateProjectMembers: (body: UpdateProjectMembersBody, otherOptions?: FetcherOptions) => Promise<UpdateProjectMembersResult>;
|
|
21
|
-
deleteProject: (otherOptions?: FetcherOptions) => Promise<DeleteProjectResult>;
|
|
22
|
-
selectProject: (projectId: SelectProjectParam["projectId"], otherOptions?: FetcherOptions) => Promise<SelectProjectResult>;
|
|
23
|
-
unselectProject: (otherOptions?: FetcherOptions) => Promise<UnselectProjectResult>;
|
|
24
|
-
addNewAccessKey: (accessKey: AddNewAccessKeyBody, otherOptions?: FetcherOptions) => Promise<AddNewAccessKeyResponse>;
|
|
25
|
-
deleteAccessKey: (clientId: DeleteAccessKeyBody["clientId"], otherOptions?: FetcherOptions) => Promise<DeleteAccessKeyResponse>;
|
|
26
|
-
refreshAccessKey: (clientId: RefreshAccessKeyBody["clientId"], otherOptions?: FetcherOptions) => Promise<RefreshAccessKeyResponse>;
|
|
27
|
-
};
|
|
28
|
-
//# sourceMappingURL=project.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"project.d.ts","sourceRoot":"","sources":["../../../src/libs/intlayer-api/project.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,gBAAgB,EAChB,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,EACnB,qBAAqB,EACrB,mBAAmB,EACnB,uBAAuB,EACvB,mBAAmB,EACnB,uBAAuB,EACvB,oBAAoB,EACpB,wBAAwB,EACxB,wBAAwB,EACxB,0BAA0B,EAC3B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAoB,KAAK,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAChF,OAAO,EAAW,KAAK,cAAc,EAAE,MAAM,WAAW,CAAC;AAEzD,eAAO,MAAM,aAAa,oBACR,cAAc,mBACb,cAAc;4BAUnB,iBAAiB,iBACb,cAAc;0BAgBnB,cAAc,iBACT,cAAc;6BAiBnB,iBAAiB,iBACZ,cAAc;iCAiBtB,wBAAwB,iBAChB,cAAc;mCAgBa,cAAc;+BAe5C,kBAAkB,CAAC,WAAW,CAAC,iBAC5B,cAAc;qCAee,cAAc;iCAiB9C,mBAAmB,iBAChB,cAAc;gCAmBlB,mBAAmB,CAAC,UAAU,CAAC,iBAC3B,cAAc;iCAmBlB,oBAAoB,CAAC,UAAU,CAAC,iBAC5B,cAAc;CAwB/B,CAAC;AAEF,eAAO,MAAM,UAAU;4BAzLT,iBAAiB,iBACb,cAAc;0BAgBnB,cAAc,iBACT,cAAc;6BAiBnB,iBAAiB,iBACZ,cAAc;iCAiBtB,wBAAwB,iBAChB,cAAc;mCAgBa,cAAc;+BAe5C,kBAAkB,CAAC,WAAW,CAAC,iBAC5B,cAAc;qCAee,cAAc;iCAiB9C,mBAAmB,iBAChB,cAAc;gCAmBlB,mBAAmB,CAAC,UAAU,CAAC,iBAC3B,cAAc;iCAmBlB,oBAAoB,CAAC,UAAU,CAAC,iBAC5B,cAAc;CA0BS,CAAC"}
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
import { getConfiguration } from "@intlayer/config/client";
|
|
2
|
-
import { fetcher } from "./fetcher.mjs";
|
|
3
|
-
const getProjectAPI = (authAPIOptions = {}, intlayerConfig) => {
|
|
4
|
-
const { backendURL } = (intlayerConfig ?? getConfiguration()).editor;
|
|
5
|
-
const PROJECT_API_ROUTE = `${backendURL}/api/project`;
|
|
6
|
-
const getProjects = async (filters, otherOptions = {}) => await fetcher(
|
|
7
|
-
PROJECT_API_ROUTE,
|
|
8
|
-
authAPIOptions,
|
|
9
|
-
otherOptions,
|
|
10
|
-
{
|
|
11
|
-
params: filters
|
|
12
|
-
}
|
|
13
|
-
);
|
|
14
|
-
const addProject = async (project, otherOptions = {}) => await fetcher(
|
|
15
|
-
`${PROJECT_API_ROUTE}`,
|
|
16
|
-
authAPIOptions,
|
|
17
|
-
otherOptions,
|
|
18
|
-
{
|
|
19
|
-
method: "POST",
|
|
20
|
-
body: project
|
|
21
|
-
}
|
|
22
|
-
);
|
|
23
|
-
const updateProject = async (project, otherOptions = {}) => await fetcher(
|
|
24
|
-
`${PROJECT_API_ROUTE}`,
|
|
25
|
-
authAPIOptions,
|
|
26
|
-
otherOptions,
|
|
27
|
-
{
|
|
28
|
-
method: "PUT",
|
|
29
|
-
body: project
|
|
30
|
-
}
|
|
31
|
-
);
|
|
32
|
-
const updateProjectMembers = async (body, otherOptions = {}) => await fetcher(
|
|
33
|
-
`${PROJECT_API_ROUTE}/members`,
|
|
34
|
-
authAPIOptions,
|
|
35
|
-
otherOptions,
|
|
36
|
-
{
|
|
37
|
-
method: "PUT",
|
|
38
|
-
body
|
|
39
|
-
}
|
|
40
|
-
);
|
|
41
|
-
const deleteProject = async (otherOptions = {}) => await fetcher(
|
|
42
|
-
`${PROJECT_API_ROUTE}`,
|
|
43
|
-
authAPIOptions,
|
|
44
|
-
otherOptions,
|
|
45
|
-
{
|
|
46
|
-
method: "DELETE"
|
|
47
|
-
}
|
|
48
|
-
);
|
|
49
|
-
const selectProject = async (projectId, otherOptions = {}) => await fetcher(
|
|
50
|
-
`${PROJECT_API_ROUTE}/${String(projectId)}`,
|
|
51
|
-
authAPIOptions,
|
|
52
|
-
otherOptions,
|
|
53
|
-
{
|
|
54
|
-
method: "PUT"
|
|
55
|
-
}
|
|
56
|
-
);
|
|
57
|
-
const unselectProject = async (otherOptions = {}) => await fetcher(
|
|
58
|
-
`${PROJECT_API_ROUTE}/logout`,
|
|
59
|
-
authAPIOptions,
|
|
60
|
-
otherOptions,
|
|
61
|
-
{
|
|
62
|
-
method: "POST"
|
|
63
|
-
}
|
|
64
|
-
);
|
|
65
|
-
const addNewAccessKey = async (accessKey, otherOptions = {}) => await fetcher(
|
|
66
|
-
`${PROJECT_API_ROUTE}/access_key`,
|
|
67
|
-
authAPIOptions,
|
|
68
|
-
otherOptions,
|
|
69
|
-
{
|
|
70
|
-
method: "POST",
|
|
71
|
-
body: accessKey
|
|
72
|
-
}
|
|
73
|
-
);
|
|
74
|
-
const deleteAccessKey = async (clientId, otherOptions = {}) => await fetcher(
|
|
75
|
-
`${PROJECT_API_ROUTE}/access_key`,
|
|
76
|
-
authAPIOptions,
|
|
77
|
-
otherOptions,
|
|
78
|
-
{
|
|
79
|
-
method: "DELETE",
|
|
80
|
-
body: { clientId }
|
|
81
|
-
}
|
|
82
|
-
);
|
|
83
|
-
const refreshAccessKey = async (clientId, otherOptions = {}) => await fetcher(
|
|
84
|
-
`${PROJECT_API_ROUTE}/access_key`,
|
|
85
|
-
authAPIOptions,
|
|
86
|
-
otherOptions,
|
|
87
|
-
{
|
|
88
|
-
method: "PATCH",
|
|
89
|
-
body: { clientId }
|
|
90
|
-
}
|
|
91
|
-
);
|
|
92
|
-
return {
|
|
93
|
-
getProjects,
|
|
94
|
-
addProject,
|
|
95
|
-
updateProject,
|
|
96
|
-
updateProjectMembers,
|
|
97
|
-
deleteProject,
|
|
98
|
-
selectProject,
|
|
99
|
-
unselectProject,
|
|
100
|
-
addNewAccessKey,
|
|
101
|
-
deleteAccessKey,
|
|
102
|
-
refreshAccessKey
|
|
103
|
-
};
|
|
104
|
-
};
|
|
105
|
-
const projectAPI = getProjectAPI();
|
|
106
|
-
export {
|
|
107
|
-
getProjectAPI,
|
|
108
|
-
projectAPI
|
|
109
|
-
};
|
|
110
|
-
//# sourceMappingURL=project.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"project.mjs","sources":["../../../src/libs/intlayer-api/project.ts"],"sourcesContent":["import type {\n AddProjectBody,\n AddProjectResult,\n DeleteProjectResult,\n GetProjectsParams,\n GetProjectsResult,\n UpdateProjectBody,\n UpdateProjectResult,\n SelectProjectParam,\n SelectProjectResult,\n UnselectProjectResult,\n AddNewAccessKeyBody,\n AddNewAccessKeyResponse,\n DeleteAccessKeyBody,\n DeleteAccessKeyResponse,\n RefreshAccessKeyBody,\n RefreshAccessKeyResponse,\n UpdateProjectMembersBody,\n UpdateProjectMembersResult,\n} from '@intlayer/backend';\nimport { getConfiguration, type IntlayerConfig } from '@intlayer/config/client';\nimport { fetcher, type FetcherOptions } from './fetcher';\n\nexport const getProjectAPI = (\n authAPIOptions: FetcherOptions = {},\n intlayerConfig?: IntlayerConfig\n) => {\n const { backendURL } = (intlayerConfig ?? getConfiguration()).editor;\n const PROJECT_API_ROUTE = `${backendURL}/api/project`;\n\n /**\n * Retrieves a list of projects based on filters and pagination.\n * @param filters - Filters and pagination options.\n */\n const getProjects = async (\n filters?: GetProjectsParams,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetProjectsResult>(\n PROJECT_API_ROUTE,\n authAPIOptions,\n otherOptions,\n {\n params: filters,\n }\n );\n\n /**\n * Adds a new project to the database.\n * @param project - Project data.\n */\n const addProject = async (\n project: AddProjectBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<AddProjectResult>(\n `${PROJECT_API_ROUTE}`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body: project,\n }\n );\n\n /**\n * Updates an existing project in the database.\n * @param project - Updated project data.\n */\n const updateProject = async (\n project: UpdateProjectBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<UpdateProjectResult>(\n `${PROJECT_API_ROUTE}`,\n authAPIOptions,\n otherOptions,\n {\n method: 'PUT',\n body: project,\n }\n );\n\n /**\n * Updates project members in the database.\n * @param project - Updated project data.\n */\n const updateProjectMembers = async (\n body: UpdateProjectMembersBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<UpdateProjectMembersResult>(\n `${PROJECT_API_ROUTE}/members`,\n authAPIOptions,\n otherOptions,\n {\n method: 'PUT',\n body,\n }\n );\n\n /**\n * Deletes a project from the database by its ID.\n * @param id - Project ID.\n */\n const deleteProject = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<DeleteProjectResult>(\n `${PROJECT_API_ROUTE}`,\n authAPIOptions,\n otherOptions,\n {\n method: 'DELETE',\n }\n );\n\n /**\n * Select a project from the database by its ID.\n * @param projectId - Organization ID.\n */\n const selectProject = async (\n projectId: SelectProjectParam['projectId'],\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<SelectProjectResult>(\n `${PROJECT_API_ROUTE}/${String(projectId)}`,\n authAPIOptions,\n otherOptions,\n {\n method: 'PUT',\n }\n );\n\n /**\n * Unselect a project from the database by its ID.\n * @param projectId - Project ID.\n */\n const unselectProject = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<UnselectProjectResult>(\n `${PROJECT_API_ROUTE}/logout`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n }\n );\n\n /**\n * Add a new access key to a project.\n * @param accessKey - Access key data.\n * @param otherOptions - Fetcher options.\n * @returns The new access key.\n */\n const addNewAccessKey = async (\n accessKey: AddNewAccessKeyBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<AddNewAccessKeyResponse>(\n `${PROJECT_API_ROUTE}/access_key`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body: accessKey,\n }\n );\n\n /**\n * Delete a project access key.\n * @param clientId - Access key client ID.\n * @param otherOptions - Fetcher options.\n * @returns The deleted project.\n */\n const deleteAccessKey = async (\n clientId: DeleteAccessKeyBody['clientId'],\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<DeleteAccessKeyResponse>(\n `${PROJECT_API_ROUTE}/access_key`,\n authAPIOptions,\n otherOptions,\n {\n method: 'DELETE',\n body: { clientId },\n }\n );\n\n /**\n * Refreshes an access key from a project.\n * @param clientId - The ID of the client to refresh.\n * @param projectId - The ID of the project to refresh the access key from.\n * @returns The new access key.\n */\n const refreshAccessKey = async (\n clientId: RefreshAccessKeyBody['clientId'],\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<RefreshAccessKeyResponse>(\n `${PROJECT_API_ROUTE}/access_key`,\n authAPIOptions,\n otherOptions,\n {\n method: 'PATCH',\n body: { clientId },\n }\n );\n\n return {\n getProjects,\n addProject,\n updateProject,\n updateProjectMembers,\n deleteProject,\n selectProject,\n unselectProject,\n addNewAccessKey,\n deleteAccessKey,\n refreshAccessKey,\n };\n};\n\nexport const projectAPI = getProjectAPI();\n"],"names":[],"mappings":";;AAuBO,MAAM,gBAAgB,CAC3B,iBAAiC,IACjC,mBACG;AACH,QAAM,EAAE,WAAgB,KAAA,kBAAkB,iBAAoB,GAAA;AACxD,QAAA,oBAAoB,GAAG,UAAU;AAMvC,QAAM,cAAc,OAClB,SACA,eAA+B,CAAA,MAE/B,MAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,MACE,QAAQ;AAAA,IAAA;AAAA,EAEZ;AAMF,QAAM,aAAa,OACjB,SACA,eAA+B,CAAA,MAE/B,MAAM;AAAA,IACJ,GAAG,iBAAiB;AAAA,IACpB;AAAA,IACA;AAAA,IACA;AAAA,MACE,QAAQ;AAAA,MACR,MAAM;AAAA,IAAA;AAAA,EAEV;AAMF,QAAM,gBAAgB,OACpB,SACA,eAA+B,CAAA,MAE/B,MAAM;AAAA,IACJ,GAAG,iBAAiB;AAAA,IACpB;AAAA,IACA;AAAA,IACA;AAAA,MACE,QAAQ;AAAA,MACR,MAAM;AAAA,IAAA;AAAA,EAEV;AAMF,QAAM,uBAAuB,OAC3B,MACA,eAA+B,CAAA,MAE/B,MAAM;AAAA,IACJ,GAAG,iBAAiB;AAAA,IACpB;AAAA,IACA;AAAA,IACA;AAAA,MACE,QAAQ;AAAA,MACR;AAAA,IAAA;AAAA,EAEJ;AAMF,QAAM,gBAAgB,OAAO,eAA+B,CAAA,MAC1D,MAAM;AAAA,IACJ,GAAG,iBAAiB;AAAA,IACpB;AAAA,IACA;AAAA,IACA;AAAA,MACE,QAAQ;AAAA,IAAA;AAAA,EAEZ;AAMF,QAAM,gBAAgB,OACpB,WACA,eAA+B,CAAA,MAE/B,MAAM;AAAA,IACJ,GAAG,iBAAiB,IAAI,OAAO,SAAS,CAAC;AAAA,IACzC;AAAA,IACA;AAAA,IACA;AAAA,MACE,QAAQ;AAAA,IAAA;AAAA,EAEZ;AAMF,QAAM,kBAAkB,OAAO,eAA+B,CAAA,MAC5D,MAAM;AAAA,IACJ,GAAG,iBAAiB;AAAA,IACpB;AAAA,IACA;AAAA,IACA;AAAA,MACE,QAAQ;AAAA,IAAA;AAAA,EAEZ;AAQF,QAAM,kBAAkB,OACtB,WACA,eAA+B,CAAA,MAE/B,MAAM;AAAA,IACJ,GAAG,iBAAiB;AAAA,IACpB;AAAA,IACA;AAAA,IACA;AAAA,MACE,QAAQ;AAAA,MACR,MAAM;AAAA,IAAA;AAAA,EAEV;AAQF,QAAM,kBAAkB,OACtB,UACA,eAA+B,CAAA,MAE/B,MAAM;AAAA,IACJ,GAAG,iBAAiB;AAAA,IACpB;AAAA,IACA;AAAA,IACA;AAAA,MACE,QAAQ;AAAA,MACR,MAAM,EAAE,SAAS;AAAA,IAAA;AAAA,EAErB;AAQF,QAAM,mBAAmB,OACvB,UACA,eAA+B,CAAA,MAE/B,MAAM;AAAA,IACJ,GAAG,iBAAiB;AAAA,IACpB;AAAA,IACA;AAAA,IACA;AAAA,MACE,QAAQ;AAAA,MACR,MAAM,EAAE,SAAS;AAAA,IAAA;AAAA,EAErB;AAEK,SAAA;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;AAEO,MAAM,aAAa,cAAc;"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const client = require("@intlayer/config/client");
|
|
4
|
-
const libs_intlayerApi_fetcher = require("./fetcher.cjs");
|
|
5
|
-
const getStripeAPI = (authAPIOptions = {}, intlayerConfig) => {
|
|
6
|
-
const backendURL = (intlayerConfig ?? client.getConfiguration()).editor.backendURL;
|
|
7
|
-
const STRIPE_API_ROUTE = `${backendURL}/api/stripe`;
|
|
8
|
-
const getSubscription = async (body, otherOptions = {}) => await libs_intlayerApi_fetcher.fetcher(
|
|
9
|
-
`${STRIPE_API_ROUTE}/create-subscription`,
|
|
10
|
-
authAPIOptions,
|
|
11
|
-
otherOptions,
|
|
12
|
-
{
|
|
13
|
-
method: "POST",
|
|
14
|
-
body
|
|
15
|
-
}
|
|
16
|
-
);
|
|
17
|
-
const cancelSubscription = async (otherOptions = {}) => await libs_intlayerApi_fetcher.fetcher(
|
|
18
|
-
`${STRIPE_API_ROUTE}/cancel-subscription`,
|
|
19
|
-
authAPIOptions,
|
|
20
|
-
otherOptions,
|
|
21
|
-
{
|
|
22
|
-
method: "POST"
|
|
23
|
-
}
|
|
24
|
-
);
|
|
25
|
-
return {
|
|
26
|
-
getSubscription,
|
|
27
|
-
cancelSubscription
|
|
28
|
-
};
|
|
29
|
-
};
|
|
30
|
-
exports.getStripeAPI = getStripeAPI;
|
|
31
|
-
//# sourceMappingURL=stripe.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"stripe.cjs","sources":["../../../src/libs/intlayer-api/stripe.ts"],"sourcesContent":["import type {\n GetCheckoutSessionBody,\n GetCheckoutSessionResult,\n} from '@intlayer/backend';\nimport { getConfiguration, type IntlayerConfig } from '@intlayer/config/client';\nimport { fetcher, type FetcherOptions } from './fetcher';\n\nexport const getStripeAPI = (\n authAPIOptions: FetcherOptions = {},\n intlayerConfig?: IntlayerConfig\n) => {\n const backendURL = (intlayerConfig ?? getConfiguration()).editor.backendURL;\n const STRIPE_API_ROUTE = `${backendURL}/api/stripe`;\n\n /**\n * Retrieves a checkout session.\n * @param body - Checkout session body.\n */\n const getSubscription = async (\n body?: GetCheckoutSessionBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetCheckoutSessionResult>(\n `${STRIPE_API_ROUTE}/create-subscription`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body,\n }\n );\n\n /**\n * Cancels a subscription.\n * @param body - Checkout session body.\n */\n const cancelSubscription = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<GetCheckoutSessionResult>(\n `${STRIPE_API_ROUTE}/cancel-subscription`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n }\n );\n\n return {\n getSubscription,\n cancelSubscription,\n };\n};\n"],"names":["getConfiguration","fetcher"],"mappings":";;;;AAOO,MAAM,eAAe,CAC1B,iBAAiC,IACjC,mBACG;AACH,QAAM,cAAc,kBAAkBA,OAAAA,iBAAiB,GAAG,OAAO;AAC3D,QAAA,mBAAmB,GAAG,UAAU;AAMtC,QAAM,kBAAkB,OACtB,MACA,eAA+B,CAAA,MAE/B,MAAMC,yBAAA;AAAA,IACJ,GAAG,gBAAgB;AAAA,IACnB;AAAA,IACA;AAAA,IACA;AAAA,MACE,QAAQ;AAAA,MACR;AAAA,IAAA;AAAA,EAEJ;AAMF,QAAM,qBAAqB,OAAO,eAA+B,CAAA,MAC/D,MAAMA,yBAAA;AAAA,IACJ,GAAG,gBAAgB;AAAA,IACnB;AAAA,IACA;AAAA,IACA;AAAA,MACE,QAAQ;AAAA,IAAA;AAAA,EAEZ;AAEK,SAAA;AAAA,IACL;AAAA,IACA;AAAA,EACF;AACF;;"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { GetCheckoutSessionBody, GetCheckoutSessionResult } from '@intlayer/backend';
|
|
2
|
-
import { IntlayerConfig } from '@intlayer/config/client';
|
|
3
|
-
import { FetcherOptions } from './fetcher';
|
|
4
|
-
export declare const getStripeAPI: (authAPIOptions?: FetcherOptions, intlayerConfig?: IntlayerConfig) => {
|
|
5
|
-
getSubscription: (body?: GetCheckoutSessionBody, otherOptions?: FetcherOptions) => Promise<GetCheckoutSessionResult>;
|
|
6
|
-
cancelSubscription: (otherOptions?: FetcherOptions) => Promise<GetCheckoutSessionResult>;
|
|
7
|
-
};
|
|
8
|
-
//# sourceMappingURL=stripe.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"stripe.d.ts","sourceRoot":"","sources":["../../../src/libs/intlayer-api/stripe.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,sBAAsB,EACtB,wBAAwB,EACzB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAoB,KAAK,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAChF,OAAO,EAAW,KAAK,cAAc,EAAE,MAAM,WAAW,CAAC;AAEzD,eAAO,MAAM,YAAY,oBACP,cAAc,mBACb,cAAc;6BAUtB,sBAAsB,iBACf,cAAc;wCAgBkB,cAAc;CAc/D,CAAC"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { getConfiguration } from "@intlayer/config/client";
|
|
2
|
-
import { fetcher } from "./fetcher.mjs";
|
|
3
|
-
const getStripeAPI = (authAPIOptions = {}, intlayerConfig) => {
|
|
4
|
-
const backendURL = (intlayerConfig ?? getConfiguration()).editor.backendURL;
|
|
5
|
-
const STRIPE_API_ROUTE = `${backendURL}/api/stripe`;
|
|
6
|
-
const getSubscription = async (body, otherOptions = {}) => await fetcher(
|
|
7
|
-
`${STRIPE_API_ROUTE}/create-subscription`,
|
|
8
|
-
authAPIOptions,
|
|
9
|
-
otherOptions,
|
|
10
|
-
{
|
|
11
|
-
method: "POST",
|
|
12
|
-
body
|
|
13
|
-
}
|
|
14
|
-
);
|
|
15
|
-
const cancelSubscription = async (otherOptions = {}) => await fetcher(
|
|
16
|
-
`${STRIPE_API_ROUTE}/cancel-subscription`,
|
|
17
|
-
authAPIOptions,
|
|
18
|
-
otherOptions,
|
|
19
|
-
{
|
|
20
|
-
method: "POST"
|
|
21
|
-
}
|
|
22
|
-
);
|
|
23
|
-
return {
|
|
24
|
-
getSubscription,
|
|
25
|
-
cancelSubscription
|
|
26
|
-
};
|
|
27
|
-
};
|
|
28
|
-
export {
|
|
29
|
-
getStripeAPI
|
|
30
|
-
};
|
|
31
|
-
//# sourceMappingURL=stripe.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"stripe.mjs","sources":["../../../src/libs/intlayer-api/stripe.ts"],"sourcesContent":["import type {\n GetCheckoutSessionBody,\n GetCheckoutSessionResult,\n} from '@intlayer/backend';\nimport { getConfiguration, type IntlayerConfig } from '@intlayer/config/client';\nimport { fetcher, type FetcherOptions } from './fetcher';\n\nexport const getStripeAPI = (\n authAPIOptions: FetcherOptions = {},\n intlayerConfig?: IntlayerConfig\n) => {\n const backendURL = (intlayerConfig ?? getConfiguration()).editor.backendURL;\n const STRIPE_API_ROUTE = `${backendURL}/api/stripe`;\n\n /**\n * Retrieves a checkout session.\n * @param body - Checkout session body.\n */\n const getSubscription = async (\n body?: GetCheckoutSessionBody,\n otherOptions: FetcherOptions = {}\n ) =>\n await fetcher<GetCheckoutSessionResult>(\n `${STRIPE_API_ROUTE}/create-subscription`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n body,\n }\n );\n\n /**\n * Cancels a subscription.\n * @param body - Checkout session body.\n */\n const cancelSubscription = async (otherOptions: FetcherOptions = {}) =>\n await fetcher<GetCheckoutSessionResult>(\n `${STRIPE_API_ROUTE}/cancel-subscription`,\n authAPIOptions,\n otherOptions,\n {\n method: 'POST',\n }\n );\n\n return {\n getSubscription,\n cancelSubscription,\n };\n};\n"],"names":[],"mappings":";;AAOO,MAAM,eAAe,CAC1B,iBAAiC,IACjC,mBACG;AACH,QAAM,cAAc,kBAAkB,iBAAiB,GAAG,OAAO;AAC3D,QAAA,mBAAmB,GAAG,UAAU;AAMtC,QAAM,kBAAkB,OACtB,MACA,eAA+B,CAAA,MAE/B,MAAM;AAAA,IACJ,GAAG,gBAAgB;AAAA,IACnB;AAAA,IACA;AAAA,IACA;AAAA,MACE,QAAQ;AAAA,MACR;AAAA,IAAA;AAAA,EAEJ;AAMF,QAAM,qBAAqB,OAAO,eAA+B,CAAA,MAC/D,MAAM;AAAA,IACJ,GAAG,gBAAgB;AAAA,IACnB;AAAA,IACA;AAAA,IACA;AAAA,MACE,QAAQ;AAAA,IAAA;AAAA,EAEZ;AAEK,SAAA;AAAA,IACL;AAAA,IACA;AAAA,EACF;AACF;"}
|