triangle-utils 1.4.62 → 1.4.64

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.
@@ -15,7 +15,6 @@ export class UtilsBee {
15
15
  url: url,
16
16
  params: params
17
17
  });
18
- console.log(response.data);
19
18
  if (response.data instanceof Buffer) {
20
19
  return response.data;
21
20
  }
@@ -7,8 +7,8 @@ export declare class UtilsDynamoDB {
7
7
  undefined_attribute_names?: string[];
8
8
  defined_attribute_names?: string[];
9
9
  attribute_names?: string[];
10
- segment?: number;
11
- concurrency?: number;
10
+ segment_id?: number;
11
+ num_segments?: number;
12
12
  }): Promise<Record<string, any>[]>;
13
13
  get(table: string, key: Record<string, any>, consistent?: boolean): Promise<Record<string, any> | undefined>;
14
14
  get_max(table_index_name: string, primary_key: Record<string, string | number>): Promise<Record<string, any> | undefined>;
@@ -104,11 +104,11 @@ export class UtilsDynamoDB {
104
104
  const filters = options.filters !== undefined ? options.filters : {};
105
105
  const undefined_attribute_names = options.undefined_attribute_names !== undefined ? options.undefined_attribute_names : [];
106
106
  const defined_attribute_names = options.defined_attribute_names !== undefined ? options.defined_attribute_names : [];
107
- const concurrency = options.concurrency !== undefined ? options.concurrency : 1;
107
+ const num_segments = options.num_segments !== undefined ? options.num_segments : 1;
108
108
  const attribute_names = options.attribute_names !== undefined ? options.attribute_names : [];
109
109
  const iterators = [];
110
- for (let i = 0; i < concurrency; i++) {
111
- if (options.segment !== undefined && i !== options.segment) {
110
+ for (let i = 0; i < num_segments; i++) {
111
+ if (options.segment_id !== undefined && i !== options.segment_id) {
112
112
  continue;
113
113
  }
114
114
  const expression_attribute_names = Object.fromEntries([...Object.keys(filters), ...attribute_names, ...undefined_attribute_names, ...defined_attribute_names]
@@ -130,7 +130,7 @@ export class UtilsDynamoDB {
130
130
  FilterExpression: filter_expression.length > 0 ? filter_expression : undefined,
131
131
  ProjectionExpression: projection_expression.length > 0 ? projection_expression : undefined,
132
132
  Segment: i,
133
- TotalSegments: concurrency
133
+ TotalSegments: num_segments
134
134
  };
135
135
  iterators.push(compile_pages(request, (request) => this.dynamodb.scan(request)));
136
136
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "triangle-utils",
3
- "version": "1.4.62",
3
+ "version": "1.4.64",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "directories": {
package/src/UtilsBee.ts CHANGED
@@ -19,7 +19,6 @@ export class UtilsBee {
19
19
  url : url,
20
20
  params : params
21
21
  })
22
- console.log(response.data)
23
22
  if (response.data instanceof Buffer) {
24
23
  return response.data
25
24
  }
@@ -112,8 +112,8 @@ export class UtilsDynamoDB {
112
112
  undefined_attribute_names? : string[],
113
113
  defined_attribute_names? : string[],
114
114
  attribute_names? : string[],
115
- segment? : number
116
- concurrency? : number
115
+ segment_id? : number
116
+ num_segments? : number
117
117
  } = {}
118
118
  ) : Promise<Record<string, any>[]> {
119
119
  const table_name : string = table_index_name.split(":")[0]
@@ -121,11 +121,11 @@ export class UtilsDynamoDB {
121
121
  const filters = options.filters !== undefined ? options.filters : {}
122
122
  const undefined_attribute_names : string[] = options.undefined_attribute_names !== undefined ? options.undefined_attribute_names : []
123
123
  const defined_attribute_names : string[] = options.defined_attribute_names !== undefined ? options.defined_attribute_names : []
124
- const concurrency : number = options.concurrency !== undefined ? options.concurrency : 1
124
+ const num_segments : number = options.num_segments !== undefined ? options.num_segments : 1
125
125
  const attribute_names : string[] = options.attribute_names !== undefined ? options.attribute_names : []
126
126
  const iterators = []
127
- for (let i = 0; i < concurrency; i++) {
128
- if (options.segment !== undefined && i !== options.segment) {
127
+ for (let i = 0; i < num_segments; i++) {
128
+ if (options.segment_id !== undefined && i !== options.segment_id) {
129
129
  continue
130
130
  }
131
131
  const expression_attribute_names = Object.fromEntries(
@@ -151,7 +151,7 @@ export class UtilsDynamoDB {
151
151
  FilterExpression : filter_expression.length > 0 ? filter_expression : undefined,
152
152
  ProjectionExpression : projection_expression.length > 0 ? projection_expression : undefined,
153
153
  Segment : i,
154
- TotalSegments : concurrency
154
+ TotalSegments : num_segments
155
155
  }
156
156
  iterators.push(compile_pages(request, (request : ScanCommandInput) => this.dynamodb.scan(request)))
157
157
  }