@xxmachina/common 19.0.0-preview.29 → 19.0.0-preview.4
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 +11 -0
- package/_shared/auth/auth.module.js +22 -0
- package/_shared/auth/auth.module.js.map +1 -0
- package/_shared/auth/index.js +5 -0
- package/_shared/auth/index.js.map +1 -0
- package/_shared/auth/passports/anonymous/anonymous.strategy.js +19 -0
- package/_shared/auth/passports/anonymous/anonymous.strategy.js.map +1 -0
- package/_shared/auth/passports/anonymous/index.js +5 -0
- package/_shared/auth/passports/anonymous/index.js.map +1 -0
- package/_shared/auth/passports/firebase/firebase.guard.js +23 -0
- package/_shared/auth/passports/firebase/firebase.guard.js.map +1 -0
- package/_shared/auth/passports/firebase/firebase.strategy.js +22 -0
- package/_shared/auth/passports/firebase/firebase.strategy.js.map +1 -0
- package/_shared/auth/passports/firebase/index.js +6 -0
- package/_shared/auth/passports/firebase/index.js.map +1 -0
- package/_shared/auth/passports/internal/index.js +5 -0
- package/_shared/auth/passports/internal/index.js.map +1 -0
- package/_shared/auth/passports/internal/internal.strategy.js +33 -0
- package/_shared/auth/passports/internal/internal.strategy.js.map +1 -0
- package/_shared/auth/passports/msal/index.js +6 -0
- package/_shared/auth/passports/msal/index.js.map +1 -0
- package/_shared/auth/passports/msal/msal.guard.js +13 -0
- package/_shared/auth/passports/msal/msal.guard.js.map +1 -0
- package/_shared/auth/passports/msal/msal.strategy.js +43 -0
- package/_shared/auth/passports/msal/msal.strategy.js.map +1 -0
- package/_shared/meta/decorators.js +25 -0
- package/_shared/meta/decorators.js.map +1 -0
- package/_shared/meta/redis/index.js +6 -0
- package/_shared/meta/redis/index.js.map +1 -0
- package/_shared/meta/redis/redis.config.js +10 -0
- package/_shared/meta/redis/redis.config.js.map +1 -0
- package/_shared/meta/redis/redis.repository.d.ts +3 -6
- package/_shared/meta/redis/redis.repository.js +108 -0
- package/_shared/meta/redis/redis.repository.js.map +1 -0
- package/auth/auth.service.d.ts +0 -3
- package/auth/auth.service.js +12 -0
- package/auth/auth.service.js.map +1 -0
- package/auth/index.js +5 -0
- package/auth/index.js.map +1 -0
- package/azure-auth/auth.di.js +56 -0
- package/azure-auth/auth.di.js.map +1 -0
- package/azure-auth/auth.service.d.ts +0 -3
- package/azure-auth/auth.service.js +115 -0
- package/azure-auth/auth.service.js.map +1 -0
- package/azure-auth/index.js +6 -0
- package/azure-auth/index.js.map +1 -0
- package/domain/builder/command/command.builder.d.ts +2 -1
- package/domain/builder/command/command.builder.js +30 -0
- package/domain/builder/command/command.builder.js.map +1 -0
- package/domain/builder/command/index.js +5 -0
- package/domain/builder/command/index.js.map +1 -0
- package/domain/builder/command-action/command-action.builder.d.ts +1 -1
- package/domain/builder/command-action/command-action.builder.js +139 -0
- package/domain/builder/command-action/command-action.builder.js.map +1 -0
- package/domain/builder/command-action/index.js +5 -0
- package/domain/builder/command-action/index.js.map +1 -0
- package/domain/builder/er/er.builder.js +112 -0
- package/domain/builder/er/er.builder.js.map +1 -0
- package/domain/builder/er/index.js +5 -0
- package/domain/builder/er/index.js.map +1 -0
- package/domain/builder/screen-item/index.js +5 -0
- package/domain/builder/screen-item/index.js.map +1 -0
- package/domain/builder/screen-item/screen-item.builder.d.ts +2 -2
- package/{fesm2022/xxmachina-common-domain-builder-screen-item.mjs → domain/builder/screen-item/screen-item.builder.js} +11 -10
- package/domain/builder/screen-item/screen-item.builder.js.map +1 -0
- package/domain/index.d.ts +1 -2
- package/domain/index.js +5 -0
- package/domain/index.js.map +1 -0
- package/{domain-invoice → domain/invoice}/builders/email/email.builder.d.ts +1 -1
- package/domain/invoice/builders/email/email.builder.js +29 -0
- package/domain/invoice/builders/email/email.builder.js.map +1 -0
- package/domain/invoice/builders/email/index.js +5 -0
- package/domain/invoice/builders/email/index.js.map +1 -0
- package/domain/invoice/builders/message/index.js +5 -0
- package/domain/invoice/builders/message/index.js.map +1 -0
- package/{domain-invoice → domain/invoice}/builders/message/message.builder.d.ts +1 -1
- package/domain/invoice/builders/message/message.builder.js +43 -0
- package/domain/invoice/builders/message/message.builder.js.map +1 -0
- package/domain/invoice/builders/title/index.js +5 -0
- package/domain/invoice/builders/title/index.js.map +1 -0
- package/{domain-invoice → domain/invoice}/builders/title/title.builder.d.ts +1 -1
- package/domain/invoice/builders/title/title.builder.js +11 -0
- package/domain/invoice/builders/title/title.builder.js.map +1 -0
- package/domain/invoice/models/backoffice/contract.js +50 -0
- package/domain/invoice/models/backoffice/contract.js.map +1 -0
- package/domain/invoice/models/backoffice/index.js +9 -0
- package/domain/invoice/models/backoffice/index.js.map +1 -0
- package/domain/invoice/models/backoffice/invoice-mail.js +7 -0
- package/domain/invoice/models/backoffice/invoice-mail.js.map +1 -0
- package/{domain-invoice → domain/invoice}/models/backoffice/invoice.d.ts +1 -1
- package/domain/invoice/models/backoffice/invoice.js +91 -0
- package/domain/invoice/models/backoffice/invoice.js.map +1 -0
- package/{domain-invoice → domain/invoice}/models/backoffice/order.d.ts +1 -1
- package/domain/invoice/models/backoffice/order.js +157 -0
- package/domain/invoice/models/backoffice/order.js.map +1 -0
- package/{domain-invoice → domain/invoice}/models/backoffice/partner.d.ts +1 -1
- package/domain/invoice/models/backoffice/partner.js +96 -0
- package/domain/invoice/models/backoffice/partner.js.map +1 -0
- package/domain/invoice/models/index.js +5 -0
- package/domain/invoice/models/index.js.map +1 -0
- package/domain/models/agent/assistant.js +31 -0
- package/domain/models/agent/assistant.js.map +1 -0
- package/domain/models/agent/index.js +5 -0
- package/domain/models/agent/index.js.map +1 -0
- package/domain/models/bookmarklet/bookmarklet.js +34 -0
- package/domain/models/bookmarklet/bookmarklet.js.map +1 -0
- package/domain/models/bookmarklet/index.js +5 -0
- package/domain/models/bookmarklet/index.js.map +1 -0
- package/domain/models/calendar-utils.d.ts +5 -0
- package/domain/models/calendar-utils.js +43 -0
- package/domain/models/calendar-utils.js.map +1 -0
- package/domain/models/command/command.helper.js +14 -0
- package/domain/models/command/command.helper.js.map +1 -0
- package/domain/models/command/command.js +40 -0
- package/domain/models/command/command.js.map +1 -0
- package/domain/models/command/index.js +6 -0
- package/domain/models/command/index.js.map +1 -0
- package/domain/models/database/database.js +7 -0
- package/domain/models/database/database.js.map +1 -0
- package/domain/models/database/index.js +5 -0
- package/domain/models/database/index.js.map +1 -0
- package/domain/models/endpoint/endpoint.helper.js +21 -0
- package/domain/models/endpoint/endpoint.helper.js.map +1 -0
- package/domain/models/endpoint/index.js +5 -0
- package/domain/models/endpoint/index.js.map +1 -0
- package/domain/models/index.d.ts +2 -8
- package/domain/models/index.js +12 -0
- package/domain/models/index.js.map +1 -0
- package/domain/models/links/google/google.js +47 -0
- package/domain/models/links/google/google.js.map +1 -0
- package/domain/models/links/google/index.js +5 -0
- package/domain/models/links/google/index.js.map +1 -0
- package/domain/models/openapi/index.js +6 -0
- package/domain/models/openapi/index.js.map +1 -0
- package/domain/models/openapi/openapi.js +87 -0
- package/domain/models/openapi/openapi.js.map +1 -0
- package/domain/models/openapi/openapi.schema.js +3 -0
- package/domain/models/openapi/openapi.schema.js.map +1 -0
- package/domain/models/operators/assistancts/base.js +13 -0
- package/domain/models/operators/assistancts/base.js.map +1 -0
- package/domain/models/operators/assistancts/index.js +5 -0
- package/domain/models/operators/assistancts/index.js.map +1 -0
- package/domain/models/operators/base.js +10 -0
- package/domain/models/operators/base.js.map +1 -0
- package/domain/models/operators/index.js +8 -0
- package/domain/models/operators/index.js.map +1 -0
- package/domain/models/operators/systems/base.js +3 -0
- package/domain/models/operators/systems/base.js.map +1 -0
- package/domain/models/operators/systems/graphql.js +3 -0
- package/domain/models/operators/systems/graphql.js.map +1 -0
- package/domain/models/operators/systems/index.js +7 -0
- package/domain/models/operators/systems/index.js.map +1 -0
- package/domain/models/operators/systems/rest.js +3 -0
- package/domain/models/operators/systems/rest.js.map +1 -0
- package/domain/models/operators/workflows/index.js +5 -0
- package/domain/models/operators/workflows/index.js.map +1 -0
- package/domain/models/operators/workflows/workflow.js +3 -0
- package/domain/models/operators/workflows/workflow.js.map +1 -0
- package/domain/models/project.js +9 -0
- package/domain/models/project.js.map +1 -0
- package/domain/models/query/index.js +6 -0
- package/domain/models/query/index.js.map +1 -0
- package/domain/models/query/query.d.ts +1 -1
- package/domain/models/query/query.helper.d.ts +0 -1
- package/domain/models/query/query.helper.js +172 -0
- package/domain/models/query/query.helper.js.map +1 -0
- package/domain/models/query/query.js +122 -0
- package/domain/models/query/query.js.map +1 -0
- package/domain/models/resource/index.js +6 -0
- package/domain/models/resource/index.js.map +1 -0
- package/domain/models/resource/resource.helper.js +16 -0
- package/domain/models/resource/resource.helper.js.map +1 -0
- package/domain/models/resource/resource.js +73 -0
- package/domain/models/resource/resource.js.map +1 -0
- package/domain/models/scheduler/index.js +5 -0
- package/domain/models/scheduler/index.js.map +1 -0
- package/domain/models/scheduler/schedule.js +89 -0
- package/domain/models/scheduler/schedule.js.map +1 -0
- package/domain/models/screen-item/index.js +5 -0
- package/domain/models/screen-item/index.js.map +1 -0
- package/domain/models/screen-item/screen-item.js +3 -0
- package/domain/models/screen-item/screen-item.js.map +1 -0
- package/domain/models/spec.js +3 -0
- package/domain/models/spec.js.map +1 -0
- package/domain/resolvers/index.js +5 -0
- package/domain/resolvers/index.js.map +1 -0
- package/{domain-invoice → domain}/resolvers/invoice.resolver.d.ts +1 -1
- package/domain/resolvers/invoice.resolver.js +31 -0
- package/domain/resolvers/invoice.resolver.js.map +1 -0
- package/infrastructure/converters/bookmarklet/bookmarklet.converter.d.ts +0 -0
- package/infrastructure/converters/bookmarklet/bookmarklet.converter.js +1 -0
- package/infrastructure/converters/bookmarklet/bookmarklet.converter.js.map +1 -0
- package/{infra → infrastructure}/converters/google/google.converter.d.ts +1 -4
- package/infrastructure/converters/google/google.converter.js +27 -0
- package/infrastructure/converters/google/google.converter.js.map +1 -0
- package/infrastructure/converters/google/index.js +5 -0
- package/infrastructure/converters/google/index.js.map +1 -0
- package/infrastructure/external/data-connect/data-connect.service.impl.d.ts +7 -0
- package/infrastructure/external/data-connect/data-connect.service.impl.js +20 -0
- package/infrastructure/external/data-connect/data-connect.service.impl.js.map +1 -0
- package/infrastructure/external/data-connect/data-connect.service.js +11 -0
- package/infrastructure/external/data-connect/data-connect.service.js.map +1 -0
- package/infrastructure/external/data-connect/index.js +5 -0
- package/infrastructure/external/data-connect/index.js.map +1 -0
- package/{infra → infrastructure}/external/external.config.d.ts +2 -2
- package/infrastructure/external/external.config.js +13 -0
- package/infrastructure/external/external.config.js.map +1 -0
- package/{infra → infrastructure}/external/external.service.d.ts +3 -4
- package/infrastructure/external/external.service.js +23 -0
- package/infrastructure/external/external.service.js.map +1 -0
- package/infrastructure/external/index.js +6 -0
- package/infrastructure/external/index.js.map +1 -0
- package/infrastructure/external/quick-js/index.js +5 -0
- package/infrastructure/external/quick-js/index.js.map +1 -0
- package/{infra → infrastructure}/external/quick-js/quick-js.service.d.ts +0 -3
- package/infrastructure/external/quick-js/quick-js.service.js +44 -0
- package/infrastructure/external/quick-js/quick-js.service.js.map +1 -0
- package/infrastructure/external/resend/index.js +5 -0
- package/infrastructure/external/resend/index.js.map +1 -0
- package/infrastructure/external/resend/resend.service.d.ts +9 -0
- package/{infra → infrastructure}/external/resend/resend.service.impl.d.ts +8 -4
- package/infrastructure/external/resend/resend.service.impl.js +27 -0
- package/infrastructure/external/resend/resend.service.impl.js.map +1 -0
- package/infrastructure/external/resend/resend.service.js +6 -0
- package/infrastructure/external/resend/resend.service.js.map +1 -0
- package/infrastructure/index.js +6 -0
- package/infrastructure/index.js.map +1 -0
- package/{infra → infrastructure}/infrastructure.config.d.ts +5 -5
- package/infrastructure/infrastructure.config.js +12 -0
- package/infrastructure/infrastructure.config.js.map +1 -0
- package/{infra → infrastructure}/infrastructure.service.d.ts +0 -3
- package/infrastructure/infrastructure.service.js +20 -0
- package/infrastructure/infrastructure.service.js.map +1 -0
- package/infrastructure/query/firestore/query/index.js +5 -0
- package/infrastructure/query/firestore/query/index.js.map +1 -0
- package/{infra → infrastructure}/query/firestore/query/query.query.d.ts +0 -3
- package/infrastructure/query/firestore/query/query.query.js +20 -0
- package/infrastructure/query/firestore/query/query.query.js.map +1 -0
- package/infrastructure/query/firestore/resource/index.js +5 -0
- package/infrastructure/query/firestore/resource/index.js.map +1 -0
- package/{infra → infrastructure}/query/firestore/resource/resource.query.d.ts +0 -3
- package/infrastructure/query/firestore/resource/resource.query.js +20 -0
- package/infrastructure/query/firestore/resource/resource.query.js.map +1 -0
- package/infrastructure/query/hasura/resource/index.js +5 -0
- package/infrastructure/query/hasura/resource/index.js.map +1 -0
- package/infrastructure/query/hasura/resource/resource.query.d.ts +3 -0
- package/infrastructure/query/hasura/resource/resource.query.js +14 -0
- package/infrastructure/query/hasura/resource/resource.query.js.map +1 -0
- package/infrastructure/repository/dataconnect/invoice/index.js +5 -0
- package/infrastructure/repository/dataconnect/invoice/index.js.map +1 -0
- package/{infra → infrastructure}/repository/dataconnect/invoice/invoice.repository.impl.d.ts +1 -4
- package/infrastructure/repository/dataconnect/invoice/invoice.repository.impl.js +54 -0
- package/infrastructure/repository/dataconnect/invoice/invoice.repository.impl.js.map +1 -0
- package/infrastructure/repository/dataconnect/invoice/invoice.repository.js +11 -0
- package/infrastructure/repository/dataconnect/invoice/invoice.repository.js.map +1 -0
- package/infrastructure/repository/dataconnect/order/index.js +5 -0
- package/infrastructure/repository/dataconnect/order/index.js.map +1 -0
- package/{infra → infrastructure}/repository/dataconnect/order/order.repository.impl.d.ts +1 -4
- package/infrastructure/repository/dataconnect/order/order.repository.impl.js +74 -0
- package/infrastructure/repository/dataconnect/order/order.repository.impl.js.map +1 -0
- package/infrastructure/repository/dataconnect/order/order.repository.js +11 -0
- package/infrastructure/repository/dataconnect/order/order.repository.js.map +1 -0
- package/infrastructure/repository/firestore/bookmarklet/bookmarklet.repository.d.ts +6 -0
- package/infrastructure/repository/firestore/bookmarklet/bookmarklet.repository.js +20 -0
- package/infrastructure/repository/firestore/bookmarklet/bookmarklet.repository.js.map +1 -0
- package/infrastructure/repository/firestore/bookmarklet/index.d.ts +1 -0
- package/infrastructure/repository/firestore/bookmarklet/index.js +5 -0
- package/infrastructure/repository/firestore/bookmarklet/index.js.map +1 -0
- package/infrastructure/repository/firestore/firestore.repository.d.ts +7 -0
- package/infrastructure/repository/firestore/firestore.repository.js +20 -0
- package/infrastructure/repository/firestore/firestore.repository.js.map +1 -0
- package/infrastructure/repository/firestore/index.d.ts +1 -0
- package/infrastructure/repository/firestore/index.js +5 -0
- package/infrastructure/repository/firestore/index.js.map +1 -0
- package/infrastructure/repository/firestore/link/google/google.repository.d.ts +7 -0
- package/infrastructure/repository/firestore/link/google/google.repository.js +19 -0
- package/infrastructure/repository/firestore/link/google/google.repository.js.map +1 -0
- package/infrastructure/repository/firestore/link/google/index.js +5 -0
- package/infrastructure/repository/firestore/link/google/index.js.map +1 -0
- package/infrastructure/repository/firestore/link/index.js +5 -0
- package/infrastructure/repository/firestore/link/index.js.map +1 -0
- package/infrastructure/repository/firestore/link/link.repository.d.ts +5 -0
- package/infrastructure/repository/firestore/link/link.repository.js +17 -0
- package/infrastructure/repository/firestore/link/link.repository.js.map +1 -0
- package/infrastructure/repository/firestore/query/index.js +5 -0
- package/infrastructure/repository/firestore/query/index.js.map +1 -0
- package/{infra → infrastructure}/repository/firestore/query/query.repository.d.ts +1 -4
- package/infrastructure/repository/firestore/query/query.repository.js +20 -0
- package/infrastructure/repository/firestore/query/query.repository.js.map +1 -0
- package/infrastructure/repository/firestore/resource/index.js +5 -0
- package/infrastructure/repository/firestore/resource/index.js.map +1 -0
- package/{infra → infrastructure}/repository/firestore/resource/resource.repository.d.ts +1 -4
- package/infrastructure/repository/firestore/resource/resource.repository.js +20 -0
- package/infrastructure/repository/firestore/resource/resource.repository.js.map +1 -0
- package/infrastructure/repository/hasura/query/index.js +5 -0
- package/infrastructure/repository/hasura/query/index.js.map +1 -0
- package/{infra → infrastructure}/repository/hasura/query/query.repository.d.ts +0 -3
- package/infrastructure/repository/hasura/query/query.repository.js +23 -0
- package/infrastructure/repository/hasura/query/query.repository.js.map +1 -0
- package/infrastructure/repository/hasura/resource/index.js +5 -0
- package/infrastructure/repository/hasura/resource/index.js.map +1 -0
- package/{infra → infrastructure}/repository/hasura/resource/resource.repository.d.ts +0 -3
- package/infrastructure/repository/hasura/resource/resource.repository.js +23 -0
- package/infrastructure/repository/hasura/resource/resource.repository.js.map +1 -0
- package/infrastructure/repository/index.js +6 -0
- package/infrastructure/repository/index.js.map +1 -0
- package/infrastructure/repository/notion/contract/contract.config.js +10 -0
- package/infrastructure/repository/notion/contract/contract.config.js.map +1 -0
- package/{infra → infrastructure}/repository/notion/contract/contract.repository.d.ts +1 -4
- package/infrastructure/repository/notion/contract/contract.repository.js +22 -0
- package/infrastructure/repository/notion/contract/contract.repository.js.map +1 -0
- package/infrastructure/repository/notion/contract/index.js +6 -0
- package/infrastructure/repository/notion/contract/index.js.map +1 -0
- package/infrastructure/repository/notion/index.d.ts +2 -0
- package/infrastructure/repository/notion/index.js +6 -0
- package/infrastructure/repository/notion/index.js.map +1 -0
- package/infrastructure/repository/notion/invoice/index.js +6 -0
- package/infrastructure/repository/notion/invoice/index.js.map +1 -0
- package/infrastructure/repository/notion/invoice/invoice.config.js +10 -0
- package/infrastructure/repository/notion/invoice/invoice.config.js.map +1 -0
- package/{infra → infrastructure}/repository/notion/invoice/invoice.repository.d.ts +1 -4
- package/infrastructure/repository/notion/invoice/invoice.repository.js +22 -0
- package/infrastructure/repository/notion/invoice/invoice.repository.js.map +1 -0
- package/infrastructure/repository/notion/notion.config.js +18 -0
- package/infrastructure/repository/notion/notion.config.js.map +1 -0
- package/{infra → infrastructure}/repository/notion/notion.repository.d.ts +0 -3
- package/infrastructure/repository/notion/notion.repository.js +26 -0
- package/infrastructure/repository/notion/notion.repository.js.map +1 -0
- package/infrastructure/repository/notion/order/index.js +5 -0
- package/infrastructure/repository/notion/order/index.js.map +1 -0
- package/infrastructure/repository/notion/order/order.config.js +10 -0
- package/infrastructure/repository/notion/order/order.config.js.map +1 -0
- package/{infra → infrastructure}/repository/notion/order/order.repository.d.ts +1 -4
- package/infrastructure/repository/notion/order/order.repository.js +22 -0
- package/infrastructure/repository/notion/order/order.repository.js.map +1 -0
- package/infrastructure/repository/notion/partner/index.js +6 -0
- package/infrastructure/repository/notion/partner/index.js.map +1 -0
- package/infrastructure/repository/notion/partner/partner.config.js +10 -0
- package/infrastructure/repository/notion/partner/partner.config.js.map +1 -0
- package/{infra → infrastructure}/repository/notion/partner/partner.repository.d.ts +1 -4
- package/infrastructure/repository/notion/partner/partner.repository.js +22 -0
- package/infrastructure/repository/notion/partner/partner.repository.js.map +1 -0
- package/infrastructure/repository/redis/index.js +6 -0
- package/infrastructure/repository/redis/index.js.map +1 -0
- package/infrastructure/repository/redis/operator/index.js +5 -0
- package/infrastructure/repository/redis/operator/index.js.map +1 -0
- package/{infra → infrastructure}/repository/redis/operator/operator.repository.d.ts +0 -3
- package/infrastructure/repository/redis/operator/operator.repository.js +17 -0
- package/infrastructure/repository/redis/operator/operator.repository.js.map +1 -0
- package/infrastructure/repository/redis/project/index.js +5 -0
- package/infrastructure/repository/redis/project/index.js.map +1 -0
- package/{infra → infrastructure}/repository/redis/project/project.repository.d.ts +0 -3
- package/infrastructure/repository/redis/project/project.repository.js +33 -0
- package/infrastructure/repository/redis/project/project.repository.js.map +1 -0
- package/infrastructure/repository/redis/redis.config.js +10 -0
- package/infrastructure/repository/redis/redis.config.js.map +1 -0
- package/{infra → infrastructure}/repository/redis/redis.service.d.ts +0 -3
- package/infrastructure/repository/redis/redis.service.js +22 -0
- package/infrastructure/repository/redis/redis.service.js.map +1 -0
- package/infrastructure/repository/redis/spec/index.js +5 -0
- package/infrastructure/repository/redis/spec/index.js.map +1 -0
- package/{infra → infrastructure}/repository/redis/spec/spec.repository.d.ts +3 -5
- package/infrastructure/repository/redis/spec/spec.repository.js +94 -0
- package/infrastructure/repository/redis/spec/spec.repository.js.map +1 -0
- package/infrastructure/repository/redis/system/index.js +5 -0
- package/infrastructure/repository/redis/system/index.js.map +1 -0
- package/infrastructure/repository/redis/system/system.repository.d.ts +3 -0
- package/infrastructure/repository/redis/system/system.repository.js +15 -0
- package/infrastructure/repository/redis/system/system.repository.js.map +1 -0
- package/{infra → infrastructure}/repository/repository.config.d.ts +4 -4
- package/infrastructure/repository/repository.config.js +12 -0
- package/infrastructure/repository/repository.config.js.map +1 -0
- package/{infra → infrastructure}/repository/repository.service.d.ts +0 -3
- package/infrastructure/repository/repository.service.js +20 -0
- package/infrastructure/repository/repository.service.js.map +1 -0
- package/package.json +14 -202
- package/stores/index.d.ts +28 -4
- package/stores/index.js +66 -0
- package/stores/index.js.map +1 -0
- package/usecase/assistant/assistant.service.d.ts +1 -4
- package/usecase/assistant/assistant.service.js +72 -0
- package/usecase/assistant/assistant.service.js.map +1 -0
- package/usecase/assistant/index.js +5 -0
- package/usecase/assistant/index.js.map +1 -0
- package/usecase/database/database.service.d.ts +0 -3
- package/usecase/database/database.service.js +103 -0
- package/usecase/database/database.service.js.map +1 -0
- package/usecase/database/index.js +5 -0
- package/usecase/database/index.js.map +1 -0
- package/usecase/graphql/graphql.service.d.ts +0 -3
- package/usecase/graphql/graphql.service.js +49 -0
- package/usecase/graphql/graphql.service.js.map +1 -0
- package/usecase/graphql/index.js +5 -0
- package/usecase/graphql/index.js.map +1 -0
- package/usecase/index.js +5 -0
- package/usecase/index.js.map +1 -0
- package/usecase/invoice/index.js +5 -0
- package/usecase/invoice/index.js.map +1 -0
- package/usecase/invoice/invoice.service.d.ts +13 -9
- package/usecase/invoice/invoice.service.js +69 -0
- package/usecase/invoice/invoice.service.js.map +1 -0
- package/usecase/link/index.js +5 -0
- package/usecase/link/index.js.map +1 -0
- package/usecase/link/link.service.d.ts +2 -5
- package/usecase/link/link.service.js +20 -0
- package/usecase/link/link.service.js.map +1 -0
- package/usecase/order/index.js +5 -0
- package/usecase/order/index.js.map +1 -0
- package/usecase/order/order.service.d.ts +2 -5
- package/usecase/order/order.service.js +27 -0
- package/usecase/order/order.service.js.map +1 -0
- package/usecase/project/index.js +5 -0
- package/usecase/project/index.js.map +1 -0
- package/usecase/project/project.service.d.ts +1 -4
- package/usecase/project/project.service.js +37 -0
- package/usecase/project/project.service.js.map +1 -0
- package/usecase/spec/index.js +5 -0
- package/usecase/spec/index.js.map +1 -0
- package/usecase/spec/spec.service.d.ts +1 -4
- package/usecase/spec/spec.service.js +49 -0
- package/usecase/spec/spec.service.js.map +1 -0
- package/usecase/usecase.service.d.ts +0 -3
- package/usecase/usecase.service.js +24 -0
- package/usecase/usecase.service.js.map +1 -0
- package/{fesm2022/xxmachina-common-utils-crypto.mjs → utils/crypto.js} +12 -10
- package/utils/crypto.js.map +1 -0
- package/{fesm2022/xxmachina-common-utils.mjs → utils/extract-display-fields.js} +4 -7
- package/utils/extract-display-fields.js.map +1 -0
- package/utils/index.js +5 -0
- package/utils/index.js.map +1 -0
- package/_shared/meta/index.d.ts +0 -1
- package/domain/builder/index.d.ts +0 -4
- package/domain/models/links/index.d.ts +0 -1
- package/domain-invoice/builders/index.d.ts +0 -3
- package/domain-invoice/index.d.ts +0 -3
- package/fesm2022/xxmachina-common-_shared-auth-passports-anonymous.mjs +0 -20
- package/fesm2022/xxmachina-common-_shared-auth-passports-anonymous.mjs.map +0 -1
- package/fesm2022/xxmachina-common-_shared-auth-passports-firebase.mjs +0 -41
- package/fesm2022/xxmachina-common-_shared-auth-passports-firebase.mjs.map +0 -1
- package/fesm2022/xxmachina-common-_shared-auth-passports-internal.mjs +0 -34
- package/fesm2022/xxmachina-common-_shared-auth-passports-internal.mjs.map +0 -1
- package/fesm2022/xxmachina-common-_shared-auth-passports-msal.mjs +0 -49
- package/fesm2022/xxmachina-common-_shared-auth-passports-msal.mjs.map +0 -1
- package/fesm2022/xxmachina-common-_shared-auth.mjs +0 -25
- package/fesm2022/xxmachina-common-_shared-auth.mjs.map +0 -1
- package/fesm2022/xxmachina-common-_shared-meta-redis.mjs +0 -99
- package/fesm2022/xxmachina-common-_shared-meta-redis.mjs.map +0 -1
- package/fesm2022/xxmachina-common-_shared-meta.mjs +0 -26
- package/fesm2022/xxmachina-common-_shared-meta.mjs.map +0 -1
- package/fesm2022/xxmachina-common-auth.mjs +0 -17
- package/fesm2022/xxmachina-common-auth.mjs.map +0 -1
- package/fesm2022/xxmachina-common-azure-auth.mjs +0 -160
- package/fesm2022/xxmachina-common-azure-auth.mjs.map +0 -1
- package/fesm2022/xxmachina-common-domain-builder-screen-item.mjs.map +0 -1
- package/fesm2022/xxmachina-common-domain-builder.mjs +0 -470
- package/fesm2022/xxmachina-common-domain-builder.mjs.map +0 -1
- package/fesm2022/xxmachina-common-domain-invoice-builders.mjs +0 -70
- package/fesm2022/xxmachina-common-domain-invoice-builders.mjs.map +0 -1
- package/fesm2022/xxmachina-common-domain-invoice-models.mjs +0 -427
- package/fesm2022/xxmachina-common-domain-invoice-models.mjs.map +0 -1
- package/fesm2022/xxmachina-common-domain-invoice-resolvers.mjs +0 -39
- package/fesm2022/xxmachina-common-domain-invoice-resolvers.mjs.map +0 -1
- package/fesm2022/xxmachina-common-domain-invoice.mjs +0 -8
- package/fesm2022/xxmachina-common-domain-invoice.mjs.map +0 -1
- package/fesm2022/xxmachina-common-domain-models.mjs +0 -805
- package/fesm2022/xxmachina-common-domain-models.mjs.map +0 -1
- package/fesm2022/xxmachina-common-domain.mjs +0 -7
- package/fesm2022/xxmachina-common-domain.mjs.map +0 -1
- package/fesm2022/xxmachina-common-infra-converters-google.mjs +0 -36
- package/fesm2022/xxmachina-common-infra-converters-google.mjs.map +0 -1
- package/fesm2022/xxmachina-common-infra-external-data-connect.mjs +0 -13
- package/fesm2022/xxmachina-common-infra-external-data-connect.mjs.map +0 -1
- package/fesm2022/xxmachina-common-infra-external-quick-js.mjs +0 -44
- package/fesm2022/xxmachina-common-infra-external-quick-js.mjs.map +0 -1
- package/fesm2022/xxmachina-common-infra-external-resend.mjs +0 -10
- package/fesm2022/xxmachina-common-infra-external-resend.mjs.map +0 -1
- package/fesm2022/xxmachina-common-infra-external.mjs +0 -35
- package/fesm2022/xxmachina-common-infra-external.mjs.map +0 -1
- package/fesm2022/xxmachina-common-infra-query-firestore.mjs +0 -34
- package/fesm2022/xxmachina-common-infra-query-firestore.mjs.map +0 -1
- package/fesm2022/xxmachina-common-infra-query-hasura.mjs +0 -20
- package/fesm2022/xxmachina-common-infra-query-hasura.mjs.map +0 -1
- package/fesm2022/xxmachina-common-infra-repository-dataconnect.mjs +0 -18
- package/fesm2022/xxmachina-common-infra-repository-dataconnect.mjs.map +0 -1
- package/fesm2022/xxmachina-common-infra-repository-firestore.mjs +0 -74
- package/fesm2022/xxmachina-common-infra-repository-firestore.mjs.map +0 -1
- package/fesm2022/xxmachina-common-infra-repository-hasura.mjs +0 -41
- package/fesm2022/xxmachina-common-infra-repository-hasura.mjs.map +0 -1
- package/fesm2022/xxmachina-common-infra-repository-notion.mjs +0 -112
- package/fesm2022/xxmachina-common-infra-repository-notion.mjs.map +0 -1
- package/fesm2022/xxmachina-common-infra.mjs +0 -376
- package/fesm2022/xxmachina-common-infra.mjs.map +0 -1
- package/fesm2022/xxmachina-common-stores-firestore.mjs +0 -33
- package/fesm2022/xxmachina-common-stores-firestore.mjs.map +0 -1
- package/fesm2022/xxmachina-common-stores-hasura.mjs +0 -32
- package/fesm2022/xxmachina-common-stores-hasura.mjs.map +0 -1
- package/fesm2022/xxmachina-common-stores.mjs +0 -16
- package/fesm2022/xxmachina-common-stores.mjs.map +0 -1
- package/fesm2022/xxmachina-common-usecase-assistant.mjs +0 -67
- package/fesm2022/xxmachina-common-usecase-assistant.mjs.map +0 -1
- package/fesm2022/xxmachina-common-usecase-database.mjs +0 -95
- package/fesm2022/xxmachina-common-usecase-database.mjs.map +0 -1
- package/fesm2022/xxmachina-common-usecase-graphql.mjs +0 -51
- package/fesm2022/xxmachina-common-usecase-graphql.mjs.map +0 -1
- package/fesm2022/xxmachina-common-usecase-invoice.mjs +0 -67
- package/fesm2022/xxmachina-common-usecase-invoice.mjs.map +0 -1
- package/fesm2022/xxmachina-common-usecase-link.mjs +0 -26
- package/fesm2022/xxmachina-common-usecase-link.mjs.map +0 -1
- package/fesm2022/xxmachina-common-usecase-order.mjs +0 -29
- package/fesm2022/xxmachina-common-usecase-order.mjs.map +0 -1
- package/fesm2022/xxmachina-common-usecase-project.mjs +0 -35
- package/fesm2022/xxmachina-common-usecase-project.mjs.map +0 -1
- package/fesm2022/xxmachina-common-usecase-spec.mjs +0 -45
- package/fesm2022/xxmachina-common-usecase-spec.mjs.map +0 -1
- package/fesm2022/xxmachina-common-usecase.mjs +0 -198
- package/fesm2022/xxmachina-common-usecase.mjs.map +0 -1
- package/fesm2022/xxmachina-common-utils-crypto.mjs.map +0 -1
- package/fesm2022/xxmachina-common-utils.mjs.map +0 -1
- package/fesm2022/xxmachina-common.mjs +0 -6
- package/fesm2022/xxmachina-common.mjs.map +0 -1
- package/index.d.ts +0 -1
- package/infra/external/resend/resend.service.d.ts +0 -2
- package/infra/query/firestore/index.d.ts +0 -2
- package/infra/query/hasura/index.d.ts +0 -1
- package/infra/query/hasura/resource/resource.query.d.ts +0 -6
- package/infra/repository/dataconnect/index.d.ts +0 -2
- package/infra/repository/firestore/firestore.repository.d.ts +0 -8
- package/infra/repository/firestore/index.d.ts +0 -3
- package/infra/repository/firestore/link/google/google.repository.d.ts +0 -10
- package/infra/repository/firestore/link/link.repository.d.ts +0 -8
- package/infra/repository/hasura/index.d.ts +0 -2
- package/infra/repository/notion/index.d.ts +0 -6
- package/infra/repository/redis/system/system.repository.d.ts +0 -6
- package/stores/firestore/firestore.store.d.ts +0 -12
- package/stores/firestore/index.d.ts +0 -1
- package/stores/hasura/hasura.store.d.ts +0 -12
- package/stores/hasura/index.d.ts +0 -1
- package/utils/crypto/index.d.ts +0 -1
- /package/{domain-invoice → domain/invoice}/builders/email/index.d.ts +0 -0
- /package/{domain-invoice → domain/invoice}/builders/message/index.d.ts +0 -0
- /package/{domain-invoice → domain/invoice}/builders/title/index.d.ts +0 -0
- /package/{domain-invoice → domain/invoice}/models/backoffice/contract.d.ts +0 -0
- /package/{domain-invoice → domain/invoice}/models/backoffice/index.d.ts +0 -0
- /package/{domain-invoice → domain/invoice}/models/backoffice/invoice-mail.d.ts +0 -0
- /package/{domain-invoice → domain/invoice}/models/index.d.ts +0 -0
- /package/{domain-invoice → domain}/resolvers/index.d.ts +0 -0
- /package/{infra → infrastructure}/converters/google/index.d.ts +0 -0
- /package/{infra → infrastructure}/external/data-connect/data-connect.service.d.ts +0 -0
- /package/{infra → infrastructure}/external/data-connect/index.d.ts +0 -0
- /package/{infra → infrastructure}/external/index.d.ts +0 -0
- /package/{infra → infrastructure}/external/quick-js/index.d.ts +0 -0
- /package/{infra → infrastructure}/external/resend/index.d.ts +0 -0
- /package/{infra → infrastructure}/index.d.ts +0 -0
- /package/{infra → infrastructure}/query/firestore/query/index.d.ts +0 -0
- /package/{infra → infrastructure}/query/firestore/resource/index.d.ts +0 -0
- /package/{infra → infrastructure}/query/hasura/resource/index.d.ts +0 -0
- /package/{infra → infrastructure}/repository/dataconnect/invoice/index.d.ts +0 -0
- /package/{infra → infrastructure}/repository/dataconnect/invoice/invoice.repository.d.ts +0 -0
- /package/{infra → infrastructure}/repository/dataconnect/order/index.d.ts +0 -0
- /package/{infra → infrastructure}/repository/dataconnect/order/order.repository.d.ts +0 -0
- /package/{infra → infrastructure}/repository/firestore/link/google/index.d.ts +0 -0
- /package/{infra → infrastructure}/repository/firestore/link/index.d.ts +0 -0
- /package/{infra → infrastructure}/repository/firestore/query/index.d.ts +0 -0
- /package/{infra → infrastructure}/repository/firestore/resource/index.d.ts +0 -0
- /package/{infra → infrastructure}/repository/hasura/query/index.d.ts +0 -0
- /package/{infra → infrastructure}/repository/hasura/resource/index.d.ts +0 -0
- /package/{infra → infrastructure}/repository/index.d.ts +0 -0
- /package/{infra → infrastructure}/repository/notion/contract/contract.config.d.ts +0 -0
- /package/{infra → infrastructure}/repository/notion/contract/index.d.ts +0 -0
- /package/{infra → infrastructure}/repository/notion/invoice/index.d.ts +0 -0
- /package/{infra → infrastructure}/repository/notion/invoice/invoice.config.d.ts +0 -0
- /package/{infra → infrastructure}/repository/notion/notion.config.d.ts +0 -0
- /package/{infra → infrastructure}/repository/notion/order/index.d.ts +0 -0
- /package/{infra → infrastructure}/repository/notion/order/order.config.d.ts +0 -0
- /package/{infra → infrastructure}/repository/notion/partner/index.d.ts +0 -0
- /package/{infra → infrastructure}/repository/notion/partner/partner.config.d.ts +0 -0
- /package/{infra → infrastructure}/repository/redis/index.d.ts +0 -0
- /package/{infra → infrastructure}/repository/redis/operator/index.d.ts +0 -0
- /package/{infra → infrastructure}/repository/redis/project/index.d.ts +0 -0
- /package/{infra → infrastructure}/repository/redis/redis.config.d.ts +0 -0
- /package/{infra → infrastructure}/repository/redis/spec/index.d.ts +0 -0
- /package/{infra → infrastructure}/repository/redis/system/index.d.ts +0 -0
- /package/utils/{crypto/crypto.d.ts → crypto.d.ts} +0 -0
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AzureAuthService = exports.AZURE_AUTH_CONFIG = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const core_1 = require("@angular/core");
|
|
6
|
+
const rxjs_interop_1 = require("@angular/core/rxjs-interop");
|
|
7
|
+
const rxjs_1 = require("rxjs");
|
|
8
|
+
const msal_angular_1 = require("@azure/msal-angular");
|
|
9
|
+
const http_1 = require("@angular/common/http");
|
|
10
|
+
class AuthService {
|
|
11
|
+
}
|
|
12
|
+
exports.AZURE_AUTH_CONFIG = new core_1.InjectionToken('[@xxmachina/common] AZURE_AUTH_CONFIG');
|
|
13
|
+
let AzureAuthService = class AzureAuthService extends AuthService {
|
|
14
|
+
constructor(msal) {
|
|
15
|
+
super();
|
|
16
|
+
this.msal = msal;
|
|
17
|
+
this.config = (0, core_1.inject)(exports.AZURE_AUTH_CONFIG);
|
|
18
|
+
this.auth$ = new rxjs_1.ReplaySubject(1);
|
|
19
|
+
this.auth = (0, rxjs_interop_1.toSignal)(this.auth$);
|
|
20
|
+
this.accessToken = (0, core_1.signal)(null);
|
|
21
|
+
this.accessToken$ = (0, rxjs_interop_1.toObservable)(this.accessToken);
|
|
22
|
+
this.http = (0, core_1.inject)(http_1.HttpClient);
|
|
23
|
+
this.initialize().then(() => {
|
|
24
|
+
const account = this.msal.instance.getActiveAccount();
|
|
25
|
+
if (account) {
|
|
26
|
+
this.auth$.next(account);
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
this.auth$.next(null);
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
(0, rxjs_1.interval)(1000 * 60 * 5).pipe((0, rxjs_1.startWith)(null), (0, rxjs_1.switchMap)(() => this.auth$.pipe((0, rxjs_1.filter)((auth) => !!auth), (0, rxjs_1.take)(1))), (0, rxjs_1.filter)(() => !!this.auth())).subscribe(() => {
|
|
33
|
+
this.updateAccessToken();
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
initialize() {
|
|
37
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
38
|
+
yield (0, rxjs_1.lastValueFrom)(this.msal.initialize()).then(() => {
|
|
39
|
+
return this.msal.instance.handleRedirectPromise().then((response) => {
|
|
40
|
+
if (response !== null) {
|
|
41
|
+
this.msal.instance.setActiveAccount(response.account);
|
|
42
|
+
}
|
|
43
|
+
}).catch((error) => {
|
|
44
|
+
console.error('リダイレクト処理エラー:', error);
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
signIn() {
|
|
50
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
51
|
+
try {
|
|
52
|
+
const result = yield (0, rxjs_1.lastValueFrom)(this.msal.loginPopup({
|
|
53
|
+
scopes: this.config.scopes,
|
|
54
|
+
}));
|
|
55
|
+
this.msal.instance.setActiveAccount(result.account);
|
|
56
|
+
this.auth$.next(result.account);
|
|
57
|
+
console.debug('Sign-in result:', result);
|
|
58
|
+
yield this.acquireAccessToken();
|
|
59
|
+
return result.account;
|
|
60
|
+
}
|
|
61
|
+
catch (error) {
|
|
62
|
+
console.error('Sign-in failed:', error);
|
|
63
|
+
throw error;
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
signOut() {
|
|
68
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
69
|
+
try {
|
|
70
|
+
this.msal.instance.setActiveAccount(null);
|
|
71
|
+
this.auth$.next(null);
|
|
72
|
+
this.accessToken.set(null);
|
|
73
|
+
}
|
|
74
|
+
catch (error) {
|
|
75
|
+
console.error('Sign-out failed:', error);
|
|
76
|
+
throw error;
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
updateAccessToken() {
|
|
81
|
+
return tslib_1.__awaiter(this, arguments, void 0, function* (scopes = this.config.scopes) {
|
|
82
|
+
try {
|
|
83
|
+
const accessToken = yield this.acquireAccessToken(scopes);
|
|
84
|
+
this.accessToken.set(accessToken);
|
|
85
|
+
}
|
|
86
|
+
catch (error) {
|
|
87
|
+
console.error('Failed to acquire access token:', error);
|
|
88
|
+
this.accessToken.set(null);
|
|
89
|
+
throw error;
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
acquireAccessToken() {
|
|
94
|
+
return tslib_1.__awaiter(this, arguments, void 0, function* (scopes = this.config.scopes) {
|
|
95
|
+
const account = this.msal.instance.getActiveAccount();
|
|
96
|
+
if (!account)
|
|
97
|
+
throw new Error('No active account found.');
|
|
98
|
+
return (0, rxjs_1.lastValueFrom)(this.msal.acquireTokenSilent({
|
|
99
|
+
account,
|
|
100
|
+
scopes,
|
|
101
|
+
forceRefresh: true,
|
|
102
|
+
})).then((response) => {
|
|
103
|
+
this.auth$.next(response.account);
|
|
104
|
+
console.debug('[AzureAuthService] response:', response);
|
|
105
|
+
return response.accessToken;
|
|
106
|
+
});
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
exports.AzureAuthService = AzureAuthService;
|
|
111
|
+
exports.AzureAuthService = AzureAuthService = tslib_1.__decorate([
|
|
112
|
+
(0, core_1.Injectable)({ providedIn: 'root' }),
|
|
113
|
+
tslib_1.__metadata("design:paramtypes", [msal_angular_1.MsalService])
|
|
114
|
+
], AzureAuthService);
|
|
115
|
+
//# sourceMappingURL=auth.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.service.js","sourceRoot":"","sources":["../../../../../packages/@xxmachina/common/src/lib/azure-auth/auth.service.ts"],"names":[],"mappings":";;;;AAAA,wCAA2E;AAC3E,6DAAoE;AACpE,+BAA8G;AAC9G,sDAAkD;AAElD,+CAAkD;AAElD,MAAe,WAAW;CAMzB;AAOY,QAAA,iBAAiB,GAAG,IAAI,qBAAc,CAAkB,uCAAuC,CAAC,CAAC;AAGvG,IAAM,gBAAgB,GAAtB,MAAM,gBAAiB,SAAQ,WAAW;IAQ/C,YAAmB,IAAiB;QAClC,KAAK,EAAE,CAAC;QADS,SAAI,GAAJ,IAAI,CAAa;QAPjB,WAAM,GAAG,IAAA,aAAM,EAAC,yBAAiB,CAAC,CAAC;QAC7C,UAAK,GAAG,IAAI,oBAAa,CAAc,CAAC,CAAC,CAAC;QAC1C,SAAI,GAAG,IAAA,uBAAQ,EAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC5B,gBAAW,GAAG,IAAA,aAAM,EAAC,IAAI,CAAC,CAAC;QAC3B,iBAAY,GAAG,IAAA,2BAAY,EAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAC9C,SAAI,GAAG,IAAA,aAAM,EAAC,iBAAU,CAAC,CAAC;QAKjC,IAAI,CAAC,UAAU,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE;YAC1B,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC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C1B,yDAA+B"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { Command
|
|
1
|
+
import { Command } from '@xxmachina/common/domain/models/command';
|
|
2
|
+
import { OpenApi } from '../../models';
|
|
2
3
|
export declare class CommandBuilder {
|
|
3
4
|
buildFromOpenApi(openApi: OpenApi): Command[];
|
|
4
5
|
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CommandBuilder = void 0;
|
|
4
|
+
class CommandBuilder {
|
|
5
|
+
buildFromOpenApi(openApi) {
|
|
6
|
+
return Object.keys(openApi.getPaths()).flatMap((path) => {
|
|
7
|
+
return openApi.getMethods(path).map((method, index) => {
|
|
8
|
+
var _a, _b, _c, _d;
|
|
9
|
+
return ({
|
|
10
|
+
id: (_a = openApi.getOperationId(path, method)) !== null && _a !== void 0 ? _a : `cmd-${index}`,
|
|
11
|
+
name: (_b = openApi.getSummary(path, method)) !== null && _b !== void 0 ? _b : '',
|
|
12
|
+
description: (_c = openApi.getDescription(path, method)) !== null && _c !== void 0 ? _c : '',
|
|
13
|
+
type: 'webApiRequest',
|
|
14
|
+
webApiRequest: {
|
|
15
|
+
path: path,
|
|
16
|
+
method: method.toLocaleUpperCase(),
|
|
17
|
+
contentType: openApi.getContentType(path, method),
|
|
18
|
+
responseContentType: openApi.getResponseContentType(path, method),
|
|
19
|
+
bodySchema: openApi.getRequestBodySchema(path, method),
|
|
20
|
+
serverUrl: openApi.getServerUrl(),
|
|
21
|
+
apiJsonUrl: openApi.apiJsonUrl,
|
|
22
|
+
security: (_d = openApi.getSecurity(path, method)) !== null && _d !== void 0 ? _d : [],
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
exports.CommandBuilder = CommandBuilder;
|
|
30
|
+
//# sourceMappingURL=command.builder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command.builder.js","sourceRoot":"","sources":["../../../../../../../packages/@xxmachina/common/src/lib/domain/builder/command/command.builder.ts"],"names":[],"mappings":";;;AAGA,MAAa,cAAc;IACzB,gBAAgB,CAAC,OAAgB;QAC/B,OAAO,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;YACtD,OAAO,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,KAAa,EAAE,EAAE;;gBAAC,OAAA,CAAC;oBAC9D,EAAE,EAAE,MAAA,OAAO,CAAC,cAAc,CAAC,IAAI,EAAE,MAAM,CAAC,mCAAI,OAAO,KAAK,EAAE;oBAC1D,IAAI,EAAE,MAAA,OAAO,CAAC,UAAU,CAAC,IAAI,EAAE,MAAM,CAAC,mCAAI,EAAE;oBAC5C,WAAW,EAAE,MAAA,OAAO,CAAC,cAAc,CAAC,IAAI,EAAE,MAAM,CAAC,mCAAI,EAAE;oBACvD,IAAI,EAAE,eAAwB;oBAC9B,aAAa,EAAE;wBACb,IAAI,EAAE,IAAI;wBACV,MAAM,EAAE,MAAM,CAAC,iBAAiB,EAAE;wBAClC,WAAW,EAAE,OAAO,CAAC,cAAc,CAAC,IAAI,EAAE,MAAM,CAA+C;wBAC/F,mBAAmB,EAAE,OAAO,CAAC,sBAAsB,CAAC,IAAI,EAAE,MAAM,CAA2C;wBAC3G,UAAU,EAAE,OAAO,CAAC,oBAAoB,CAAC,IAAI,EAAE,MAAM,CAAC;wBACtD,SAAS,EAAE,OAAO,CAAC,YAAY,EAAE;wBACjC,UAAU,EAAE,OAAO,CAAC,UAAU;wBAC9B,QAAQ,EAAE,MAAA,OAAO,CAAC,WAAW,CAAC,IAAI,EAAE,MAAM,CAAC,mCAAI,EAAE;qBAClD;iBACF,CAAC,CAAA;aAAA,CAAC,CAAC;QACN,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AArBD,wCAqBC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/@xxmachina/common/src/lib/domain/builder/command/index.ts"],"names":[],"mappings":";;;AAAA,4DAAkC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Action, CreateActionsOptions } from '@ng-atomic/core';
|
|
2
2
|
import { NavigationExtras } from '@angular/router';
|
|
3
|
-
import { Command } from
|
|
3
|
+
import { Command } from "../../models";
|
|
4
4
|
export declare enum ActionId {
|
|
5
5
|
NAVIGATE_TO_COMMAND_PAGE = "[@xxmachina/common] Navigate To Command Page",
|
|
6
6
|
EXECUTE_COMMAND = "[@xxmachina/common] Execute Command"
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CommandActionsBuilder = exports.ActionId = void 0;
|
|
4
|
+
exports.createCommandNavigateAction = createCommandNavigateAction;
|
|
5
|
+
exports.createCommandExecutionAction = createCommandExecutionAction;
|
|
6
|
+
const core_1 = require("@ng-atomic/core");
|
|
7
|
+
const flat_1 = require("flat");
|
|
8
|
+
const lodash_es_1 = require("lodash-es");
|
|
9
|
+
const app_1 = require("@ng-atomic/components/frames/app");
|
|
10
|
+
var ActionId;
|
|
11
|
+
(function (ActionId) {
|
|
12
|
+
ActionId["NAVIGATE_TO_COMMAND_PAGE"] = "[@xxmachina/common] Navigate To Command Page";
|
|
13
|
+
ActionId["EXECUTE_COMMAND"] = "[@xxmachina/common] Execute Command";
|
|
14
|
+
})(ActionId || (exports.ActionId = ActionId = {}));
|
|
15
|
+
class CommandActionsBuilder {
|
|
16
|
+
constructor() {
|
|
17
|
+
this.commands = [];
|
|
18
|
+
this.options = {};
|
|
19
|
+
this.item = null;
|
|
20
|
+
this.filterIds = null;
|
|
21
|
+
this.autoIds = [];
|
|
22
|
+
}
|
|
23
|
+
setCommands(commands) {
|
|
24
|
+
const newFactory = new CommandActionsBuilder();
|
|
25
|
+
newFactory.commands = [...commands];
|
|
26
|
+
newFactory.options = Object.assign({}, this.options);
|
|
27
|
+
newFactory.item = this.item;
|
|
28
|
+
newFactory.filterIds = this.filterIds;
|
|
29
|
+
newFactory.autoIds = this.autoIds;
|
|
30
|
+
return newFactory;
|
|
31
|
+
}
|
|
32
|
+
setOptions(options) {
|
|
33
|
+
const newFactory = new CommandActionsBuilder();
|
|
34
|
+
newFactory.commands = [...this.commands];
|
|
35
|
+
newFactory.options = Object.assign(Object.assign({}, this.options), options);
|
|
36
|
+
newFactory.item = this.item;
|
|
37
|
+
newFactory.filterIds = this.filterIds;
|
|
38
|
+
newFactory.autoIds = this.autoIds;
|
|
39
|
+
return newFactory;
|
|
40
|
+
}
|
|
41
|
+
setItem(item) {
|
|
42
|
+
const newFactory = new CommandActionsBuilder();
|
|
43
|
+
newFactory.commands = [...this.commands];
|
|
44
|
+
newFactory.options = Object.assign({}, this.options);
|
|
45
|
+
newFactory.item = item;
|
|
46
|
+
newFactory.filterIds = this.filterIds;
|
|
47
|
+
newFactory.autoIds = this.autoIds;
|
|
48
|
+
return newFactory;
|
|
49
|
+
}
|
|
50
|
+
setFilterIds(filterIds = []) {
|
|
51
|
+
const newFactory = new CommandActionsBuilder();
|
|
52
|
+
newFactory.commands = [...this.commands];
|
|
53
|
+
newFactory.options = Object.assign({}, this.options);
|
|
54
|
+
newFactory.item = this.item;
|
|
55
|
+
newFactory.filterIds = filterIds.map((id) => typeof id === 'string' ? id : id.id);
|
|
56
|
+
newFactory.autoIds = filterIds.filter((id) => typeof id !== 'string' && id.auto).map((id) => id.id);
|
|
57
|
+
return newFactory;
|
|
58
|
+
}
|
|
59
|
+
setAutoIds(autoIds) {
|
|
60
|
+
const newFactory = new CommandActionsBuilder();
|
|
61
|
+
newFactory.commands = [...this.commands];
|
|
62
|
+
newFactory.options = Object.assign({}, this.options);
|
|
63
|
+
newFactory.item = this.item;
|
|
64
|
+
newFactory.filterIds = [...this.filterIds];
|
|
65
|
+
newFactory.autoIds = autoIds;
|
|
66
|
+
return newFactory;
|
|
67
|
+
}
|
|
68
|
+
applyFilter(commands) {
|
|
69
|
+
if (!this.filterIds)
|
|
70
|
+
return commands;
|
|
71
|
+
return this.filterIds.map((id) => commands.find((command) => command.id === id))
|
|
72
|
+
.filter((command) => !!command);
|
|
73
|
+
}
|
|
74
|
+
buildAction(id) {
|
|
75
|
+
const command = this.commands.find((command) => command.id === id);
|
|
76
|
+
if (!command)
|
|
77
|
+
throw new Error(`Command not found: ${id}`);
|
|
78
|
+
const actionId = this.autoIds.includes(command.id)
|
|
79
|
+
? ActionId.EXECUTE_COMMAND
|
|
80
|
+
: ActionId.NAVIGATE_TO_COMMAND_PAGE;
|
|
81
|
+
const creator = (0, core_1.createAction)(actionId, command.webApiRequest.bodySchema, Object.assign({ name: command.name, icon: this.options.icon || 'default' }, this.options));
|
|
82
|
+
return creator.create({
|
|
83
|
+
command,
|
|
84
|
+
body: this.item,
|
|
85
|
+
options: {
|
|
86
|
+
queryId: this.options.queryId,
|
|
87
|
+
confirm: this.options.confirm,
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
buildActions(item, navigationExtras = {}, overwrite = {}) {
|
|
92
|
+
const filteredCommands = this.applyFilter(this.commands);
|
|
93
|
+
return filteredCommands.map((command) => {
|
|
94
|
+
if (this.autoIds.includes(command.id)) {
|
|
95
|
+
return (0, core_1.createAction)(ActionId.EXECUTE_COMMAND, command.webApiRequest.bodySchema, {
|
|
96
|
+
name: command.name,
|
|
97
|
+
icon: this.options.icon || 'default',
|
|
98
|
+
}).create({
|
|
99
|
+
command,
|
|
100
|
+
body: this.item,
|
|
101
|
+
options: {
|
|
102
|
+
queryId: this.options.queryId,
|
|
103
|
+
confirm: this.options.confirm,
|
|
104
|
+
}
|
|
105
|
+
}, overwrite);
|
|
106
|
+
}
|
|
107
|
+
else {
|
|
108
|
+
const data = (0, lodash_es_1.omitBy)((0, flat_1.flatten)({ data: this.item, queryId: this.options.queryId }), value => typeof value === 'undefined');
|
|
109
|
+
return (0, app_1.createNavigateAction)(['commands', { skip: true }, command.id, data], navigationExtras, Object.assign({ name: command.name, icon: this.options.icon }, overwrite));
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
buildItemActions() {
|
|
114
|
+
return (item) => this.setItem(item).buildActions();
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
exports.CommandActionsBuilder = CommandActionsBuilder;
|
|
118
|
+
function createCommandNavigateAction(command, navigationExtras = {}, item = {}, options = {}, overwrite = {}) {
|
|
119
|
+
if (!command)
|
|
120
|
+
return null;
|
|
121
|
+
return new CommandActionsBuilder()
|
|
122
|
+
.setItem(item)
|
|
123
|
+
.setCommands([command])
|
|
124
|
+
.setOptions(options)
|
|
125
|
+
.setFilterIds([command.id])
|
|
126
|
+
.buildActions(item, navigationExtras, overwrite)[0];
|
|
127
|
+
}
|
|
128
|
+
function createCommandExecutionAction(command, item = {}, options = {}, overwrite = {}) {
|
|
129
|
+
if (!command)
|
|
130
|
+
return null;
|
|
131
|
+
return new CommandActionsBuilder()
|
|
132
|
+
.setItem(item)
|
|
133
|
+
.setCommands([command])
|
|
134
|
+
.setOptions(options)
|
|
135
|
+
.setFilterIds([command.id])
|
|
136
|
+
.setAutoIds([command.id])
|
|
137
|
+
.buildActions(item, undefined, overwrite)[0];
|
|
138
|
+
}
|
|
139
|
+
//# sourceMappingURL=command-action.builder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command-action.builder.js","sourceRoot":"","sources":["../../../../../../../packages/@xxmachina/common/src/lib/domain/builder/command-action/command-action.builder.ts"],"names":[],"mappings":";;;AAuJA,kEAcC;AAED,oEAcC;AArLD,0CAA6E;AAC7E,+BAA+B;AAC/B,yCAAmC;AACnC,0DAAwE;AAIxE,IAAY,QAGX;AAHD,WAAY,Q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CAAC,CAAC,CAAC,CAAC,CAAC;AACjD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/@xxmachina/common/src/lib/domain/builder/command-action/index.ts"],"names":[],"mappings":";;;AAAA,mEAAyC"}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ErBuilder = void 0;
|
|
4
|
+
const NOTION_PROP_TYPE_MAP = {
|
|
5
|
+
people: 'string',
|
|
6
|
+
unique_id: 'string',
|
|
7
|
+
rich_text: 'string',
|
|
8
|
+
title: 'string',
|
|
9
|
+
text: 'string',
|
|
10
|
+
number: 'number',
|
|
11
|
+
select: 'enum',
|
|
12
|
+
status: 'enum',
|
|
13
|
+
multi_select: 'string',
|
|
14
|
+
date: 'date',
|
|
15
|
+
person: 'string',
|
|
16
|
+
files: 'string',
|
|
17
|
+
checkbox: 'boolean',
|
|
18
|
+
url: 'string',
|
|
19
|
+
email: 'string',
|
|
20
|
+
phone_number: 'string',
|
|
21
|
+
relation: 'string',
|
|
22
|
+
rollup: 'string',
|
|
23
|
+
created_time: 'date',
|
|
24
|
+
created_by: 'string',
|
|
25
|
+
last_edited_time: 'date',
|
|
26
|
+
last_edited_by: 'string',
|
|
27
|
+
};
|
|
28
|
+
const NOTION_KEY_MAP = {
|
|
29
|
+
'relation': 'FK',
|
|
30
|
+
'unique_id': 'UK',
|
|
31
|
+
};
|
|
32
|
+
class ErBuilder {
|
|
33
|
+
build(databases) {
|
|
34
|
+
var _a, _b;
|
|
35
|
+
const schemas = [];
|
|
36
|
+
const dbIdToName = databases.reduce((acc, db) => {
|
|
37
|
+
var _a, _b;
|
|
38
|
+
return (Object.assign(Object.assign({}, acc), { [db.id]: (_b = (_a = db === null || db === void 0 ? void 0 : db.title) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.plain_text }));
|
|
39
|
+
}, {});
|
|
40
|
+
for (const database of databases) {
|
|
41
|
+
const schema = this.parseDatabaseSchema(database, (_b = (_a = database === null || database === void 0 ? void 0 : database.title) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.plain_text, dbIdToName);
|
|
42
|
+
schemas.push(schema);
|
|
43
|
+
}
|
|
44
|
+
return this.buildMermaidER(schemas);
|
|
45
|
+
}
|
|
46
|
+
parseDatabaseSchema(database, name = '', map = {}) {
|
|
47
|
+
const properties = database.properties;
|
|
48
|
+
const fields = [];
|
|
49
|
+
const relations = [];
|
|
50
|
+
Object.keys(properties)
|
|
51
|
+
.filter(propName => {
|
|
52
|
+
if (['formula', 'rollup', 'button'].includes(properties[propName].type))
|
|
53
|
+
return false;
|
|
54
|
+
return true;
|
|
55
|
+
})
|
|
56
|
+
.sort()
|
|
57
|
+
.forEach(propName => {
|
|
58
|
+
var _a;
|
|
59
|
+
const prop = properties[propName];
|
|
60
|
+
const type = prop.type;
|
|
61
|
+
const mappedType = NOTION_PROP_TYPE_MAP[type];
|
|
62
|
+
const key = (_a = NOTION_KEY_MAP[type]) !== null && _a !== void 0 ? _a : ' ';
|
|
63
|
+
const field = `${mappedType} ${type} ${key} "${propName}"`;
|
|
64
|
+
fields.push(field);
|
|
65
|
+
// リレーションシップの解析
|
|
66
|
+
if (type === 'relation') {
|
|
67
|
+
const relation = prop['relation'];
|
|
68
|
+
if (relation && relation.database_id) {
|
|
69
|
+
const targetDbId = relation.database_id;
|
|
70
|
+
const targetDbName = map[targetDbId] || 'Unknown';
|
|
71
|
+
relations.push({
|
|
72
|
+
source: name,
|
|
73
|
+
target: targetDbName,
|
|
74
|
+
label: propName,
|
|
75
|
+
type: '||--||', // リレーションのタイプを適宜設定
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
else if (relation && Array.isArray(relation)) {
|
|
79
|
+
relation.forEach(rel => {
|
|
80
|
+
const targetDbId = rel.database_id;
|
|
81
|
+
const targetDbName = map[targetDbId] || 'Unknown';
|
|
82
|
+
relations.push({
|
|
83
|
+
source: name,
|
|
84
|
+
target: targetDbName,
|
|
85
|
+
label: propName,
|
|
86
|
+
type: '||--o{',
|
|
87
|
+
});
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
return { name, fields, relations };
|
|
93
|
+
}
|
|
94
|
+
buildMermaidER(schemas) {
|
|
95
|
+
let mermaid = 'erDiagram\n';
|
|
96
|
+
// エンティティの定義
|
|
97
|
+
schemas.forEach(schema => {
|
|
98
|
+
mermaid += ` "${schema.name}" {\n`;
|
|
99
|
+
mermaid += schema.fields.map(field => ` ${field}`).join('\n');
|
|
100
|
+
mermaid += '\n }\n';
|
|
101
|
+
});
|
|
102
|
+
// リレーションシップの定義
|
|
103
|
+
schemas.forEach(schema => {
|
|
104
|
+
schema.relations.forEach(relation => {
|
|
105
|
+
mermaid += ` "${relation.source}" ${relation.type} "${relation.target}" : "${relation.label}"\n`;
|
|
106
|
+
});
|
|
107
|
+
});
|
|
108
|
+
return mermaid;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
exports.ErBuilder = ErBuilder;
|
|
112
|
+
//# sourceMappingURL=er.builder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"er.builder.js","sourceRoot":"","sources":["../../../../../../../packages/@xxmachina/common/src/lib/domain/builder/er/er.builder.ts"],"names":[],"mappings":";;;AAaA,MAAM,oBAAoB,GAAG;IAC3B,MAAM,EAAE,QAAQ;IAChB,SAAS,EAAE,QAAQ;IACnB,SAAS,EAAE,QAAQ;IACnB,KAAK,EAAE,QAAQ;IACf,IAAI,EAAE,QAAQ;IACd,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE,MAAM;IACd,MAAM,EAAE,MAAM;IACd,YAAY,EAAE,QAAQ;IACtB,IAAI,EAAE,MAAM;IACZ,MAAM,EAAE,QAAQ;IAChB,KAAK,EAAE,QAA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
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/@xxmachina/common/src/lib/domain/builder/er/index.ts"],"names":[],"mappings":";;;AAAA,uDAA6B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/@xxmachina/common/src/lib/domain/builder/screen-item/index.ts"],"names":[],"mappings":";;;AAAA,gEAAsC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ScreenItem } from '@xxmachina/common/domain/models';
|
|
2
|
-
import { Database } from '
|
|
1
|
+
import { ScreenItem } from '@xxmachina/common/domain/models/screen-item';
|
|
2
|
+
import { Database } from '../../models/database';
|
|
3
3
|
export declare class ScreenItemBuilder {
|
|
4
4
|
build(database: Database): ScreenItem[];
|
|
5
5
|
}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ScreenItemBuilder = void 0;
|
|
1
4
|
function buildPageItem(property, propName, dbName) {
|
|
5
|
+
var _a;
|
|
2
6
|
switch (property.type) {
|
|
3
7
|
case 'select': return {
|
|
4
8
|
id: property.id,
|
|
@@ -155,7 +159,7 @@ function buildPageItem(property, propName, dbName) {
|
|
|
155
159
|
};
|
|
156
160
|
/* @ts-ignore */
|
|
157
161
|
case 'button': return {
|
|
158
|
-
id: property
|
|
162
|
+
id: (_a = property === null || property === void 0 ? void 0 : property['id']) !== null && _a !== void 0 ? _a : '',
|
|
159
163
|
name: propName,
|
|
160
164
|
type: 'ボタン',
|
|
161
165
|
notionPropType: 'ボタン',
|
|
@@ -176,8 +180,9 @@ function buildPageItem(property, propName, dbName) {
|
|
|
176
180
|
}
|
|
177
181
|
class ScreenItemBuilder {
|
|
178
182
|
build(database) {
|
|
183
|
+
var _a;
|
|
179
184
|
const items = [];
|
|
180
|
-
Object.entries(database
|
|
185
|
+
Object.entries((_a = database === null || database === void 0 ? void 0 : database.properties) !== null && _a !== void 0 ? _a : {}).sort((a, b) => {
|
|
181
186
|
return a[0].localeCompare(b[0]);
|
|
182
187
|
}).filter(([propName, prop]) => {
|
|
183
188
|
// if (propName.startsWith('_')) return false;
|
|
@@ -186,16 +191,12 @@ class ScreenItemBuilder {
|
|
|
186
191
|
// if (['formula', 'rollup', 'button'].includes(prop.type)) return false;
|
|
187
192
|
return true;
|
|
188
193
|
}).forEach(([propName, prop]) => {
|
|
189
|
-
|
|
194
|
+
var _a, _b, _c;
|
|
195
|
+
const item = buildPageItem(prop, propName, (_c = (_b = (_a = database === null || database === void 0 ? void 0 : database.title) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.plain_text) !== null && _c !== void 0 ? _c : '');
|
|
190
196
|
items.push(item);
|
|
191
197
|
});
|
|
192
198
|
return items;
|
|
193
199
|
}
|
|
194
200
|
}
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
* Generated bundle index. Do not edit.
|
|
198
|
-
*/
|
|
199
|
-
|
|
200
|
-
export { ScreenItemBuilder };
|
|
201
|
-
//# sourceMappingURL=xxmachina-common-domain-builder-screen-item.mjs.map
|
|
201
|
+
exports.ScreenItemBuilder = ScreenItemBuilder;
|
|
202
|
+
//# sourceMappingURL=screen-item.builder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"screen-item.builder.js","sourceRoot":"","sources":["../../../../../../../packages/@xxmachina/common/src/lib/domain/builder/screen-item/screen-item.builder.ts"],"names":[],"mappings":";;;AAIA,SAAS,aAAa,CACpB,QAAmD,EACnD,QAAgB,EAChB,MAAc;;IAEd,QAAQ,QAAQ,CAAC,IAAI,EAAE,CAAC;QACtB,KAAK,QAAQ,CAAC,CAAC,OAAO;YACpB,EAAE,EAAE,QAAQ,CAAC,EAAE;YACf,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,UAAU;YAChB,cAAc,EAAE,MAAM;YACtB,OAAO,EAAE,EAA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
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export * from '
|
|
2
|
-
export * from '@xxmachina/common/domain/models';
|
|
1
|
+
export * from './models';
|
package/domain/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/@xxmachina/common/src/lib/domain/index.ts"],"names":[],"mappings":";;;AAAA,mDAAyB"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EmailBuilder = exports.Email = void 0;
|
|
4
|
+
const message_1 = require("../message");
|
|
5
|
+
class Email {
|
|
6
|
+
}
|
|
7
|
+
exports.Email = Email;
|
|
8
|
+
Email.EMPTY = {
|
|
9
|
+
to: '',
|
|
10
|
+
cc: '',
|
|
11
|
+
title: '',
|
|
12
|
+
body: '',
|
|
13
|
+
};
|
|
14
|
+
class EmailBuilder {
|
|
15
|
+
constructor() {
|
|
16
|
+
this.mesageBuilder = new message_1.MessageBuilder();
|
|
17
|
+
}
|
|
18
|
+
build(invoice) {
|
|
19
|
+
var _a, _b, _c, _d;
|
|
20
|
+
return {
|
|
21
|
+
to: (_a = invoice === null || invoice === void 0 ? void 0 : invoice.customer) === null || _a === void 0 ? void 0 : _a.billingEmail,
|
|
22
|
+
cc: (_b = invoice === null || invoice === void 0 ? void 0 : invoice.vendor) === null || _b === void 0 ? void 0 : _b.email,
|
|
23
|
+
title: `[${(_d = (_c = invoice === null || invoice === void 0 ? void 0 : invoice.vendor) === null || _c === void 0 ? void 0 : _c.name) !== null && _d !== void 0 ? _d : '{{invoice.vendor.name}}'}] 請求書ご送付のお知らせ`,
|
|
24
|
+
body: this.mesageBuilder.build(invoice),
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
exports.EmailBuilder = EmailBuilder;
|
|
29
|
+
//# sourceMappingURL=email.builder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"email.builder.js","sourceRoot":"","sources":["../../../../../../../../packages/@xxmachina/common/src/lib/domain/invoice/builders/email/email.builder.ts"],"names":[],"mappings":";;;AACA,wCAA4C;AAE5C,MAAa,KAAK;;AAAlB,sBAYC;AAXQ,WAAK,GAAG;IACb,EAAE,EAAE,EAAE;IACN,EAAE,EAAE,EAAE;IACN,KAAK,EAAE,EAAE;IACT,IAAI,EAAE,EAAE;CACT,CAAC;AAQJ,MAAa,YAAY;IAAzB;QACqB,kBAAa,GAAG,IAAI,wBAAc,EAAE,CAAC;IAU1D,CAAC;IARC,KAAK,CAAC,OAAgB;;QACpB,OAAO;YACL,EAAE,EAAE,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,QAAQ,0CAAE,YAAY;YACnC,EAAE,EAAE,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,0CAAE,KAAK;YAC1B,KAAK,EAAE,IAAI,MAAA,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,0CAAE,IAAI,mCAAI,yBAAyB,eAAe;YAC5E,IAAI,EAAE,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,OAAO,CAAC;SACxC,CAAA;IACH,CAAC;CACF;AAXD,oCAWC"}
|