@aws-amplify/geo 1.2.1 → 1.2.2-geo.3
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/aws-amplify-geo.js +1062 -51
- package/dist/aws-amplify-geo.js.map +1 -1
- package/dist/aws-amplify-geo.min.js +6 -6
- package/dist/aws-amplify-geo.min.js.map +1 -1
- package/lib/Geo.d.ts +36 -3
- package/lib/Geo.js +170 -5
- package/lib/Geo.js.map +1 -1
- package/lib/Providers/AmazonLocationServiceProvider.d.ts +37 -1
- package/lib/Providers/AmazonLocationServiceProvider.js +409 -8
- package/lib/Providers/AmazonLocationServiceProvider.js.map +1 -1
- package/lib/types/AmazonLocationServiceProvider.d.ts +21 -1
- package/lib/types/Geo.d.ts +48 -1
- package/lib/types/Provider.d.ts +5 -1
- package/lib/types/Provider.js +0 -12
- package/lib/types/Provider.js.map +1 -1
- package/lib/util.d.ts +6 -0
- package/lib/util.js +163 -0
- package/lib/util.js.map +1 -0
- package/lib-esm/Geo.d.ts +36 -3
- package/lib-esm/Geo.js +170 -5
- package/lib-esm/Geo.js.map +1 -1
- package/lib-esm/Providers/AmazonLocationServiceProvider.d.ts +37 -1
- package/lib-esm/Providers/AmazonLocationServiceProvider.js +410 -9
- package/lib-esm/Providers/AmazonLocationServiceProvider.js.map +1 -1
- package/lib-esm/types/AmazonLocationServiceProvider.d.ts +21 -1
- package/lib-esm/types/Geo.d.ts +48 -1
- package/lib-esm/types/Provider.d.ts +5 -1
- package/lib-esm/types/Provider.js +0 -12
- package/lib-esm/types/Provider.js.map +1 -1
- package/lib-esm/util.d.ts +6 -0
- package/lib-esm/util.js +156 -0
- package/lib-esm/util.js.map +1 -0
- package/package.json +5 -4
- package/src/Geo.ts +144 -2
- package/src/Providers/AmazonLocationServiceProvider.ts +409 -6
- package/src/types/AmazonLocationServiceProvider.ts +56 -1
- package/src/types/Geo.ts +72 -2
- package/src/types/Provider.ts +31 -1
- package/src/util.ts +182 -0
|
@@ -34,6 +34,26 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
34
34
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
35
35
|
}
|
|
36
36
|
};
|
|
37
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
38
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
39
|
+
if (!m) return o;
|
|
40
|
+
var i = m.call(o), r, ar = [], e;
|
|
41
|
+
try {
|
|
42
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
43
|
+
}
|
|
44
|
+
catch (error) { e = { error: error }; }
|
|
45
|
+
finally {
|
|
46
|
+
try {
|
|
47
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
48
|
+
}
|
|
49
|
+
finally { if (e) throw e.error; }
|
|
50
|
+
}
|
|
51
|
+
return ar;
|
|
52
|
+
};
|
|
53
|
+
var __spread = (this && this.__spread) || function () {
|
|
54
|
+
for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));
|
|
55
|
+
return ar;
|
|
56
|
+
};
|
|
37
57
|
/*
|
|
38
58
|
* Copyright 2017-2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
39
59
|
*
|
|
@@ -48,7 +68,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
48
68
|
*/
|
|
49
69
|
import camelcaseKeys from 'camelcase-keys';
|
|
50
70
|
import { ConsoleLogger as Logger, Credentials, getAmplifyUserAgent, } from '@aws-amplify/core';
|
|
51
|
-
import { LocationClient, SearchPlaceIndexForTextCommand, SearchPlaceIndexForSuggestionsCommand, SearchPlaceIndexForPositionCommand, } from '@aws-sdk/client-location';
|
|
71
|
+
import { LocationClient, SearchPlaceIndexForTextCommand, SearchPlaceIndexForSuggestionsCommand, SearchPlaceIndexForPositionCommand, BatchPutGeofenceCommand, GetGeofenceCommand, ListGeofencesCommand, BatchDeleteGeofenceCommand, } from '@aws-sdk/client-location';
|
|
52
72
|
var logger = new Logger('AmazonLocationServiceProvider');
|
|
53
73
|
var AmazonLocationServiceProvider = /** @class */ (function () {
|
|
54
74
|
/**
|
|
@@ -299,12 +319,322 @@ var AmazonLocationServiceProvider = /** @class */ (function () {
|
|
|
299
319
|
});
|
|
300
320
|
});
|
|
301
321
|
};
|
|
322
|
+
/**
|
|
323
|
+
* Create geofences inside of a geofence collection
|
|
324
|
+
* @param geofences - Array of geofence objects to create
|
|
325
|
+
* @param options? - Optional parameters for creating geofences
|
|
326
|
+
* @returns {Promise<AmazonLocationServiceSaveGeofencesResults>} - Promise that resolves to an object with:
|
|
327
|
+
* successes: list of geofences successfully created
|
|
328
|
+
* errors: list of geofences that failed to create
|
|
329
|
+
*/
|
|
330
|
+
AmazonLocationServiceProvider.prototype.saveGeofences = function (geofences, options) {
|
|
331
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
332
|
+
var credentialsOK, PascalGeofences, results, batches;
|
|
333
|
+
var _this = this;
|
|
334
|
+
return __generator(this, function (_a) {
|
|
335
|
+
switch (_a.label) {
|
|
336
|
+
case 0: return [4 /*yield*/, this._ensureCredentials()];
|
|
337
|
+
case 1:
|
|
338
|
+
credentialsOK = _a.sent();
|
|
339
|
+
if (!credentialsOK) {
|
|
340
|
+
throw new Error('No credentials');
|
|
341
|
+
}
|
|
342
|
+
try {
|
|
343
|
+
this._verifyGeofenceCollections(options === null || options === void 0 ? void 0 : options.collectionName);
|
|
344
|
+
}
|
|
345
|
+
catch (error) {
|
|
346
|
+
logger.debug(error);
|
|
347
|
+
throw error;
|
|
348
|
+
}
|
|
349
|
+
PascalGeofences = geofences.map(function (_a) {
|
|
350
|
+
var geofenceId = _a.geofenceId, polygon = _a.geometry.polygon;
|
|
351
|
+
return {
|
|
352
|
+
GeofenceId: geofenceId,
|
|
353
|
+
Geometry: {
|
|
354
|
+
Polygon: polygon,
|
|
355
|
+
},
|
|
356
|
+
};
|
|
357
|
+
});
|
|
358
|
+
results = {
|
|
359
|
+
successes: [],
|
|
360
|
+
errors: [],
|
|
361
|
+
};
|
|
362
|
+
batches = [];
|
|
363
|
+
while (PascalGeofences.length > 0) {
|
|
364
|
+
// Splice off 10 geofences from input clone due to Amazon Location Service API limit
|
|
365
|
+
batches.push(PascalGeofences.splice(0, 10));
|
|
366
|
+
}
|
|
367
|
+
return [4 /*yield*/, Promise.all(batches.map(function (batch) { return __awaiter(_this, void 0, void 0, function () {
|
|
368
|
+
var response, error_4;
|
|
369
|
+
return __generator(this, function (_a) {
|
|
370
|
+
switch (_a.label) {
|
|
371
|
+
case 0:
|
|
372
|
+
_a.trys.push([0, 2, , 3]);
|
|
373
|
+
return [4 /*yield*/, this._AmazonLocationServiceBatchPutGeofenceCall(batch, (options === null || options === void 0 ? void 0 : options.collectionName) || this._config.geofenceCollections.default)];
|
|
374
|
+
case 1:
|
|
375
|
+
response = _a.sent();
|
|
376
|
+
return [3 /*break*/, 3];
|
|
377
|
+
case 2:
|
|
378
|
+
error_4 = _a.sent();
|
|
379
|
+
// If the API call fails, add the geofences to the errors array and move to next batch
|
|
380
|
+
batch.forEach(function (geofence) {
|
|
381
|
+
results.errors.push({
|
|
382
|
+
geofenceId: geofence.GeofenceId,
|
|
383
|
+
error: {
|
|
384
|
+
code: 'APIConnectionError',
|
|
385
|
+
message: error_4.message,
|
|
386
|
+
},
|
|
387
|
+
});
|
|
388
|
+
});
|
|
389
|
+
return [2 /*return*/];
|
|
390
|
+
case 3:
|
|
391
|
+
// Push all successes to results
|
|
392
|
+
response.Successes.forEach(function (success) {
|
|
393
|
+
var GeofenceId = success.GeofenceId, CreateTime = success.CreateTime, UpdateTime = success.UpdateTime;
|
|
394
|
+
results.successes.push({
|
|
395
|
+
geofenceId: GeofenceId,
|
|
396
|
+
createTime: CreateTime,
|
|
397
|
+
updateTime: UpdateTime,
|
|
398
|
+
});
|
|
399
|
+
});
|
|
400
|
+
// Push all errors to results
|
|
401
|
+
response.Errors.forEach(function (error) {
|
|
402
|
+
var _a = error.Error, Code = _a.Code, Message = _a.Message, GeofenceId = error.GeofenceId;
|
|
403
|
+
results.errors.push({
|
|
404
|
+
error: {
|
|
405
|
+
code: Code,
|
|
406
|
+
message: Message,
|
|
407
|
+
},
|
|
408
|
+
geofenceId: GeofenceId,
|
|
409
|
+
});
|
|
410
|
+
});
|
|
411
|
+
return [2 /*return*/];
|
|
412
|
+
}
|
|
413
|
+
});
|
|
414
|
+
}); }))];
|
|
415
|
+
case 2:
|
|
416
|
+
_a.sent();
|
|
417
|
+
return [2 /*return*/, results];
|
|
418
|
+
}
|
|
419
|
+
});
|
|
420
|
+
});
|
|
421
|
+
};
|
|
422
|
+
/**
|
|
423
|
+
* Get geofence from a geofence collection
|
|
424
|
+
* @param geofenceId:string
|
|
425
|
+
* @param options?: Optional parameters for getGeofence
|
|
426
|
+
* @returns {Promise<AmazonLocationServiceGeofence>} - Promise that resolves to a geofence object
|
|
427
|
+
*/
|
|
428
|
+
AmazonLocationServiceProvider.prototype.getGeofence = function (geofenceId, options) {
|
|
429
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
430
|
+
var credentialsOK, client, commandInput, command, response, error_5, GeofenceId, CreateTime, UpdateTime, Status, Geometry, geofence;
|
|
431
|
+
return __generator(this, function (_a) {
|
|
432
|
+
switch (_a.label) {
|
|
433
|
+
case 0: return [4 /*yield*/, this._ensureCredentials()];
|
|
434
|
+
case 1:
|
|
435
|
+
credentialsOK = _a.sent();
|
|
436
|
+
if (!credentialsOK) {
|
|
437
|
+
throw new Error('No credentials');
|
|
438
|
+
}
|
|
439
|
+
// Verify geofence collection exists in aws-config.js
|
|
440
|
+
try {
|
|
441
|
+
this._verifyGeofenceCollections(options === null || options === void 0 ? void 0 : options.collectionName);
|
|
442
|
+
}
|
|
443
|
+
catch (error) {
|
|
444
|
+
logger.debug(error);
|
|
445
|
+
throw error;
|
|
446
|
+
}
|
|
447
|
+
client = new LocationClient({
|
|
448
|
+
credentials: this._config.credentials,
|
|
449
|
+
region: this._config.region,
|
|
450
|
+
customUserAgent: getAmplifyUserAgent(),
|
|
451
|
+
});
|
|
452
|
+
commandInput = {
|
|
453
|
+
GeofenceId: geofenceId,
|
|
454
|
+
CollectionName: (options === null || options === void 0 ? void 0 : options.collectionName) || this._config.geofenceCollections.default,
|
|
455
|
+
};
|
|
456
|
+
command = new GetGeofenceCommand(commandInput);
|
|
457
|
+
_a.label = 2;
|
|
458
|
+
case 2:
|
|
459
|
+
_a.trys.push([2, 4, , 5]);
|
|
460
|
+
return [4 /*yield*/, client.send(command)];
|
|
461
|
+
case 3:
|
|
462
|
+
response = _a.sent();
|
|
463
|
+
return [3 /*break*/, 5];
|
|
464
|
+
case 4:
|
|
465
|
+
error_5 = _a.sent();
|
|
466
|
+
logger.debug(error_5);
|
|
467
|
+
throw error_5;
|
|
468
|
+
case 5:
|
|
469
|
+
GeofenceId = response.GeofenceId, CreateTime = response.CreateTime, UpdateTime = response.UpdateTime, Status = response.Status, Geometry = response.Geometry;
|
|
470
|
+
geofence = {
|
|
471
|
+
createTime: CreateTime,
|
|
472
|
+
geofenceId: GeofenceId,
|
|
473
|
+
geometry: {
|
|
474
|
+
polygon: Geometry.Polygon,
|
|
475
|
+
},
|
|
476
|
+
status: Status,
|
|
477
|
+
updateTime: UpdateTime,
|
|
478
|
+
};
|
|
479
|
+
return [2 /*return*/, geofence];
|
|
480
|
+
}
|
|
481
|
+
});
|
|
482
|
+
});
|
|
483
|
+
};
|
|
484
|
+
/**
|
|
485
|
+
* List geofences from a geofence collection
|
|
486
|
+
* @param options?: ListGeofenceOptions
|
|
487
|
+
* @returns {Promise<ListGeofencesResults>} - Promise that resolves to an object with:
|
|
488
|
+
* entries: list of geofences - 100 geofences are listed per page
|
|
489
|
+
* nextToken: token for next page of geofences
|
|
490
|
+
*/
|
|
491
|
+
AmazonLocationServiceProvider.prototype.listGeofences = function (options) {
|
|
492
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
493
|
+
var credentialsOK, client, listGeofencesInput, command, response, error_6, NextToken, Entries, results;
|
|
494
|
+
return __generator(this, function (_a) {
|
|
495
|
+
switch (_a.label) {
|
|
496
|
+
case 0: return [4 /*yield*/, this._ensureCredentials()];
|
|
497
|
+
case 1:
|
|
498
|
+
credentialsOK = _a.sent();
|
|
499
|
+
if (!credentialsOK) {
|
|
500
|
+
throw new Error('No credentials');
|
|
501
|
+
}
|
|
502
|
+
// Verify geofence collection exists in aws-config.js
|
|
503
|
+
try {
|
|
504
|
+
this._verifyGeofenceCollections(options === null || options === void 0 ? void 0 : options.collectionName);
|
|
505
|
+
}
|
|
506
|
+
catch (error) {
|
|
507
|
+
logger.debug(error);
|
|
508
|
+
throw error;
|
|
509
|
+
}
|
|
510
|
+
client = new LocationClient({
|
|
511
|
+
credentials: this._config.credentials,
|
|
512
|
+
region: this._config.region,
|
|
513
|
+
customUserAgent: getAmplifyUserAgent(),
|
|
514
|
+
});
|
|
515
|
+
listGeofencesInput = {
|
|
516
|
+
NextToken: options === null || options === void 0 ? void 0 : options.nextToken,
|
|
517
|
+
CollectionName: (options === null || options === void 0 ? void 0 : options.collectionName) || this._config.geofenceCollections.default,
|
|
518
|
+
};
|
|
519
|
+
command = new ListGeofencesCommand(listGeofencesInput);
|
|
520
|
+
_a.label = 2;
|
|
521
|
+
case 2:
|
|
522
|
+
_a.trys.push([2, 4, , 5]);
|
|
523
|
+
return [4 /*yield*/, client.send(command)];
|
|
524
|
+
case 3:
|
|
525
|
+
response = _a.sent();
|
|
526
|
+
return [3 /*break*/, 5];
|
|
527
|
+
case 4:
|
|
528
|
+
error_6 = _a.sent();
|
|
529
|
+
logger.debug(error_6);
|
|
530
|
+
throw error_6;
|
|
531
|
+
case 5:
|
|
532
|
+
NextToken = response.NextToken, Entries = response.Entries;
|
|
533
|
+
results = {
|
|
534
|
+
entries: Entries.map(function (_a) {
|
|
535
|
+
var GeofenceId = _a.GeofenceId, CreateTime = _a.CreateTime, UpdateTime = _a.UpdateTime, Status = _a.Status, Polygon = _a.Geometry.Polygon;
|
|
536
|
+
return {
|
|
537
|
+
geofenceId: GeofenceId,
|
|
538
|
+
createTime: CreateTime,
|
|
539
|
+
updateTime: UpdateTime,
|
|
540
|
+
status: Status,
|
|
541
|
+
geometry: {
|
|
542
|
+
polygon: Polygon,
|
|
543
|
+
},
|
|
544
|
+
};
|
|
545
|
+
}),
|
|
546
|
+
nextToken: NextToken,
|
|
547
|
+
};
|
|
548
|
+
return [2 /*return*/, results];
|
|
549
|
+
}
|
|
550
|
+
});
|
|
551
|
+
});
|
|
552
|
+
};
|
|
553
|
+
/**
|
|
554
|
+
* Delete geofences from a geofence collection
|
|
555
|
+
* @param geofenceIds: string|string[]
|
|
556
|
+
* @param options?: GeofenceOptions
|
|
557
|
+
* @returns {Promise<DeleteGeofencesResults>} - Promise that resolves to an object with:
|
|
558
|
+
* successes: list of geofences successfully deleted
|
|
559
|
+
* errors: list of geofences that failed to delete
|
|
560
|
+
*/
|
|
561
|
+
AmazonLocationServiceProvider.prototype.deleteGeofences = function (geofenceIds, options) {
|
|
562
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
563
|
+
var credentialsOK, results, batches, count;
|
|
564
|
+
var _this = this;
|
|
565
|
+
return __generator(this, function (_a) {
|
|
566
|
+
switch (_a.label) {
|
|
567
|
+
case 0: return [4 /*yield*/, this._ensureCredentials()];
|
|
568
|
+
case 1:
|
|
569
|
+
credentialsOK = _a.sent();
|
|
570
|
+
if (!credentialsOK) {
|
|
571
|
+
throw new Error('No credentials');
|
|
572
|
+
}
|
|
573
|
+
// Verify geofence collection exists in aws-config.js
|
|
574
|
+
try {
|
|
575
|
+
this._verifyGeofenceCollections(options === null || options === void 0 ? void 0 : options.collectionName);
|
|
576
|
+
}
|
|
577
|
+
catch (error) {
|
|
578
|
+
logger.debug(error);
|
|
579
|
+
throw error;
|
|
580
|
+
}
|
|
581
|
+
results = {
|
|
582
|
+
successes: [],
|
|
583
|
+
errors: [],
|
|
584
|
+
};
|
|
585
|
+
batches = [];
|
|
586
|
+
count = 0;
|
|
587
|
+
while (count < geofenceIds.length) {
|
|
588
|
+
batches.push(geofenceIds.slice(count, (count += 10)));
|
|
589
|
+
}
|
|
590
|
+
return [4 /*yield*/, Promise.all(batches.map(function (batch) { return __awaiter(_this, void 0, void 0, function () {
|
|
591
|
+
var response, error_7, badGeofenceIds;
|
|
592
|
+
var _a;
|
|
593
|
+
return __generator(this, function (_b) {
|
|
594
|
+
switch (_b.label) {
|
|
595
|
+
case 0:
|
|
596
|
+
_b.trys.push([0, 2, , 3]);
|
|
597
|
+
return [4 /*yield*/, this._AmazonLocationServiceBatchDeleteGeofenceCall(batch, (options === null || options === void 0 ? void 0 : options.collectionName) || this._config.geofenceCollections.default)];
|
|
598
|
+
case 1:
|
|
599
|
+
response = _b.sent();
|
|
600
|
+
return [3 /*break*/, 3];
|
|
601
|
+
case 2:
|
|
602
|
+
error_7 = _b.sent();
|
|
603
|
+
// If the API call fails, add the geofences to the errors array and move to next batch
|
|
604
|
+
batch.forEach(function (geofenceId) {
|
|
605
|
+
var errorObject = {
|
|
606
|
+
geofenceId: geofenceId,
|
|
607
|
+
error: {
|
|
608
|
+
code: error_7.message,
|
|
609
|
+
message: error_7.message,
|
|
610
|
+
},
|
|
611
|
+
};
|
|
612
|
+
results.errors.push(errorObject);
|
|
613
|
+
});
|
|
614
|
+
return [2 /*return*/];
|
|
615
|
+
case 3:
|
|
616
|
+
badGeofenceIds = response.Errors.map(function (_a) {
|
|
617
|
+
var geofenceId = _a.geofenceId;
|
|
618
|
+
return geofenceId;
|
|
619
|
+
});
|
|
620
|
+
(_a = results.successes).push.apply(_a, __spread(batch.filter(function (Id) { return !badGeofenceIds.includes(Id); })));
|
|
621
|
+
return [2 /*return*/];
|
|
622
|
+
}
|
|
623
|
+
});
|
|
624
|
+
}); }))];
|
|
625
|
+
case 2:
|
|
626
|
+
_a.sent();
|
|
627
|
+
return [2 /*return*/, results];
|
|
628
|
+
}
|
|
629
|
+
});
|
|
630
|
+
});
|
|
631
|
+
};
|
|
302
632
|
/**
|
|
303
633
|
* @private
|
|
304
634
|
*/
|
|
305
635
|
AmazonLocationServiceProvider.prototype._ensureCredentials = function () {
|
|
306
636
|
return __awaiter(this, void 0, void 0, function () {
|
|
307
|
-
var credentials, cred,
|
|
637
|
+
var credentials, cred, error_8;
|
|
308
638
|
return __generator(this, function (_a) {
|
|
309
639
|
switch (_a.label) {
|
|
310
640
|
case 0:
|
|
@@ -319,8 +649,8 @@ var AmazonLocationServiceProvider = /** @class */ (function () {
|
|
|
319
649
|
this._config.credentials = cred;
|
|
320
650
|
return [2 /*return*/, true];
|
|
321
651
|
case 2:
|
|
322
|
-
|
|
323
|
-
logger.
|
|
652
|
+
error_8 = _a.sent();
|
|
653
|
+
logger.debug('Ensure credentials error. Credentials are:', error_8);
|
|
324
654
|
return [2 /*return*/, false];
|
|
325
655
|
case 3: return [2 /*return*/];
|
|
326
656
|
}
|
|
@@ -329,24 +659,95 @@ var AmazonLocationServiceProvider = /** @class */ (function () {
|
|
|
329
659
|
};
|
|
330
660
|
AmazonLocationServiceProvider.prototype._verifyMapResources = function () {
|
|
331
661
|
if (!this._config.maps) {
|
|
332
|
-
var errorString = "No map resources found in amplify config, run 'amplify add geo' to create
|
|
333
|
-
logger.
|
|
662
|
+
var errorString = "No map resources found in amplify config, run 'amplify add geo' to create one and run `amplify push` after";
|
|
663
|
+
logger.debug(errorString);
|
|
334
664
|
throw new Error(errorString);
|
|
335
665
|
}
|
|
336
666
|
if (!this._config.maps.default) {
|
|
337
667
|
var errorString = "No default map resource found in amplify config, run 'amplify add geo' to create one and run `amplify push` after";
|
|
338
|
-
logger.
|
|
668
|
+
logger.debug(errorString);
|
|
339
669
|
throw new Error(errorString);
|
|
340
670
|
}
|
|
341
671
|
};
|
|
342
672
|
AmazonLocationServiceProvider.prototype._verifySearchIndex = function (optionalSearchIndex) {
|
|
343
673
|
if ((!this._config.search_indices || !this._config.search_indices.default) &&
|
|
344
674
|
!optionalSearchIndex) {
|
|
345
|
-
var errorString = 'No Search Index found, please run `amplify add geo` to
|
|
346
|
-
logger.
|
|
675
|
+
var errorString = 'No Search Index found in amplify config, please run `amplify add geo` to create one and run `amplify push` after.';
|
|
676
|
+
logger.debug(errorString);
|
|
677
|
+
throw new Error(errorString);
|
|
678
|
+
}
|
|
679
|
+
};
|
|
680
|
+
AmazonLocationServiceProvider.prototype._verifyGeofenceCollections = function (optionalGeofenceCollectionName) {
|
|
681
|
+
if ((!this._config.geofenceCollections ||
|
|
682
|
+
!this._config.geofenceCollections.default) &&
|
|
683
|
+
!optionalGeofenceCollectionName) {
|
|
684
|
+
var errorString = 'No Geofence Collections found, please run `amplify add geo` to create one and run `amplify push` after.';
|
|
685
|
+
logger.debug(errorString);
|
|
347
686
|
throw new Error(errorString);
|
|
348
687
|
}
|
|
349
688
|
};
|
|
689
|
+
AmazonLocationServiceProvider.prototype._AmazonLocationServiceBatchPutGeofenceCall = function (PascalGeofences, collectionName) {
|
|
690
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
691
|
+
var geofenceInput, client, command, response, error_9;
|
|
692
|
+
return __generator(this, function (_a) {
|
|
693
|
+
switch (_a.label) {
|
|
694
|
+
case 0:
|
|
695
|
+
geofenceInput = {
|
|
696
|
+
Entries: PascalGeofences,
|
|
697
|
+
CollectionName: collectionName || this._config.geofenceCollections.default,
|
|
698
|
+
};
|
|
699
|
+
client = new LocationClient({
|
|
700
|
+
credentials: this._config.credentials,
|
|
701
|
+
region: this._config.region,
|
|
702
|
+
customUserAgent: getAmplifyUserAgent(),
|
|
703
|
+
});
|
|
704
|
+
command = new BatchPutGeofenceCommand(geofenceInput);
|
|
705
|
+
_a.label = 1;
|
|
706
|
+
case 1:
|
|
707
|
+
_a.trys.push([1, 3, , 4]);
|
|
708
|
+
return [4 /*yield*/, client.send(command)];
|
|
709
|
+
case 2:
|
|
710
|
+
response = _a.sent();
|
|
711
|
+
return [3 /*break*/, 4];
|
|
712
|
+
case 3:
|
|
713
|
+
error_9 = _a.sent();
|
|
714
|
+
throw error_9;
|
|
715
|
+
case 4: return [2 /*return*/, response];
|
|
716
|
+
}
|
|
717
|
+
});
|
|
718
|
+
});
|
|
719
|
+
};
|
|
720
|
+
AmazonLocationServiceProvider.prototype._AmazonLocationServiceBatchDeleteGeofenceCall = function (geofenceIds, collectionName) {
|
|
721
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
722
|
+
var deleteGeofencesInput, client, command, response, error_10;
|
|
723
|
+
return __generator(this, function (_a) {
|
|
724
|
+
switch (_a.label) {
|
|
725
|
+
case 0:
|
|
726
|
+
deleteGeofencesInput = {
|
|
727
|
+
GeofenceIds: geofenceIds,
|
|
728
|
+
CollectionName: collectionName || this._config.geofenceCollections.default,
|
|
729
|
+
};
|
|
730
|
+
client = new LocationClient({
|
|
731
|
+
credentials: this._config.credentials,
|
|
732
|
+
region: this._config.region,
|
|
733
|
+
customUserAgent: getAmplifyUserAgent(),
|
|
734
|
+
});
|
|
735
|
+
command = new BatchDeleteGeofenceCommand(deleteGeofencesInput);
|
|
736
|
+
_a.label = 1;
|
|
737
|
+
case 1:
|
|
738
|
+
_a.trys.push([1, 3, , 4]);
|
|
739
|
+
return [4 /*yield*/, client.send(command)];
|
|
740
|
+
case 2:
|
|
741
|
+
response = _a.sent();
|
|
742
|
+
return [3 /*break*/, 4];
|
|
743
|
+
case 3:
|
|
744
|
+
error_10 = _a.sent();
|
|
745
|
+
throw error_10;
|
|
746
|
+
case 4: return [2 /*return*/, response];
|
|
747
|
+
}
|
|
748
|
+
});
|
|
749
|
+
});
|
|
750
|
+
};
|
|
350
751
|
AmazonLocationServiceProvider.CATEGORY = 'Geo';
|
|
351
752
|
AmazonLocationServiceProvider.PROVIDER_NAME = 'AmazonLocationService';
|
|
352
753
|
return AmazonLocationServiceProvider;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AmazonLocationServiceProvider.js","sourceRoot":"","sources":["../../src/Providers/AmazonLocationServiceProvider.ts"],"names":[],"m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AAI,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE;YAC/B,IAAM,WAAW,GAChB,mHAAmH,CAAC;YACrH,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;YACzB,MAAM,IAAI,KAAK,CAAC,WAAW,CAAC,CAAC;SAC7B;IACF,CAAC;IAEO,0DAAkB,GAA1B,UAA2B,mBAA4B;QACtD,IACC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,cAAc,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,OAAO,CAAC;YACtE,CAAC,mBAAmB,EACnB;YACD,IAAM,WAAW,GAChB,8FAA8F,CAAC;YAChG,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;YACzB,MAAM,IAAI,KAAK,CAAC,WAAW,CAAC,CAAC;SAC7B;IACF,CAAC;IA9UM,sCAAQ,GAAG,KAAK,CAAC;IACjB,2CAAa,GAAG,uBAAuB,CAAC;IA8UhD,oCAAC;CAAA,AAhVD,IAgVC;SAhVY,6BAA6B"}
|
|
1
|
+
{"version":3,"file":"AmazonLocationServiceProvider.js","sourceRoot":"","sources":["../../src/Providers/AmazonLocationServiceProvider.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;GAWG;AACH,OAAO,aAAa,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EACN,aAAa,IAAI,MAAM,EACvB,WAAW,EACX,mBAAmB,GACnB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAEN,cAAc,EACd,8BAA8B,EAE9B,qCAAqC,EAErC,kCAAkC,EAElC,uBAAuB,EAIvB,kBAAkB,EAGlB,oBAAoB,EAGpB,0BAA0B,GAG1B,MAAM,0BAA0B,CAAC;AAsBlC,IAAM,MAAM,GAAG,IAAI,MAAM,CAAC,+BAA+B,CAAC,CAAC;AAE3D;IASC;;;OAGG;IACH,uC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AA;;wBAArC,QAAQ,GAAG,SAA0B,CAAC;;;;wBAEtC,MAAM,QAAK,CAAC;4BAEb,sBAAO,QAAQ,EAAC;;;;KAChB;IA3sBM,sCAAQ,GAAG,KAAK,CAAC;IACjB,2CAAa,GAAG,uBAAuB,CAAC;IA2sBhD,oCAAC;CAAA,AA7sBD,IA6sBC;SA7sBY,6BAA6B"}
|
|
@@ -1,4 +1,24 @@
|
|
|
1
|
-
import { MapStyle } from './Geo';
|
|
1
|
+
import { MapStyle, GeofenceOptions, ListGeofenceOptions, Geofence, DeleteGeofencesResults, GeofenceError } from './Geo';
|
|
2
2
|
export interface AmazonLocationServiceMapStyle extends MapStyle {
|
|
3
3
|
region: string;
|
|
4
4
|
}
|
|
5
|
+
export declare type AmazonLocationServiceGeofenceOptions = GeofenceOptions & {
|
|
6
|
+
collectionName?: string;
|
|
7
|
+
};
|
|
8
|
+
export declare type AmazonLocationServiceGeofenceStatus = 'ACTIVE' | 'PENDING' | 'FAILED' | 'DELETED' | 'DELETING';
|
|
9
|
+
export declare type AmazonLocationServiceGeofence = Omit<Geofence, 'status'> & {
|
|
10
|
+
status: AmazonLocationServiceGeofenceStatus;
|
|
11
|
+
};
|
|
12
|
+
export declare type AmazonLocationServiceListGeofenceOptions = ListGeofenceOptions & {
|
|
13
|
+
collectionName?: string;
|
|
14
|
+
};
|
|
15
|
+
export declare type AmazonLocationServiceBatchGeofenceErrorMessages = 'AccessDeniedException' | 'InternalServerException' | 'ResourceNotFoundException' | 'ThrottlingException' | 'ValidationException';
|
|
16
|
+
export declare type AmazonLocationServiceBatchGeofenceError = Omit<GeofenceError, 'error'> & {
|
|
17
|
+
error: {
|
|
18
|
+
code: string;
|
|
19
|
+
message: AmazonLocationServiceBatchGeofenceErrorMessages;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
export declare type AmazonLocationServiceDeleteGeofencesResults = Omit<DeleteGeofencesResults, 'errors'> & {
|
|
23
|
+
errors: AmazonLocationServiceBatchGeofenceError[];
|
|
24
|
+
};
|
package/lib-esm/types/Geo.d.ts
CHANGED
|
@@ -9,14 +9,18 @@ export interface GeoConfig {
|
|
|
9
9
|
items: string[];
|
|
10
10
|
default: string;
|
|
11
11
|
};
|
|
12
|
+
geofenceCollections?: {
|
|
13
|
+
items: string[];
|
|
14
|
+
default: string;
|
|
15
|
+
};
|
|
12
16
|
};
|
|
13
17
|
}
|
|
14
18
|
export interface MapStyle {
|
|
15
19
|
mapName: string;
|
|
16
20
|
style: string;
|
|
17
21
|
}
|
|
18
|
-
export declare type Latitude = number;
|
|
19
22
|
export declare type Longitude = number;
|
|
23
|
+
export declare type Latitude = number;
|
|
20
24
|
export declare type Coordinates = [Longitude, Latitude];
|
|
21
25
|
export declare type SWLongitude = Longitude;
|
|
22
26
|
export declare type SWLatitude = Latitude;
|
|
@@ -57,3 +61,46 @@ export interface Place {
|
|
|
57
61
|
subRegion?: string;
|
|
58
62
|
}
|
|
59
63
|
export declare type SearchForSuggestionsResults = string[];
|
|
64
|
+
export declare type LinearRing = Coordinates[];
|
|
65
|
+
export declare type GeofencePolygon = LinearRing[];
|
|
66
|
+
export declare type PolygonGeometry = {
|
|
67
|
+
polygon: GeofencePolygon;
|
|
68
|
+
};
|
|
69
|
+
export declare type GeofenceInput = {
|
|
70
|
+
geofenceId: string;
|
|
71
|
+
geometry: PolygonGeometry;
|
|
72
|
+
};
|
|
73
|
+
export declare type GeofenceOptions = {
|
|
74
|
+
providerName?: string;
|
|
75
|
+
};
|
|
76
|
+
export declare type GeofenceError = {
|
|
77
|
+
error: {
|
|
78
|
+
code: string;
|
|
79
|
+
message: string;
|
|
80
|
+
};
|
|
81
|
+
geofenceId: string;
|
|
82
|
+
};
|
|
83
|
+
declare type GeofenceBase = {
|
|
84
|
+
geofenceId: string;
|
|
85
|
+
createTime?: Date;
|
|
86
|
+
updateTime?: Date;
|
|
87
|
+
};
|
|
88
|
+
export declare type Geofence = GeofenceBase & {
|
|
89
|
+
geometry: PolygonGeometry;
|
|
90
|
+
};
|
|
91
|
+
export declare type SaveGeofencesResults = {
|
|
92
|
+
successes: GeofenceBase[];
|
|
93
|
+
errors: GeofenceError[];
|
|
94
|
+
};
|
|
95
|
+
export declare type ListGeofenceOptions = GeofenceOptions & {
|
|
96
|
+
nextToken?: string;
|
|
97
|
+
};
|
|
98
|
+
export declare type ListGeofenceResults = {
|
|
99
|
+
entries: Geofence[];
|
|
100
|
+
nextToken: string;
|
|
101
|
+
};
|
|
102
|
+
export declare type DeleteGeofencesResults = {
|
|
103
|
+
successes: string[];
|
|
104
|
+
errors: GeofenceError[];
|
|
105
|
+
};
|
|
106
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SearchByTextOptions, SearchByCoordinatesOptions, SearchForSuggestionsResults, Coordinates, Place, MapStyle } from './Geo';
|
|
1
|
+
import { SearchByTextOptions, SearchByCoordinatesOptions, SearchForSuggestionsResults, Coordinates, Place, MapStyle, Geofence, GeofenceInput, GeofenceOptions, ListGeofenceOptions, ListGeofenceResults, SaveGeofencesResults, DeleteGeofencesResults } from './Geo';
|
|
2
2
|
export interface GeoProvider {
|
|
3
3
|
getCategory(): string;
|
|
4
4
|
getProviderName(): string;
|
|
@@ -8,4 +8,8 @@ export interface GeoProvider {
|
|
|
8
8
|
searchByText(text: string, options?: SearchByTextOptions): Promise<Place[]>;
|
|
9
9
|
searchByCoordinates(coordinates: Coordinates, options?: SearchByCoordinatesOptions): Promise<Place>;
|
|
10
10
|
searchForSuggestions(text: string, options?: SearchByTextOptions): Promise<SearchForSuggestionsResults>;
|
|
11
|
+
saveGeofences(geofences: GeofenceInput[], options?: GeofenceOptions): Promise<SaveGeofencesResults>;
|
|
12
|
+
getGeofence(geofenceId: string, options?: ListGeofenceOptions): Promise<Geofence>;
|
|
13
|
+
listGeofences(options?: ListGeofenceOptions): Promise<ListGeofenceResults>;
|
|
14
|
+
deleteGeofences(geofenceIds: string[], options?: GeofenceOptions): Promise<DeleteGeofencesResults>;
|
|
11
15
|
}
|
|
@@ -1,13 +1 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2017-2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
|
|
5
|
-
* the License. A copy of the License is located at
|
|
6
|
-
*
|
|
7
|
-
* http://aws.amazon.com/apache2.0/
|
|
8
|
-
*
|
|
9
|
-
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
|
10
|
-
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
|
|
11
|
-
* and limitations under the License.
|
|
12
|
-
*/
|
|
13
1
|
//# sourceMappingURL=Provider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Provider.js","sourceRoot":"","sources":["../../src/types/Provider.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Provider.js","sourceRoot":"","sources":["../../src/types/Provider.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Longitude, Latitude, GeofenceInput, GeofencePolygon, LinearRing } from './types';
|
|
2
|
+
export declare function validateCoordinates(lng: Longitude, lat: Latitude): void;
|
|
3
|
+
export declare function validateGeofenceId(geofenceId: string): void;
|
|
4
|
+
export declare function validateLinearRing(linearRing: LinearRing): void;
|
|
5
|
+
export declare function validatePolygon(polygon: GeofencePolygon): void;
|
|
6
|
+
export declare function validateGeofences(geofences: GeofenceInput[]): void;
|