diff --git a/.github/workflows/build-test-ci.yml b/.github/workflows/build-test-ci.yml new file mode 100644 index 0000000..36b7d56 --- /dev/null +++ b/.github/workflows/build-test-ci.yml @@ -0,0 +1,37 @@ +name: Build and test + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + main: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [20.x] + steps: + - uses: actions/checkout@v3 + - uses: pnpm/action-setup@v3 + with: + version: 8 + - name: Setting up Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + cache: "pnpm" + - name: Enabling pre-post scripts + run: pnpm config set enable-pre-post-scripts true + - run: pnpm install + - run: pnpm lint + - name: Cache pnpm modules + uses: actions/cache@v4 + with: + path: ~/.pnpm-store + key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-pnpm- + - run: pnpm build + - run: pnpm test:coverage diff --git a/.prettierignore b/.prettierignore index f1002e6..1d50f70 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,2 +1,3 @@ pnpm-lock.yaml -spec/kinde-mgmt-api-specs.yaml \ No newline at end of file +spec/kinde-mgmt-api-specs.yaml +renovate.json \ No newline at end of file diff --git a/lib/main.test.ts b/lib/main.test.ts new file mode 100644 index 0000000..2e14372 --- /dev/null +++ b/lib/main.test.ts @@ -0,0 +1,140 @@ +import { describe, it, expect } from "vitest"; + +import * as main from "./main"; + +describe("main.ts exports", () => { + it("should not export anything extra", () => { + const actualExports = Object.keys(main); + + const expectedExports = [ + // types + "$add_organization_users_response", + "$api_result", + "$applications", + "$authorize_app_api_response", + "$category", + "$connected_apps_access_token", + "$connected_apps_auth_url", + "$connection", + "$create_apis_response", + "$create_application_response", + "$create_category_response", + "$create_connection_response", + "$create_environment_variable_response", + "$create_identity_response", + "$create_organization_response", + "$create_property_response", + "$create_roles_response", + "$create_subscriber_success_response", + "$create_user_response", + "$create_webhook_response", + "$delete_api_response", + "$delete_environment_variable_response", + "$delete_webhook_response", + "$environment_variable", + "$error", + "$error_response", + "$event_type", + "$get_api_response", + "$get_apis_response", + "$get_application_response", + "$get_applications_response", + "$get_business_response", + "$get_categories_response", + "$get_connections_response", + "$get_environment_feature_flags_response", + "$get_environment_variable_response", + "$get_environment_variables_response", + "$get_event_response", + "$get_event_types_response", + "$get_identities_response", + "$get_industries_response", + "$get_organization_feature_flags_response", + "$get_organization_response", + "$get_organization_users_response", + "$get_organizations_response", + "$get_organizations_user_permissions_response", + "$get_organizations_user_roles_response", + "$get_permissions_response", + "$get_properties_response", + "$get_property_values_response", + "$get_redirect_callback_urls_response", + "$get_role_response", + "$get_roles_response", + "$get_subscriber_response", + "$get_subscribers_response", + "$get_timezones_response", + "$get_webhooks_response", + "$identity", + "$logout_redirect_urls", + "$not_found_response", + "$organization_item_schema", + "$organization_user", + "$organization_user_permission", + "$organization_user_role", + "$organization_user_role_permissions", + "$organization_users", + "$permissions", + "$property", + "$property_value", + "$redirect_callback_urls", + "$role", + "$role_permissions_response", + "$roles", + "$subscriber", + "$subscribers_subscriber", + "$success_response", + "$token_error_response", + "$token_introspect", + "$update_environment_variable_response", + "$update_organization_users_response", + "$update_role_permissions_response", + "$update_user_response", + "$update_webhook_response", + "$user", + "$user_identity", + "$user_profile_v2", + "$users", + "$users_response", + "$webhook", + "ApIs", + "ApiError", + "Applications", + "Business", + "Callbacks", + "CancelError", + "CancelablePromise", + "ConnectedApps", + "Connections", + "EnvironmentVariables", + "Environments", + "FeatureFlags", + "Identities", + "Industries", + "Oauth", + "OpenAPI", + "Organizations", + "Permissions", + "Properties", + "PropertyCategories", + "Roles", + "Subscribers", + "Timezones", + "Users", + "Webhooks", + + // utils + "checkAudience", + "getToken", + "jwtDecode", + "jwtDecoder", + "setToken", + "validateToken", + + // init + "init", + ]; + + expect(actualExports.sort()).toEqual(expectedExports.sort()); + }); +});