@adtrackify/at-service-common 1.0.13 → 1.0.16
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/bitbucket-pipelines.yml +20 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +15 -0
- package/dist/index.js.map +2 -2
- package/package.json +7 -7
- package/src/clients/axios.d.ts +7 -7
- package/src/clients/dynamodb-client.ts +16 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
image: node:14.13.0
|
|
2
|
+
|
|
3
|
+
pipelines:
|
|
4
|
+
default:
|
|
5
|
+
- step:
|
|
6
|
+
caches:
|
|
7
|
+
- node
|
|
8
|
+
script:
|
|
9
|
+
- printf "//`node -p \"require('url').parse(process.env.NPM_REGISTRY_URL || 'https://registry.npmjs.org').host\"`/:_authToken=${NPM_TOKEN}\nregistry=${NPM_REGISTRY_URL:-https://registry.npmjs.org}\n" >> ~/.npmrc
|
|
10
|
+
- npm install
|
|
11
|
+
- npm run build:dev
|
|
12
|
+
branches:
|
|
13
|
+
master:
|
|
14
|
+
- step:
|
|
15
|
+
deployment: prod
|
|
16
|
+
caches:
|
|
17
|
+
- node
|
|
18
|
+
script:
|
|
19
|
+
- printf "//`node -p \"require('url').parse(process.env.NPM_REGISTRY_URL || 'https://registry.npmjs.org').host\"`/:_authToken=${NPM_TOKEN}\nregistry=${NPM_REGISTRY_URL:-https://registry.npmjs.org}\n" >> ~/.npmrc
|
|
20
|
+
- npm run push
|
package/dist/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ declare module '@adtrackify/at-service-common/clients/dynamodb-client' {
|
|
|
3
3
|
export class DynamoDbClient {
|
|
4
4
|
static safeGet: (tableName: string, keyName: string, keyValue: any) => Promise<AWS.DynamoDB.DocumentClient.AttributeMap | null>;
|
|
5
5
|
static safePut: (tableName: string, data: any) => Promise<import("aws-sdk/lib/request").PromiseResult<AWS.DynamoDB.DocumentClient.PutItemOutput, AWS.AWSError> | null>;
|
|
6
|
+
static safeDelete: (tableName: string, keyName: string, keyValue: any) => Promise<import("aws-sdk/lib/request").PromiseResult<AWS.DynamoDB.DocumentClient.DeleteItemOutput, AWS.AWSError> | null>;
|
|
6
7
|
static safeBatchGet: (tableName: string, keys: any) => Promise<AWS.DynamoDB.DocumentClient.ItemList>;
|
|
7
8
|
static queryAll: (params: any) => Promise<any[] | null>;
|
|
8
9
|
static batchGet: (params: any) => Promise<import("aws-sdk/lib/request").PromiseResult<AWS.DynamoDB.DocumentClient.BatchGetItemOutput, AWS.AWSError>>;
|
package/dist/index.js
CHANGED
|
@@ -627966,6 +627966,21 @@ __publicField(DynamoDbClient, "safePut", async (tableName, data) => {
|
|
|
627966
627966
|
return null;
|
|
627967
627967
|
}
|
|
627968
627968
|
});
|
|
627969
|
+
__publicField(DynamoDbClient, "safeDelete", async (tableName, keyName, keyValue) => {
|
|
627970
|
+
try {
|
|
627971
|
+
const params = {
|
|
627972
|
+
TableName: tableName,
|
|
627973
|
+
Key: {
|
|
627974
|
+
[keyName]: keyValue
|
|
627975
|
+
}
|
|
627976
|
+
};
|
|
627977
|
+
const res = await client.delete(params).promise();
|
|
627978
|
+
return res;
|
|
627979
|
+
} catch (e) {
|
|
627980
|
+
log.error(e, { message: "Dynamo failed safeDelete" });
|
|
627981
|
+
return null;
|
|
627982
|
+
}
|
|
627983
|
+
});
|
|
627969
627984
|
__publicField(DynamoDbClient, "safeBatchGet", async (tableName, keys) => {
|
|
627970
627985
|
try {
|
|
627971
627986
|
const params = {
|