80 lines
2.0 KiB
TypeScript
80 lines
2.0 KiB
TypeScript
import { createAction, props } from '@ngrx/store';
|
|
import { ApiKey, CreateApiKeyRequest, CreateApiKeyResponse } from '../api-keys/models/api-key.model';
|
|
|
|
export const loadApiKeys = createAction(
|
|
'[ApiKey] Load Keys',
|
|
props<{ ownerId?: string }>()
|
|
);
|
|
|
|
export const loadApiKeysSuccess = createAction(
|
|
'[ApiKey] Load Keys Success',
|
|
props<{ keys: ApiKey[] }>()
|
|
);
|
|
|
|
export const loadApiKeysFailure = createAction(
|
|
'[ApiKey] Load Keys Failure',
|
|
props<{ error: string }>()
|
|
);
|
|
|
|
export const createApiKey = createAction(
|
|
'[ApiKey] Create Key',
|
|
props<{ request: CreateApiKeyRequest }>()
|
|
);
|
|
|
|
export const createApiKeySuccess = createAction(
|
|
'[ApiKey] Create Key Success',
|
|
props<{ response: CreateApiKeyResponse }>()
|
|
);
|
|
|
|
export const createApiKeyFailure = createAction(
|
|
'[ApiKey] Create Key Failure',
|
|
props<{ error: string }>()
|
|
);
|
|
|
|
export const revokeApiKey = createAction(
|
|
'[ApiKey] Revoke Key',
|
|
props<{ keyId: string; ownerId?: string }>()
|
|
);
|
|
|
|
export const revokeApiKeySuccess = createAction(
|
|
'[ApiKey] Revoke Key Success',
|
|
props<{ keyId: string; ownerId?: string }>()
|
|
);
|
|
|
|
export const revokeApiKeyFailure = createAction(
|
|
'[ApiKey] Revoke Key Failure',
|
|
props<{ error: string }>()
|
|
);
|
|
|
|
export const dismissNewKey = createAction('[ApiKey] Dismiss New Key');
|
|
|
|
export const deleteApiKey = createAction(
|
|
'[ApiKey] Delete Key',
|
|
props<{ keyId: string; ownerId?: string }>()
|
|
);
|
|
|
|
export const deleteApiKeySuccess = createAction(
|
|
'[ApiKey] Delete Key Success',
|
|
props<{ keyId: string; ownerId?: string }>()
|
|
);
|
|
|
|
export const deleteApiKeyFailure = createAction(
|
|
'[ApiKey] Delete Key Failure',
|
|
props<{ error: string }>()
|
|
);
|
|
|
|
export const regenerateApiKey = createAction(
|
|
'[ApiKey] Regenerate Key',
|
|
props<{ keyId: string; ownerId?: string }>()
|
|
);
|
|
|
|
export const regenerateApiKeySuccess = createAction(
|
|
'[ApiKey] Regenerate Key Success',
|
|
props<{ response: CreateApiKeyResponse; ownerId?: string }>()
|
|
);
|
|
|
|
export const regenerateApiKeyFailure = createAction(
|
|
'[ApiKey] Regenerate Key Failure',
|
|
props<{ error: string }>()
|
|
);
|