Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/pipes/fixtures/connected-account.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
"user_id": "user_01EHZNVPK3SFK441A1RGBFSHRT",
"organization_id": null,
"scopes": ["repo", "user:email"],
"auth_method": "oauth",
"api_key_last_4": null,
"state": "connected",
"created_at": "2024-01-16T14:20:00.000Z",
"updated_at": "2024-01-16T14:20:00.000Z"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@
"expires_at": "2025-12-31T23:59:59.000Z",
"scopes": ["repo", "user:email"],
"missing_scopes": []
}
},
"error": "not_installed"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"object": "credential",
"auth_method": "oauth",
"value": "gho_16C7e42F292c6912E7710c838347Ae178B4a",
"expires_at": "2025-12-31T23:59:59.000Z",
"scopes": ["repo", "user:email"],
"missing_scopes": []
}
12 changes: 12 additions & 0 deletions src/pipes/fixtures/data-integration-credentials-response.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"active": true,
"credential": {
"object": "credential",
"auth_method": "oauth",
"value": "gho_16C7e42F292c6912E7710c838347Ae178B4a",
"expires_at": "2025-12-31T23:59:59.000Z",
"scopes": ["repo", "user:email"],
"missing_scopes": []
},
"error": "not_installed"
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
"user_id": "user_01EHZNVPK3SFK441A1RGBFSHRT",
"organization_id": "test_organizationId",
"scopes": ["repo", "user:email"],
"auth_method": "oauth",
"api_key_last_4": null,
"state": "connected",
"created_at": "test_createdAt",
"updated_at": "test_updatedAt",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"integration_type": "test_integrationType",
"credentials_type": "test_credentialsType",
"scopes": ["repo", "user:email"],
"auth_methods": ["oauth"],
"ownership": "userland_user",
"created_at": "test_createdAt",
"updated_at": "test_updatedAt",
Expand All @@ -16,6 +17,8 @@
"user_id": "user_01EHZNVPK3SFK441A1RGBFSHRT",
"organization_id": "test_organizationId",
"scopes": ["repo", "user:email"],
"auth_method": "oauth",
"api_key_last_4": null,
"state": "connected",
"created_at": "test_createdAt",
"updated_at": "test_updatedAt",
Expand Down
3 changes: 3 additions & 0 deletions src/pipes/fixtures/data-integrations-list-response.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"integration_type": "test_integrationType",
"credentials_type": "test_credentialsType",
"scopes": ["repo", "user:email"],
"auth_methods": ["oauth"],
"ownership": "userland_user",
"created_at": "test_createdAt",
"updated_at": "test_updatedAt",
Expand All @@ -19,6 +20,8 @@
"user_id": "user_01EHZNVPK3SFK441A1RGBFSHRT",
"organization_id": "test_organizationId",
"scopes": ["repo", "user:email"],
"auth_method": "oauth",
"api_key_last_4": null,
"state": "connected",
"created_at": "test_createdAt",
"updated_at": "test_updatedAt",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"user_id": "user_01EHZNVPK3SFK441A1RGBFSHRT",
"organization_id": "org_01EHZNVPK3SFK441A1RGBFSHRT",
"secret": "sk-1234567890abcdef"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"user_id": "user_01EHZNVPK3SFK441A1RGBFSHRT",
"organization_id": "org_01EHZNVPK3SFK441A1RGBFSHRT"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// This file is auto-generated by oagen. Do not edit.

export const ConnectedAccountAuthMethod = {
OAuth: 'oauth',
ApiKey: 'api_key',
} as const;

export type ConnectedAccountAuthMethod =
(typeof ConnectedAccountAuthMethod)[keyof typeof ConnectedAccountAuthMethod];
7 changes: 7 additions & 0 deletions src/pipes/interfaces/connected-account.interface.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// This file is auto-generated by oagen. Do not edit.

import type { ConnectedAccountAuthMethod } from './connected-account-auth-method.interface';
import type { ConnectedAccountState } from './connected-account-state.interface';

export interface ConnectedAccount {
Expand All @@ -13,6 +14,10 @@ export interface ConnectedAccount {
organizationId: string | null;
/** The OAuth scopes granted for this connection. */
scopes: string[];
/** The authentication method used for this connection (`oauth` or `api_key`). Defaults to `oauth` if absent. */
authMethod?: ConnectedAccountAuthMethod;
/** The last four characters of the API key, or `null` for OAuth connections. */
apiKeyLast4?: string | null;
/**
* The state of the connected account:
* - `connected`: The connection is active and tokens are valid.
Expand All @@ -32,6 +37,8 @@ export interface ConnectedAccountResponse {
user_id: string | null;
organization_id: string | null;
scopes: string[];
auth_method?: ConnectedAccountAuthMethod;
api_key_last_4?: string | null;
state: ConnectedAccountState;
created_at: string;
updated_at: string;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// This file is auto-generated by oagen. Do not edit.

export interface CreateDataIntegrationCredentialOptions {
/** The identifier of the integration. */
slug: string;
/** A [User](https://workos.com/docs/reference/authkit/user) identifier. */
userId: string;
/** An [Organization](https://workos.com/docs/reference/organization) identifier. Optional parameter to scope the connection to a specific organization. */
organizationId?: string;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// This file is auto-generated by oagen. Do not edit.

/** The credential object containing the vended secret. */
export interface DataIntegrationCredentialsResponseCredential {
/** Distinguishes the credential object. */
object: 'credential';
/** The authentication method for this credential. Additional values may be added in the future; handle unknown values gracefully. */
authMethod: 'oauth';
/** The OAuth access token. */
value: string;
/** The ISO-8601 formatted timestamp indicating when the credential expires. */
expiresAt: string | null;
/** The scopes granted to the access token. */
scopes: string[];
/** If the integration has requested scopes that aren't present on the access token, they're listed here. */
missingScopes: string[];
}

export interface DataIntegrationCredentialsResponseCredentialResponse {
object: 'credential';
auth_method: 'oauth';
value: string;
expires_at: string | null;
scopes: string[];
missing_scopes: string[];
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// This file is auto-generated by oagen. Do not edit.

export const DataIntegrationCredentialsResponseError = {
NotInstalled: 'not_installed',
NeedsReauthorization: 'needs_reauthorization',
} as const;

export type DataIntegrationCredentialsResponseError =
(typeof DataIntegrationCredentialsResponseError)[keyof typeof DataIntegrationCredentialsResponseError];
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// This file is auto-generated by oagen. Do not edit.

import type {
DataIntegrationCredentialsResponseCredential,
DataIntegrationCredentialsResponseCredentialResponse,
} from './data-integration-credentials-response-credential.interface';
import type { DataIntegrationCredentialsResponseError } from './data-integration-credentials-response-error.interface';

export interface DataIntegrationCredentialsResponse {
/** Indicates credentials are available. */
active?: true;
/** The credential object containing the vended secret. */
credential?: DataIntegrationCredentialsResponseCredential;
/**
* The reason credentials are unavailable. Additional values may be added in the future; handle unknown values gracefully.
* - `"not_installed"`: The user does not have the integration installed.
* - `"needs_reauthorization"`: The user needs to reauthorize the integration.
*/
error?: DataIntegrationCredentialsResponseError;
}

export interface DataIntegrationCredentialsResponseWire {
active?: true;
credential?: DataIntegrationCredentialsResponseCredentialResponse;
error?: DataIntegrationCredentialsResponseError;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// This file is auto-generated by oagen. Do not edit.

export const DataIntegrationsListResponseDataAuthMethods = {
OAuth: 'oauth',
ApiKey: 'api_key',
} as const;

export type DataIntegrationsListResponseDataAuthMethods =
(typeof DataIntegrationsListResponseDataAuthMethods)[keyof typeof DataIntegrationsListResponseDataAuthMethods];
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// This file is auto-generated by oagen. Do not edit.

export const DataIntegrationsListResponseDataConnectedAccountAuthMethod = {
OAuth: 'oauth',
ApiKey: 'api_key',
} as const;

export type DataIntegrationsListResponseDataConnectedAccountAuthMethod =
(typeof DataIntegrationsListResponseDataConnectedAccountAuthMethod)[keyof typeof DataIntegrationsListResponseDataConnectedAccountAuthMethod];
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// This file is auto-generated by oagen. Do not edit.

import type { DataIntegrationsListResponseDataConnectedAccountAuthMethod } from './data-integrations-list-response-data-connected-account-auth-method.interface';
import type { DataIntegrationsListResponseDataConnectedAccountState } from './data-integrations-list-response-data-connected-account-state.interface';

export interface DataIntegrationsListResponseDataConnectedAccount {
Expand All @@ -13,6 +14,10 @@ export interface DataIntegrationsListResponseDataConnectedAccount {
organizationId: string | null;
/** The OAuth scopes granted for this connection. */
scopes: string[];
/** The authentication method used for this connection (`oauth` or `api_key`). Defaults to `oauth` if absent. */
authMethod?: DataIntegrationsListResponseDataConnectedAccountAuthMethod;
/** The last four characters of the API key, or `null` for OAuth connections. */
apiKeyLast4?: string | null;
/**
* The state of the connected account:
* - `connected`: The connection is active and tokens are valid.
Expand All @@ -37,6 +42,8 @@ export interface DataIntegrationsListResponseDataConnectedAccountResponse {
user_id: string | null;
organization_id: string | null;
scopes: string[];
auth_method?: DataIntegrationsListResponseDataConnectedAccountAuthMethod;
api_key_last_4?: string | null;
state: DataIntegrationsListResponseDataConnectedAccountState;
created_at: string;
updated_at: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import type {
DataIntegrationsListResponseDataConnectedAccount,
DataIntegrationsListResponseDataConnectedAccountResponse,
} from './data-integrations-list-response-data-connected-account.interface';
import type { DataIntegrationsListResponseDataAuthMethods } from './data-integrations-list-response-data-auth-methods.interface';
import type { DataIntegrationsListResponseDataOwnership } from './data-integrations-list-response-data-ownership.interface';

export interface DataIntegrationsListResponseData {
Expand All @@ -23,6 +24,8 @@ export interface DataIntegrationsListResponseData {
credentialsType: string;
/** The OAuth scopes configured for this provider, or `null` if none are configured. */
scopes: string[] | null;
/** The authentication methods supported by this provider (`oauth`, `api_key`, or both). Defaults to `["oauth"]` if absent. */
authMethods?: DataIntegrationsListResponseDataAuthMethods[];
/** Whether the provider is owned by a user or organization. */
ownership: DataIntegrationsListResponseDataOwnership;
/** The timestamp when the provider was created. */
Expand All @@ -42,6 +45,7 @@ export interface DataIntegrationsListResponseDataResponse {
integration_type: string;
credentials_type: string;
scopes: string[] | null;
auth_methods?: DataIntegrationsListResponseDataAuthMethods[];
ownership: DataIntegrationsListResponseDataOwnership;
created_at: string;
updated_at: string;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// This file is auto-generated by oagen. Do not edit.

export interface DataIntegrationsUpsertApiKeyRequest {
/** A [User](https://workos.com/docs/reference/authkit/user) identifier. */
userId: string;
/** An [Organization](https://workos.com/docs/reference/organization) identifier. Optional parameter to scope the connection to a specific organization. */
organizationId?: string;
/** The API key secret to store for this integration. */
secret: string;
}

export interface DataIntegrationsUpsertApiKeyRequestResponse {
user_id: string;
organization_id?: string;
secret: string;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// This file is auto-generated by oagen. Do not edit.

export interface DataIntegrationsVendCredentialsRequest {
/** A [User](https://workos.com/docs/reference/authkit/user) identifier. */
userId: string;
/** An [Organization](https://workos.com/docs/reference/organization) identifier. Optional parameter to scope the connection to a specific organization. */
organizationId?: string;
}

export interface DataIntegrationsVendCredentialsRequestResponse {
user_id: string;
organization_id?: string;
}
10 changes: 10 additions & 0 deletions src/pipes/interfaces/get-access-token-options.interface.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// This file is auto-generated by oagen. Do not edit.

export interface GetAccessTokenOptions {
/** The identifier of the integration. */
provider: string;
/** A [User](https://workos.com/docs/reference/authkit/user) identifier. */
userId: string;
/** An [Organization](https://workos.com/docs/reference/organization) identifier. Optional parameter to scope the connection to a specific organization. */
organizationId?: string | null;
}
11 changes: 10 additions & 1 deletion src/pipes/interfaces/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,30 @@

export * from './access-token.interface';
export * from './authorize-data-integration-options.interface';
export * from './connected-account-auth-method.interface';
export * from './connected-account-state.interface';
export * from './connected-account.interface';
export * from './create-data-integration-credential-options.interface';
export * from './create-data-integration-token-options.interface';
export * from './data-integration-access-token-response-access-token.interface';
export * from './data-integration-access-token-response-error.interface';
export * from './data-integration-access-token-response.interface';
export * from './data-integration-authorize-url-response.interface';
export * from './data-integration-credentials-response-credential.interface';
export * from './data-integration-credentials-response-error.interface';
export * from './data-integrations-get-data-integration-authorize-url-request.interface';
export * from './data-integrations-get-user-token-request.interface';
export * from './data-integrations-list-response-data-auth-methods.interface';
export * from './data-integrations-list-response-data-connected-account-auth-method.interface';
export * from './data-integrations-list-response-data-connected-account-state.interface';
export * from './data-integrations-list-response-data-connected-account.interface';
export * from './data-integrations-list-response-data-ownership.interface';
export * from './data-integrations-list-response-data.interface';
export * from './data-integrations-list-response.interface';
export * from './data-integrations-upsert-api-key-request.interface';
export * from './data-integrations-vend-credentials-request.interface';
export * from './delete-user-connected-account-options.interface';
export * from './get-access-token.interface';
export * from './get-access-token-options.interface';
export * from './get-user-connected-account-options.interface';
export * from './list-user-data-providers-options.interface';
export * from './update-data-integration-api-key-options.interface';
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// This file is auto-generated by oagen. Do not edit.

export interface UpdateDataIntegrationApiKeyOptions {
/** The identifier of the integration. */
slug: string;
/** A [User](https://workos.com/docs/reference/authkit/user) identifier. */
userId: string;
/** An [Organization](https://workos.com/docs/reference/organization) identifier. Optional parameter to scope the connection to a specific organization. */
organizationId?: string;
/** The API key secret to store for this integration. */
secret: string;
}
Loading