@venturialstd/workflow 0.1.113 → 0.1.115
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/README.md +238 -238
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -1
- package/dist/index.js.map +1 -1
- package/dist/modules/capa/actions/cancel-transaction.action.d.ts +3 -0
- package/dist/modules/capa/actions/cancel-transaction.action.d.ts.map +1 -0
- package/dist/modules/capa/actions/cancel-transaction.action.js +58 -0
- package/dist/modules/capa/actions/cancel-transaction.action.js.map +1 -0
- package/dist/modules/capa/actions/create-cross-ramp-quote.action.d.ts +3 -0
- package/dist/modules/capa/actions/create-cross-ramp-quote.action.d.ts.map +1 -0
- package/dist/modules/capa/actions/create-cross-ramp-quote.action.js +143 -0
- package/dist/modules/capa/actions/create-cross-ramp-quote.action.js.map +1 -0
- package/dist/modules/capa/actions/create-cross-ramp.action.d.ts +3 -0
- package/dist/modules/capa/actions/create-cross-ramp.action.d.ts.map +1 -0
- package/dist/modules/capa/actions/create-cross-ramp.action.js +158 -0
- package/dist/modules/capa/actions/create-cross-ramp.action.js.map +1 -0
- package/dist/modules/capa/actions/create-kyb-verification-link.action.d.ts +3 -0
- package/dist/modules/capa/actions/create-kyb-verification-link.action.d.ts.map +1 -0
- package/dist/modules/capa/actions/create-kyb-verification-link.action.js +50 -0
- package/dist/modules/capa/actions/create-kyb-verification-link.action.js.map +1 -0
- package/dist/modules/capa/actions/create-kyc-verification-link.action.d.ts +3 -0
- package/dist/modules/capa/actions/create-kyc-verification-link.action.d.ts.map +1 -0
- package/dist/modules/capa/actions/create-kyc-verification-link.action.js +50 -0
- package/dist/modules/capa/actions/create-kyc-verification-link.action.js.map +1 -0
- package/dist/modules/capa/actions/create-off-ramp.action.d.ts +3 -0
- package/dist/modules/capa/actions/create-off-ramp.action.d.ts.map +1 -0
- package/dist/modules/capa/actions/create-off-ramp.action.js +195 -0
- package/dist/modules/capa/actions/create-off-ramp.action.js.map +1 -0
- package/dist/modules/capa/actions/create-on-ramp.action.d.ts +3 -0
- package/dist/modules/capa/actions/create-on-ramp.action.d.ts.map +1 -0
- package/dist/modules/capa/actions/create-on-ramp.action.js +195 -0
- package/dist/modules/capa/actions/create-on-ramp.action.js.map +1 -0
- package/dist/modules/capa/actions/create-quote.action.d.ts +3 -0
- package/dist/modules/capa/actions/create-quote.action.d.ts.map +1 -0
- package/dist/modules/capa/actions/create-quote.action.js +156 -0
- package/dist/modules/capa/actions/create-quote.action.js.map +1 -0
- package/dist/modules/capa/actions/create-receiver.action.d.ts +3 -0
- package/dist/modules/capa/actions/create-receiver.action.d.ts.map +1 -0
- package/dist/modules/capa/actions/create-receiver.action.js +217 -0
- package/dist/modules/capa/actions/create-receiver.action.js.map +1 -0
- package/dist/modules/capa/actions/create-user-kyc.action.d.ts +3 -0
- package/dist/modules/capa/actions/create-user-kyc.action.d.ts.map +1 -0
- package/dist/modules/capa/actions/create-user-kyc.action.js +90 -0
- package/dist/modules/capa/actions/create-user-kyc.action.js.map +1 -0
- package/dist/modules/capa/actions/create-user.action.d.ts +3 -0
- package/dist/modules/capa/actions/create-user.action.d.ts.map +1 -0
- package/dist/modules/capa/actions/create-user.action.js +110 -0
- package/dist/modules/capa/actions/create-user.action.js.map +1 -0
- package/dist/modules/capa/actions/delete-receiver.action.d.ts +3 -0
- package/dist/modules/capa/actions/delete-receiver.action.d.ts.map +1 -0
- package/dist/modules/capa/actions/delete-receiver.action.js +56 -0
- package/dist/modules/capa/actions/delete-receiver.action.js.map +1 -0
- package/dist/modules/capa/actions/get-cross-ramp-quote.action.d.ts +3 -0
- package/dist/modules/capa/actions/get-cross-ramp-quote.action.d.ts.map +1 -0
- package/dist/modules/capa/actions/get-cross-ramp-quote.action.js +143 -0
- package/dist/modules/capa/actions/get-cross-ramp-quote.action.js.map +1 -0
- package/dist/modules/capa/actions/get-kyb-details.action.d.ts +3 -0
- package/dist/modules/capa/actions/get-kyb-details.action.d.ts.map +1 -0
- package/dist/modules/capa/actions/get-kyb-details.action.js +64 -0
- package/dist/modules/capa/actions/get-kyb-details.action.js.map +1 -0
- package/dist/modules/capa/actions/get-kyc-details.action.d.ts +3 -0
- package/dist/modules/capa/actions/get-kyc-details.action.d.ts.map +1 -0
- package/dist/modules/capa/actions/get-kyc-details.action.js +100 -0
- package/dist/modules/capa/actions/get-kyc-details.action.js.map +1 -0
- package/dist/modules/capa/actions/get-mock-testing-guide.action.d.ts +3 -0
- package/dist/modules/capa/actions/get-mock-testing-guide.action.d.ts.map +1 -0
- package/dist/modules/capa/actions/get-mock-testing-guide.action.js +23 -0
- package/dist/modules/capa/actions/get-mock-testing-guide.action.js.map +1 -0
- package/dist/modules/capa/actions/get-quote.action.d.ts +3 -0
- package/dist/modules/capa/actions/get-quote.action.d.ts.map +1 -0
- package/dist/modules/capa/actions/get-quote.action.js +156 -0
- package/dist/modules/capa/actions/get-quote.action.js.map +1 -0
- package/dist/modules/capa/actions/get-user-agreements.action.d.ts +3 -0
- package/dist/modules/capa/actions/get-user-agreements.action.d.ts.map +1 -0
- package/dist/modules/capa/actions/get-user-agreements.action.js +40 -0
- package/dist/modules/capa/actions/get-user-agreements.action.js.map +1 -0
- package/dist/modules/capa/actions/index.d.ts +23 -0
- package/dist/modules/capa/actions/index.d.ts.map +1 -0
- package/dist/modules/capa/actions/index.js +39 -0
- package/dist/modules/capa/actions/index.js.map +1 -0
- package/dist/modules/capa/actions/list-receivers.action.d.ts +3 -0
- package/dist/modules/capa/actions/list-receivers.action.d.ts.map +1 -0
- package/dist/modules/capa/actions/list-receivers.action.js +51 -0
- package/dist/modules/capa/actions/list-receivers.action.js.map +1 -0
- package/dist/modules/capa/actions/list-transactions.action.d.ts +3 -0
- package/dist/modules/capa/actions/list-transactions.action.d.ts.map +1 -0
- package/dist/modules/capa/actions/list-transactions.action.js +125 -0
- package/dist/modules/capa/actions/list-transactions.action.js.map +1 -0
- package/dist/modules/capa/actions/request-document-signature.action.d.ts +3 -0
- package/dist/modules/capa/actions/request-document-signature.action.d.ts.map +1 -0
- package/dist/modules/capa/actions/request-document-signature.action.js +50 -0
- package/dist/modules/capa/actions/request-document-signature.action.js.map +1 -0
- package/dist/modules/capa/actions/update-webhook-settings.action.d.ts +3 -0
- package/dist/modules/capa/actions/update-webhook-settings.action.d.ts.map +1 -0
- package/dist/modules/capa/actions/update-webhook-settings.action.js +52 -0
- package/dist/modules/capa/actions/update-webhook-settings.action.js.map +1 -0
- package/dist/modules/capa/auth/capa-auth.service.d.ts +8 -0
- package/dist/modules/capa/auth/capa-auth.service.d.ts.map +1 -0
- package/dist/modules/capa/auth/capa-auth.service.js +94 -0
- package/dist/modules/capa/auth/capa-auth.service.js.map +1 -0
- package/dist/modules/capa/auth/index.d.ts +2 -0
- package/dist/modules/capa/auth/index.d.ts.map +1 -0
- package/dist/modules/{chatbot/triggers → capa/auth}/index.js +1 -1
- package/dist/modules/capa/auth/index.js.map +1 -0
- package/dist/modules/capa/capa-nest.module.d.ts +3 -0
- package/dist/modules/capa/capa-nest.module.d.ts.map +1 -0
- package/dist/modules/capa/capa-nest.module.js +72 -0
- package/dist/modules/capa/capa-nest.module.js.map +1 -0
- package/dist/modules/capa/capa.module.d.ts +3 -0
- package/dist/modules/capa/capa.module.d.ts.map +1 -0
- package/dist/modules/capa/capa.module.js +42 -0
- package/dist/modules/capa/capa.module.js.map +1 -0
- package/dist/modules/capa/credentials.d.ts +3 -0
- package/dist/modules/capa/credentials.d.ts.map +1 -0
- package/dist/modules/capa/credentials.js +46 -0
- package/dist/modules/capa/credentials.js.map +1 -0
- package/dist/modules/capa/services/cancel-transaction.service.d.ts +9 -0
- package/dist/modules/capa/services/cancel-transaction.service.d.ts.map +1 -0
- package/dist/modules/capa/services/cancel-transaction.service.js +45 -0
- package/dist/modules/capa/services/cancel-transaction.service.js.map +1 -0
- package/dist/modules/capa/services/create-cross-ramp-quote.service.d.ts +9 -0
- package/dist/modules/capa/services/create-cross-ramp-quote.service.d.ts.map +1 -0
- package/dist/modules/capa/services/create-cross-ramp-quote.service.js +75 -0
- package/dist/modules/capa/services/create-cross-ramp-quote.service.js.map +1 -0
- package/dist/modules/capa/services/create-cross-ramp.service.d.ts +9 -0
- package/dist/modules/capa/services/create-cross-ramp.service.d.ts.map +1 -0
- package/dist/modules/capa/services/create-cross-ramp.service.js +66 -0
- package/dist/modules/capa/services/create-cross-ramp.service.js.map +1 -0
- package/dist/modules/capa/services/create-kyb-verification-link.service.d.ts +9 -0
- package/dist/modules/capa/services/create-kyb-verification-link.service.d.ts.map +1 -0
- package/dist/modules/capa/services/create-kyb-verification-link.service.js +47 -0
- package/dist/modules/capa/services/create-kyb-verification-link.service.js.map +1 -0
- package/dist/modules/capa/services/create-kyc-verification-link.service.d.ts +9 -0
- package/dist/modules/capa/services/create-kyc-verification-link.service.d.ts.map +1 -0
- package/dist/modules/capa/services/create-kyc-verification-link.service.js +47 -0
- package/dist/modules/capa/services/create-kyc-verification-link.service.js.map +1 -0
- package/dist/modules/capa/services/create-off-ramp.service.d.ts +9 -0
- package/dist/modules/capa/services/create-off-ramp.service.d.ts.map +1 -0
- package/dist/modules/capa/services/create-off-ramp.service.js +80 -0
- package/dist/modules/capa/services/create-off-ramp.service.js.map +1 -0
- package/dist/modules/capa/services/create-on-ramp.service.d.ts +9 -0
- package/dist/modules/capa/services/create-on-ramp.service.d.ts.map +1 -0
- package/dist/modules/capa/services/create-on-ramp.service.js +80 -0
- package/dist/modules/capa/services/create-on-ramp.service.js.map +1 -0
- package/dist/modules/capa/services/create-quote.service.d.ts +9 -0
- package/dist/modules/capa/services/create-quote.service.d.ts.map +1 -0
- package/dist/modules/capa/services/create-quote.service.js +77 -0
- package/dist/modules/capa/services/create-quote.service.js.map +1 -0
- package/dist/modules/capa/services/create-receiver.service.d.ts +9 -0
- package/dist/modules/capa/services/create-receiver.service.d.ts.map +1 -0
- package/dist/modules/capa/services/create-receiver.service.js +79 -0
- package/dist/modules/capa/services/create-receiver.service.js.map +1 -0
- package/dist/modules/capa/services/create-user-kyc.service.d.ts +9 -0
- package/dist/modules/capa/services/create-user-kyc.service.d.ts.map +1 -0
- package/dist/modules/capa/services/create-user-kyc.service.js +54 -0
- package/dist/modules/capa/services/create-user-kyc.service.js.map +1 -0
- package/dist/modules/capa/services/create-user.service.d.ts +9 -0
- package/dist/modules/capa/services/create-user.service.d.ts.map +1 -0
- package/dist/modules/capa/services/create-user.service.js +57 -0
- package/dist/modules/capa/services/create-user.service.js.map +1 -0
- package/dist/modules/capa/services/delete-receiver.service.d.ts +9 -0
- package/dist/modules/capa/services/delete-receiver.service.d.ts.map +1 -0
- package/dist/modules/capa/services/delete-receiver.service.js +47 -0
- package/dist/modules/capa/services/delete-receiver.service.js.map +1 -0
- package/dist/modules/capa/services/get-cross-ramp-quote.service.d.ts +9 -0
- package/dist/modules/capa/services/get-cross-ramp-quote.service.d.ts.map +1 -0
- package/dist/modules/capa/services/get-cross-ramp-quote.service.js +75 -0
- package/dist/modules/capa/services/get-cross-ramp-quote.service.js.map +1 -0
- package/dist/modules/capa/services/get-kyb-details.service.d.ts +9 -0
- package/dist/modules/capa/services/get-kyb-details.service.d.ts.map +1 -0
- package/dist/modules/capa/services/get-kyb-details.service.js +46 -0
- package/dist/modules/capa/services/get-kyb-details.service.js.map +1 -0
- package/dist/modules/capa/services/get-kyc-details.service.d.ts +9 -0
- package/dist/modules/capa/services/get-kyc-details.service.d.ts.map +1 -0
- package/dist/modules/capa/services/get-kyc-details.service.js +52 -0
- package/dist/modules/capa/services/get-kyc-details.service.js.map +1 -0
- package/dist/modules/capa/services/get-mock-testing-guide.service.d.ts +9 -0
- package/dist/modules/capa/services/get-mock-testing-guide.service.d.ts.map +1 -0
- package/dist/modules/capa/services/get-mock-testing-guide.service.js +37 -0
- package/dist/modules/capa/services/get-mock-testing-guide.service.js.map +1 -0
- package/dist/modules/capa/services/get-quote.service.d.ts +9 -0
- package/dist/modules/capa/services/get-quote.service.d.ts.map +1 -0
- package/dist/modules/capa/services/get-quote.service.js +77 -0
- package/dist/modules/capa/services/get-quote.service.js.map +1 -0
- package/dist/modules/capa/services/get-user-agreements.service.d.ts +9 -0
- package/dist/modules/capa/services/get-user-agreements.service.d.ts.map +1 -0
- package/dist/modules/capa/services/get-user-agreements.service.js +42 -0
- package/dist/modules/capa/services/get-user-agreements.service.js.map +1 -0
- package/dist/modules/capa/services/index.d.ts +23 -0
- package/dist/modules/capa/services/index.d.ts.map +1 -0
- package/dist/modules/capa/services/index.js +39 -0
- package/dist/modules/capa/services/index.js.map +1 -0
- package/dist/modules/capa/services/list-receivers.service.d.ts +9 -0
- package/dist/modules/capa/services/list-receivers.service.d.ts.map +1 -0
- package/dist/modules/capa/services/list-receivers.service.js +45 -0
- package/dist/modules/capa/services/list-receivers.service.js.map +1 -0
- package/dist/modules/capa/services/list-transactions.service.d.ts +9 -0
- package/dist/modules/capa/services/list-transactions.service.d.ts.map +1 -0
- package/dist/modules/capa/services/list-transactions.service.js +58 -0
- package/dist/modules/capa/services/list-transactions.service.js.map +1 -0
- package/dist/modules/capa/services/request-document-signature.service.d.ts +9 -0
- package/dist/modules/capa/services/request-document-signature.service.d.ts.map +1 -0
- package/dist/modules/capa/services/request-document-signature.service.js +46 -0
- package/dist/modules/capa/services/request-document-signature.service.js.map +1 -0
- package/dist/modules/capa/services/update-webhook-settings.service.d.ts +9 -0
- package/dist/modules/capa/services/update-webhook-settings.service.d.ts.map +1 -0
- package/dist/modules/capa/services/update-webhook-settings.service.js +47 -0
- package/dist/modules/capa/services/update-webhook-settings.service.js.map +1 -0
- package/dist/modules/capa/triggers/index.d.ts +3 -0
- package/dist/modules/capa/triggers/index.d.ts.map +1 -0
- package/dist/modules/capa/triggers/index.js +5 -0
- package/dist/modules/capa/triggers/index.js.map +1 -0
- package/dist/modules/capa/utils/capa-credentials.util.d.ts +4 -0
- package/dist/modules/capa/utils/capa-credentials.util.d.ts.map +1 -0
- package/dist/modules/capa/utils/capa-credentials.util.js +24 -0
- package/dist/modules/capa/utils/capa-credentials.util.js.map +1 -0
- package/dist/modules/capa/utils/capa-query.util.d.ts +4 -0
- package/dist/modules/capa/utils/capa-query.util.d.ts.map +1 -0
- package/dist/modules/capa/utils/capa-query.util.js +55 -0
- package/dist/modules/capa/utils/capa-query.util.js.map +1 -0
- package/dist/modules/chatgpt/actions/chat-completion.action.d.ts +3 -0
- package/dist/modules/chatgpt/actions/chat-completion.action.d.ts.map +1 -0
- package/dist/modules/chatgpt/actions/chat-completion.action.js +168 -0
- package/dist/modules/chatgpt/actions/chat-completion.action.js.map +1 -0
- package/dist/modules/chatgpt/actions/create-embedding.action.d.ts +3 -0
- package/dist/modules/chatgpt/actions/create-embedding.action.d.ts.map +1 -0
- package/dist/modules/chatgpt/actions/create-embedding.action.js +71 -0
- package/dist/modules/chatgpt/actions/create-embedding.action.js.map +1 -0
- package/dist/modules/chatgpt/actions/generate-image.action.d.ts +3 -0
- package/dist/modules/chatgpt/actions/generate-image.action.d.ts.map +1 -0
- package/dist/modules/chatgpt/actions/generate-image.action.js +103 -0
- package/dist/modules/chatgpt/actions/generate-image.action.js.map +1 -0
- package/dist/modules/chatgpt/actions/index.d.ts +6 -0
- package/dist/modules/chatgpt/actions/index.d.ts.map +1 -0
- package/dist/modules/{chatbot/services → chatgpt/actions}/index.js +5 -4
- package/dist/modules/chatgpt/actions/index.js.map +1 -0
- package/dist/modules/chatgpt/actions/speech-to-text.action.d.ts +3 -0
- package/dist/modules/chatgpt/actions/speech-to-text.action.d.ts.map +1 -0
- package/dist/modules/chatgpt/actions/speech-to-text.action.js +83 -0
- package/dist/modules/chatgpt/actions/speech-to-text.action.js.map +1 -0
- package/dist/modules/chatgpt/actions/text-to-speech.action.d.ts +3 -0
- package/dist/modules/chatgpt/actions/text-to-speech.action.d.ts.map +1 -0
- package/dist/modules/chatgpt/actions/text-to-speech.action.js +111 -0
- package/dist/modules/chatgpt/actions/text-to-speech.action.js.map +1 -0
- package/dist/modules/chatgpt/auth/chatgpt-auth.service.d.ts +5 -0
- package/dist/modules/chatgpt/auth/chatgpt-auth.service.d.ts.map +1 -0
- package/dist/modules/chatgpt/auth/chatgpt-auth.service.js +68 -0
- package/dist/modules/chatgpt/auth/chatgpt-auth.service.js.map +1 -0
- package/dist/modules/chatgpt/chatgpt-nest.module.d.ts +3 -0
- package/dist/modules/chatgpt/chatgpt-nest.module.d.ts.map +1 -0
- package/dist/modules/chatgpt/chatgpt-nest.module.js +37 -0
- package/dist/modules/chatgpt/chatgpt-nest.module.js.map +1 -0
- package/dist/modules/chatgpt/chatgpt.module.d.ts +3 -0
- package/dist/modules/chatgpt/chatgpt.module.d.ts.map +1 -0
- package/dist/modules/chatgpt/chatgpt.module.js +24 -0
- package/dist/modules/chatgpt/chatgpt.module.js.map +1 -0
- package/dist/modules/chatgpt/constants/chatgpt-completion.constants.d.ts +4 -0
- package/dist/modules/chatgpt/constants/chatgpt-completion.constants.d.ts.map +1 -0
- package/dist/modules/chatgpt/constants/chatgpt-completion.constants.js +32 -0
- package/dist/modules/chatgpt/constants/chatgpt-completion.constants.js.map +1 -0
- package/dist/modules/chatgpt/credentials.d.ts +3 -0
- package/dist/modules/chatgpt/credentials.d.ts.map +1 -0
- package/dist/modules/chatgpt/credentials.js +32 -0
- package/dist/modules/chatgpt/credentials.js.map +1 -0
- package/dist/modules/chatgpt/services/chat-completion.service.d.ts +12 -0
- package/dist/modules/chatgpt/services/chat-completion.service.d.ts.map +1 -0
- package/dist/modules/chatgpt/services/chat-completion.service.js +151 -0
- package/dist/modules/chatgpt/services/chat-completion.service.js.map +1 -0
- package/dist/modules/chatgpt/services/create-embedding.service.d.ts +8 -0
- package/dist/modules/chatgpt/services/create-embedding.service.d.ts.map +1 -0
- package/dist/modules/chatgpt/services/create-embedding.service.js +65 -0
- package/dist/modules/chatgpt/services/create-embedding.service.js.map +1 -0
- package/dist/modules/chatgpt/services/generate-image.service.d.ts +8 -0
- package/dist/modules/chatgpt/services/generate-image.service.d.ts.map +1 -0
- package/dist/modules/chatgpt/services/generate-image.service.js +56 -0
- package/dist/modules/chatgpt/services/generate-image.service.js.map +1 -0
- package/dist/modules/chatgpt/services/index.d.ts +6 -0
- package/dist/modules/chatgpt/services/index.d.ts.map +1 -0
- package/dist/modules/chatgpt/services/index.js +22 -0
- package/dist/modules/chatgpt/services/index.js.map +1 -0
- package/dist/modules/chatgpt/services/speech-to-text.service.d.ts +8 -0
- package/dist/modules/chatgpt/services/speech-to-text.service.d.ts.map +1 -0
- package/dist/modules/chatgpt/services/speech-to-text.service.js +54 -0
- package/dist/modules/chatgpt/services/speech-to-text.service.js.map +1 -0
- package/dist/modules/chatgpt/services/text-to-speech.service.d.ts +8 -0
- package/dist/modules/chatgpt/services/text-to-speech.service.d.ts.map +1 -0
- package/dist/modules/chatgpt/services/text-to-speech.service.js +55 -0
- package/dist/modules/chatgpt/services/text-to-speech.service.js.map +1 -0
- package/dist/modules/inbestgo/auth/inbestgo-auth.service.d.ts.map +1 -1
- package/dist/modules/inbestgo/auth/inbestgo-auth.service.js.map +1 -1
- package/dist/modules/inbestgo/services/lookup-user-by-phone.service.d.ts.map +1 -1
- package/dist/modules/inbestgo/services/lookup-user-by-phone.service.js.map +1 -1
- package/dist/modules/index.d.ts +3 -1
- package/dist/modules/index.d.ts.map +1 -1
- package/dist/modules/index.js +13 -5
- package/dist/modules/index.js.map +1 -1
- package/dist/modules/slack/actions/add-reaction.action.d.ts +3 -0
- package/dist/modules/slack/actions/add-reaction.action.d.ts.map +1 -0
- package/dist/modules/slack/actions/add-reaction.action.js +63 -0
- package/dist/modules/slack/actions/add-reaction.action.js.map +1 -0
- package/dist/modules/slack/actions/archive-conversation.action.d.ts +3 -0
- package/dist/modules/slack/actions/archive-conversation.action.d.ts.map +1 -0
- package/dist/modules/slack/actions/archive-conversation.action.js +41 -0
- package/dist/modules/slack/actions/archive-conversation.action.js.map +1 -0
- package/dist/modules/slack/actions/complete-upload-external.action.d.ts +3 -0
- package/dist/modules/slack/actions/complete-upload-external.action.d.ts.map +1 -0
- package/dist/modules/slack/actions/complete-upload-external.action.js +76 -0
- package/dist/modules/slack/actions/complete-upload-external.action.js.map +1 -0
- package/dist/modules/slack/actions/create-conversation.action.d.ts +3 -0
- package/dist/modules/slack/actions/create-conversation.action.d.ts.map +1 -0
- package/dist/modules/slack/actions/create-conversation.action.js +67 -0
- package/dist/modules/slack/actions/create-conversation.action.js.map +1 -0
- package/dist/modules/slack/actions/create-reminder.action.d.ts +3 -0
- package/dist/modules/slack/actions/create-reminder.action.d.ts.map +1 -0
- package/dist/modules/slack/actions/create-reminder.action.js +68 -0
- package/dist/modules/slack/actions/create-reminder.action.js.map +1 -0
- package/dist/modules/slack/actions/delete-message.action.d.ts +3 -0
- package/dist/modules/slack/actions/delete-message.action.d.ts.map +1 -0
- package/dist/modules/slack/actions/delete-message.action.js +74 -0
- package/dist/modules/slack/actions/delete-message.action.js.map +1 -0
- package/dist/modules/slack/actions/get-conversation-history.action.d.ts +3 -0
- package/dist/modules/slack/actions/get-conversation-history.action.d.ts.map +1 -0
- package/dist/modules/slack/actions/get-conversation-history.action.js +116 -0
- package/dist/modules/slack/actions/get-conversation-history.action.js.map +1 -0
- package/dist/modules/slack/actions/get-conversation-info.action.d.ts +3 -0
- package/dist/modules/slack/actions/get-conversation-info.action.d.ts.map +1 -0
- package/dist/modules/slack/actions/get-conversation-info.action.js +67 -0
- package/dist/modules/slack/actions/get-conversation-info.action.js.map +1 -0
- package/dist/modules/slack/actions/get-message-permalink.action.d.ts +3 -0
- package/dist/modules/slack/actions/get-message-permalink.action.d.ts.map +1 -0
- package/dist/modules/slack/actions/get-message-permalink.action.js +64 -0
- package/dist/modules/slack/actions/get-message-permalink.action.js.map +1 -0
- package/dist/modules/slack/actions/get-team-info.action.d.ts +3 -0
- package/dist/modules/slack/actions/get-team-info.action.d.ts.map +1 -0
- package/dist/modules/slack/actions/get-team-info.action.js +46 -0
- package/dist/modules/slack/actions/get-team-info.action.js.map +1 -0
- package/dist/modules/slack/actions/get-thread-replies.action.d.ts +3 -0
- package/dist/modules/slack/actions/get-thread-replies.action.d.ts.map +1 -0
- package/dist/modules/slack/actions/get-thread-replies.action.js +121 -0
- package/dist/modules/slack/actions/get-thread-replies.action.js.map +1 -0
- package/dist/modules/slack/actions/get-upload-url-external.action.d.ts +3 -0
- package/dist/modules/slack/actions/get-upload-url-external.action.d.ts.map +1 -0
- package/dist/modules/slack/actions/get-upload-url-external.action.js +64 -0
- package/dist/modules/slack/actions/get-upload-url-external.action.js.map +1 -0
- package/dist/modules/slack/actions/get-user-info.action.d.ts +3 -0
- package/dist/modules/slack/actions/get-user-info.action.d.ts.map +1 -0
- package/dist/modules/slack/actions/get-user-info.action.js +57 -0
- package/dist/modules/slack/actions/get-user-info.action.js.map +1 -0
- package/dist/modules/slack/actions/index.d.ts +30 -0
- package/dist/modules/slack/actions/index.d.ts.map +1 -0
- package/dist/modules/slack/actions/index.js +46 -0
- package/dist/modules/slack/actions/index.js.map +1 -0
- package/dist/modules/slack/actions/invite-to-conversation.action.d.ts +3 -0
- package/dist/modules/slack/actions/invite-to-conversation.action.d.ts.map +1 -0
- package/dist/modules/slack/actions/invite-to-conversation.action.js +58 -0
- package/dist/modules/slack/actions/invite-to-conversation.action.js.map +1 -0
- package/dist/modules/slack/actions/join-conversation.action.d.ts +3 -0
- package/dist/modules/slack/actions/join-conversation.action.d.ts.map +1 -0
- package/dist/modules/slack/actions/join-conversation.action.js +53 -0
- package/dist/modules/slack/actions/join-conversation.action.js.map +1 -0
- package/dist/modules/slack/actions/list-conversations.action.d.ts +3 -0
- package/dist/modules/slack/actions/list-conversations.action.d.ts.map +1 -0
- package/dist/modules/slack/actions/list-conversations.action.js +93 -0
- package/dist/modules/slack/actions/list-conversations.action.js.map +1 -0
- package/dist/modules/slack/actions/list-emoji.action.d.ts +3 -0
- package/dist/modules/slack/actions/list-emoji.action.d.ts.map +1 -0
- package/dist/modules/slack/actions/list-emoji.action.js +41 -0
- package/dist/modules/slack/actions/list-emoji.action.js.map +1 -0
- package/dist/modules/slack/actions/list-files.action.d.ts +3 -0
- package/dist/modules/slack/actions/list-files.action.d.ts.map +1 -0
- package/dist/modules/slack/actions/list-files.action.js +142 -0
- package/dist/modules/slack/actions/list-files.action.js.map +1 -0
- package/dist/modules/slack/actions/list-users.action.d.ts +3 -0
- package/dist/modules/slack/actions/list-users.action.d.ts.map +1 -0
- package/dist/modules/slack/actions/list-users.action.js +88 -0
- package/dist/modules/slack/actions/list-users.action.js.map +1 -0
- package/dist/modules/slack/actions/lookup-user-by-email.action.d.ts +3 -0
- package/dist/modules/slack/actions/lookup-user-by-email.action.d.ts.map +1 -0
- package/dist/modules/slack/actions/lookup-user-by-email.action.js +46 -0
- package/dist/modules/slack/actions/lookup-user-by-email.action.js.map +1 -0
- package/dist/modules/slack/actions/open-view.action.d.ts +3 -0
- package/dist/modules/slack/actions/open-view.action.d.ts.map +1 -0
- package/dist/modules/slack/actions/open-view.action.js +57 -0
- package/dist/modules/slack/actions/open-view.action.js.map +1 -0
- package/dist/modules/slack/actions/pin-message.action.d.ts +3 -0
- package/dist/modules/slack/actions/pin-message.action.d.ts.map +1 -0
- package/dist/modules/slack/actions/pin-message.action.js +71 -0
- package/dist/modules/slack/actions/pin-message.action.js.map +1 -0
- package/dist/modules/slack/actions/post-message.action.d.ts +3 -0
- package/dist/modules/slack/actions/post-message.action.d.ts.map +1 -0
- package/dist/modules/slack/actions/post-message.action.js +183 -0
- package/dist/modules/slack/actions/post-message.action.js.map +1 -0
- package/dist/modules/slack/actions/remove-reaction.action.d.ts +3 -0
- package/dist/modules/slack/actions/remove-reaction.action.d.ts.map +1 -0
- package/dist/modules/slack/actions/remove-reaction.action.js +63 -0
- package/dist/modules/slack/actions/remove-reaction.action.js.map +1 -0
- package/dist/modules/slack/actions/schedule-message.action.d.ts +3 -0
- package/dist/modules/slack/actions/schedule-message.action.d.ts.map +1 -0
- package/dist/modules/slack/actions/schedule-message.action.js +96 -0
- package/dist/modules/slack/actions/schedule-message.action.js.map +1 -0
- package/dist/modules/slack/actions/search-messages.action.d.ts +3 -0
- package/dist/modules/slack/actions/search-messages.action.d.ts.map +1 -0
- package/dist/modules/slack/actions/search-messages.action.js +116 -0
- package/dist/modules/slack/actions/search-messages.action.js.map +1 -0
- package/dist/modules/slack/actions/set-conversation-topic.action.d.ts +3 -0
- package/dist/modules/slack/actions/set-conversation-topic.action.d.ts.map +1 -0
- package/dist/modules/slack/actions/set-conversation-topic.action.js +59 -0
- package/dist/modules/slack/actions/set-conversation-topic.action.js.map +1 -0
- package/dist/modules/slack/actions/update-message.action.d.ts +3 -0
- package/dist/modules/slack/actions/update-message.action.d.ts.map +1 -0
- package/dist/modules/slack/actions/update-message.action.js +139 -0
- package/dist/modules/slack/actions/update-message.action.js.map +1 -0
- package/dist/modules/slack/actions/upload-file.action.d.ts +3 -0
- package/dist/modules/slack/actions/upload-file.action.d.ts.map +1 -0
- package/dist/modules/slack/actions/upload-file.action.js +114 -0
- package/dist/modules/slack/actions/upload-file.action.js.map +1 -0
- package/dist/modules/slack/auth/index.d.ts +2 -0
- package/dist/modules/slack/auth/index.d.ts.map +1 -0
- package/dist/modules/{chatbot/actions → slack/auth}/index.js +1 -3
- package/dist/modules/slack/auth/index.js.map +1 -0
- package/dist/modules/slack/auth/slack-auth.service.d.ts +8 -0
- package/dist/modules/slack/auth/slack-auth.service.d.ts.map +1 -0
- package/dist/modules/slack/auth/slack-auth.service.js +78 -0
- package/dist/modules/slack/auth/slack-auth.service.js.map +1 -0
- package/dist/modules/slack/credentials.d.ts +3 -0
- package/dist/modules/slack/credentials.d.ts.map +1 -0
- package/dist/modules/slack/credentials.js +20 -0
- package/dist/modules/slack/credentials.js.map +1 -0
- package/dist/modules/slack/services/add-reaction.service.d.ts +8 -0
- package/dist/modules/slack/services/add-reaction.service.d.ts.map +1 -0
- package/dist/modules/slack/services/add-reaction.service.js +52 -0
- package/dist/modules/slack/services/add-reaction.service.js.map +1 -0
- package/dist/modules/slack/services/archive-conversation.service.d.ts +8 -0
- package/dist/modules/slack/services/archive-conversation.service.d.ts.map +1 -0
- package/dist/modules/slack/services/archive-conversation.service.js +42 -0
- package/dist/modules/slack/services/archive-conversation.service.js.map +1 -0
- package/dist/modules/slack/services/complete-upload-external.service.d.ts +8 -0
- package/dist/modules/slack/services/complete-upload-external.service.d.ts.map +1 -0
- package/dist/modules/slack/services/complete-upload-external.service.js +49 -0
- package/dist/modules/slack/services/complete-upload-external.service.js.map +1 -0
- package/dist/modules/slack/services/create-conversation.service.d.ts +8 -0
- package/dist/modules/slack/services/create-conversation.service.d.ts.map +1 -0
- package/dist/modules/slack/services/create-conversation.service.js +47 -0
- package/dist/modules/slack/services/create-conversation.service.js.map +1 -0
- package/dist/modules/slack/services/create-reminder.service.d.ts +8 -0
- package/dist/modules/slack/services/create-reminder.service.d.ts.map +1 -0
- package/dist/modules/slack/services/create-reminder.service.js +50 -0
- package/dist/modules/slack/services/create-reminder.service.js.map +1 -0
- package/dist/modules/slack/services/delete-message.service.d.ts +8 -0
- package/dist/modules/slack/services/delete-message.service.d.ts.map +1 -0
- package/dist/modules/slack/services/delete-message.service.js +51 -0
- package/dist/modules/slack/services/delete-message.service.js.map +1 -0
- package/dist/modules/slack/services/get-conversation-history.service.d.ts +8 -0
- package/dist/modules/slack/services/get-conversation-history.service.d.ts.map +1 -0
- package/dist/modules/slack/services/get-conversation-history.service.js +56 -0
- package/dist/modules/slack/services/get-conversation-history.service.js.map +1 -0
- package/dist/modules/slack/services/get-conversation-info.service.d.ts +8 -0
- package/dist/modules/slack/services/get-conversation-info.service.d.ts.map +1 -0
- package/dist/modules/slack/services/get-conversation-info.service.js +47 -0
- package/dist/modules/slack/services/get-conversation-info.service.js.map +1 -0
- package/dist/modules/slack/services/get-message-permalink.service.d.ts +8 -0
- package/dist/modules/slack/services/get-message-permalink.service.d.ts.map +1 -0
- package/dist/modules/slack/services/get-message-permalink.service.js +49 -0
- package/dist/modules/slack/services/get-message-permalink.service.js.map +1 -0
- package/dist/modules/slack/services/get-team-info.service.d.ts +8 -0
- package/dist/modules/slack/services/get-team-info.service.d.ts.map +1 -0
- package/dist/modules/slack/services/get-team-info.service.js +40 -0
- package/dist/modules/slack/services/get-team-info.service.js.map +1 -0
- package/dist/modules/slack/services/get-thread-replies.service.d.ts +8 -0
- package/dist/modules/slack/services/get-thread-replies.service.d.ts.map +1 -0
- package/dist/modules/slack/services/get-thread-replies.service.js +60 -0
- package/dist/modules/slack/services/get-thread-replies.service.js.map +1 -0
- package/dist/modules/slack/services/get-upload-url-external.service.d.ts +8 -0
- package/dist/modules/slack/services/get-upload-url-external.service.d.ts.map +1 -0
- package/dist/modules/slack/services/get-upload-url-external.service.js +49 -0
- package/dist/modules/slack/services/get-upload-url-external.service.js.map +1 -0
- package/dist/modules/slack/services/get-user-info.service.d.ts +8 -0
- package/dist/modules/slack/services/get-user-info.service.d.ts.map +1 -0
- package/dist/modules/slack/services/get-user-info.service.js +45 -0
- package/dist/modules/slack/services/get-user-info.service.js.map +1 -0
- package/dist/modules/slack/services/index.d.ts +31 -0
- package/dist/modules/slack/services/index.d.ts.map +1 -0
- package/dist/modules/slack/services/index.js +47 -0
- package/dist/modules/slack/services/index.js.map +1 -0
- package/dist/modules/slack/services/invite-to-conversation.service.d.ts +8 -0
- package/dist/modules/slack/services/invite-to-conversation.service.d.ts.map +1 -0
- package/dist/modules/slack/services/invite-to-conversation.service.js +49 -0
- package/dist/modules/slack/services/invite-to-conversation.service.js.map +1 -0
- package/dist/modules/slack/services/join-conversation.service.d.ts +8 -0
- package/dist/modules/slack/services/join-conversation.service.d.ts.map +1 -0
- package/dist/modules/slack/services/join-conversation.service.js +44 -0
- package/dist/modules/slack/services/join-conversation.service.js.map +1 -0
- package/dist/modules/slack/services/list-conversations.service.d.ts +8 -0
- package/dist/modules/slack/services/list-conversations.service.d.ts.map +1 -0
- package/dist/modules/slack/services/list-conversations.service.js +49 -0
- package/dist/modules/slack/services/list-conversations.service.js.map +1 -0
- package/dist/modules/slack/services/list-emoji.service.d.ts +8 -0
- package/dist/modules/slack/services/list-emoji.service.d.ts.map +1 -0
- package/dist/modules/slack/services/list-emoji.service.js +38 -0
- package/dist/modules/slack/services/list-emoji.service.js.map +1 -0
- package/dist/modules/slack/services/list-files.service.d.ts +8 -0
- package/dist/modules/slack/services/list-files.service.d.ts.map +1 -0
- package/dist/modules/slack/services/list-files.service.js +59 -0
- package/dist/modules/slack/services/list-files.service.js.map +1 -0
- package/dist/modules/slack/services/list-users.service.d.ts +8 -0
- package/dist/modules/slack/services/list-users.service.d.ts.map +1 -0
- package/dist/modules/slack/services/list-users.service.js +48 -0
- package/dist/modules/slack/services/list-users.service.js.map +1 -0
- package/dist/modules/slack/services/lookup-user-by-email.service.d.ts +8 -0
- package/dist/modules/slack/services/lookup-user-by-email.service.d.ts.map +1 -0
- package/dist/modules/slack/services/lookup-user-by-email.service.js +43 -0
- package/dist/modules/slack/services/lookup-user-by-email.service.js.map +1 -0
- package/dist/modules/slack/services/message-received.service.d.ts +30 -0
- package/dist/modules/slack/services/message-received.service.d.ts.map +1 -0
- package/dist/modules/slack/services/message-received.service.js +220 -0
- package/dist/modules/slack/services/message-received.service.js.map +1 -0
- package/dist/modules/slack/services/open-view.service.d.ts +8 -0
- package/dist/modules/slack/services/open-view.service.d.ts.map +1 -0
- package/dist/modules/slack/services/open-view.service.js +48 -0
- package/dist/modules/slack/services/open-view.service.js.map +1 -0
- package/dist/modules/slack/services/pin-message.service.d.ts +8 -0
- package/dist/modules/slack/services/pin-message.service.d.ts.map +1 -0
- package/dist/modules/slack/services/pin-message.service.js +51 -0
- package/dist/modules/slack/services/pin-message.service.js.map +1 -0
- package/dist/modules/slack/services/post-message.service.d.ts +8 -0
- package/dist/modules/slack/services/post-message.service.d.ts.map +1 -0
- package/dist/modules/slack/services/post-message.service.js +72 -0
- package/dist/modules/slack/services/post-message.service.js.map +1 -0
- package/dist/modules/slack/services/remove-reaction.service.d.ts +8 -0
- package/dist/modules/slack/services/remove-reaction.service.d.ts.map +1 -0
- package/dist/modules/slack/services/remove-reaction.service.js +52 -0
- package/dist/modules/slack/services/remove-reaction.service.js.map +1 -0
- package/dist/modules/slack/services/schedule-message.service.d.ts +8 -0
- package/dist/modules/slack/services/schedule-message.service.d.ts.map +1 -0
- package/dist/modules/slack/services/schedule-message.service.js +59 -0
- package/dist/modules/slack/services/schedule-message.service.js.map +1 -0
- package/dist/modules/slack/services/search-messages.service.d.ts +8 -0
- package/dist/modules/slack/services/search-messages.service.d.ts.map +1 -0
- package/dist/modules/slack/services/search-messages.service.js +54 -0
- package/dist/modules/slack/services/search-messages.service.js.map +1 -0
- package/dist/modules/slack/services/set-conversation-topic.service.d.ts +8 -0
- package/dist/modules/slack/services/set-conversation-topic.service.d.ts.map +1 -0
- package/dist/modules/slack/services/set-conversation-topic.service.js +48 -0
- package/dist/modules/slack/services/set-conversation-topic.service.js.map +1 -0
- package/dist/modules/slack/services/update-message.service.d.ts +8 -0
- package/dist/modules/slack/services/update-message.service.d.ts.map +1 -0
- package/dist/modules/slack/services/update-message.service.js +66 -0
- package/dist/modules/slack/services/update-message.service.js.map +1 -0
- package/dist/modules/slack/services/upload-file.service.d.ts +8 -0
- package/dist/modules/slack/services/upload-file.service.d.ts.map +1 -0
- package/dist/modules/slack/services/upload-file.service.js +66 -0
- package/dist/modules/slack/services/upload-file.service.js.map +1 -0
- package/dist/modules/slack/slack-nest.module.d.ts +3 -0
- package/dist/modules/slack/slack-nest.module.d.ts.map +1 -0
- package/dist/modules/slack/slack-nest.module.js +89 -0
- package/dist/modules/slack/slack-nest.module.js.map +1 -0
- package/dist/modules/slack/slack.module.d.ts +3 -0
- package/dist/modules/slack/slack.module.d.ts.map +1 -0
- package/dist/modules/slack/slack.module.js +49 -0
- package/dist/modules/slack/slack.module.js.map +1 -0
- package/dist/modules/slack/triggers/index.d.ts +3 -0
- package/dist/modules/slack/triggers/index.d.ts.map +1 -0
- package/dist/modules/slack/triggers/index.js +8 -0
- package/dist/modules/slack/triggers/index.js.map +1 -0
- package/dist/modules/slack/triggers/message-received.trigger.d.ts +3 -0
- package/dist/modules/slack/triggers/message-received.trigger.d.ts.map +1 -0
- package/dist/modules/slack/triggers/message-received.trigger.js +122 -0
- package/dist/modules/slack/triggers/message-received.trigger.js.map +1 -0
- package/dist/modules/slack/utils/slack-credentials.util.d.ts +4 -0
- package/dist/modules/slack/utils/slack-credentials.util.d.ts.map +1 -0
- package/dist/modules/slack/utils/slack-credentials.util.js +13 -0
- package/dist/modules/slack/utils/slack-credentials.util.js.map +1 -0
- package/dist/workflow.module.d.ts.map +1 -1
- package/dist/workflow.module.js +9 -3
- package/dist/workflow.module.js.map +1 -1
- package/package.json +106 -102
- package/dist/modules/chatbot/actions/ask-question.action.d.ts +0 -3
- package/dist/modules/chatbot/actions/ask-question.action.d.ts.map +0 -1
- package/dist/modules/chatbot/actions/ask-question.action.js +0 -42
- package/dist/modules/chatbot/actions/ask-question.action.js.map +0 -1
- package/dist/modules/chatbot/actions/index.d.ts +0 -4
- package/dist/modules/chatbot/actions/index.d.ts.map +0 -1
- package/dist/modules/chatbot/actions/index.js.map +0 -1
- package/dist/modules/chatbot/actions/send-buttons.action.d.ts +0 -3
- package/dist/modules/chatbot/actions/send-buttons.action.d.ts.map +0 -1
- package/dist/modules/chatbot/actions/send-buttons.action.js +0 -67
- package/dist/modules/chatbot/actions/send-buttons.action.js.map +0 -1
- package/dist/modules/chatbot/actions/send-message.action.d.ts +0 -3
- package/dist/modules/chatbot/actions/send-message.action.d.ts.map +0 -1
- package/dist/modules/chatbot/actions/send-message.action.js +0 -52
- package/dist/modules/chatbot/actions/send-message.action.js.map +0 -1
- package/dist/modules/chatbot/chatbot-nest.module.d.ts +0 -3
- package/dist/modules/chatbot/chatbot-nest.module.d.ts.map +0 -1
- package/dist/modules/chatbot/chatbot-nest.module.js +0 -21
- package/dist/modules/chatbot/chatbot-nest.module.js.map +0 -1
- package/dist/modules/chatbot/chatbot.module.d.ts +0 -3
- package/dist/modules/chatbot/chatbot.module.d.ts.map +0 -1
- package/dist/modules/chatbot/chatbot.module.js +0 -17
- package/dist/modules/chatbot/chatbot.module.js.map +0 -1
- package/dist/modules/chatbot/credentials.d.ts +0 -3
- package/dist/modules/chatbot/credentials.d.ts.map +0 -1
- package/dist/modules/chatbot/credentials.js +0 -5
- package/dist/modules/chatbot/credentials.js.map +0 -1
- package/dist/modules/chatbot/services/ask-question.service.d.ts +0 -5
- package/dist/modules/chatbot/services/ask-question.service.d.ts.map +0 -1
- package/dist/modules/chatbot/services/ask-question.service.js +0 -25
- package/dist/modules/chatbot/services/ask-question.service.js.map +0 -1
- package/dist/modules/chatbot/services/index.d.ts +0 -5
- package/dist/modules/chatbot/services/index.d.ts.map +0 -1
- package/dist/modules/chatbot/services/index.js.map +0 -1
- package/dist/modules/chatbot/services/send-buttons.service.d.ts +0 -5
- package/dist/modules/chatbot/services/send-buttons.service.d.ts.map +0 -1
- package/dist/modules/chatbot/services/send-buttons.service.js +0 -25
- package/dist/modules/chatbot/services/send-buttons.service.js.map +0 -1
- package/dist/modules/chatbot/services/send-message.service.d.ts +0 -5
- package/dist/modules/chatbot/services/send-message.service.d.ts.map +0 -1
- package/dist/modules/chatbot/services/send-message.service.js +0 -27
- package/dist/modules/chatbot/services/send-message.service.js.map +0 -1
- package/dist/modules/chatbot/services/user-responded.service.d.ts +0 -5
- package/dist/modules/chatbot/services/user-responded.service.d.ts.map +0 -1
- package/dist/modules/chatbot/services/user-responded.service.js +0 -25
- package/dist/modules/chatbot/services/user-responded.service.js.map +0 -1
- package/dist/modules/chatbot/triggers/index.d.ts +0 -2
- package/dist/modules/chatbot/triggers/index.d.ts.map +0 -1
- package/dist/modules/chatbot/triggers/index.js.map +0 -1
- package/dist/modules/chatbot/triggers/user-responded.trigger.d.ts +0 -3
- package/dist/modules/chatbot/triggers/user-responded.trigger.d.ts.map +0 -1
- package/dist/modules/chatbot/triggers/user-responded.trigger.js +0 -45
- package/dist/modules/chatbot/triggers/user-responded.trigger.js.map +0 -1
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
9
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.ChatGptAuthService = void 0;
|
|
13
|
+
const common_1 = require("@nestjs/common");
|
|
14
|
+
const openai_1 = __importDefault(require("openai"));
|
|
15
|
+
let ChatGptAuthService = class ChatGptAuthService {
|
|
16
|
+
async authenticate(credentials) {
|
|
17
|
+
try {
|
|
18
|
+
const apiKey = credentials.apiKey;
|
|
19
|
+
const baseUrl = credentials.baseUrl || 'https://api.openai.com/v1';
|
|
20
|
+
if (!apiKey || apiKey.trim().length === 0) {
|
|
21
|
+
return {
|
|
22
|
+
success: false,
|
|
23
|
+
message: 'API Key is required',
|
|
24
|
+
error: 'MISSING_API_KEY',
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
const client = new openai_1.default({
|
|
28
|
+
apiKey,
|
|
29
|
+
baseURL: baseUrl,
|
|
30
|
+
});
|
|
31
|
+
try {
|
|
32
|
+
await client.models.list();
|
|
33
|
+
return {
|
|
34
|
+
success: true,
|
|
35
|
+
message: 'ChatGPT credentials validated successfully',
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
catch (error) {
|
|
39
|
+
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
|
|
40
|
+
const statusCode = error.statusCode;
|
|
41
|
+
if (statusCode === 401 || statusCode === 403) {
|
|
42
|
+
return {
|
|
43
|
+
success: false,
|
|
44
|
+
message: 'Invalid API Key',
|
|
45
|
+
error: 'INVALID_API_KEY',
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
return {
|
|
49
|
+
success: false,
|
|
50
|
+
message: `Failed to validate credentials: ${errorMessage}`,
|
|
51
|
+
error: 'VALIDATION_ERROR',
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
catch (error) {
|
|
56
|
+
return {
|
|
57
|
+
success: false,
|
|
58
|
+
message: error instanceof Error ? error.message : 'Unknown error occurred',
|
|
59
|
+
error: 'AUTH_ERROR',
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
exports.ChatGptAuthService = ChatGptAuthService;
|
|
65
|
+
exports.ChatGptAuthService = ChatGptAuthService = __decorate([
|
|
66
|
+
(0, common_1.Injectable)()
|
|
67
|
+
], ChatGptAuthService);
|
|
68
|
+
//# sourceMappingURL=chatgpt-auth.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chatgpt-auth.service.js","sourceRoot":"","sources":["../../../../src/modules/chatgpt/auth/chatgpt-auth.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,2CAA4C;AAC5C,oDAA4B;AAKrB,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IAC7B,KAAK,CAAC,YAAY,CAAC,WAAoC;QACrD,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,WAAW,CAAC,MAAgB,CAAC;YAC5C,MAAM,OAAO,GAAI,WAAW,CAAC,OAAkB,IAAI,2BAA2B,CAAC;YAE/E,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBAC1C,OAAO;oB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1
|
+
{"version":3,"file":"chatgpt-nest.module.d.ts","sourceRoot":"","sources":["../../../src/modules/chatgpt/chatgpt-nest.module.ts"],"names":[],"mappings":"AAWA,qBAkBa,iBAAiB;CAAG"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.ChatGptNestModule = void 0;
|
|
10
|
+
const common_1 = require("@nestjs/common");
|
|
11
|
+
const chatgpt_1 = require("@venturialstd/chatgpt");
|
|
12
|
+
const chatgpt_auth_service_1 = require("./auth/chatgpt-auth.service");
|
|
13
|
+
const services_1 = require("./services");
|
|
14
|
+
let ChatGptNestModule = class ChatGptNestModule {
|
|
15
|
+
};
|
|
16
|
+
exports.ChatGptNestModule = ChatGptNestModule;
|
|
17
|
+
exports.ChatGptNestModule = ChatGptNestModule = __decorate([
|
|
18
|
+
(0, common_1.Module)({
|
|
19
|
+
imports: [chatgpt_1.ChatGptModule],
|
|
20
|
+
providers: [
|
|
21
|
+
services_1.ChatCompletionService,
|
|
22
|
+
services_1.GenerateImageService,
|
|
23
|
+
services_1.TextToSpeechService,
|
|
24
|
+
services_1.SpeechToTextService,
|
|
25
|
+
services_1.CreateEmbeddingService,
|
|
26
|
+
chatgpt_auth_service_1.ChatGptAuthService,
|
|
27
|
+
],
|
|
28
|
+
exports: [
|
|
29
|
+
services_1.ChatCompletionService,
|
|
30
|
+
services_1.GenerateImageService,
|
|
31
|
+
services_1.TextToSpeechService,
|
|
32
|
+
services_1.SpeechToTextService,
|
|
33
|
+
services_1.CreateEmbeddingService,
|
|
34
|
+
],
|
|
35
|
+
})
|
|
36
|
+
], ChatGptNestModule);
|
|
37
|
+
//# sourceMappingURL=chatgpt-nest.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chatgpt-nest.module.js","sourceRoot":"","sources":["../../../src/modules/chatgpt/chatgpt-nest.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,mDAAsD;AACtD,sEAAiE;AACjE,yCAMoB;AAoBb,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;CAAG,CAAA;AAApB,8CAAiB;4BAAjB,iBAAiB;IAlB7B,IAAA,eAAM,EAAC;QACN,OAAO,EAAE,CAAC,uBAAa,CAAC;QACxB,SAAS,EAAE;YACT,gCAAqB;YACrB,+BAAoB;YACpB,8BAAmB;YACnB,8BAAmB;YACnB,iCAAsB;YACtB,yCAAkB;SACnB;QACD,OAAO,EAAE;YACP,gCAAqB;YACrB,+BAAoB;YACpB,8BAAmB;YACnB,8BAAmB;YACnB,iCAAsB;SACvB;KACF,CAAC;GACW,iBAAiB,CAAG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chatgpt.module.d.ts","sourceRoot":"","sources":["../../../src/modules/chatgpt/chatgpt.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkC,wBAAwB,EAAE,MAAM,UAAU,CAAC;AAWpF,eAAO,MAAM,aAAa,EAAE,wBAgB3B,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.chatgptModule = void 0;
|
|
4
|
+
const actions_1 = require("./actions");
|
|
5
|
+
const chatgpt_auth_service_1 = require("./auth/chatgpt-auth.service");
|
|
6
|
+
const credentials_1 = require("./credentials");
|
|
7
|
+
exports.chatgptModule = {
|
|
8
|
+
key: 'chatgpt',
|
|
9
|
+
name: 'ChatGPT',
|
|
10
|
+
description: 'Interact with OpenAI ChatGPT, DALL-E, Whisper, and Embeddings',
|
|
11
|
+
icon: '🤖',
|
|
12
|
+
version: '1.0.0',
|
|
13
|
+
authServiceClass: chatgpt_auth_service_1.ChatGptAuthService,
|
|
14
|
+
credentialFields: credentials_1.chatgptCredentials,
|
|
15
|
+
actions: [
|
|
16
|
+
actions_1.chatCompletionAction,
|
|
17
|
+
actions_1.generateImageAction,
|
|
18
|
+
actions_1.textToSpeechAction,
|
|
19
|
+
actions_1.speechToTextAction,
|
|
20
|
+
actions_1.createEmbeddingAction,
|
|
21
|
+
],
|
|
22
|
+
triggers: [],
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=chatgpt.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chatgpt.module.js","sourceRoot":"","sources":["../../../src/modules/chatgpt/chatgpt.module.ts"],"names":[],"mappings":";;;AACA,uCAMmB;AACnB,sEAA+D;AAC/D,+CAAmD;AAEtC,QAAA,aAAa,GAA6B;IACrD,GAAG,EAAE,SAAS;IACd,IAAI,EAAE,SAAS;IACf,WAAW,EAAE,+DAA+D;IAC5E,IAAI,EAAE,IAAI;IACV,OAAO,EAAE,OAAO;IAChB,gBAAgB,EAAE,yCAAgF;IAClG,gBAAgB,EAAE,gCAAkB;IACpC,OAAO,EAAE;QACP,8BAAoB;QACpB,6BAAmB;QACnB,4BAAkB;QAClB,4BAAkB;QAClB,+BAAqB;KACtB;IACD,QAAQ,EAAE,EAAE;CACb,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const CHATGPT_COMPLETION_CONSTANTS: {
|
|
2
|
+
readonly SYSTEM_INSTRUCTIONS: "You are a helpful AI assistant. Your responses MUST be in JSON format WITHOUT markdown, just the raw JSON.\n IMPORTANT RULES:\n - Always respond in valid JSON format\n - Do NOT use markdown code blocks (no ```json```)\n - The response must be a JSON object with the following structure:\n - You will ask the user for their name, email, phone, and status.\n - You will then extract the data from the user's response and store it in the \"output\" field.\n - You will then return the JSON object with the \"event\" field set to \"IN_PROGRESS\" and the \"output\" field containing the data.\n - You will ask again till the user fill all the fields.\n - If the user responds with \"END\", you will set the \"event\" field to \"END\" and return the JSON object.\n - If the user responds with something else, you will set the \"event\" field to \"IN_PROGRESS\", ask again the missing fields and return the JSON object.\n - If the user responds correctly all the fields, you will set the \"event\" field to \"END\" and return the JSON object.\n {\n \"event\": \"IN_PROGRESS\" | \"END\",\n \"aiMessage\": \"Your response message here\",\n \"output\": {\n \"name\": \"John Doe\",\n \"email\": \"john@example.com\",\n \"phone\": \"+1234567890\",\n \"status\": \"active\"\n }\n }\n - The \"event\" field indicates conversation state: \"IN_PROGRESS\" for ongoing, \"END\" for completed\n - The \"aiMessage\" field contains your response to the user\n - The \"output\" field contains structured data extracted from the conversation\n - Use placeholder values when data is not available (e.g., \"N/A\", \"pending\", \"unknown\")";
|
|
3
|
+
};
|
|
4
|
+
//# sourceMappingURL=chatgpt-completion.constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chatgpt-completion.constants.d.ts","sourceRoot":"","sources":["../../../../src/modules/chatgpt/constants/chatgpt-completion.constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,4BAA4B;;CA2B3B,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CHATGPT_COMPLETION_CONSTANTS = void 0;
|
|
4
|
+
exports.CHATGPT_COMPLETION_CONSTANTS = {
|
|
5
|
+
SYSTEM_INSTRUCTIONS: `You are a helpful AI assistant. Your responses MUST be in JSON format WITHOUT markdown, just the raw JSON.
|
|
6
|
+
IMPORTANT RULES:
|
|
7
|
+
- Always respond in valid JSON format
|
|
8
|
+
- Do NOT use markdown code blocks (no \`\`\`json\`\`\`)
|
|
9
|
+
- The response must be a JSON object with the following structure:
|
|
10
|
+
- You will ask the user for their name, email, phone, and status.
|
|
11
|
+
- You will then extract the data from the user's response and store it in the "output" field.
|
|
12
|
+
- You will then return the JSON object with the "event" field set to "IN_PROGRESS" and the "output" field containing the data.
|
|
13
|
+
- You will ask again till the user fill all the fields.
|
|
14
|
+
- If the user responds with "END", you will set the "event" field to "END" and return the JSON object.
|
|
15
|
+
- If the user responds with something else, you will set the "event" field to "IN_PROGRESS", ask again the missing fields and return the JSON object.
|
|
16
|
+
- If the user responds correctly all the fields, you will set the "event" field to "END" and return the JSON object.
|
|
17
|
+
{
|
|
18
|
+
"event": "IN_PROGRESS" | "END",
|
|
19
|
+
"aiMessage": "Your response message here",
|
|
20
|
+
"output": {
|
|
21
|
+
"name": "John Doe",
|
|
22
|
+
"email": "john@example.com",
|
|
23
|
+
"phone": "+1234567890",
|
|
24
|
+
"status": "active"
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
- The "event" field indicates conversation state: "IN_PROGRESS" for ongoing, "END" for completed
|
|
28
|
+
- The "aiMessage" field contains your response to the user
|
|
29
|
+
- The "output" field contains structured data extracted from the conversation
|
|
30
|
+
- Use placeholder values when data is not available (e.g., "N/A", "pending", "unknown")`,
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=chatgpt-completion.constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chatgpt-completion.constants.js","sourceRoot":"","sources":["../../../../src/modules/chatgpt/constants/chatgpt-completion.constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,4BAA4B,GAAG;IACxC,mBAAmB,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;gGAyBuE;CAClF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"credentials.d.ts","sourceRoot":"","sources":["../../../src/modules/chatgpt/credentials.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAc,MAAM,UAAU,CAAC;AAEjE,eAAO,MAAM,kBAAkB,EAAE,yBAAyB,EA0BzD,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.chatgptCredentials = void 0;
|
|
4
|
+
const types_1 = require("../types");
|
|
5
|
+
exports.chatgptCredentials = [
|
|
6
|
+
{
|
|
7
|
+
id: 'apiKey',
|
|
8
|
+
name: 'OpenAI API Key',
|
|
9
|
+
description: 'Your OpenAI API key for ChatGPT',
|
|
10
|
+
type: types_1.FIELD_TYPE.STRING,
|
|
11
|
+
validation: {
|
|
12
|
+
required: true,
|
|
13
|
+
minLength: 1,
|
|
14
|
+
},
|
|
15
|
+
placeholder: 'sk-...',
|
|
16
|
+
sensitive: true,
|
|
17
|
+
required: true,
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
id: 'baseUrl',
|
|
21
|
+
name: 'Base URL',
|
|
22
|
+
description: 'Base URL for OpenAI API (optional, defaults to https://api.openai.com/v1)',
|
|
23
|
+
type: types_1.FIELD_TYPE.URL,
|
|
24
|
+
validation: {
|
|
25
|
+
required: false,
|
|
26
|
+
},
|
|
27
|
+
placeholder: 'https://api.openai.com/v1',
|
|
28
|
+
sensitive: false,
|
|
29
|
+
required: false,
|
|
30
|
+
},
|
|
31
|
+
];
|
|
32
|
+
//# sourceMappingURL=credentials.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"credentials.js","sourceRoot":"","sources":["../../../src/modules/chatgpt/credentials.ts"],"names":[],"mappings":";;;AAAA,oCAAiE;AAEpD,QAAA,kBAAkB,GAAgC;IAC7D;QACE,EAAE,EAAE,QAAQ;QACZ,IAAI,EAAE,gBAAgB;QACtB,WAAW,EAAE,iCAAiC;QAC9C,IAAI,EAAE,kBAAU,CAAC,MAAM;QACvB,UAAU,EAAE;YACV,QAAQ,EAAE,IAAI;YACd,SAAS,EAAE,CAAC;SACb;QACD,WAAW,EAAE,QAAQ;QACrB,SAAS,EAAE,IAAI;QACf,QAAQ,EAAE,IAAI;KACf;IACD;QACE,EAAE,EAAE,SAAS;QACb,IAAI,EAAE,UAAU;QAChB,WAAW,EAAE,2EAA2E;QACxF,IAAI,EAAE,kBAAU,CAAC,GAAG;QACpB,UAAU,EAAE;YACV,QAAQ,EAAE,KAAK;SAChB;QACD,WAAW,EAAE,2BAA2B;QACxC,SAAS,EAAE,KAAK;QAChB,QAAQ,EAAE,KAAK;KAChB;CACF,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ChatGptChatService } from '@venturialstd/chatgpt';
|
|
2
|
+
import { CacheService } from '@venturialstd/core';
|
|
3
|
+
import { IWorkflowActionService, WorkflowActionContext } from '../../types';
|
|
4
|
+
export declare class ChatCompletionService implements IWorkflowActionService {
|
|
5
|
+
private readonly chatGptChatService;
|
|
6
|
+
private readonly cacheService;
|
|
7
|
+
constructor(chatGptChatService: ChatGptChatService, cacheService: CacheService);
|
|
8
|
+
perform(inputs: Record<string, unknown>, context: WorkflowActionContext): Promise<Record<string, unknown>>;
|
|
9
|
+
private checkPurposeFinished;
|
|
10
|
+
private calculateCost;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=chat-completion.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-completion.service.d.ts","sourceRoot":"","sources":["../../../../src/modules/chatgpt/services/chat-completion.service.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,kBAAkB,EAEnB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAO5E,qBACa,qBAAsB,YAAW,sBAAsB;IAEhE,OAAO,CAAC,QAAQ,CAAC,kBAAkB;IACnC,OAAO,CAAC,QAAQ,CAAC,YAAY;gBADZ,kBAAkB,EAAE,kBAAkB,EACtC,YAAY,EAAE,YAAY;IAGvC,OAAO,CACX,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,OAAO,EAAE,qBAAqB,GAC7B,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IA0JnC,OAAO,CAAC,oBAAoB;IAQ5B,OAAO,CAAC,aAAa;CAWtB"}
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.ChatCompletionService = void 0;
|
|
13
|
+
const common_1 = require("@nestjs/common");
|
|
14
|
+
const chatgpt_1 = require("@venturialstd/chatgpt");
|
|
15
|
+
const core_1 = require("@venturialstd/core");
|
|
16
|
+
let ChatCompletionService = class ChatCompletionService {
|
|
17
|
+
chatGptChatService;
|
|
18
|
+
cacheService;
|
|
19
|
+
constructor(chatGptChatService, cacheService) {
|
|
20
|
+
this.chatGptChatService = chatGptChatService;
|
|
21
|
+
this.cacheService = cacheService;
|
|
22
|
+
}
|
|
23
|
+
async perform(inputs, context) {
|
|
24
|
+
const apiKey = context.credentials?.apiKey;
|
|
25
|
+
const baseUrl = context.credentials?.baseUrl || 'https://api.openai.com/v1';
|
|
26
|
+
if (!apiKey) {
|
|
27
|
+
throw new Error('OpenAI API key is required in credentials');
|
|
28
|
+
}
|
|
29
|
+
const model = inputs.model || 'gpt-4o';
|
|
30
|
+
const temperature = inputs.temperature || 0.7;
|
|
31
|
+
const maxTokens = inputs.maxTokens || 2000;
|
|
32
|
+
const enableMemoryPersistence = inputs.enableMemoryPersistence === true;
|
|
33
|
+
const memoryKey = inputs.memoryKey;
|
|
34
|
+
const phone = inputs.phone;
|
|
35
|
+
const memoryTimePersistence = inputs.memoryTimePersistence || 60;
|
|
36
|
+
const stopExecutionUntilPurposeFinish = inputs.stopExecutionUntilPurposeFinish === true;
|
|
37
|
+
const systemInstructions = inputs.systemInstructions;
|
|
38
|
+
let previousMemory = null;
|
|
39
|
+
let cacheKey = null;
|
|
40
|
+
let newMessagesInRedisFormat = [];
|
|
41
|
+
let messages = [];
|
|
42
|
+
if (enableMemoryPersistence && memoryKey) {
|
|
43
|
+
cacheKey = `workflow:${context.workflowId}:${phone || ''}:${memoryKey}`;
|
|
44
|
+
previousMemory = await this.cacheService.get(cacheKey);
|
|
45
|
+
if (previousMemory && previousMemory.length > 0) {
|
|
46
|
+
messages = previousMemory.map((resp) => ({
|
|
47
|
+
role: resp.role === 'system' ? 'system' : resp.role === 'user' ? 'user' : 'assistant',
|
|
48
|
+
content: resp.message,
|
|
49
|
+
}));
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
if (inputs.messages) {
|
|
53
|
+
let currentMessages = [];
|
|
54
|
+
if (typeof inputs.messages === 'string') {
|
|
55
|
+
try {
|
|
56
|
+
const parsed = JSON.parse(inputs.messages);
|
|
57
|
+
currentMessages = parsed;
|
|
58
|
+
}
|
|
59
|
+
catch (error) {
|
|
60
|
+
throw new Error(`Invalid JSON format for messages: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
else if (Array.isArray(inputs.messages)) {
|
|
64
|
+
currentMessages = inputs.messages;
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
throw new Error('Messages must be a JSON array or JSON string');
|
|
68
|
+
}
|
|
69
|
+
messages = [...messages, ...currentMessages];
|
|
70
|
+
newMessagesInRedisFormat = currentMessages.map((msg) => ({
|
|
71
|
+
role: (msg.role === 'system' ? 'system' : msg.role === 'user' ? 'user' : 'admin'),
|
|
72
|
+
message: msg.content,
|
|
73
|
+
}));
|
|
74
|
+
}
|
|
75
|
+
if (systemInstructions && systemInstructions.trim()) {
|
|
76
|
+
const hasSystemMessage = messages.some((msg) => msg.role === 'system');
|
|
77
|
+
if (hasSystemMessage) {
|
|
78
|
+
const firstSystemIndex = messages.findIndex((msg) => msg.role === 'system');
|
|
79
|
+
messages[firstSystemIndex] = {
|
|
80
|
+
role: 'system',
|
|
81
|
+
content: systemInstructions,
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
messages = [
|
|
86
|
+
{ role: 'system', content: systemInstructions },
|
|
87
|
+
...messages,
|
|
88
|
+
];
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
if (messages.length === 0) {
|
|
92
|
+
throw new Error('Messages are required. Provide messages in input or enable memory persistence with existing memory.');
|
|
93
|
+
}
|
|
94
|
+
const completion = await this.chatGptChatService.createChatCompletion({
|
|
95
|
+
model,
|
|
96
|
+
temperature,
|
|
97
|
+
maxTokens,
|
|
98
|
+
store: false,
|
|
99
|
+
apiKey,
|
|
100
|
+
baseUrl,
|
|
101
|
+
}, messages);
|
|
102
|
+
const assistantMessage = completion.choices[0]?.message;
|
|
103
|
+
if (enableMemoryPersistence && memoryKey && assistantMessage?.content && cacheKey) {
|
|
104
|
+
const assistantResponse = {
|
|
105
|
+
role: 'admin',
|
|
106
|
+
message: assistantMessage.content,
|
|
107
|
+
};
|
|
108
|
+
const updatedMemory = [
|
|
109
|
+
...(previousMemory || []),
|
|
110
|
+
...newMessagesInRedisFormat,
|
|
111
|
+
assistantResponse,
|
|
112
|
+
];
|
|
113
|
+
const ttlInSeconds = memoryTimePersistence * 60;
|
|
114
|
+
await this.cacheService.set(cacheKey, updatedMemory, undefined, ttlInSeconds);
|
|
115
|
+
}
|
|
116
|
+
const result = {
|
|
117
|
+
content: assistantMessage?.content || '',
|
|
118
|
+
role: assistantMessage?.role || 'assistant',
|
|
119
|
+
model: completion.model,
|
|
120
|
+
tokensUsed: completion.usage?.total_tokens || 0,
|
|
121
|
+
cost: this.calculateCost(completion.model, completion.usage?.total_tokens || 0),
|
|
122
|
+
messageId: completion.id,
|
|
123
|
+
};
|
|
124
|
+
if (stopExecutionUntilPurposeFinish) {
|
|
125
|
+
const content = assistantMessage?.content || '';
|
|
126
|
+
const isPurposeFinished = this.checkPurposeFinished(content);
|
|
127
|
+
result.stopExecution = !isPurposeFinished;
|
|
128
|
+
}
|
|
129
|
+
return result;
|
|
130
|
+
}
|
|
131
|
+
checkPurposeFinished(content) {
|
|
132
|
+
const completionIndicators = ['END', 'COMPLETE', 'FINISHED', 'DONE'];
|
|
133
|
+
const upperContent = content.toUpperCase();
|
|
134
|
+
return completionIndicators.some((indicator) => upperContent.includes(indicator));
|
|
135
|
+
}
|
|
136
|
+
calculateCost(model, tokens) {
|
|
137
|
+
const modelPricing = chatgpt_1.CHATGPT_MODEL_PRICING[model] || chatgpt_1.CHATGPT_MODEL_PRICING[chatgpt_1.CHATGPT_DEFAULT_MODELS.GPT_4O];
|
|
138
|
+
const estimatedInputTokens = tokens * 0.7;
|
|
139
|
+
const estimatedOutputTokens = tokens * 0.3;
|
|
140
|
+
const cost = (estimatedInputTokens / 1_000_000) * modelPricing.input +
|
|
141
|
+
(estimatedOutputTokens / 1_000_000) * modelPricing.output;
|
|
142
|
+
return parseFloat(cost.toFixed(6));
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
exports.ChatCompletionService = ChatCompletionService;
|
|
146
|
+
exports.ChatCompletionService = ChatCompletionService = __decorate([
|
|
147
|
+
(0, common_1.Injectable)(),
|
|
148
|
+
__metadata("design:paramtypes", [chatgpt_1.ChatGptChatService,
|
|
149
|
+
core_1.CacheService])
|
|
150
|
+
], ChatCompletionService);
|
|
151
|
+
//# sourceMappingURL=chat-completion.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-completion.service.js","sourceRoot":"","sources":["../../../../src/modules/chatgpt/services/chat-completion.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,mDAK+B;AAC/B,6CAAkD;AAU3C,IAAM,qBAAqB,GAA3B,MAAM,qBAAqB;IAEb;IACA;IAFnB,YACmB,kBAAsC,EACtC,YAA0B;QAD1B,uBAAkB,GAAlB,kBAAkB,CAAoB;QACtC,iBAAY,GAAZ,YAAY,CAAc;IAC1C,CAAC;IAEJ,KAAK,CAAC,OAAO,CACX,MAA+B,EAC/B,OAA8B;QAE9B,MAAM,MAAM,GAAG,OAAO,CAAC,WAAW,EAAE,MAAgB,CAAC;QACrD,MAAM,OAAO,GAAI,OAAO,CAAC,WAAW,EAAE,OAAkB,IAAI,2BAA2B,CAAC;QAExF,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,MAAM,IAAI,KAAK,CAAC,2CAA2C,CAAC,CAAC;QAC/D,CAAC;QAED,MAAM,KAAK,GAAI,MAAM,CAAC,KAAgB,IAAI,QAAQ,CAAC;QACnD,MAAM,WAAW,GAAI,MAAM,CAAC,WAAsB,IAAI,GAAG,CAAC;QAC1D,MAAM,SAAS,GAAI,MAAM,CAAC,SAAoB,IAAI,IAAI,CAAC;QACvD,MAAM,uBAAuB,GAAG,MAAM,CAAC,uBAAuB,KAAK,IAAI,CAAC;QACxE,MAAM,SAAS,GAAG,MAAM,CAAC,SAA+B,CAAC;QACzD,MAAM,KAAK,GAAG,MAAM,CAAC,KAA2B,CAA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,CAAC,CAAC,CAAC,CAAC;IACrC,CAAC;CACF,CAAA;AAtLY,sDAAqB;gCAArB,qBAAqB;IADjC,IAAA,mBAAU,GAAE;qCAG4B,4BAAkB;QACxB,mBAAY;GAHlC,qBAAqB,CAsLjC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ChatGptEmbeddingService } from '@venturialstd/chatgpt';
|
|
2
|
+
import { IWorkflowActionService, WorkflowActionContext } from '../../types';
|
|
3
|
+
export declare class CreateEmbeddingService implements IWorkflowActionService {
|
|
4
|
+
private readonly chatGptEmbeddingService;
|
|
5
|
+
constructor(chatGptEmbeddingService: ChatGptEmbeddingService);
|
|
6
|
+
perform(inputs: Record<string, unknown>, context: WorkflowActionContext): Promise<Record<string, unknown>>;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=create-embedding.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-embedding.service.d.ts","sourceRoot":"","sources":["../../../../src/modules/chatgpt/services/create-embedding.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAEhE,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAE5E,qBACa,sBAAuB,YAAW,sBAAsB;IACvD,OAAO,CAAC,QAAQ,CAAC,uBAAuB;gBAAvB,uBAAuB,EAAE,uBAAuB;IAEvE,OAAO,CACX,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,OAAO,EAAE,qBAAqB,GAC7B,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CA4CpC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.CreateEmbeddingService = void 0;
|
|
13
|
+
const common_1 = require("@nestjs/common");
|
|
14
|
+
const chatgpt_1 = require("@venturialstd/chatgpt");
|
|
15
|
+
let CreateEmbeddingService = class CreateEmbeddingService {
|
|
16
|
+
chatGptEmbeddingService;
|
|
17
|
+
constructor(chatGptEmbeddingService) {
|
|
18
|
+
this.chatGptEmbeddingService = chatGptEmbeddingService;
|
|
19
|
+
}
|
|
20
|
+
async perform(inputs, context) {
|
|
21
|
+
const apiKey = context.credentials?.apiKey;
|
|
22
|
+
const baseUrl = context.credentials?.baseUrl || 'https://api.openai.com/v1';
|
|
23
|
+
if (!apiKey) {
|
|
24
|
+
throw new Error('OpenAI API key is required in credentials');
|
|
25
|
+
}
|
|
26
|
+
let input;
|
|
27
|
+
if (typeof inputs.input === 'string') {
|
|
28
|
+
try {
|
|
29
|
+
const parsed = JSON.parse(inputs.input);
|
|
30
|
+
input = parsed;
|
|
31
|
+
}
|
|
32
|
+
catch {
|
|
33
|
+
input = inputs.input;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
else if (Array.isArray(inputs.input)) {
|
|
37
|
+
input = inputs.input;
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
input = String(inputs.input);
|
|
41
|
+
}
|
|
42
|
+
const model = inputs.model || 'text-embedding-3-small';
|
|
43
|
+
const dimensions = inputs.dimensions;
|
|
44
|
+
const embedding = await this.chatGptEmbeddingService.createEmbedding({
|
|
45
|
+
model,
|
|
46
|
+
dimensions,
|
|
47
|
+
apiKey,
|
|
48
|
+
baseUrl,
|
|
49
|
+
}, input);
|
|
50
|
+
return {
|
|
51
|
+
embeddings: embedding.data.map((item) => item.embedding),
|
|
52
|
+
model: embedding.model,
|
|
53
|
+
usage: {
|
|
54
|
+
promptTokens: embedding.usage.prompt_tokens,
|
|
55
|
+
totalTokens: embedding.usage.total_tokens,
|
|
56
|
+
},
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
exports.CreateEmbeddingService = CreateEmbeddingService;
|
|
61
|
+
exports.CreateEmbeddingService = CreateEmbeddingService = __decorate([
|
|
62
|
+
(0, common_1.Injectable)(),
|
|
63
|
+
__metadata("design:paramtypes", [chatgpt_1.ChatGptEmbeddingService])
|
|
64
|
+
], CreateEmbeddingService);
|
|
65
|
+
//# sourceMappingURL=create-embedding.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-embedding.service.js","sourceRoot":"","sources":["../../../../src/modules/chatgpt/services/create-embedding.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,mDAAgE;AAKzD,IAAM,sBAAsB,GAA5B,MAAM,sBAAsB;IACJ;IAA7B,YAA6B,uBAAgD;QAAhD,4BAAuB,GAAvB,uBAAuB,CAAyB;IAAG,CAAC;IAEjF,KAAK,CAAC,OAAO,CACX,MAA+B,EAC/B,OAA8B;QAE9B,MAAM,MAAM,GAAG,OAAO,CAAC,WAAW,EAAE,MAAgB,CAAC;QACrD,MAAM,OAAO,GAAI,OAAO,CAAC,WAAW,EAAE,OAAkB,IAAI,2BAA2B,CAAC;QAExF,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,MAAM,IAAI,KAAK,CAAC,2CAA2C,CAAC,CAAC;QAC/D,CAAC;QAED,IAAI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turialstd/chatgpt';
|
|
2
|
+
import { IWorkflowActionService, WorkflowActionContext } from '../../types';
|
|
3
|
+
export declare class GenerateImageService implements IWorkflowActionService {
|
|
4
|
+
private readonly chatGptImageService;
|
|
5
|
+
constructor(chatGptImageService: ChatGptImageService);
|
|
6
|
+
perform(inputs: Record<string, unknown>, context: WorkflowActionContext): Promise<Record<string, unknown>>;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=generate-image.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate-image.service.d.ts","sourceRoot":"","sources":["../../../../src/modules/chatgpt/services/generate-image.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAE5E,qBACa,oBAAqB,YAAW,sBAAsB;IACrD,OAAO,CAAC,QAAQ,CAAC,mBAAmB;gBAAnB,mBAAmB,EAAE,mBAAmB;IAE/D,OAAO,CACX,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,OAAO,EAAE,qBAAqB,GAC7B,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAuCpC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.GenerateImageService = void 0;
|
|
13
|
+
const common_1 = require("@nestjs/common");
|
|
14
|
+
const chatgpt_1 = require("@venturialstd/chatgpt");
|
|
15
|
+
let GenerateImageService = class GenerateImageService {
|
|
16
|
+
chatGptImageService;
|
|
17
|
+
constructor(chatGptImageService) {
|
|
18
|
+
this.chatGptImageService = chatGptImageService;
|
|
19
|
+
}
|
|
20
|
+
async perform(inputs, context) {
|
|
21
|
+
const apiKey = context.credentials?.apiKey;
|
|
22
|
+
const baseUrl = context.credentials?.baseUrl || 'https://api.openai.com/v1';
|
|
23
|
+
if (!apiKey) {
|
|
24
|
+
throw new Error('OpenAI API key is required in credentials');
|
|
25
|
+
}
|
|
26
|
+
const prompt = inputs.prompt;
|
|
27
|
+
const model = inputs.model || 'dall-e-3';
|
|
28
|
+
const size = inputs.size || '1024x1024';
|
|
29
|
+
const quality = inputs.quality;
|
|
30
|
+
const style = inputs.style;
|
|
31
|
+
if (!prompt) {
|
|
32
|
+
throw new Error('Prompt is required');
|
|
33
|
+
}
|
|
34
|
+
const images = await this.chatGptImageService.generateImage({
|
|
35
|
+
model: model,
|
|
36
|
+
size: size,
|
|
37
|
+
quality,
|
|
38
|
+
style,
|
|
39
|
+
n: 1,
|
|
40
|
+
responseFormat: 'url',
|
|
41
|
+
apiKey,
|
|
42
|
+
baseUrl,
|
|
43
|
+
}, prompt);
|
|
44
|
+
const imageData = images.data?.[0];
|
|
45
|
+
return {
|
|
46
|
+
imageUrl: imageData?.url || '',
|
|
47
|
+
revisedPrompt: imageData?.revised_prompt || prompt,
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
exports.GenerateImageService = GenerateImageService;
|
|
52
|
+
exports.GenerateImageService = GenerateImageService = __decorate([
|
|
53
|
+
(0, common_1.Injectable)(),
|
|
54
|
+
__metadata("design:paramtypes", [chatgpt_1.ChatGptImageService])
|
|
55
|
+
], GenerateImageService);
|
|
56
|
+
//# sourceMappingURL=generate-image.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate-image.service.js","sourceRoot":"","sources":["../../../../src/modules/chatgpt/services/generate-image.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,mDAA4D;AAKrD,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;IACF;IAA7B,YAA6B,mBAAwC;QAAxC,wBAAmB,GAAnB,mBAAmB,CAAqB;IAAG,CAAC;IAEzE,KAAK,CAAC,OAAO,CACX,MAA+B,EAC/B,OAA8B;QAE9B,MAAM,MAAM,GAAG,OAAO,CAAC,WAAW,EAAE,MAAgB,CAAC;QACrD,MAAM,OAAO,GAAI,OAAO,CAAC,WAAW,EAAE,OAAkB,IAAI,2BAA2B,CAAC;QAExF,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,MAAM,IAAI,KAAK,CAAC,2CAA2C,CAAC,CAAC;QAC/D,CAAC;QAED,MAAM,MAAM,GAAG,MAAM,CAAC,MAAgB,CAAC;QACvC,MAAM,KAAK,GAAI,MAAM,CAAC,KAAgB,IAAI,UAAU,CAAC;QACrD,MAAM,IAAI,GAAI,MAAM,CAAC,IAAe,IAAI,WAAW,CAAC;QACpD,MAAM,OAAO,GAAG,MAAM,CAAC,OAAwC,CAAC;QAChE,MAAM,KAAK,GAAG,MAAM,CAAC,KAAwC,CAAC;QAE9D,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,MAAM,IAAI,KAAK,CAAC,oBAAoB,CAAC,CAAC;QACxC,CAAC;QAED,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,mBAAmB,CAAC,aAAa,CACzD;YACE,KAAK,EAAE,KAAgC;YACvC,IAAI,EAAE,IAAuE;YAC7E,OAA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