@microwiseai/snapshot 0.3.6 → 0.3.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/install.d.ts +13 -0
- package/dist/commands/install.d.ts.map +1 -1
- package/dist/commands/install.js +517 -49
- package/dist/commands/install.js.map +1 -1
- package/dist/commands/license.d.ts +21 -0
- package/dist/commands/license.d.ts.map +1 -0
- package/dist/commands/license.js +120 -0
- package/dist/commands/license.js.map +1 -0
- package/dist/index.js +46 -6
- package/dist/index.js.map +1 -1
- package/dist/lib/config.d.ts +32 -0
- package/dist/lib/config.d.ts.map +1 -1
- package/dist/lib/config.js +89 -0
- package/dist/lib/config.js.map +1 -1
- package/dist/lib/gitlab.d.ts +26 -20
- package/dist/lib/gitlab.d.ts.map +1 -1
- package/dist/lib/gitlab.js +100 -153
- package/dist/lib/gitlab.js.map +1 -1
- package/dist/lib/package-resolver.d.ts +48 -0
- package/dist/lib/package-resolver.d.ts.map +1 -0
- package/dist/lib/package-resolver.js +178 -0
- package/dist/lib/package-resolver.js.map +1 -0
- package/dist/lib/skit-adapter.d.ts +56 -0
- package/dist/lib/skit-adapter.d.ts.map +1 -0
- package/dist/lib/skit-adapter.js +166 -0
- package/dist/lib/skit-adapter.js.map +1 -0
- package/dist/lib/transitive-resolver.d.ts +86 -0
- package/dist/lib/transitive-resolver.d.ts.map +1 -0
- package/dist/lib/transitive-resolver.js +431 -0
- package/dist/lib/transitive-resolver.js.map +1 -0
- package/dist/lib/types.d.ts +6 -0
- package/dist/lib/types.d.ts.map +1 -1
- package/dist/lib.d.ts +59 -0
- package/dist/lib.d.ts.map +1 -0
- package/dist/lib.js +134 -0
- package/dist/lib.js.map +1 -0
- package/dist/tools/snapshot-to-license.d.ts +13 -0
- package/dist/tools/snapshot-to-license.d.ts.map +1 -0
- package/dist/tools/snapshot-to-license.js +105 -0
- package/dist/tools/snapshot-to-license.js.map +1 -0
- package/node_modules/@microwiseai/cache/README.md +143 -0
- package/node_modules/@microwiseai/cache/dist/file.d.ts +97 -0
- package/node_modules/@microwiseai/cache/dist/file.d.ts.map +1 -0
- package/node_modules/@microwiseai/cache/dist/file.js +256 -0
- package/node_modules/@microwiseai/cache/dist/file.js.map +1 -0
- package/node_modules/@microwiseai/cache/dist/index.d.ts +10 -0
- package/node_modules/@microwiseai/cache/dist/index.d.ts.map +1 -0
- package/node_modules/@microwiseai/cache/dist/index.js +11 -0
- package/node_modules/@microwiseai/cache/dist/index.js.map +1 -0
- package/node_modules/@microwiseai/cache/dist/memory.d.ts +69 -0
- package/node_modules/@microwiseai/cache/dist/memory.d.ts.map +1 -0
- package/node_modules/@microwiseai/cache/dist/memory.js +152 -0
- package/node_modules/@microwiseai/cache/dist/memory.js.map +1 -0
- package/node_modules/@microwiseai/cache/dist/types.d.ts +76 -0
- package/node_modules/@microwiseai/cache/dist/types.d.ts.map +1 -0
- package/node_modules/@microwiseai/cache/dist/types.js +5 -0
- package/node_modules/@microwiseai/cache/dist/types.js.map +1 -0
- package/node_modules/@microwiseai/cache/package.json +40 -0
- package/node_modules/@microwiseai/import-telemetry/dist/__tests__/detector.test.d.ts +7 -0
- package/node_modules/@microwiseai/import-telemetry/dist/__tests__/detector.test.d.ts.map +1 -0
- package/node_modules/@microwiseai/import-telemetry/dist/__tests__/detector.test.js +139 -0
- package/node_modules/@microwiseai/import-telemetry/dist/__tests__/detector.test.js.map +1 -0
- package/node_modules/@microwiseai/import-telemetry/dist/__tests__/reporter.test.d.ts +8 -0
- package/node_modules/@microwiseai/import-telemetry/dist/__tests__/reporter.test.d.ts.map +1 -0
- package/node_modules/@microwiseai/import-telemetry/dist/__tests__/reporter.test.js +195 -0
- package/node_modules/@microwiseai/import-telemetry/dist/__tests__/reporter.test.js.map +1 -0
- package/node_modules/@microwiseai/import-telemetry/dist/__tests__/types.test.d.ts +8 -0
- package/node_modules/@microwiseai/import-telemetry/dist/__tests__/types.test.d.ts.map +1 -0
- package/node_modules/@microwiseai/import-telemetry/dist/__tests__/types.test.js +97 -0
- package/node_modules/@microwiseai/import-telemetry/dist/__tests__/types.test.js.map +1 -0
- package/node_modules/@microwiseai/import-telemetry/dist/detector.d.ts +16 -0
- package/node_modules/@microwiseai/import-telemetry/dist/detector.d.ts.map +1 -0
- package/node_modules/@microwiseai/import-telemetry/dist/detector.js +103 -0
- package/node_modules/@microwiseai/import-telemetry/dist/detector.js.map +1 -0
- package/node_modules/@microwiseai/import-telemetry/dist/index.d.ts +48 -0
- package/node_modules/@microwiseai/import-telemetry/dist/index.d.ts.map +1 -0
- package/node_modules/@microwiseai/import-telemetry/dist/index.js +56 -0
- package/node_modules/@microwiseai/import-telemetry/dist/index.js.map +1 -0
- package/node_modules/@microwiseai/import-telemetry/dist/reporter.d.ts +16 -0
- package/node_modules/@microwiseai/import-telemetry/dist/reporter.d.ts.map +1 -0
- package/node_modules/@microwiseai/import-telemetry/dist/reporter.js +147 -0
- package/node_modules/@microwiseai/import-telemetry/dist/reporter.js.map +1 -0
- package/node_modules/@microwiseai/import-telemetry/dist/types.d.ts +75 -0
- package/node_modules/@microwiseai/import-telemetry/dist/types.d.ts.map +1 -0
- package/node_modules/@microwiseai/import-telemetry/dist/types.js +23 -0
- package/node_modules/@microwiseai/import-telemetry/dist/types.js.map +1 -0
- package/node_modules/@microwiseai/import-telemetry/package.json +40 -0
- package/node_modules/@microwiseai/license/README.md +157 -0
- package/node_modules/@microwiseai/license/dist/api/client.d.ts +37 -0
- package/node_modules/@microwiseai/license/dist/api/client.d.ts.map +1 -0
- package/node_modules/@microwiseai/license/dist/api/client.js +95 -0
- package/node_modules/@microwiseai/license/dist/api/client.js.map +1 -0
- package/node_modules/@microwiseai/license/dist/api/endpoints.d.ts +25 -0
- package/node_modules/@microwiseai/license/dist/api/endpoints.d.ts.map +1 -0
- package/node_modules/@microwiseai/license/dist/api/endpoints.js +101 -0
- package/node_modules/@microwiseai/license/dist/api/endpoints.js.map +1 -0
- package/node_modules/@microwiseai/license/dist/api/index.d.ts +7 -0
- package/node_modules/@microwiseai/license/dist/api/index.d.ts.map +1 -0
- package/node_modules/@microwiseai/license/dist/api/index.js +8 -0
- package/node_modules/@microwiseai/license/dist/api/index.js.map +1 -0
- package/node_modules/@microwiseai/license/dist/cache/file.d.ts +38 -0
- package/node_modules/@microwiseai/license/dist/cache/file.d.ts.map +1 -0
- package/node_modules/@microwiseai/license/dist/cache/file.js +140 -0
- package/node_modules/@microwiseai/license/dist/cache/file.js.map +1 -0
- package/node_modules/@microwiseai/license/dist/cache/index.d.ts +7 -0
- package/node_modules/@microwiseai/license/dist/cache/index.d.ts.map +1 -0
- package/node_modules/@microwiseai/license/dist/cache/index.js +10 -0
- package/node_modules/@microwiseai/license/dist/cache/index.js.map +1 -0
- package/node_modules/@microwiseai/license/dist/cache/memory.d.ts +35 -0
- package/node_modules/@microwiseai/license/dist/cache/memory.d.ts.map +1 -0
- package/node_modules/@microwiseai/license/dist/cache/memory.js +77 -0
- package/node_modules/@microwiseai/license/dist/cache/memory.js.map +1 -0
- package/node_modules/@microwiseai/license/dist/cache/offline.d.ts +29 -0
- package/node_modules/@microwiseai/license/dist/cache/offline.d.ts.map +1 -0
- package/node_modules/@microwiseai/license/dist/cache/offline.js +58 -0
- package/node_modules/@microwiseai/license/dist/cache/offline.js.map +1 -0
- package/node_modules/@microwiseai/license/dist/client.d.ts +42 -0
- package/node_modules/@microwiseai/license/dist/client.d.ts.map +1 -0
- package/node_modules/@microwiseai/license/dist/client.js +83 -0
- package/node_modules/@microwiseai/license/dist/client.js.map +1 -0
- package/node_modules/@microwiseai/license/dist/config.d.ts +27 -0
- package/node_modules/@microwiseai/license/dist/config.d.ts.map +1 -0
- package/node_modules/@microwiseai/license/dist/config.js +52 -0
- package/node_modules/@microwiseai/license/dist/config.js.map +1 -0
- package/node_modules/@microwiseai/license/dist/core/activate.d.ts +21 -0
- package/node_modules/@microwiseai/license/dist/core/activate.d.ts.map +1 -0
- package/node_modules/@microwiseai/license/dist/core/activate.js +72 -0
- package/node_modules/@microwiseai/license/dist/core/activate.js.map +1 -0
- package/node_modules/@microwiseai/license/dist/core/check.d.ts +19 -0
- package/node_modules/@microwiseai/license/dist/core/check.d.ts.map +1 -0
- package/node_modules/@microwiseai/license/dist/core/check.js +244 -0
- package/node_modules/@microwiseai/license/dist/core/check.js.map +1 -0
- package/node_modules/@microwiseai/license/dist/core/index.d.ts +7 -0
- package/node_modules/@microwiseai/license/dist/core/index.d.ts.map +1 -0
- package/node_modules/@microwiseai/license/dist/core/index.js +10 -0
- package/node_modules/@microwiseai/license/dist/core/index.js.map +1 -0
- package/node_modules/@microwiseai/license/dist/core/verify.d.ts +39 -0
- package/node_modules/@microwiseai/license/dist/core/verify.d.ts.map +1 -0
- package/node_modules/@microwiseai/license/dist/core/verify.js +188 -0
- package/node_modules/@microwiseai/license/dist/core/verify.js.map +1 -0
- package/node_modules/@microwiseai/license/dist/env.d.ts +33 -0
- package/node_modules/@microwiseai/license/dist/env.d.ts.map +1 -0
- package/node_modules/@microwiseai/license/dist/env.js +69 -0
- package/node_modules/@microwiseai/license/dist/env.js.map +1 -0
- package/node_modules/@microwiseai/license/dist/helpers/cache.d.ts +97 -0
- package/node_modules/@microwiseai/license/dist/helpers/cache.d.ts.map +1 -0
- package/node_modules/@microwiseai/license/dist/helpers/cache.js +198 -0
- package/node_modules/@microwiseai/license/dist/helpers/cache.js.map +1 -0
- package/node_modules/@microwiseai/license/dist/helpers/index.d.ts +7 -0
- package/node_modules/@microwiseai/license/dist/helpers/index.d.ts.map +1 -0
- package/node_modules/@microwiseai/license/dist/helpers/index.js +9 -0
- package/node_modules/@microwiseai/license/dist/helpers/index.js.map +1 -0
- package/node_modules/@microwiseai/license/dist/helpers/telemetry.d.ts +68 -0
- package/node_modules/@microwiseai/license/dist/helpers/telemetry.d.ts.map +1 -0
- package/node_modules/@microwiseai/license/dist/helpers/telemetry.js +119 -0
- package/node_modules/@microwiseai/license/dist/helpers/telemetry.js.map +1 -0
- package/node_modules/@microwiseai/license/dist/index.d.ts +34 -0
- package/node_modules/@microwiseai/license/dist/index.d.ts.map +1 -0
- package/node_modules/@microwiseai/license/dist/index.js +48 -0
- package/node_modules/@microwiseai/license/dist/index.js.map +1 -0
- package/node_modules/@microwiseai/license/dist/machine/id.d.ts +19 -0
- package/node_modules/@microwiseai/license/dist/machine/id.d.ts.map +1 -0
- package/node_modules/@microwiseai/license/dist/machine/id.js +83 -0
- package/node_modules/@microwiseai/license/dist/machine/id.js.map +1 -0
- package/node_modules/@microwiseai/license/dist/machine/index.d.ts +6 -0
- package/node_modules/@microwiseai/license/dist/machine/index.d.ts.map +1 -0
- package/node_modules/@microwiseai/license/dist/machine/index.js +6 -0
- package/node_modules/@microwiseai/license/dist/machine/index.js.map +1 -0
- package/node_modules/@microwiseai/license/dist/machine/instance.d.ts +23 -0
- package/node_modules/@microwiseai/license/dist/machine/instance.d.ts.map +1 -0
- package/node_modules/@microwiseai/license/dist/machine/instance.js +52 -0
- package/node_modules/@microwiseai/license/dist/machine/instance.js.map +1 -0
- package/node_modules/@microwiseai/license/dist/telemetry/index.d.ts +6 -0
- package/node_modules/@microwiseai/license/dist/telemetry/index.d.ts.map +1 -0
- package/node_modules/@microwiseai/license/dist/telemetry/index.js +6 -0
- package/node_modules/@microwiseai/license/dist/telemetry/index.js.map +1 -0
- package/node_modules/@microwiseai/license/dist/telemetry/manager.d.ts +53 -0
- package/node_modules/@microwiseai/license/dist/telemetry/manager.d.ts.map +1 -0
- package/node_modules/@microwiseai/license/dist/telemetry/manager.js +125 -0
- package/node_modules/@microwiseai/license/dist/telemetry/manager.js.map +1 -0
- package/node_modules/@microwiseai/license/dist/telemetry/payload.d.ts +17 -0
- package/node_modules/@microwiseai/license/dist/telemetry/payload.d.ts.map +1 -0
- package/node_modules/@microwiseai/license/dist/telemetry/payload.js +65 -0
- package/node_modules/@microwiseai/license/dist/telemetry/payload.js.map +1 -0
- package/node_modules/@microwiseai/license/dist/types/api.d.ts +120 -0
- package/node_modules/@microwiseai/license/dist/types/api.d.ts.map +1 -0
- package/node_modules/@microwiseai/license/dist/types/api.js +5 -0
- package/node_modules/@microwiseai/license/dist/types/api.js.map +1 -0
- package/node_modules/@microwiseai/license/dist/types/config.d.ts +80 -0
- package/node_modules/@microwiseai/license/dist/types/config.d.ts.map +1 -0
- package/node_modules/@microwiseai/license/dist/types/config.js +12 -0
- package/node_modules/@microwiseai/license/dist/types/config.js.map +1 -0
- package/node_modules/@microwiseai/license/dist/types/errors.d.ts +93 -0
- package/node_modules/@microwiseai/license/dist/types/errors.d.ts.map +1 -0
- package/node_modules/@microwiseai/license/dist/types/errors.js +144 -0
- package/node_modules/@microwiseai/license/dist/types/errors.js.map +1 -0
- package/node_modules/@microwiseai/license/dist/types/index.d.ts +10 -0
- package/node_modules/@microwiseai/license/dist/types/index.d.ts.map +1 -0
- package/node_modules/@microwiseai/license/dist/types/index.js +6 -0
- package/node_modules/@microwiseai/license/dist/types/index.js.map +1 -0
- package/node_modules/@microwiseai/license/dist/types/license.d.ts +113 -0
- package/node_modules/@microwiseai/license/dist/types/license.d.ts.map +1 -0
- package/node_modules/@microwiseai/license/dist/types/license.js +5 -0
- package/node_modules/@microwiseai/license/dist/types/license.js.map +1 -0
- package/node_modules/@microwiseai/license/dist/utils/date.d.ts +45 -0
- package/node_modules/@microwiseai/license/dist/utils/date.d.ts.map +1 -0
- package/node_modules/@microwiseai/license/dist/utils/date.js +95 -0
- package/node_modules/@microwiseai/license/dist/utils/date.js.map +1 -0
- package/node_modules/@microwiseai/license/dist/utils/env.d.ts +41 -0
- package/node_modules/@microwiseai/license/dist/utils/env.d.ts.map +1 -0
- package/node_modules/@microwiseai/license/dist/utils/env.js +80 -0
- package/node_modules/@microwiseai/license/dist/utils/env.js.map +1 -0
- package/node_modules/@microwiseai/license/dist/utils/index.d.ts +7 -0
- package/node_modules/@microwiseai/license/dist/utils/index.d.ts.map +1 -0
- package/node_modules/@microwiseai/license/dist/utils/index.js +7 -0
- package/node_modules/@microwiseai/license/dist/utils/index.js.map +1 -0
- package/node_modules/@microwiseai/license/dist/utils/mask.d.ts +27 -0
- package/node_modules/@microwiseai/license/dist/utils/mask.d.ts.map +1 -0
- package/node_modules/@microwiseai/license/dist/utils/mask.js +67 -0
- package/node_modules/@microwiseai/license/dist/utils/mask.js.map +1 -0
- package/node_modules/@microwiseai/license/package.json +52 -0
- package/node_modules/@microwiseai/license-types/README.md +84 -0
- package/node_modules/@microwiseai/license-types/dist/api.d.ts +120 -0
- package/node_modules/@microwiseai/license-types/dist/api.d.ts.map +1 -0
- package/node_modules/@microwiseai/license-types/dist/api.js +5 -0
- package/node_modules/@microwiseai/license-types/dist/api.js.map +1 -0
- package/node_modules/@microwiseai/license-types/dist/config.d.ts +80 -0
- package/node_modules/@microwiseai/license-types/dist/config.d.ts.map +1 -0
- package/node_modules/@microwiseai/license-types/dist/config.js +12 -0
- package/node_modules/@microwiseai/license-types/dist/config.js.map +1 -0
- package/node_modules/@microwiseai/license-types/dist/errors.d.ts +93 -0
- package/node_modules/@microwiseai/license-types/dist/errors.d.ts.map +1 -0
- package/node_modules/@microwiseai/license-types/dist/errors.js +144 -0
- package/node_modules/@microwiseai/license-types/dist/errors.js.map +1 -0
- package/node_modules/@microwiseai/license-types/dist/index.d.ts +10 -0
- package/node_modules/@microwiseai/license-types/dist/index.d.ts.map +1 -0
- package/node_modules/@microwiseai/license-types/dist/index.js +6 -0
- package/node_modules/@microwiseai/license-types/dist/index.js.map +1 -0
- package/node_modules/@microwiseai/license-types/dist/license.d.ts +113 -0
- package/node_modules/@microwiseai/license-types/dist/license.d.ts.map +1 -0
- package/node_modules/@microwiseai/license-types/dist/license.js +5 -0
- package/node_modules/@microwiseai/license-types/dist/license.js.map +1 -0
- package/node_modules/@microwiseai/license-types/package.json +38 -0
- package/node_modules/@microwiseai/license-utils/README.md +82 -0
- package/node_modules/@microwiseai/license-utils/dist/__tests__/machine.test.d.ts +2 -0
- package/node_modules/@microwiseai/license-utils/dist/__tests__/machine.test.d.ts.map +1 -0
- package/node_modules/@microwiseai/license-utils/dist/__tests__/machine.test.js +124 -0
- package/node_modules/@microwiseai/license-utils/dist/__tests__/machine.test.js.map +1 -0
- package/node_modules/@microwiseai/license-utils/dist/index.d.ts +7 -0
- package/node_modules/@microwiseai/license-utils/dist/index.d.ts.map +1 -0
- package/node_modules/@microwiseai/license-utils/dist/index.js +15 -0
- package/node_modules/@microwiseai/license-utils/dist/index.js.map +1 -0
- package/node_modules/@microwiseai/license-utils/dist/machine/id.d.ts +19 -0
- package/node_modules/@microwiseai/license-utils/dist/machine/id.d.ts.map +1 -0
- package/node_modules/@microwiseai/license-utils/dist/machine/id.js +83 -0
- package/node_modules/@microwiseai/license-utils/dist/machine/id.js.map +1 -0
- package/node_modules/@microwiseai/license-utils/dist/machine/index.d.ts +6 -0
- package/node_modules/@microwiseai/license-utils/dist/machine/index.d.ts.map +1 -0
- package/node_modules/@microwiseai/license-utils/dist/machine/index.js +6 -0
- package/node_modules/@microwiseai/license-utils/dist/machine/index.js.map +1 -0
- package/node_modules/@microwiseai/license-utils/dist/machine/instance.d.ts +23 -0
- package/node_modules/@microwiseai/license-utils/dist/machine/instance.d.ts.map +1 -0
- package/node_modules/@microwiseai/license-utils/dist/machine/instance.js +52 -0
- package/node_modules/@microwiseai/license-utils/dist/machine/instance.js.map +1 -0
- package/node_modules/@microwiseai/license-utils/dist/utils/date.d.ts +45 -0
- package/node_modules/@microwiseai/license-utils/dist/utils/date.d.ts.map +1 -0
- package/node_modules/@microwiseai/license-utils/dist/utils/date.js +95 -0
- package/node_modules/@microwiseai/license-utils/dist/utils/date.js.map +1 -0
- package/node_modules/@microwiseai/license-utils/dist/utils/env.d.ts +16 -0
- package/node_modules/@microwiseai/license-utils/dist/utils/env.d.ts.map +1 -0
- package/node_modules/@microwiseai/license-utils/dist/utils/env.js +22 -0
- package/node_modules/@microwiseai/license-utils/dist/utils/env.js.map +1 -0
- package/node_modules/@microwiseai/license-utils/dist/utils/index.d.ts +7 -0
- package/node_modules/@microwiseai/license-utils/dist/utils/index.d.ts.map +1 -0
- package/node_modules/@microwiseai/license-utils/dist/utils/index.js +7 -0
- package/node_modules/@microwiseai/license-utils/dist/utils/index.js.map +1 -0
- package/node_modules/@microwiseai/license-utils/dist/utils/mask.d.ts +27 -0
- package/node_modules/@microwiseai/license-utils/dist/utils/mask.d.ts.map +1 -0
- package/node_modules/@microwiseai/license-utils/dist/utils/mask.js +67 -0
- package/node_modules/@microwiseai/license-utils/dist/utils/mask.js.map +1 -0
- package/node_modules/@microwiseai/license-utils/package.json +45 -0
- package/node_modules/@microwiseai/telemetry/README.md +86 -0
- package/node_modules/@microwiseai/telemetry/dist/index.d.ts +9 -0
- package/node_modules/@microwiseai/telemetry/dist/index.d.ts.map +1 -0
- package/node_modules/@microwiseai/telemetry/dist/index.js +10 -0
- package/node_modules/@microwiseai/telemetry/dist/index.js.map +1 -0
- package/node_modules/@microwiseai/telemetry/dist/manager.d.ts +71 -0
- package/node_modules/@microwiseai/telemetry/dist/manager.d.ts.map +1 -0
- package/node_modules/@microwiseai/telemetry/dist/manager.js +171 -0
- package/node_modules/@microwiseai/telemetry/dist/manager.js.map +1 -0
- package/node_modules/@microwiseai/telemetry/dist/payload.d.ts +13 -0
- package/node_modules/@microwiseai/telemetry/dist/payload.d.ts.map +1 -0
- package/node_modules/@microwiseai/telemetry/dist/payload.js +35 -0
- package/node_modules/@microwiseai/telemetry/dist/payload.js.map +1 -0
- package/node_modules/@microwiseai/telemetry/dist/types.d.ts +76 -0
- package/node_modules/@microwiseai/telemetry/dist/types.d.ts.map +1 -0
- package/node_modules/@microwiseai/telemetry/dist/types.js +13 -0
- package/node_modules/@microwiseai/telemetry/dist/types.js.map +1 -0
- package/node_modules/@microwiseai/telemetry/package.json +43 -0
- package/node_modules/chalk/license +9 -0
- package/node_modules/chalk/package.json +83 -0
- package/node_modules/chalk/readme.md +297 -0
- package/node_modules/chalk/source/index.d.ts +325 -0
- package/node_modules/chalk/source/index.js +225 -0
- package/node_modules/chalk/source/utilities.js +33 -0
- package/node_modules/chalk/source/vendor/ansi-styles/index.d.ts +236 -0
- package/node_modules/chalk/source/vendor/ansi-styles/index.js +223 -0
- package/node_modules/chalk/source/vendor/supports-color/browser.d.ts +1 -0
- package/node_modules/chalk/source/vendor/supports-color/browser.js +34 -0
- package/node_modules/chalk/source/vendor/supports-color/index.d.ts +55 -0
- package/node_modules/chalk/source/vendor/supports-color/index.js +190 -0
- package/package.json +26 -2
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tests for detector.ts
|
|
3
|
+
* - detectLicenseStatus()
|
|
4
|
+
* - detectBypass()
|
|
5
|
+
*/
|
|
6
|
+
import { describe, it, expect, beforeEach, afterEach, vi } from 'vitest';
|
|
7
|
+
import * as fs from 'fs';
|
|
8
|
+
import * as os from 'os';
|
|
9
|
+
import * as path from 'path';
|
|
10
|
+
import { detectLicenseStatus, detectBypass } from '../detector.js';
|
|
11
|
+
// Mock fs module
|
|
12
|
+
vi.mock('fs');
|
|
13
|
+
vi.mock('os');
|
|
14
|
+
describe('detectLicenseStatus', () => {
|
|
15
|
+
const vendorName = 'testvendor';
|
|
16
|
+
const homeDir = '/home/testuser';
|
|
17
|
+
const licensePath = path.join(homeDir, '.testvendor', 'license.json');
|
|
18
|
+
beforeEach(() => {
|
|
19
|
+
vi.mocked(os.homedir).mockReturnValue(homeDir);
|
|
20
|
+
});
|
|
21
|
+
afterEach(() => {
|
|
22
|
+
vi.clearAllMocks();
|
|
23
|
+
});
|
|
24
|
+
it('should return "none" when license file does not exist', () => {
|
|
25
|
+
vi.mocked(fs.existsSync).mockReturnValue(false);
|
|
26
|
+
const result = detectLicenseStatus(vendorName);
|
|
27
|
+
expect(result).toBe('none');
|
|
28
|
+
});
|
|
29
|
+
it('should return "none" when license file has no licenseKey', () => {
|
|
30
|
+
vi.mocked(fs.existsSync).mockReturnValue(true);
|
|
31
|
+
vi.mocked(fs.readFileSync).mockReturnValue(JSON.stringify({
|
|
32
|
+
status: 'active',
|
|
33
|
+
}));
|
|
34
|
+
const result = detectLicenseStatus(vendorName);
|
|
35
|
+
expect(result).toBe('none');
|
|
36
|
+
});
|
|
37
|
+
it('should return "valid" when license is active and not expired', () => {
|
|
38
|
+
const futureDate = new Date();
|
|
39
|
+
futureDate.setFullYear(futureDate.getFullYear() + 1);
|
|
40
|
+
vi.mocked(fs.existsSync).mockReturnValue(true);
|
|
41
|
+
vi.mocked(fs.readFileSync).mockReturnValue(JSON.stringify({
|
|
42
|
+
licenseKey: 'TEST-KEY-1234',
|
|
43
|
+
status: 'active',
|
|
44
|
+
expiresAt: futureDate.toISOString(),
|
|
45
|
+
}));
|
|
46
|
+
const result = detectLicenseStatus(vendorName);
|
|
47
|
+
expect(result).toBe('valid');
|
|
48
|
+
});
|
|
49
|
+
it('should return "invalid" when license status is cancelled', () => {
|
|
50
|
+
vi.mocked(fs.existsSync).mockReturnValue(true);
|
|
51
|
+
vi.mocked(fs.readFileSync).mockReturnValue(JSON.stringify({
|
|
52
|
+
licenseKey: 'TEST-KEY-1234',
|
|
53
|
+
status: 'cancelled',
|
|
54
|
+
}));
|
|
55
|
+
const result = detectLicenseStatus(vendorName);
|
|
56
|
+
expect(result).toBe('invalid');
|
|
57
|
+
});
|
|
58
|
+
it('should return "invalid" when license status is suspended', () => {
|
|
59
|
+
vi.mocked(fs.existsSync).mockReturnValue(true);
|
|
60
|
+
vi.mocked(fs.readFileSync).mockReturnValue(JSON.stringify({
|
|
61
|
+
licenseKey: 'TEST-KEY-1234',
|
|
62
|
+
status: 'suspended',
|
|
63
|
+
}));
|
|
64
|
+
const result = detectLicenseStatus(vendorName);
|
|
65
|
+
expect(result).toBe('invalid');
|
|
66
|
+
});
|
|
67
|
+
it('should return "invalid" when license is expired', () => {
|
|
68
|
+
const pastDate = new Date();
|
|
69
|
+
pastDate.setFullYear(pastDate.getFullYear() - 1);
|
|
70
|
+
vi.mocked(fs.existsSync).mockReturnValue(true);
|
|
71
|
+
vi.mocked(fs.readFileSync).mockReturnValue(JSON.stringify({
|
|
72
|
+
licenseKey: 'TEST-KEY-1234',
|
|
73
|
+
status: 'active',
|
|
74
|
+
expiresAt: pastDate.toISOString(),
|
|
75
|
+
}));
|
|
76
|
+
const result = detectLicenseStatus(vendorName);
|
|
77
|
+
expect(result).toBe('invalid');
|
|
78
|
+
});
|
|
79
|
+
it('should return "invalid" when trial has ended', () => {
|
|
80
|
+
const pastDate = new Date();
|
|
81
|
+
pastDate.setDate(pastDate.getDate() - 1);
|
|
82
|
+
vi.mocked(fs.existsSync).mockReturnValue(true);
|
|
83
|
+
vi.mocked(fs.readFileSync).mockReturnValue(JSON.stringify({
|
|
84
|
+
licenseKey: 'TRIAL-KEY-1234',
|
|
85
|
+
status: 'active',
|
|
86
|
+
type: 'trial',
|
|
87
|
+
trialEndsAt: pastDate.toISOString(),
|
|
88
|
+
}));
|
|
89
|
+
const result = detectLicenseStatus(vendorName);
|
|
90
|
+
expect(result).toBe('invalid');
|
|
91
|
+
});
|
|
92
|
+
it('should return "none" when file read throws error', () => {
|
|
93
|
+
vi.mocked(fs.existsSync).mockReturnValue(true);
|
|
94
|
+
vi.mocked(fs.readFileSync).mockImplementation(() => {
|
|
95
|
+
throw new Error('Permission denied');
|
|
96
|
+
});
|
|
97
|
+
const result = detectLicenseStatus(vendorName);
|
|
98
|
+
expect(result).toBe('none');
|
|
99
|
+
});
|
|
100
|
+
it('should return "none" when JSON is invalid', () => {
|
|
101
|
+
vi.mocked(fs.existsSync).mockReturnValue(true);
|
|
102
|
+
vi.mocked(fs.readFileSync).mockReturnValue('invalid json {');
|
|
103
|
+
const result = detectLicenseStatus(vendorName);
|
|
104
|
+
expect(result).toBe('none');
|
|
105
|
+
});
|
|
106
|
+
it('should sanitize vendor name for storage path', () => {
|
|
107
|
+
vi.mocked(fs.existsSync).mockReturnValue(false);
|
|
108
|
+
detectLicenseStatus('Test-Vendor_123');
|
|
109
|
+
// Should use sanitized name: testvendor123
|
|
110
|
+
expect(fs.existsSync).toHaveBeenCalledWith(expect.stringContaining('.test-vendor123'));
|
|
111
|
+
});
|
|
112
|
+
});
|
|
113
|
+
describe('detectBypass', () => {
|
|
114
|
+
const packageName = '@test/package';
|
|
115
|
+
it('should return initial status when license was checked', () => {
|
|
116
|
+
const statuses = ['valid', 'invalid', 'none'];
|
|
117
|
+
for (const status of statuses) {
|
|
118
|
+
const result = detectBypass(packageName, true, status);
|
|
119
|
+
expect(result).toBe(status);
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
it('should return "bypassed" when license check was skipped and status is "none"', () => {
|
|
123
|
+
const result = detectBypass(packageName, false, 'none');
|
|
124
|
+
expect(result).toBe('bypassed');
|
|
125
|
+
});
|
|
126
|
+
it('should return "bypassed" when license check was skipped and status is "valid"', () => {
|
|
127
|
+
const result = detectBypass(packageName, false, 'valid');
|
|
128
|
+
expect(result).toBe('bypassed');
|
|
129
|
+
});
|
|
130
|
+
it('should return "bypassed" when license check was skipped and status is "invalid"', () => {
|
|
131
|
+
const result = detectBypass(packageName, false, 'invalid');
|
|
132
|
+
expect(result).toBe('bypassed');
|
|
133
|
+
});
|
|
134
|
+
it('should return initial status when already "bypassed"', () => {
|
|
135
|
+
const result = detectBypass(packageName, false, 'bypassed');
|
|
136
|
+
expect(result).toBe('bypassed');
|
|
137
|
+
});
|
|
138
|
+
});
|
|
139
|
+
//# sourceMappingURL=detector.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detector.test.js","sourceRoot":"","sources":["../../src/__tests__/detector.test.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AACzE,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;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CAAC,UAAU,CAAC,CAAC;IAClC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,iFAAiF,EAAE,GAAG,EAAE;QACzF,MAAM,MAAM,GAAG,YAAY,CAAC,WAAW,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC;QAE3D,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAClC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,sDAAsD,EAAE,GAAG,EAAE;QAC9D,MAAM,MAAM,GAAG,YAAY,CAAC,WAAW,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC;QAE5D,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAClC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reporter.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/reporter.test.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tests for reporter.ts
|
|
3
|
+
* - reportImport()
|
|
4
|
+
* - buildPayload()
|
|
5
|
+
* - buildEndpoint()
|
|
6
|
+
*/
|
|
7
|
+
import { describe, it, expect, beforeEach, afterEach, vi } from 'vitest';
|
|
8
|
+
import { reportImport, createImportReporter } from '../reporter.js';
|
|
9
|
+
import { importRegistry, markLicenseChecked } from '../types.js';
|
|
10
|
+
// Mock fetch globally
|
|
11
|
+
const mockFetch = vi.fn();
|
|
12
|
+
global.fetch = mockFetch;
|
|
13
|
+
// Mock license-utils
|
|
14
|
+
vi.mock('@microwiseai/license-utils', () => ({
|
|
15
|
+
getMachineId: vi.fn().mockReturnValue('mock-machine-id'),
|
|
16
|
+
}));
|
|
17
|
+
// Mock os module
|
|
18
|
+
vi.mock('os', () => ({
|
|
19
|
+
platform: vi.fn().mockReturnValue('linux'),
|
|
20
|
+
}));
|
|
21
|
+
describe('reportImport', () => {
|
|
22
|
+
const baseConfig = {
|
|
23
|
+
vendorName: 'testvendor',
|
|
24
|
+
packageName: '@test/package',
|
|
25
|
+
packageVersion: '1.0.0',
|
|
26
|
+
apiUrl: 'https://api.example.com',
|
|
27
|
+
};
|
|
28
|
+
beforeEach(() => {
|
|
29
|
+
vi.clearAllMocks();
|
|
30
|
+
mockFetch.mockResolvedValue({ ok: true });
|
|
31
|
+
importRegistry.clear();
|
|
32
|
+
});
|
|
33
|
+
afterEach(() => {
|
|
34
|
+
importRegistry.clear();
|
|
35
|
+
});
|
|
36
|
+
it('should send telemetry to the correct endpoint', async () => {
|
|
37
|
+
reportImport(baseConfig);
|
|
38
|
+
// Wait for async fetch
|
|
39
|
+
await vi.waitFor(() => {
|
|
40
|
+
expect(mockFetch).toHaveBeenCalled();
|
|
41
|
+
});
|
|
42
|
+
expect(mockFetch).toHaveBeenCalledWith('https://api.example.com/telemetry', expect.objectContaining({
|
|
43
|
+
method: 'POST',
|
|
44
|
+
headers: { 'Content-Type': 'application/json' },
|
|
45
|
+
}));
|
|
46
|
+
});
|
|
47
|
+
it('should include correct payload fields', async () => {
|
|
48
|
+
reportImport(baseConfig);
|
|
49
|
+
await vi.waitFor(() => {
|
|
50
|
+
expect(mockFetch).toHaveBeenCalled();
|
|
51
|
+
});
|
|
52
|
+
const [, options] = mockFetch.mock.calls[0];
|
|
53
|
+
const payload = JSON.parse(options.body);
|
|
54
|
+
expect(payload).toMatchObject({
|
|
55
|
+
machineId: 'mock-machine-id',
|
|
56
|
+
packageName: '@test/package',
|
|
57
|
+
packageVersion: '1.0.0',
|
|
58
|
+
vendorName: 'testvendor',
|
|
59
|
+
platform: 'linux',
|
|
60
|
+
event: 'import',
|
|
61
|
+
});
|
|
62
|
+
expect(payload.timestamp).toBeDefined();
|
|
63
|
+
expect(payload.nodeVersion).toBeDefined();
|
|
64
|
+
expect(payload.licenseStatus).toBeDefined();
|
|
65
|
+
});
|
|
66
|
+
it('should register package in importRegistry', () => {
|
|
67
|
+
reportImport(baseConfig);
|
|
68
|
+
const state = importRegistry.get('@test/package');
|
|
69
|
+
expect(state).toBeDefined();
|
|
70
|
+
expect(state?.packageName).toBe('@test/package');
|
|
71
|
+
expect(state?.licenseChecked).toBe(false);
|
|
72
|
+
});
|
|
73
|
+
it('should not send telemetry when disabled', async () => {
|
|
74
|
+
reportImport({ ...baseConfig, enabled: false });
|
|
75
|
+
// Give time for any async operations
|
|
76
|
+
await new Promise(resolve => setTimeout(resolve, 50));
|
|
77
|
+
expect(mockFetch).not.toHaveBeenCalled();
|
|
78
|
+
});
|
|
79
|
+
it('should not throw on fetch error', async () => {
|
|
80
|
+
mockFetch.mockRejectedValue(new Error('Network error'));
|
|
81
|
+
// Should not throw
|
|
82
|
+
expect(() => reportImport(baseConfig)).not.toThrow();
|
|
83
|
+
await vi.waitFor(() => {
|
|
84
|
+
expect(mockFetch).toHaveBeenCalled();
|
|
85
|
+
});
|
|
86
|
+
});
|
|
87
|
+
it('should use custom timeout', async () => {
|
|
88
|
+
reportImport({ ...baseConfig, timeout: 10000 });
|
|
89
|
+
await vi.waitFor(() => {
|
|
90
|
+
expect(mockFetch).toHaveBeenCalled();
|
|
91
|
+
});
|
|
92
|
+
const [, options] = mockFetch.mock.calls[0];
|
|
93
|
+
expect(options.signal).toBeDefined();
|
|
94
|
+
});
|
|
95
|
+
});
|
|
96
|
+
describe('buildEndpoint', () => {
|
|
97
|
+
beforeEach(() => {
|
|
98
|
+
vi.clearAllMocks();
|
|
99
|
+
mockFetch.mockResolvedValue({ ok: true });
|
|
100
|
+
importRegistry.clear();
|
|
101
|
+
});
|
|
102
|
+
it('should append /telemetry to base URL', async () => {
|
|
103
|
+
reportImport({
|
|
104
|
+
vendorName: 'test',
|
|
105
|
+
packageName: 'test',
|
|
106
|
+
packageVersion: '1.0.0',
|
|
107
|
+
apiUrl: 'https://api.example.com',
|
|
108
|
+
});
|
|
109
|
+
await vi.waitFor(() => {
|
|
110
|
+
expect(mockFetch).toHaveBeenCalledWith('https://api.example.com/telemetry', expect.anything());
|
|
111
|
+
});
|
|
112
|
+
});
|
|
113
|
+
it('should append /telemetry to URL with trailing slash', async () => {
|
|
114
|
+
reportImport({
|
|
115
|
+
vendorName: 'test',
|
|
116
|
+
packageName: 'test',
|
|
117
|
+
packageVersion: '1.0.0',
|
|
118
|
+
apiUrl: 'https://api.example.com/',
|
|
119
|
+
});
|
|
120
|
+
await vi.waitFor(() => {
|
|
121
|
+
expect(mockFetch).toHaveBeenCalledWith('https://api.example.com/telemetry', expect.anything());
|
|
122
|
+
});
|
|
123
|
+
});
|
|
124
|
+
it('should not duplicate /telemetry if already present', async () => {
|
|
125
|
+
reportImport({
|
|
126
|
+
vendorName: 'test',
|
|
127
|
+
packageName: 'test',
|
|
128
|
+
packageVersion: '1.0.0',
|
|
129
|
+
apiUrl: 'https://api.example.com/telemetry',
|
|
130
|
+
});
|
|
131
|
+
await vi.waitFor(() => {
|
|
132
|
+
expect(mockFetch).toHaveBeenCalledWith('https://api.example.com/telemetry', expect.anything());
|
|
133
|
+
});
|
|
134
|
+
});
|
|
135
|
+
it('should handle /api base path correctly', async () => {
|
|
136
|
+
reportImport({
|
|
137
|
+
vendorName: 'test',
|
|
138
|
+
packageName: 'test',
|
|
139
|
+
packageVersion: '1.0.0',
|
|
140
|
+
apiUrl: 'https://api.example.com/api',
|
|
141
|
+
});
|
|
142
|
+
await vi.waitFor(() => {
|
|
143
|
+
expect(mockFetch).toHaveBeenCalledWith('https://api.example.com/api/telemetry', expect.anything());
|
|
144
|
+
});
|
|
145
|
+
});
|
|
146
|
+
});
|
|
147
|
+
describe('createImportReporter', () => {
|
|
148
|
+
beforeEach(() => {
|
|
149
|
+
vi.clearAllMocks();
|
|
150
|
+
mockFetch.mockResolvedValue({ ok: true });
|
|
151
|
+
importRegistry.clear();
|
|
152
|
+
});
|
|
153
|
+
it('should create a pre-configured reporter function', async () => {
|
|
154
|
+
const reporter = createImportReporter({
|
|
155
|
+
vendorName: 'testvendor',
|
|
156
|
+
packageName: '@test/package',
|
|
157
|
+
packageVersion: '1.0.0',
|
|
158
|
+
apiUrl: 'https://api.example.com',
|
|
159
|
+
});
|
|
160
|
+
reporter();
|
|
161
|
+
await vi.waitFor(() => {
|
|
162
|
+
expect(mockFetch).toHaveBeenCalled();
|
|
163
|
+
});
|
|
164
|
+
});
|
|
165
|
+
it('should allow disabling via parameter', async () => {
|
|
166
|
+
const reporter = createImportReporter({
|
|
167
|
+
vendorName: 'testvendor',
|
|
168
|
+
packageName: '@test/package',
|
|
169
|
+
packageVersion: '1.0.0',
|
|
170
|
+
apiUrl: 'https://api.example.com',
|
|
171
|
+
});
|
|
172
|
+
reporter(false);
|
|
173
|
+
await new Promise(resolve => setTimeout(resolve, 50));
|
|
174
|
+
expect(mockFetch).not.toHaveBeenCalled();
|
|
175
|
+
});
|
|
176
|
+
});
|
|
177
|
+
describe('markLicenseChecked integration', () => {
|
|
178
|
+
beforeEach(() => {
|
|
179
|
+
vi.clearAllMocks();
|
|
180
|
+
mockFetch.mockResolvedValue({ ok: true });
|
|
181
|
+
importRegistry.clear();
|
|
182
|
+
});
|
|
183
|
+
it('should update registry when markLicenseChecked is called', () => {
|
|
184
|
+
reportImport({
|
|
185
|
+
vendorName: 'testvendor',
|
|
186
|
+
packageName: '@test/package',
|
|
187
|
+
packageVersion: '1.0.0',
|
|
188
|
+
apiUrl: 'https://api.example.com',
|
|
189
|
+
});
|
|
190
|
+
expect(importRegistry.get('@test/package')?.licenseChecked).toBe(false);
|
|
191
|
+
markLicenseChecked('@test/package');
|
|
192
|
+
expect(importRegistry.get('@test/package')?.licenseChecked).toBe(true);
|
|
193
|
+
});
|
|
194
|
+
});
|
|
195
|
+
//# sourceMappingURL=reporter.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reporter.test.js","sourceRoot":"","sources":["../../src/__tests__/reporter.test.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,O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Ac,CAAC,GAAG,CAAC,eAAe,CAAC,EAAE,cAAc,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAExE,kBAAkB,CAAC,eAAe,CAAC,CAAC;QAEpC,MAAM,CAAC,cAAc,CAAC,GAAG,CAAC,eAAe,CAAC,EAAE,cAAc,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACzE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/types.test.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tests for types.ts
|
|
3
|
+
* - importRegistry
|
|
4
|
+
* - markLicenseChecked()
|
|
5
|
+
* - isLicenseChecked()
|
|
6
|
+
*/
|
|
7
|
+
import { describe, it, expect, beforeEach } from 'vitest';
|
|
8
|
+
import { importRegistry, markLicenseChecked, isLicenseChecked, } from '../types.js';
|
|
9
|
+
describe('importRegistry', () => {
|
|
10
|
+
beforeEach(() => {
|
|
11
|
+
importRegistry.clear();
|
|
12
|
+
});
|
|
13
|
+
it('should be a Map instance', () => {
|
|
14
|
+
expect(importRegistry).toBeInstanceOf(Map);
|
|
15
|
+
});
|
|
16
|
+
it('should store and retrieve tracking state', () => {
|
|
17
|
+
const state = {
|
|
18
|
+
importedAt: Date.now(),
|
|
19
|
+
licenseChecked: false,
|
|
20
|
+
packageName: '@test/package',
|
|
21
|
+
};
|
|
22
|
+
importRegistry.set('@test/package', state);
|
|
23
|
+
expect(importRegistry.get('@test/package')).toEqual(state);
|
|
24
|
+
});
|
|
25
|
+
it('should allow multiple packages', () => {
|
|
26
|
+
importRegistry.set('@test/package1', {
|
|
27
|
+
importedAt: Date.now(),
|
|
28
|
+
licenseChecked: false,
|
|
29
|
+
packageName: '@test/package1',
|
|
30
|
+
});
|
|
31
|
+
importRegistry.set('@test/package2', {
|
|
32
|
+
importedAt: Date.now(),
|
|
33
|
+
licenseChecked: true,
|
|
34
|
+
packageName: '@test/package2',
|
|
35
|
+
});
|
|
36
|
+
expect(importRegistry.size).toBe(2);
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
describe('markLicenseChecked', () => {
|
|
40
|
+
beforeEach(() => {
|
|
41
|
+
importRegistry.clear();
|
|
42
|
+
});
|
|
43
|
+
it('should mark existing package as license checked', () => {
|
|
44
|
+
importRegistry.set('@test/package', {
|
|
45
|
+
importedAt: Date.now(),
|
|
46
|
+
licenseChecked: false,
|
|
47
|
+
packageName: '@test/package',
|
|
48
|
+
});
|
|
49
|
+
markLicenseChecked('@test/package');
|
|
50
|
+
expect(importRegistry.get('@test/package')?.licenseChecked).toBe(true);
|
|
51
|
+
});
|
|
52
|
+
it('should do nothing for non-existent package', () => {
|
|
53
|
+
// Should not throw
|
|
54
|
+
expect(() => markLicenseChecked('@nonexistent/package')).not.toThrow();
|
|
55
|
+
expect(importRegistry.has('@nonexistent/package')).toBe(false);
|
|
56
|
+
});
|
|
57
|
+
it('should update only the target package', () => {
|
|
58
|
+
importRegistry.set('@test/package1', {
|
|
59
|
+
importedAt: Date.now(),
|
|
60
|
+
licenseChecked: false,
|
|
61
|
+
packageName: '@test/package1',
|
|
62
|
+
});
|
|
63
|
+
importRegistry.set('@test/package2', {
|
|
64
|
+
importedAt: Date.now(),
|
|
65
|
+
licenseChecked: false,
|
|
66
|
+
packageName: '@test/package2',
|
|
67
|
+
});
|
|
68
|
+
markLicenseChecked('@test/package1');
|
|
69
|
+
expect(importRegistry.get('@test/package1')?.licenseChecked).toBe(true);
|
|
70
|
+
expect(importRegistry.get('@test/package2')?.licenseChecked).toBe(false);
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
describe('isLicenseChecked', () => {
|
|
74
|
+
beforeEach(() => {
|
|
75
|
+
importRegistry.clear();
|
|
76
|
+
});
|
|
77
|
+
it('should return true when license is checked', () => {
|
|
78
|
+
importRegistry.set('@test/package', {
|
|
79
|
+
importedAt: Date.now(),
|
|
80
|
+
licenseChecked: true,
|
|
81
|
+
packageName: '@test/package',
|
|
82
|
+
});
|
|
83
|
+
expect(isLicenseChecked('@test/package')).toBe(true);
|
|
84
|
+
});
|
|
85
|
+
it('should return false when license is not checked', () => {
|
|
86
|
+
importRegistry.set('@test/package', {
|
|
87
|
+
importedAt: Date.now(),
|
|
88
|
+
licenseChecked: false,
|
|
89
|
+
packageName: '@test/package',
|
|
90
|
+
});
|
|
91
|
+
expect(isLicenseChecked('@test/package')).toBe(false);
|
|
92
|
+
});
|
|
93
|
+
it('should return false for non-existent package', () => {
|
|
94
|
+
expect(isLicenseChecked('@nonexistent/package')).toBe(false);
|
|
95
|
+
});
|
|
96
|
+
});
|
|
97
|
+
//# sourceMappingURL=types.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.test.js","sourceRoot":"","sources":["../../src/__tests__/types.test.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAC1D,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,gBAAgB,GACjB,MAAM,aAAa,CAAC;AAGrB,QAAQ,CAAC,gBAAgB,EAAE,GAAG,EAAE;IAC9B,UAAU,CAAC,GAAG,EAAE;QACd,cAAc,CAAC,KAAK,EAAE,CAAC;IACzB,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,0BAA0B,EAAE,GAAG,EAAE;QAClC,MAAM,CAAC,cAAc,CAAC,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC;IAC7C,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,0CAA0C,EAAE,GAAG,EAAE;QAClD,MAAM,KAAK,GAAwB;YACjC,UAAU,EAAE,IAAI,CAAC,GAAG,EAAE;YACtB,cAAc,EAAE,KAAK;YACr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E,eAAe;SAC7B,CAAC,CAAC;QAEH,MAAM,CAAC,gBAAgB,CAAC,eAAe,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACvD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,iDAAiD,EAAE,GAAG,EAAE;QACzD,cAAc,CAAC,GAAG,CAAC,eAAe,EAAE;YAClC,UAAU,EAAE,IAAI,CAAC,GAAG,EAAE;YACtB,cAAc,EAAE,KAAK;YACrB,WAAW,EAAE,eAAe;SAC7B,CAAC,CAAC;QAEH,MAAM,CAAC,gBAAgB,CAAC,eAAe,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACxD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,8CAA8C,EAAE,GAAG,EAAE;QACtD,MAAM,CAAC,gBAAgB,CAAC,sBAAsB,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC/D,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* License status detection for import-time telemetry
|
|
3
|
+
* Detects license presence and validity without requiring full license check
|
|
4
|
+
*/
|
|
5
|
+
import type { ImportLicenseStatus } from './types.js';
|
|
6
|
+
/**
|
|
7
|
+
* Detect license status at import time
|
|
8
|
+
* This is a lightweight check - doesn't verify with server
|
|
9
|
+
*/
|
|
10
|
+
export declare function detectLicenseStatus(vendorName: string): ImportLicenseStatus;
|
|
11
|
+
/**
|
|
12
|
+
* Check for bypass indicators
|
|
13
|
+
* Called after a delay to detect if license check was never called
|
|
14
|
+
*/
|
|
15
|
+
export declare function detectBypass(packageName: string, licenseChecked: boolean, initialStatus: ImportLicenseStatus): ImportLicenseStatus;
|
|
16
|
+
//# sourceMappingURL=detector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detector.d.ts","sourceRoot":"","sources":["../src/detector.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAatD;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,MAAM,GAAG,mBAAmB,CA4B3E;AAsDD;;;GAGG;AACH,wBAAgB,YAAY,CAC1B,WAAW,EAAE,MAAM,EACnB,cAAc,EAAE,OAAO,EACvB,aAAa,EAAE,mBAAmB,GACjC,mBAAmB,CAmBrB"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* License status detection for import-time telemetry
|
|
3
|
+
* Detects license presence and validity without requiring full license check
|
|
4
|
+
*/
|
|
5
|
+
import * as fs from 'fs';
|
|
6
|
+
import * as path from 'path';
|
|
7
|
+
import * as os from 'os';
|
|
8
|
+
/**
|
|
9
|
+
* Detect license status at import time
|
|
10
|
+
* This is a lightweight check - doesn't verify with server
|
|
11
|
+
*/
|
|
12
|
+
export function detectLicenseStatus(vendorName) {
|
|
13
|
+
try {
|
|
14
|
+
const licenseData = readLicenseFile(vendorName);
|
|
15
|
+
if (!licenseData) {
|
|
16
|
+
return 'none';
|
|
17
|
+
}
|
|
18
|
+
// Check if license appears valid
|
|
19
|
+
if (!licenseData.licenseKey) {
|
|
20
|
+
return 'none';
|
|
21
|
+
}
|
|
22
|
+
// Check status
|
|
23
|
+
if (licenseData.status === 'cancelled' || licenseData.status === 'suspended') {
|
|
24
|
+
return 'invalid';
|
|
25
|
+
}
|
|
26
|
+
// Check expiration
|
|
27
|
+
if (isExpired(licenseData)) {
|
|
28
|
+
return 'invalid';
|
|
29
|
+
}
|
|
30
|
+
return 'valid';
|
|
31
|
+
}
|
|
32
|
+
catch {
|
|
33
|
+
// Any error in detection - treat as no license
|
|
34
|
+
return 'none';
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Read license file from vendor's storage directory
|
|
39
|
+
*/
|
|
40
|
+
function readLicenseFile(vendorName) {
|
|
41
|
+
const storageDir = getStorageDir(vendorName);
|
|
42
|
+
const licensePath = path.join(storageDir, 'license.json');
|
|
43
|
+
try {
|
|
44
|
+
if (!fs.existsSync(licensePath)) {
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
const content = fs.readFileSync(licensePath, 'utf-8');
|
|
48
|
+
return JSON.parse(content);
|
|
49
|
+
}
|
|
50
|
+
catch {
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Get storage directory for vendor
|
|
56
|
+
*/
|
|
57
|
+
function getStorageDir(vendorName) {
|
|
58
|
+
const safeName = vendorName.toLowerCase().replace(/[^a-z0-9-]/g, '');
|
|
59
|
+
return path.join(os.homedir(), `.${safeName}`);
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Check if license is expired based on local data
|
|
63
|
+
*/
|
|
64
|
+
function isExpired(license) {
|
|
65
|
+
const now = new Date();
|
|
66
|
+
// Check subscription expiration
|
|
67
|
+
if (license.expiresAt) {
|
|
68
|
+
const expiresAt = new Date(license.expiresAt);
|
|
69
|
+
if (expiresAt < now) {
|
|
70
|
+
return true;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
// Check trial expiration
|
|
74
|
+
if (license.trialEndsAt) {
|
|
75
|
+
const trialEndsAt = new Date(license.trialEndsAt);
|
|
76
|
+
if (trialEndsAt < now) {
|
|
77
|
+
return true;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
return false;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Check for bypass indicators
|
|
84
|
+
* Called after a delay to detect if license check was never called
|
|
85
|
+
*/
|
|
86
|
+
export function detectBypass(packageName, licenseChecked, initialStatus) {
|
|
87
|
+
// If license was properly checked, return initial status
|
|
88
|
+
if (licenseChecked) {
|
|
89
|
+
return initialStatus;
|
|
90
|
+
}
|
|
91
|
+
// If no license exists and license check wasn't called,
|
|
92
|
+
// they might be using features without license
|
|
93
|
+
if (initialStatus === 'none') {
|
|
94
|
+
return 'bypassed';
|
|
95
|
+
}
|
|
96
|
+
// If license exists but check wasn't called,
|
|
97
|
+
// they might have modified code to skip validation
|
|
98
|
+
if (initialStatus === 'valid' || initialStatus === 'invalid') {
|
|
99
|
+
return 'bypassed';
|
|
100
|
+
}
|
|
101
|
+
return initialStatus;
|
|
102
|
+
}
|
|
103
|
+
//# sourceMappingURL=detector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detector.js","sourceRoot":"","sources":["../src/detector.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AAczB;;;GAGG;AACH,MAAM,UAAU,mBAAmB,CAAC,UAAkB;IACpD,IAAI,CAAC;QACH,MAAM,WAAW,GAAG,eAAe,CAAC,UAAU,CAAC,CAAC;QAEhD,IAAI,CAAC,WAAW,EAAE,CAAC;YACjB,OAAO,MAAM,CAAC;QAChB,CAAC;QAED,iCAAiC;QACjC,IAAI,CAAC,WAAW,CAAC,UAAU,EAAE,CAAC;YAC5B,OAAO,MAAM,CAAC;QAChB,CAAC;QAED,eAAe;QACf,IAAI,WAAW,CAAC,MAAM,KAAK,WAAW,IAAI,WAAW,CAAC,MAAM,KAAK,WAAW,EAAE,CAAC;YAC7E,OAAO,SAAS,CAAC;QACnB,CAAC;QAED,mBAAmB;QACnB,IAAI,SAAS,CAAC,WAAW,CAAC,EAAE,CAAC;YAC3B,OAAO,SAAS,CAAC;QACnB,CAAC;QAED,OAAO,OAAO,CAAC;IACjB,CAAC;IAAC,MAAM,CAAC;QACP,+CAA+C;QAC/C,OAAO,MAAM,CAAC;IAChB,CAAC;AACH,CAAC;AAED;;GAEG;AACH,SAAS,eAAe,CAAC,UAAkB;IACzC,MAAM,UAAU,GAAG,aAAa,CAAC,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