diff --git a/packages/api-key/.gitignore b/packages/api-key/.gitignore new file mode 100644 index 0000000000..874c6c69d3 --- /dev/null +++ b/packages/api-key/.gitignore @@ -0,0 +1,6 @@ +/dist +node_modules +.DS_store +.env* +.env +*.sql diff --git a/packages/api-key/README.md b/packages/api-key/README.md new file mode 100644 index 0000000000..b314a3663f --- /dev/null +++ b/packages/api-key/README.md @@ -0,0 +1 @@ +# API Key Module diff --git a/packages/api-key/integration-tests/__fixtures__/index.ts b/packages/api-key/integration-tests/__fixtures__/index.ts new file mode 100644 index 0000000000..172f1ae6a4 --- /dev/null +++ b/packages/api-key/integration-tests/__fixtures__/index.ts @@ -0,0 +1 @@ +// noop diff --git a/packages/api-key/integration-tests/__tests__/api-key-module-service.spec.ts b/packages/api-key/integration-tests/__tests__/api-key-module-service.spec.ts new file mode 100644 index 0000000000..00658c1e07 --- /dev/null +++ b/packages/api-key/integration-tests/__tests__/api-key-module-service.spec.ts @@ -0,0 +1,21 @@ +import { Modules } from "@medusajs/modules-sdk" +import { IApiKeyModuleService } from "@medusajs/types" +import { moduleIntegrationTestRunner, SuiteOptions } from "medusa-test-utils" + +jest.setTimeout(100000) + +moduleIntegrationTestRunner({ + moduleName: Modules.API_KEY, + testSuite: ({ + MikroOrmWrapper, + service, + }: SuiteOptions) => { + describe("API Key Module Service", () => { + describe("noop", () => { + it("should run", function () { + expect(true).toBe(true) + }) + }) + }) + }, +}) diff --git a/packages/api-key/jest.config.js b/packages/api-key/jest.config.js new file mode 100644 index 0000000000..58c887c1c3 --- /dev/null +++ b/packages/api-key/jest.config.js @@ -0,0 +1,20 @@ +module.exports = { + moduleNameMapper: { + "^@models": "/src/models", + "^@services": "/src/services", + "^@repositories": "/src/repositories", + "^@types": "/src/types", + }, + transform: { + "^.+\\.[jt]s?$": [ + "ts-jest", + { + tsConfig: "tsconfig.spec.json", + isolatedModules: true, + }, + ], + }, + testEnvironment: `node`, + moduleFileExtensions: [`js`, `ts`], + modulePathIgnorePatterns: ["dist/"], +} diff --git a/packages/api-key/mikro-orm.config.dev.ts b/packages/api-key/mikro-orm.config.dev.ts new file mode 100644 index 0000000000..df194ea7c8 --- /dev/null +++ b/packages/api-key/mikro-orm.config.dev.ts @@ -0,0 +1,12 @@ +import * as entities from "./src/models" +import { TSMigrationGenerator } from "@medusajs/utils" + +module.exports = { + entities: Object.values(entities), + schema: "public", + clientUrl: "postgres://postgres@localhost/medusa-api-key", + type: "postgresql", + migrations: { + generator: TSMigrationGenerator, + }, +} diff --git a/packages/api-key/package.json b/packages/api-key/package.json new file mode 100644 index 0000000000..6da26ef7d5 --- /dev/null +++ b/packages/api-key/package.json @@ -0,0 +1,61 @@ +{ + "name": "@medusajs/api-key", + "version": "0.1.0", + "description": "Medusa API Key module", + "main": "dist/index.js", + "types": "dist/index.d.ts", + "files": [ + "dist" + ], + "engines": { + "node": ">=16" + }, + "bin": { + "medusa-api-key-seed": "dist/scripts/bin/run-seed.js" + }, + "repository": { + "type": "git", + "url": "https://github.com/medusajs/medusa", + "directory": "packages/api-key" + }, + "publishConfig": { + "access": "public" + }, + "author": "Medusa", + "license": "MIT", + "scripts": { + "watch": "tsc --build --watch", + "watch:test": "tsc --build tsconfig.spec.json --watch", + "prepublishOnly": "cross-env NODE_ENV=production tsc --build && tsc-alias -p tsconfig.json", + "build": "rimraf dist && tsc --build && tsc-alias -p tsconfig.json", + "test": "jest --runInBand --bail --forceExit -- src/**/__tests__/**/*.ts", + "test:integration": "jest --runInBand --forceExit -- integration-tests/**/__tests__/**/*.ts", + "migration:generate": " MIKRO_ORM_CLI=./mikro-orm.config.dev.ts mikro-orm migration:generate", + "migration:initial": " MIKRO_ORM_CLI=./mikro-orm.config.dev.ts mikro-orm migration:create --initial", + "migration:create": " MIKRO_ORM_CLI=./mikro-orm.config.dev.ts mikro-orm migration:create", + "migration:up": " MIKRO_ORM_CLI=./mikro-orm.config.dev.ts mikro-orm migration:up", + "orm:cache:clear": " MIKRO_ORM_CLI=./mikro-orm.config.dev.ts mikro-orm cache:clear" + }, + "devDependencies": { + "@mikro-orm/cli": "5.9.7", + "cross-env": "^5.2.1", + "jest": "^29.6.3", + "medusa-test-utils": "^1.1.40", + "rimraf": "^3.0.2", + "ts-jest": "^29.1.1", + "ts-node": "^10.9.1", + "tsc-alias": "^1.8.6", + "typescript": "^5.1.6" + }, + "dependencies": { + "@medusajs/modules-sdk": "^1.12.4", + "@medusajs/types": "^1.11.8", + "@medusajs/utils": "^1.11.1", + "@mikro-orm/core": "5.9.7", + "@mikro-orm/migrations": "5.9.7", + "@mikro-orm/postgresql": "5.9.7", + "awilix": "^8.0.0", + "dotenv": "^16.1.4", + "knex": "2.4.2" + } +} diff --git a/packages/api-key/src/index.ts b/packages/api-key/src/index.ts new file mode 100644 index 0000000000..bd9fb22270 --- /dev/null +++ b/packages/api-key/src/index.ts @@ -0,0 +1,14 @@ +import { moduleDefinition } from "./module-definition" +import { initializeFactory, Modules } from "@medusajs/modules-sdk" + +export * from "./types" +export * from "./models" +export * from "./services" + +export const initialize = initializeFactory({ + moduleName: Modules.API_KEY, + moduleDefinition, +}) +export const runMigrations = moduleDefinition.runMigrations +export const revertMigration = moduleDefinition.revertMigration +export default moduleDefinition diff --git a/packages/api-key/src/joiner-config.ts b/packages/api-key/src/joiner-config.ts new file mode 100644 index 0000000000..95b4550664 --- /dev/null +++ b/packages/api-key/src/joiner-config.ts @@ -0,0 +1,25 @@ +import { Modules } from "@medusajs/modules-sdk" +import { ModuleJoinerConfig } from "@medusajs/types" +import { MapToConfig } from "@medusajs/utils" + +// TODO manage the config + +export const LinkableKeys: Record = {} + +const entityLinkableKeysMap: MapToConfig = {} +Object.entries(LinkableKeys).forEach(([key, value]) => { + entityLinkableKeysMap[value] ??= [] + entityLinkableKeysMap[value].push({ + mapTo: key, + valueFrom: key.split("_").pop()!, + }) +}) + +export const entityNameToLinkableKeysMap: MapToConfig = entityLinkableKeysMap + +export const joinerConfig: ModuleJoinerConfig = { + serviceName: Modules.API_KEY, + primaryKeys: ["id"], + linkableKeys: LinkableKeys, + alias: [], +} as ModuleJoinerConfig diff --git a/packages/api-key/src/models/api-key.ts b/packages/api-key/src/models/api-key.ts new file mode 100644 index 0000000000..d7fe5a334a --- /dev/null +++ b/packages/api-key/src/models/api-key.ts @@ -0,0 +1,41 @@ +import { generateEntityId } from "@medusajs/utils" + +import { + BeforeCreate, + Entity, + OnInit, + PrimaryKey, + Property, +} from "@mikro-orm/core" + +// TODO: +@Entity() +export default class ApiKey { + @PrimaryKey({ columnType: "text" }) + id: string + + @Property({ + onCreate: () => new Date(), + columnType: "timestamptz", + defaultRaw: "now()", + }) + created_at: Date + + @Property({ + onCreate: () => new Date(), + onUpdate: () => new Date(), + columnType: "timestamptz", + defaultRaw: "now()", + }) + updated_at: Date + + @BeforeCreate() + onCreate() { + this.id = generateEntityId(this.id, "apk") + } + + @OnInit() + onInit() { + this.id = generateEntityId(this.id, "apk") + } +} diff --git a/packages/api-key/src/models/index.ts b/packages/api-key/src/models/index.ts new file mode 100644 index 0000000000..66a970e311 --- /dev/null +++ b/packages/api-key/src/models/index.ts @@ -0,0 +1 @@ +export { default as ApiKey } from "./api-key" diff --git a/packages/api-key/src/module-definition.ts b/packages/api-key/src/module-definition.ts new file mode 100644 index 0000000000..61d2e6a2e9 --- /dev/null +++ b/packages/api-key/src/module-definition.ts @@ -0,0 +1,44 @@ +import { ModuleExports } from "@medusajs/types" +import * as ModuleServices from "@services" +import { ApiKeyModuleService } from "@services" +import { Modules } from "@medusajs/modules-sdk" +import * as Models from "@models" +import * as ModuleModels from "@models" +import { ModulesSdkUtils } from "@medusajs/utils" +import * as ModuleRepositories from "@repositories" + +const migrationScriptOptions = { + moduleName: Modules.API_KEY, + models: Models, + pathToMigrations: __dirname + "/migrations", +} + +const runMigrations = ModulesSdkUtils.buildMigrationScript( + migrationScriptOptions +) + +const revertMigration = ModulesSdkUtils.buildRevertMigrationScript( + migrationScriptOptions +) + +const containerLoader = ModulesSdkUtils.moduleContainerLoaderFactory({ + moduleModels: ModuleModels, + moduleRepositories: ModuleRepositories, + moduleServices: ModuleServices, +}) + +const connectionLoader = ModulesSdkUtils.mikroOrmConnectionLoaderFactory({ + moduleName: Modules.API_KEY, + moduleModels: Object.values(Models), + migrationsPath: __dirname + "/migrations", +}) + +const service = ApiKeyModuleService +const loaders = [containerLoader, connectionLoader] as any + +export const moduleDefinition: ModuleExports = { + service, + loaders, + revertMigration, + runMigrations, +} diff --git a/packages/api-key/src/repositories/index.ts b/packages/api-key/src/repositories/index.ts new file mode 100644 index 0000000000..147c9cc259 --- /dev/null +++ b/packages/api-key/src/repositories/index.ts @@ -0,0 +1 @@ +export { MikroOrmBaseRepository as BaseRepository } from "@medusajs/utils" diff --git a/packages/api-key/src/scripts/bin/run-seed.ts b/packages/api-key/src/scripts/bin/run-seed.ts new file mode 100644 index 0000000000..27098566d0 --- /dev/null +++ b/packages/api-key/src/scripts/bin/run-seed.ts @@ -0,0 +1,29 @@ +#!/usr/bin/env node + +import { ModulesSdkUtils } from "@medusajs/utils" +import { Modules } from "@medusajs/modules-sdk" +import * as Models from "@models" +import { EOL } from "os" + +const args = process.argv +const path = args.pop() as string + +export default (async () => { + const { config } = await import("dotenv") + config() + if (!path) { + throw new Error( + `filePath is required.${EOL}Example: medusa-api-key-seed ` + ) + } + + const run = ModulesSdkUtils.buildSeedScript({ + moduleName: Modules.API_KEY, + models: Models, + pathToMigrations: __dirname + "/../../migrations", + seedHandler: async ({ manager, data }) => { + // TODO: Add seed logic + }, + }) + await run({ path }) +})() diff --git a/packages/api-key/src/services/__tests__/noop.ts b/packages/api-key/src/services/__tests__/noop.ts new file mode 100644 index 0000000000..333c84c1dd --- /dev/null +++ b/packages/api-key/src/services/__tests__/noop.ts @@ -0,0 +1,5 @@ +describe("noop", function () { + it("should run", function () { + expect(true).toBe(true) + }) +}) diff --git a/packages/api-key/src/services/api-key-module-service.ts b/packages/api-key/src/services/api-key-module-service.ts new file mode 100644 index 0000000000..d28262ab18 --- /dev/null +++ b/packages/api-key/src/services/api-key-module-service.ts @@ -0,0 +1,138 @@ +import { + Context, + DAL, + ApiKeyTypes, + IApiKeyModuleService, + ModulesSdkTypes, + InternalModuleDeclaration, + ModuleJoinerConfig, +} from "@medusajs/types" +import { + InjectManager, + InjectTransactionManager, + MedusaContext, + ModulesSdkUtils, +} from "@medusajs/utils" + +import { entityNameToLinkableKeysMap, joinerConfig } from "../joiner-config" +import { ApiKey } from "@models" + +const generateMethodForModels = [] + +type InjectedDependencies = { + baseRepository: DAL.RepositoryService + apiKeyService: ModulesSdkTypes.InternalModuleService +} + +export default class ApiKeyModuleService + extends ModulesSdkUtils.abstractModuleServiceFactory< + InjectedDependencies, + ApiKeyTypes.ApiKeyDTO, + { + ApiKey: { dto: ApiKeyTypes.ApiKeyDTO } + } + >(ApiKey, generateMethodForModels, entityNameToLinkableKeysMap) + implements IApiKeyModuleService +{ + protected baseRepository_: DAL.RepositoryService + protected readonly apiKeyService_: ModulesSdkTypes.InternalModuleService + + constructor( + { baseRepository, apiKeyService }: InjectedDependencies, + protected readonly moduleDeclaration: InternalModuleDeclaration + ) { + // @ts-ignore + super(...arguments) + this.baseRepository_ = baseRepository + this.apiKeyService_ = apiKeyService + } + + __joinerConfig(): ModuleJoinerConfig { + return joinerConfig + } + + create( + data: ApiKeyTypes.CreateApiKeyDTO[], + sharedContext?: Context + ): Promise + create( + data: ApiKeyTypes.CreateApiKeyDTO, + sharedContext?: Context + ): Promise + + @InjectManager("baseRepository_") + async create( + data: ApiKeyTypes.CreateApiKeyDTO | ApiKeyTypes.CreateApiKeyDTO[], + @MedusaContext() sharedContext: Context = {} + ): Promise { + const createdApiKeys = await this.create_(data, sharedContext) + + return await this.baseRepository_.serialize< + ApiKeyTypes.ApiKeyDTO | ApiKeyTypes.ApiKeyDTO[] + >(createdApiKeys, { + populate: true, + }) + } + + @InjectTransactionManager("baseRepository_") + protected async create_( + data: ApiKeyTypes.CreateApiKeyDTO | ApiKeyTypes.CreateApiKeyDTO[], + @MedusaContext() sharedContext: Context = {} + ): Promise { + const data_ = Array.isArray(data) ? data : [data] + + const createdApiKeys = await this.apiKeyService_.create( + data_, + sharedContext + ) + + return Array.isArray(data) ? createdApiKeys : createdApiKeys[0] + } + + update( + data: ApiKeyTypes.UpdateApiKeyDTO[], + sharedContext?: Context + ): Promise + update( + data: ApiKeyTypes.UpdateApiKeyDTO, + sharedContext?: Context + ): Promise + + @InjectManager("baseRepository_") + async update( + data: ApiKeyTypes.UpdateApiKeyDTO[] | ApiKeyTypes.UpdateApiKeyDTO, + @MedusaContext() sharedContext: Context = {} + ): Promise { + const updatedApiKeys = await this.update_(data, sharedContext) + + return await this.baseRepository_.serialize< + ApiKeyTypes.ApiKeyDTO | ApiKeyTypes.ApiKeyDTO[] + >(updatedApiKeys, { + populate: true, + }) + } + + @InjectTransactionManager("baseRepository_") + protected async update_( + data: ApiKeyTypes.UpdateApiKeyDTO[] | ApiKeyTypes.UpdateApiKeyDTO, + @MedusaContext() sharedContext: Context = {} + ): Promise { + return [] + } + + @InjectTransactionManager("baseRepository_") + async revoke( + id: string, + @MedusaContext() sharedContext: Context = {} + ): Promise { + return + } + + @InjectTransactionManager("baseRepository_") + authenticate( + id: string, + @MedusaContext() sharedContext: Context = {} + ): Promise { + return Promise.resolve(false) + } +} diff --git a/packages/api-key/src/services/index.ts b/packages/api-key/src/services/index.ts new file mode 100644 index 0000000000..9855bfcea7 --- /dev/null +++ b/packages/api-key/src/services/index.ts @@ -0,0 +1 @@ +export { default as ApiKeyModuleService } from "./api-key-module-service" diff --git a/packages/api-key/src/types/index.ts b/packages/api-key/src/types/index.ts new file mode 100644 index 0000000000..fdac085753 --- /dev/null +++ b/packages/api-key/src/types/index.ts @@ -0,0 +1,6 @@ +import { IEventBusModuleService, Logger } from "@medusajs/types" + +export type InitializeModuleInjectableDependencies = { + logger?: Logger + eventBusService?: IEventBusModuleService +} diff --git a/packages/api-key/tsconfig.json b/packages/api-key/tsconfig.json new file mode 100644 index 0000000000..4b79cd6032 --- /dev/null +++ b/packages/api-key/tsconfig.json @@ -0,0 +1,37 @@ +{ + "compilerOptions": { + "lib": ["es2020"], + "target": "es2020", + "outDir": "./dist", + "esModuleInterop": true, + "declaration": true, + "module": "commonjs", + "moduleResolution": "node", + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "sourceMap": false, + "noImplicitReturns": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "noImplicitThis": true, + "allowJs": true, + "skipLibCheck": true, + "downlevelIteration": true, // to use ES5 specific tooling + "baseUrl": ".", + "resolveJsonModule": true, + "paths": { + "@models": ["./src/models"], + "@services": ["./src/services"], + "@repositories": ["./src/repositories"], + "@types": ["./src/types"] + } + }, + "include": ["src"], + "exclude": [ + "dist", + "./src/**/__tests__", + "./src/**/__mocks__", + "./src/**/__fixtures__", + "node_modules" + ] +} diff --git a/packages/api-key/tsconfig.spec.json b/packages/api-key/tsconfig.spec.json new file mode 100644 index 0000000000..48e47e8cbb --- /dev/null +++ b/packages/api-key/tsconfig.spec.json @@ -0,0 +1,8 @@ +{ + "extends": "./tsconfig.json", + "include": ["src", "integration-tests"], + "exclude": ["node_modules", "dist"], + "compilerOptions": { + "sourceMap": true + } +} diff --git a/packages/modules-sdk/src/definitions.ts b/packages/modules-sdk/src/definitions.ts index 0cd49b09a7..119f12bdc7 100644 --- a/packages/modules-sdk/src/definitions.ts +++ b/packages/modules-sdk/src/definitions.ts @@ -26,6 +26,7 @@ export enum Modules { WORKFLOW_ENGINE = "workflows", REGION = "region", ORDER = "order", + API_KEY = "apiKey", } export enum ModuleRegistrationName { @@ -47,6 +48,7 @@ export enum ModuleRegistrationName { WORKFLOW_ENGINE = "workflowsModuleService", REGION = "regionModuleService", ORDER = "orderModuleService", + API_KEY = "apiKeyModuleService", } export const MODULE_PACKAGE_NAMES = { @@ -69,6 +71,7 @@ export const MODULE_PACKAGE_NAMES = { [Modules.WORKFLOW_ENGINE]: "@medusajs/workflow-engine-inmemory", [Modules.REGION]: "@medusajs/region", [Modules.ORDER]: "@medusajs/order", + [Modules.API_KEY]: "@medusajs/api-key", } export const ModulesDefinition: { [key: string | Modules]: ModuleDefinition } = @@ -308,6 +311,19 @@ export const ModulesDefinition: { [key: string | Modules]: ModuleDefinition } = resources: MODULE_RESOURCE_TYPE.SHARED, }, }, + [Modules.API_KEY]: { + key: Modules.API_KEY, + registrationName: ModuleRegistrationName.API_KEY, + defaultPackage: false, + label: upperCaseFirst(ModuleRegistrationName.API_KEY), + isRequired: false, + isQueryable: true, + dependencies: ["logger"], + defaultModuleDeclaration: { + scope: MODULE_SCOPE.INTERNAL, + resources: MODULE_RESOURCE_TYPE.SHARED, + }, + }, } export const MODULE_DEFINITIONS: ModuleDefinition[] = diff --git a/packages/types/src/api-key/common/api-key.ts b/packages/types/src/api-key/common/api-key.ts new file mode 100644 index 0000000000..0aba76fe89 --- /dev/null +++ b/packages/types/src/api-key/common/api-key.ts @@ -0,0 +1,8 @@ +import { BaseFilterable } from "../../dal" + +// TODO: +export interface ApiKeyDTO {} + +// TODO: +export interface FilterableApiKeyProps + extends BaseFilterable {} diff --git a/packages/types/src/api-key/common/index.ts b/packages/types/src/api-key/common/index.ts new file mode 100644 index 0000000000..277e322691 --- /dev/null +++ b/packages/types/src/api-key/common/index.ts @@ -0,0 +1 @@ +export * from "./api-key" diff --git a/packages/types/src/api-key/index.ts b/packages/types/src/api-key/index.ts new file mode 100644 index 0000000000..0c73656566 --- /dev/null +++ b/packages/types/src/api-key/index.ts @@ -0,0 +1,3 @@ +export * from "./common" +export * from "./mutations" +export * from "./service" diff --git a/packages/types/src/api-key/mutations/api-key.ts b/packages/types/src/api-key/mutations/api-key.ts new file mode 100644 index 0000000000..5b69b7d01d --- /dev/null +++ b/packages/types/src/api-key/mutations/api-key.ts @@ -0,0 +1,5 @@ +// TODO: +export interface CreateApiKeyDTO {} + +// TODO: +export interface UpdateApiKeyDTO {} diff --git a/packages/types/src/api-key/mutations/index.ts b/packages/types/src/api-key/mutations/index.ts new file mode 100644 index 0000000000..277e322691 --- /dev/null +++ b/packages/types/src/api-key/mutations/index.ts @@ -0,0 +1 @@ +export * from "./api-key" diff --git a/packages/types/src/api-key/service.ts b/packages/types/src/api-key/service.ts new file mode 100644 index 0000000000..7d5286a8c4 --- /dev/null +++ b/packages/types/src/api-key/service.ts @@ -0,0 +1,81 @@ +import { IModuleService } from "../modules-sdk" +import { ApiKeyDTO, FilterableApiKeyProps } from "./common" +import { FindConfig } from "../common" +import { Context } from "../shared-context" +import { CreateApiKeyDTO, UpdateApiKeyDTO } from "./mutations" + +export interface IApiKeyModuleService extends IModuleService { + /** + * Create a new api key + * @param data + * @param sharedContext + */ + create(data: CreateApiKeyDTO[], sharedContext?: Context): Promise + create(data: CreateApiKeyDTO, sharedContext?: Context): Promise + + /** + * Update an api key + * @param data + * @param sharedContext + */ + update(data: UpdateApiKeyDTO[], sharedContext?: Context): Promise + update(data: UpdateApiKeyDTO, sharedContext?: Context): Promise + + /** + * Delete an api key + * @param ids + * @param sharedContext + */ + delete(ids: string[], sharedContext?: Context): Promise + delete(id: string, sharedContext?: Context): Promise + + /** + * Retrieve an api key + * @param id + * @param config + * @param sharedContext + */ + retrieve( + id: string, + config?: FindConfig, + sharedContext?: Context + ): Promise + + /** + * List api keys + * @param filters + * @param config + * @param sharedContext + */ + list( + filters?: FilterableApiKeyProps, + config?: FindConfig, + sharedContext?: Context + ): Promise + + /** + * List and count api keys + * @param filters + * @param config + * @param sharedContext + */ + listAndCount( + filters?: FilterableApiKeyProps, + config?: FindConfig, + sharedContext?: Context + ): Promise<[ApiKeyDTO[], number]> + + /** + * Revokes an api key + * @param id + * @param sharedContext + */ + revoke(id: string, sharedContext?: Context): Promise + + /** + * Check the validity of an api key + * @param id + * @param sharedContext + */ + authenticate(id: string, sharedContext?: Context): Promise +} diff --git a/packages/types/src/bundles.ts b/packages/types/src/bundles.ts index aaa0af865b..1eb2ddac74 100644 --- a/packages/types/src/bundles.ts +++ b/packages/types/src/bundles.ts @@ -22,3 +22,4 @@ export * as TaxTypes from "./tax" export * as TransactionBaseTypes from "./transaction-base" export * as UserTypes from "./user" export * as WorkflowTypes from "./workflow" +export * as ApiKeyTypes from "./api-key" diff --git a/packages/types/src/index.ts b/packages/types/src/index.ts index e84ba220a9..5017d410c0 100644 --- a/packages/types/src/index.ts +++ b/packages/types/src/index.ts @@ -32,3 +32,4 @@ export * from "./totals" export * from "./transaction-base" export * from "./user" export * from "./workflow" +export * from "./api-key" diff --git a/yarn.lock b/yarn.lock index ff7230c77e..9be232a3db 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7898,6 +7898,33 @@ __metadata: languageName: unknown linkType: soft +"@medusajs/api-key@workspace:packages/api-key": + version: 0.0.0-use.local + resolution: "@medusajs/api-key@workspace:packages/api-key" + dependencies: + "@medusajs/modules-sdk": ^1.12.4 + "@medusajs/types": ^1.11.8 + "@medusajs/utils": ^1.11.1 + "@mikro-orm/cli": 5.9.7 + "@mikro-orm/core": 5.9.7 + "@mikro-orm/migrations": 5.9.7 + "@mikro-orm/postgresql": 5.9.7 + awilix: ^8.0.0 + cross-env: ^5.2.1 + dotenv: ^16.1.4 + jest: ^29.6.3 + knex: 2.4.2 + medusa-test-utils: ^1.1.40 + rimraf: ^3.0.2 + ts-jest: ^29.1.1 + ts-node: ^10.9.1 + tsc-alias: ^1.8.6 + typescript: ^5.1.6 + bin: + medusa-api-key-seed: dist/scripts/bin/run-seed.js + languageName: unknown + linkType: soft + "@medusajs/auth@workspace:*, @medusajs/auth@workspace:packages/auth": version: 0.0.0-use.local resolution: "@medusajs/auth@workspace:packages/auth"