@spytecgps/nova-orm 0.0.166 → 0.0.168

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.
@@ -0,0 +1,5 @@
1
+ import { CustomerAttribute } from '../../entities/customerAttribute';
2
+ import { NovaDataSource } from '../../novaDataSource';
3
+ import { CreateCustomerAttributeParams } from '../../types/clients';
4
+ import { Logger } from '../../types/logger';
5
+ export declare const createCustomerAttribute: (novaDataSource: NovaDataSource, params: CreateCustomerAttributeParams, logger: Logger) => Promise<CustomerAttribute>;
@@ -0,0 +1,5 @@
1
+ import { CustomerAttribute } from '../../entities';
2
+ import { NovaDataSource } from '../../novaDataSource';
3
+ import { GetCustomerAttributeParams } from '../../types/clients';
4
+ import { Logger } from '../../types/logger';
5
+ export declare const getCustomerAttribute: (novaDataSource: NovaDataSource, params: GetCustomerAttributeParams, logger: Logger) => Promise<CustomerAttribute>;
@@ -1,5 +1,6 @@
1
1
  import { Client, ClientConfiguration } from '../../entities';
2
- import { CreateClientConfigurationParams, CreateClientParams, DeleteClientParams, GetClientConfigurationParams, GetClientParams, GetClientsParams, UpdateClientConfigurationParams, UpdateClientParams } from '../../types/clients';
2
+ import { CustomerAttribute } from '../../entities/customerAttribute';
3
+ import { CreateClientConfigurationParams, CreateClientParams, CreateCustomerAttributeParams, DeleteClientParams, GetClientConfigurationParams, GetClientParams, GetClientsParams, GetCustomerAttributeParams, UpdateClientConfigurationParams, UpdateClientParams, UpdateCustomerAttributeParams } from '../../types/clients';
3
4
  import { BaseRepository } from '../baseRepository';
4
5
  export declare class ClientsRepository extends BaseRepository {
5
6
  /**
@@ -90,4 +91,27 @@ export declare class ClientsRepository extends BaseRepository {
90
91
  * @returns {Promise<boolean>} True if the client configuration was updated, false otherwise
91
92
  */
92
93
  updateClientConfiguration(params: UpdateClientConfigurationParams): Promise<boolean>;
94
+ /**
95
+ * Create a customer attribute for a client
96
+ * @param {CreateCustomerAttributeParams} params containing information to create a customer attribute
97
+ * - clientId: The client id
98
+ * - enterprise: The enterprise, optional
99
+ * - maintenanceModule: The maintenance module, optional
100
+ */
101
+ createCustomerAttribute(params: CreateCustomerAttributeParams): Promise<CustomerAttribute>;
102
+ /**
103
+ * Update a customer attribute for a client
104
+ * @param {UpdateCustomerAttributeParams} params containing information to update a customer attribute
105
+ * - filters.clientId: The client id
106
+ * - enterprise: The enterprise, optional
107
+ * - maintenanceModule: The maintenance module, optional
108
+ * @returns {Promise<boolean>} True if the customer attribute was updated, false otherwise
109
+ */
110
+ updateCustomerAttribute(params: UpdateCustomerAttributeParams): Promise<boolean>;
111
+ /**
112
+ * Get a costumer attribute for a client
113
+ * @param {GetCustomerAttributeParams} params containing information to get a customer attribute
114
+ * - filters.clientId: The client id
115
+ */
116
+ getCustomerAttribute(params: GetCustomerAttributeParams): Promise<CustomerAttribute>;
93
117
  }
@@ -0,0 +1,4 @@
1
+ import { NovaDataSource } from '../../novaDataSource';
2
+ import { UpdateCustomerAttributeParams } from '../../types/clients';
3
+ import { Logger } from '../../types/logger';
4
+ export declare const updateCustomerAttribute: (novaDataSource: NovaDataSource, params: UpdateCustomerAttributeParams, logger: Logger) => Promise<boolean>;
@@ -1,13 +1,11 @@
1
- import { EntitySubscriberInterface, InsertEvent, RemoveEvent, UpdateEvent } from 'typeorm';
1
+ import { EntitySubscriberInterface, RemoveEvent } from 'typeorm';
2
2
  export declare class AllEntitiesSubscriber implements EntitySubscriberInterface<any> {
3
3
  /**
4
4
  * Called after entity insertion.
5
5
  */
6
- afterInsert(event: InsertEvent<any>): void;
7
6
  /**
8
7
  * Called after entity update.
9
8
  */
10
- afterUpdate(event: UpdateEvent<any>): void;
11
9
  /**
12
10
  * Called after entity removal.
13
11
  */
@@ -76,3 +76,22 @@ export interface UpdateClientConfigurationParams {
76
76
  maxUsersAllowed?: number;
77
77
  };
78
78
  }
79
+ export interface CreateCustomerAttributeParams {
80
+ clientId: number;
81
+ enterprise?: boolean;
82
+ maintenanceModule?: boolean;
83
+ }
84
+ export interface UpdateCustomerAttributeParams {
85
+ filters: {
86
+ clientId: number;
87
+ };
88
+ values: {
89
+ enterprise?: boolean;
90
+ maintenanceModule?: boolean;
91
+ };
92
+ }
93
+ export interface GetCustomerAttributeParams {
94
+ filters: {
95
+ clientId: number;
96
+ };
97
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spytecgps/nova-orm",
3
- "version": "0.0.166",
3
+ "version": "0.0.168",
4
4
  "description": "ORM with PlanetScale",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",