@amohamud23/notihub 1.0.164 → 1.0.165
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.
- package/dist/index.cjs +35 -0
- package/dist/index.d.cts +12 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +36 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1051,6 +1051,41 @@ var CustomerMetaData = class _CustomerMetaData {
|
|
|
1051
1051
|
throw new Error("Could not fetch customer metadata");
|
|
1052
1052
|
}
|
|
1053
1053
|
}
|
|
1054
|
+
/**
|
|
1055
|
+
* Deletes customer metadata by its ID.
|
|
1056
|
+
* @param id - The ID of the customer metadata to delete.
|
|
1057
|
+
* @returns A promise that resolves when the customer metadata is deleted.
|
|
1058
|
+
*/
|
|
1059
|
+
static async deleteCustomerMetaDataById(id) {
|
|
1060
|
+
const command = new import_lib_dynamodb11.DeleteCommand({
|
|
1061
|
+
TableName: _CustomerMetaData.TABLE_NAME,
|
|
1062
|
+
Key: { id }
|
|
1063
|
+
});
|
|
1064
|
+
try {
|
|
1065
|
+
await ddbDocClient.send(command);
|
|
1066
|
+
} catch (error) {
|
|
1067
|
+
console.error("Error deleting customer metadata:", error);
|
|
1068
|
+
throw new Error("Could not delete customer metadata");
|
|
1069
|
+
}
|
|
1070
|
+
}
|
|
1071
|
+
/**
|
|
1072
|
+
* Retrieve customer metadata by customerId.
|
|
1073
|
+
* @param ids - An array of customer IDs to fetch metadata for.
|
|
1074
|
+
* @returns A promise that resolves to an array of customer metadata objects or null if not found.
|
|
1075
|
+
*/
|
|
1076
|
+
static async getCustomerMetaDataByCustomerId(customerId) {
|
|
1077
|
+
const command = new import_lib_dynamodb11.GetCommand({
|
|
1078
|
+
TableName: _CustomerMetaData.TABLE_NAME,
|
|
1079
|
+
Key: { customerId }
|
|
1080
|
+
});
|
|
1081
|
+
try {
|
|
1082
|
+
const result = await ddbDocClient.send(command);
|
|
1083
|
+
return result.Item || null;
|
|
1084
|
+
} catch (error) {
|
|
1085
|
+
console.error("Error fetching customer metadata by customerId:", error);
|
|
1086
|
+
throw new Error("Could not fetch customer metadata by customerId");
|
|
1087
|
+
}
|
|
1088
|
+
}
|
|
1054
1089
|
/**
|
|
1055
1090
|
* Creates or updates customer metadata.
|
|
1056
1091
|
* @param customerMetaData - The customer metadata object to create or update.
|
package/dist/index.d.cts
CHANGED
|
@@ -528,6 +528,18 @@ declare class CustomerMetaData {
|
|
|
528
528
|
* @returns A promise that resolves to the customer metadata object or null if not found.
|
|
529
529
|
*/
|
|
530
530
|
static getCustomerMetaDataById(id: string): Promise<INotiHubCustomerMetadata | null>;
|
|
531
|
+
/**
|
|
532
|
+
* Deletes customer metadata by its ID.
|
|
533
|
+
* @param id - The ID of the customer metadata to delete.
|
|
534
|
+
* @returns A promise that resolves when the customer metadata is deleted.
|
|
535
|
+
*/
|
|
536
|
+
static deleteCustomerMetaDataById(id: string): Promise<void>;
|
|
537
|
+
/**
|
|
538
|
+
* Retrieve customer metadata by customerId.
|
|
539
|
+
* @param ids - An array of customer IDs to fetch metadata for.
|
|
540
|
+
* @returns A promise that resolves to an array of customer metadata objects or null if not found.
|
|
541
|
+
*/
|
|
542
|
+
static getCustomerMetaDataByCustomerId(customerId: string): Promise<INotiHubCustomerMetadata | null>;
|
|
531
543
|
/**
|
|
532
544
|
* Creates or updates customer metadata.
|
|
533
545
|
* @param customerMetaData - The customer metadata object to create or update.
|
package/dist/index.d.ts
CHANGED
|
@@ -528,6 +528,18 @@ declare class CustomerMetaData {
|
|
|
528
528
|
* @returns A promise that resolves to the customer metadata object or null if not found.
|
|
529
529
|
*/
|
|
530
530
|
static getCustomerMetaDataById(id: string): Promise<INotiHubCustomerMetadata | null>;
|
|
531
|
+
/**
|
|
532
|
+
* Deletes customer metadata by its ID.
|
|
533
|
+
* @param id - The ID of the customer metadata to delete.
|
|
534
|
+
* @returns A promise that resolves when the customer metadata is deleted.
|
|
535
|
+
*/
|
|
536
|
+
static deleteCustomerMetaDataById(id: string): Promise<void>;
|
|
537
|
+
/**
|
|
538
|
+
* Retrieve customer metadata by customerId.
|
|
539
|
+
* @param ids - An array of customer IDs to fetch metadata for.
|
|
540
|
+
* @returns A promise that resolves to an array of customer metadata objects or null if not found.
|
|
541
|
+
*/
|
|
542
|
+
static getCustomerMetaDataByCustomerId(customerId: string): Promise<INotiHubCustomerMetadata | null>;
|
|
531
543
|
/**
|
|
532
544
|
* Creates or updates customer metadata.
|
|
533
545
|
* @param customerMetaData - The customer metadata object to create or update.
|
package/dist/index.js
CHANGED
|
@@ -1035,6 +1035,7 @@ var SubscriptionType_default = SubscriptionType;
|
|
|
1035
1035
|
|
|
1036
1036
|
// src/DynamoModels/CustomerMetaData.ts
|
|
1037
1037
|
import {
|
|
1038
|
+
DeleteCommand as DeleteCommand10,
|
|
1038
1039
|
GetCommand as GetCommand10,
|
|
1039
1040
|
PutCommand as PutCommand10
|
|
1040
1041
|
} from "@aws-sdk/lib-dynamodb";
|
|
@@ -1059,6 +1060,41 @@ var CustomerMetaData = class _CustomerMetaData {
|
|
|
1059
1060
|
throw new Error("Could not fetch customer metadata");
|
|
1060
1061
|
}
|
|
1061
1062
|
}
|
|
1063
|
+
/**
|
|
1064
|
+
* Deletes customer metadata by its ID.
|
|
1065
|
+
* @param id - The ID of the customer metadata to delete.
|
|
1066
|
+
* @returns A promise that resolves when the customer metadata is deleted.
|
|
1067
|
+
*/
|
|
1068
|
+
static async deleteCustomerMetaDataById(id) {
|
|
1069
|
+
const command = new DeleteCommand10({
|
|
1070
|
+
TableName: _CustomerMetaData.TABLE_NAME,
|
|
1071
|
+
Key: { id }
|
|
1072
|
+
});
|
|
1073
|
+
try {
|
|
1074
|
+
await ddbDocClient.send(command);
|
|
1075
|
+
} catch (error) {
|
|
1076
|
+
console.error("Error deleting customer metadata:", error);
|
|
1077
|
+
throw new Error("Could not delete customer metadata");
|
|
1078
|
+
}
|
|
1079
|
+
}
|
|
1080
|
+
/**
|
|
1081
|
+
* Retrieve customer metadata by customerId.
|
|
1082
|
+
* @param ids - An array of customer IDs to fetch metadata for.
|
|
1083
|
+
* @returns A promise that resolves to an array of customer metadata objects or null if not found.
|
|
1084
|
+
*/
|
|
1085
|
+
static async getCustomerMetaDataByCustomerId(customerId) {
|
|
1086
|
+
const command = new GetCommand10({
|
|
1087
|
+
TableName: _CustomerMetaData.TABLE_NAME,
|
|
1088
|
+
Key: { customerId }
|
|
1089
|
+
});
|
|
1090
|
+
try {
|
|
1091
|
+
const result = await ddbDocClient.send(command);
|
|
1092
|
+
return result.Item || null;
|
|
1093
|
+
} catch (error) {
|
|
1094
|
+
console.error("Error fetching customer metadata by customerId:", error);
|
|
1095
|
+
throw new Error("Could not fetch customer metadata by customerId");
|
|
1096
|
+
}
|
|
1097
|
+
}
|
|
1062
1098
|
/**
|
|
1063
1099
|
* Creates or updates customer metadata.
|
|
1064
1100
|
* @param customerMetaData - The customer metadata object to create or update.
|