@transcend-io/cli 4.18.1 → 4.20.0
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/README.md +189 -27
- package/build/cli-cron-mark-identifiers-completed.d.ts +3 -0
- package/build/cli-cron-mark-identifiers-completed.d.ts.map +1 -0
- package/build/cli-cron-mark-identifiers-completed.js +44 -0
- package/build/cli-cron-mark-identifiers-completed.js.map +1 -0
- package/build/cli-cron-pull-identifiers.d.ts +3 -0
- package/build/cli-cron-pull-identifiers.d.ts.map +1 -0
- package/build/{cli-pull-cron-identifiers.js → cli-cron-pull-identifiers.js} +3 -3
- package/build/{cli-pull-cron-identifiers.js.map → cli-cron-pull-identifiers.js.map} +1 -1
- package/build/cli-request-restart.d.ts +3 -0
- package/build/cli-request-restart.d.ts.map +1 -0
- package/build/cli-request-restart.js +96 -0
- package/build/cli-request-restart.js.map +1 -0
- package/build/cron/index.d.ts +2 -0
- package/build/cron/index.d.ts.map +1 -1
- package/build/cron/index.js +2 -0
- package/build/cron/index.js.map +1 -1
- package/build/cron/markCronIdentifierCompleted.d.ts +21 -0
- package/build/cron/markCronIdentifierCompleted.d.ts.map +1 -0
- package/build/cron/markCronIdentifierCompleted.js +55 -0
- package/build/cron/markCronIdentifierCompleted.js.map +1 -0
- package/build/cron/pushCronIdentifiersFromCsv.d.ts +21 -0
- package/build/cron/pushCronIdentifiersFromCsv.d.ts.map +1 -0
- package/build/cron/pushCronIdentifiersFromCsv.js +34 -0
- package/build/cron/pushCronIdentifiersFromCsv.js.map +1 -0
- package/build/graphql/fetchAllRequestIdentifiers.d.ts +25 -0
- package/build/graphql/fetchAllRequestIdentifiers.d.ts.map +1 -0
- package/build/graphql/fetchAllRequestIdentifiers.js +34 -0
- package/build/graphql/fetchAllRequestIdentifiers.js.map +1 -0
- package/build/graphql/fetchAllRequests.d.ts +45 -0
- package/build/graphql/fetchAllRequests.d.ts.map +1 -0
- package/build/graphql/fetchAllRequests.js +43 -0
- package/build/graphql/fetchAllRequests.js.map +1 -0
- package/build/graphql/fetchApiKeys.d.ts +1 -1
- package/build/graphql/gqls/RequestIdentifier.d.ts +2 -0
- package/build/graphql/gqls/RequestIdentifier.d.ts.map +1 -0
- package/build/graphql/gqls/RequestIdentifier.js +27 -0
- package/build/graphql/gqls/RequestIdentifier.js.map +1 -0
- package/build/graphql/gqls/index.d.ts +2 -0
- package/build/graphql/gqls/index.d.ts.map +1 -1
- package/build/graphql/gqls/index.js +2 -0
- package/build/graphql/gqls/index.js.map +1 -1
- package/build/graphql/gqls/request.d.ts +2 -0
- package/build/graphql/gqls/request.d.ts.map +1 -0
- package/build/graphql/gqls/request.js +36 -0
- package/build/graphql/gqls/request.js.map +1 -0
- package/build/graphql/index.d.ts +2 -0
- package/build/graphql/index.d.ts.map +1 -1
- package/build/graphql/index.js +2 -0
- package/build/graphql/index.js.map +1 -1
- package/build/requests/bulkRestartRequests.d.ts +35 -0
- package/build/requests/bulkRestartRequests.d.ts.map +1 -0
- package/build/requests/bulkRestartRequests.js +160 -0
- package/build/requests/bulkRestartRequests.js.map +1 -0
- package/build/requests/constants.d.ts +17 -3
- package/build/requests/constants.d.ts.map +1 -1
- package/build/requests/constants.js +14 -8
- package/build/requests/constants.js.map +1 -1
- package/build/requests/index.d.ts +2 -0
- package/build/requests/index.d.ts.map +1 -1
- package/build/requests/index.js +2 -0
- package/build/requests/index.js.map +1 -1
- package/build/requests/mapColumnsToIdentifiers.d.ts.map +1 -1
- package/build/requests/mapColumnsToIdentifiers.js +2 -3
- package/build/requests/mapColumnsToIdentifiers.js.map +1 -1
- package/build/requests/restartPrivacyRequest.d.ts +20 -0
- package/build/requests/restartPrivacyRequest.d.ts.map +1 -0
- package/build/requests/restartPrivacyRequest.js +86 -0
- package/build/requests/restartPrivacyRequest.js.map +1 -0
- package/build/requests/submitPrivacyRequest.d.ts +5 -5
- package/build/requests/uploadPrivacyRequestsFromCsv.d.ts.map +1 -1
- package/build/requests/uploadPrivacyRequestsFromCsv.js +1 -1
- package/build/requests/uploadPrivacyRequestsFromCsv.js.map +1 -1
- package/build/tsbuildinfo +1 -1
- package/package.json +4 -2
- package/build/cli-pull-cron-identifiers.d.ts +0 -3
- package/build/cli-pull-cron-identifiers.d.ts.map +0 -1
package/README.md
CHANGED
|
@@ -25,10 +25,18 @@
|
|
|
25
25
|
- [Authentication](#authentication-3)
|
|
26
26
|
- [Arguments](#arguments-3)
|
|
27
27
|
- [Usage](#usage-4)
|
|
28
|
-
- [tr-
|
|
28
|
+
- [tr-request-restart](#tr-request-restart)
|
|
29
29
|
- [Authentication](#authentication-4)
|
|
30
30
|
- [Arguments](#arguments-4)
|
|
31
31
|
- [Usage](#usage-5)
|
|
32
|
+
- [tr-cron-pull-identifiers](#tr-cron-pull-identifiers)
|
|
33
|
+
- [Authentication](#authentication-5)
|
|
34
|
+
- [Arguments](#arguments-5)
|
|
35
|
+
- [Usage](#usage-6)
|
|
36
|
+
- [tr-cron-mark-identifiers-completed](#tr-cron-mark-identifiers-completed)
|
|
37
|
+
- [Authentication](#authentication-6)
|
|
38
|
+
- [Arguments](#arguments-6)
|
|
39
|
+
- [Usage](#usage-7)
|
|
32
40
|
|
|
33
41
|
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
|
|
34
42
|
|
|
@@ -47,11 +55,13 @@ If your codebase is typescript or javascript based, you can add this package as
|
|
|
47
55
|
yarn add -D @transcend-io/cli
|
|
48
56
|
|
|
49
57
|
# cli commands available within package
|
|
50
|
-
yarn tr-pull --auth
|
|
51
|
-
yarn tr-push --auth
|
|
52
|
-
yarn tr-discover-silos --auth
|
|
53
|
-
yarn tr-request-upload --auth
|
|
54
|
-
yarn tr-
|
|
58
|
+
yarn tr-pull --auth=$TRANSCEND_API_KEY
|
|
59
|
+
yarn tr-push --auth=$TRANSCEND_API_KEY
|
|
60
|
+
yarn tr-discover-silos --auth=$TRANSCEND_API_KEY
|
|
61
|
+
yarn tr-request-upload --auth=$TRANSCEND_API_KEY
|
|
62
|
+
yarn tr-request-restart --auth=$TRANSCEND_API_KEY
|
|
63
|
+
yarn tr-cron-pull-identifiers --auth=$TRANSCEND_API_KEY
|
|
64
|
+
yarn tr-cron-mark-identifiers-completed --auth=$TRANSCEND_API_KEY
|
|
55
65
|
```
|
|
56
66
|
|
|
57
67
|
or
|
|
@@ -61,11 +71,13 @@ or
|
|
|
61
71
|
npm i -D @transcend-io/cli
|
|
62
72
|
|
|
63
73
|
# cli commands available within package
|
|
64
|
-
tr-pull --auth
|
|
65
|
-
tr-push --auth
|
|
66
|
-
tr-discover-silos --auth
|
|
67
|
-
tr-request-upload --auth
|
|
68
|
-
tr-
|
|
74
|
+
tr-pull --auth=$TRANSCEND_API_KEY
|
|
75
|
+
tr-push --auth=$TRANSCEND_API_KEY
|
|
76
|
+
tr-discover-silos --auth=$TRANSCEND_API_KEY
|
|
77
|
+
tr-request-upload --auth=$TRANSCEND_API_KEY
|
|
78
|
+
tr-request-restart --auth=$TRANSCEND_API_KEY
|
|
79
|
+
tr-cron-pull-identifiers --auth=$TRANSCEND_API_KEY
|
|
80
|
+
tr-cron-mark-identifiers-completed --auth=$TRANSCEND_API_KEY
|
|
69
81
|
```
|
|
70
82
|
|
|
71
83
|
alternatively, you can install the cli globally on your machine:
|
|
@@ -75,10 +87,13 @@ alternatively, you can install the cli globally on your machine:
|
|
|
75
87
|
npm i -g @transcend-io/cli
|
|
76
88
|
|
|
77
89
|
# cli commands available everywhere on machine
|
|
78
|
-
tr-pull --auth
|
|
79
|
-
tr-push --auth
|
|
80
|
-
tr-discover-silos --auth
|
|
81
|
-
tr-request-upload --auth
|
|
90
|
+
tr-pull --auth=$TRANSCEND_API_KEY
|
|
91
|
+
tr-push --auth=$TRANSCEND_API_KEY
|
|
92
|
+
tr-discover-silos --auth=$TRANSCEND_API_KEY
|
|
93
|
+
tr-request-upload --auth=$TRANSCEND_API_KEY
|
|
94
|
+
tr-request-restart --auth=$TRANSCEND_API_KEY
|
|
95
|
+
tr-cron-pull-identifiers --auth=$TRANSCEND_API_KEY
|
|
96
|
+
tr-cron-mark-identifiers-completed --auth=$TRANSCEND_API_KEY
|
|
82
97
|
```
|
|
83
98
|
|
|
84
99
|
Note:
|
|
@@ -229,7 +244,7 @@ tr-pull --auth=$TRANSCEND_API_KEY --file=./custom/location.yml
|
|
|
229
244
|
Or a specific data silo(s) can be pulled in:
|
|
230
245
|
|
|
231
246
|
```sh
|
|
232
|
-
tr-pull --auth=$TRANSCEND_API_KEY
|
|
247
|
+
tr-pull --auth=$TRANSCEND_API_KEY ---dataSiloIds=710fec3c-7bcc-4c9e-baff-bf39f9bec43e
|
|
233
248
|
```
|
|
234
249
|
|
|
235
250
|
Or a specific types of data silo(s) can be pulled in:
|
|
@@ -406,7 +421,7 @@ Then, you'll need to grab that `dataSiloId` and a Transcend API key and pass it
|
|
|
406
421
|
|
|
407
422
|
```sh
|
|
408
423
|
# Scan a javascript project (package.json files) to look for new data silos
|
|
409
|
-
yarn tr-discover-silos --scanPath=./myJavascriptProject --auth={{api_key}}
|
|
424
|
+
yarn tr-discover-silos --scanPath=./myJavascriptProject --auth={{api_key}} ---dataSiloId=abcdefg
|
|
410
425
|
```
|
|
411
426
|
|
|
412
427
|
This call will look for all the package.json files that in the scan path `./myJavascriptProject`, parse each of the dependencies into their individual package names, and send it to our Transcend backend for classification. These classifications can then be viewed [here](https://app.transcend.io/data-map/data-inventory/silo-discovery/triage). The process is the same for scanning requirements.txt, podfiles and build.gradle files.
|
|
@@ -519,10 +534,10 @@ yarn tr-request-upload --auth=$TRANSCEND_API_KEY --file=/Users/transcend/Desktop
|
|
|
519
534
|
--isSilent=false --emailIsVerified=false
|
|
520
535
|
```
|
|
521
536
|
|
|
522
|
-
Increase the concurrency (defaults to
|
|
537
|
+
Increase the concurrency (defaults to 100)
|
|
523
538
|
|
|
524
539
|
```sh
|
|
525
|
-
yarn tr-request-upload --auth=$TRANSCEND_API_KEY --file=/Users/transcend/Desktop/test.csv --concurrency=
|
|
540
|
+
yarn tr-request-upload --auth=$TRANSCEND_API_KEY --file=/Users/transcend/Desktop/test.csv --concurrency=100
|
|
526
541
|
```
|
|
527
542
|
|
|
528
543
|
Tag all uploaded requests with an attribute
|
|
@@ -544,7 +559,99 @@ Include debug logs - warning, this logs out personal data.
|
|
|
544
559
|
yarn tr-request-upload --auth=$TRANSCEND_API_KEY --file=/Users/transcend/Desktop/test.csv --debug=true
|
|
545
560
|
```
|
|
546
561
|
|
|
547
|
-
### tr-
|
|
562
|
+
### tr-request-restart
|
|
563
|
+
|
|
564
|
+
Bulk update a set of privacy requests based on a set of request filters.
|
|
565
|
+
|
|
566
|
+
#### Authentication
|
|
567
|
+
|
|
568
|
+
In order to use this cli, you will first need to generate an API key on the Transcend Admin Dashboard (https://app.transcend.io/infrastructure/api-keys).
|
|
569
|
+
|
|
570
|
+
The API key needs the following scopes:
|
|
571
|
+
|
|
572
|
+
- Submit New Data Subject Request
|
|
573
|
+
- View the Request Compilation
|
|
574
|
+
|
|
575
|
+
#### Arguments
|
|
576
|
+
|
|
577
|
+
| Argument | Description | Type | Default | Required |
|
|
578
|
+
| -------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | --------------- | --------------------------------- | -------- |
|
|
579
|
+
| auth | The Transcend API capable of submitting privacy requests. | string | N/A | true |
|
|
580
|
+
| acions | The [request action](https://docs.transcend.io/docs/privacy-requests/configuring-requests/data-subject-requests#data-actions) to restart. | RequestAction[] | N/A | true |
|
|
581
|
+
| statuses | The [request statuses](https://docs.transcend.io/docs/privacy-requests/overview#request-statuses) to restart. | RequestStatus[] | N/A | true |
|
|
582
|
+
| transcendUrl | URL of the Transcend backend. Use https://api.us.transcend.io for US hosting. | string - URL | https://api.transcend.io | false |
|
|
583
|
+
| requestReceiptFolder | The path to the folder where receipts of each upload are stored. This allows for debugging of errors. | string | ./privacy-request-upload-receipts | false |
|
|
584
|
+
| sombraAuth | The sombra internal key, use for additional authentication when self-hosting sombra. | string | N/A | false |
|
|
585
|
+
| concurrency | The concurrency to use when uploading requests in parallel. | number | 20 | false |
|
|
586
|
+
| requestIds | Specify the specific request IDs to restart | string[] | [] | false |
|
|
587
|
+
| createdAt | Restart requests that were submitted before a specific date. | Date | Date.now() | false |
|
|
588
|
+
| markSilent | Requests older than this date should be marked as silent mode | Date | Date.now() - 3 months | false |
|
|
589
|
+
| sendEmailReceipt | Send email receipts to the restarted requests | boolean | false | false |
|
|
590
|
+
| copyIdentifiers | Copy over all enriched identifiers from the initial request. Leave false to restart from scratch with initial identifiers only. | boolean | false | false |
|
|
591
|
+
| skipWaitingPeriod | Skip queued state of request and go straight to compiling | boolean | false | false |
|
|
592
|
+
|
|
593
|
+
### Usage
|
|
594
|
+
|
|
595
|
+
```sh
|
|
596
|
+
yarn tr-request-restart --auth=$TRANSCEND_API_KEY --statuses=COMPILING,ENRICHING --actions=ACCESS,ERASURE
|
|
597
|
+
```
|
|
598
|
+
|
|
599
|
+
For self-hosted sombras that use an internal key:
|
|
600
|
+
|
|
601
|
+
```sh
|
|
602
|
+
yarn tr-request-restart --auth=$TRANSCEND_API_KEY --sombraAuth=$SOMBRA_INTERNAL_KEY --statuses=COMPILING,ENRICHING --actions=ACCESS,ERASURE
|
|
603
|
+
```
|
|
604
|
+
|
|
605
|
+
Specifying the backend URL, needed for US hosted backend infrastructure.
|
|
606
|
+
|
|
607
|
+
```sh
|
|
608
|
+
yarn tr-request-restart --auth=$TRANSCEND_API_KEY --sombraAuth=$SOMBRA_INTERNAL_KEY --statuses=COMPILING,ENRICHING --actions=ACCESS,ERASURE \
|
|
609
|
+
--transcendUrl=https://api.us.transcend.io
|
|
610
|
+
```
|
|
611
|
+
|
|
612
|
+
Increase the concurrency (defaults to 20)
|
|
613
|
+
|
|
614
|
+
```sh
|
|
615
|
+
yarn tr-request-restart --auth=$TRANSCEND_API_KEY --statuses=COMPILING,ENRICHING --actions=ACCESS,ERASURE --concurrency=100
|
|
616
|
+
```
|
|
617
|
+
|
|
618
|
+
Restart specific requests by ID
|
|
619
|
+
|
|
620
|
+
```sh
|
|
621
|
+
yarn tr-request-restart --auth=$TRANSCEND_API_KEY --statuses=COMPILING,ENRICHING --actions=ACCESS,ERASURE --requestIds=c3ae78c9-2768-4666-991a-d2f729503337,342e4bd1-64ea-4af0-a4ad-704b5a07cfe4
|
|
622
|
+
```
|
|
623
|
+
|
|
624
|
+
Restart requests that were submitted before a specific date.
|
|
625
|
+
|
|
626
|
+
```sh
|
|
627
|
+
yarn tr-request-restart --auth=$TRANSCEND_API_KEY --statuses=COMPILING,ENRICHING --actions=ACCESS,ERASURE --createdAt=2022-05-11T00:46
|
|
628
|
+
```
|
|
629
|
+
|
|
630
|
+
Restart requests and place everything in silent mode submitted before a certain date
|
|
631
|
+
|
|
632
|
+
```sh
|
|
633
|
+
yarn tr-request-restart --auth=$TRANSCEND_API_KEY --statuses=COMPILING,ENRICHING --actions=ACCESS,ERASURE --markSilent=2022-12-05T00:46
|
|
634
|
+
```
|
|
635
|
+
|
|
636
|
+
Send email receipts to the restarted requests
|
|
637
|
+
|
|
638
|
+
```sh
|
|
639
|
+
yarn tr-request-restart --auth=$TRANSCEND_API_KEY --statuses=COMPILING,ENRICHING --actions=ACCESS,ERASURE --sendEmailReceipt=true
|
|
640
|
+
```
|
|
641
|
+
|
|
642
|
+
Copy over all enriched identifiers from the initial request. Leave false to restart from scratch with initial identifiers only
|
|
643
|
+
|
|
644
|
+
```sh
|
|
645
|
+
yarn tr-request-restart --auth=$TRANSCEND_API_KEY --statuses=COMPILING,ENRICHING --actions=ACCESS,ERASURE --copyIdentifiers=true
|
|
646
|
+
```
|
|
647
|
+
|
|
648
|
+
Skip queued state of request and go straight to compiling
|
|
649
|
+
|
|
650
|
+
```sh
|
|
651
|
+
yarn tr-request-restart --auth=$TRANSCEND_API_KEY --statuses=COMPILING,ENRICHING --actions=ACCESS,ERASURE --skipWaitingPeriod=true
|
|
652
|
+
```
|
|
653
|
+
|
|
654
|
+
### tr-cron-pull-identifiers
|
|
548
655
|
|
|
549
656
|
If you are using the cron job integration, you can run this command to pull the outstanding identifiers
|
|
550
657
|
for the data silo to a CSV.
|
|
@@ -574,34 +681,89 @@ The API key must be associated to the ID of the integration/data silo that is be
|
|
|
574
681
|
### Usage
|
|
575
682
|
|
|
576
683
|
```sh
|
|
577
|
-
yarn tr-pull-
|
|
578
|
-
--requestType=ERASURE
|
|
684
|
+
yarn tr-cron-pull-identifiers --auth=$TRANSCEND_API_KEY --dataSiloId=70810f2e-cf90-43f6-9776-901a5950599f --requestType=ERASURE
|
|
579
685
|
```
|
|
580
686
|
|
|
581
687
|
Pull to a specific file location
|
|
582
688
|
|
|
583
689
|
```sh
|
|
584
|
-
yarn tr-pull-
|
|
690
|
+
yarn tr-cron-pull-identifiers --auth=$TRANSCEND_API_KEY --dataSiloId=70810f2e-cf90-43f6-9776-901a5950599f --requestType=ERASURE \
|
|
585
691
|
--file=/Users/transcend/Desktop/test.csv
|
|
586
692
|
```
|
|
587
693
|
|
|
588
694
|
For self-hosted sombras that use an internal key:
|
|
589
695
|
|
|
590
696
|
```sh
|
|
591
|
-
yarn tr-pull-
|
|
592
|
-
--
|
|
697
|
+
yarn tr-cron-pull-identifiers --auth=$TRANSCEND_API_KEY --dataSiloId=70810f2e-cf90-43f6-9776-901a5950599f --requestType=ERASURE \
|
|
698
|
+
--sombraAuth=$SOMBRA_INTERNAL_KEY
|
|
593
699
|
```
|
|
594
700
|
|
|
595
701
|
Specifying the backend URL, needed for US hosted backend infrastructure.
|
|
596
702
|
|
|
597
703
|
```sh
|
|
598
|
-
yarn tr-pull-
|
|
704
|
+
yarn tr-cron-pull-identifiers --auth=$TRANSCEND_API_KEY --dataSiloId=70810f2e-cf90-43f6-9776-901a5950599f --requestType=ERASURE \
|
|
599
705
|
--transcendUrl=https://api.us.transcend.io
|
|
600
706
|
```
|
|
601
707
|
|
|
602
708
|
Specifying the page limit, defaults to 100.
|
|
603
709
|
|
|
604
710
|
```sh
|
|
605
|
-
yarn tr-pull-
|
|
711
|
+
yarn tr-cron-pull-identifiers --auth=$TRANSCEND_API_KEY --dataSiloId=70810f2e-cf90-43f6-9776-901a5950599f --requestType=ERASURE \
|
|
606
712
|
--pageLimit=300
|
|
607
713
|
```
|
|
714
|
+
|
|
715
|
+
### tr-cron-mark-identifiers-completed
|
|
716
|
+
|
|
717
|
+
This command takes the output of `tr-cron-pull-identifiers` and notifies Transcend that all of the requests in the CSV have been processed.
|
|
718
|
+
This is used in the workflow like:
|
|
719
|
+
|
|
720
|
+
1. Pull identifiers to CSV:
|
|
721
|
+
`yarn tr-cron-pull-identifiers --auth=$TRANSCEND_API_KEY --dataSiloId=70810f2e-cf90-43f6-9776-901a5950599f --requestType=ERASURE --file=./outstanding-requests.csv`
|
|
722
|
+
2. Run your process to operate on that CSV of requests.
|
|
723
|
+
3. Notify Transcend of completion
|
|
724
|
+
`yarn tr-cron-mark-identifiers-completed --auth=$TRANSCEND_API_KEY --dataSiloId=70810f2e-cf90-43f6-9776-901a5950599f --file=./outstanding-requests.csv`
|
|
725
|
+
|
|
726
|
+
Read more at https://docs.transcend.io/docs/integrations/cron-job-integration.
|
|
727
|
+
|
|
728
|
+
#### Authentication
|
|
729
|
+
|
|
730
|
+
In order to use this cli, you will first need to generate an API key on the Transcend Admin Dashboard (https://app.transcend.io/infrastructure/api-keys).
|
|
731
|
+
|
|
732
|
+
The API key must be associated to the ID of the integration/data silo that is being operated on.
|
|
733
|
+
|
|
734
|
+
#### Arguments
|
|
735
|
+
|
|
736
|
+
| Argument | Description | Type | Default | Required |
|
|
737
|
+
| ------------ | ------------------------------------------------------------------------------------ | ------------------ | ------------------------ | -------- |
|
|
738
|
+
| auth | The Transcend API capable of pulling the cron identifiers. | string | N/A | true |
|
|
739
|
+
| dataSiloId | The ID of the data silo to pull in. | string - UUID | N/A | true |
|
|
740
|
+
| file | Path to the CSV file where identifiers will be written to. | string - file-path | ./cron-identifiers.csv | false |
|
|
741
|
+
| transcendUrl | URL of the Transcend backend. Use https://api.us.transcend.io for US hosting. | string - URL | https://api.transcend.io | false |
|
|
742
|
+
| sombraAuth | The sombra internal key, use for additional authentication when self-hosting sombra. | string | N/A | false |
|
|
743
|
+
|
|
744
|
+
### Usage
|
|
745
|
+
|
|
746
|
+
```sh
|
|
747
|
+
yarn tr-cron-mark-identifiers-completed --auth=$TRANSCEND_API_KEY --dataSiloId=70810f2e-cf90-43f6-9776-901a5950599f
|
|
748
|
+
```
|
|
749
|
+
|
|
750
|
+
Pull to a specific file location
|
|
751
|
+
|
|
752
|
+
```sh
|
|
753
|
+
yarn tr-cron-mark-identifiers-completed --auth=$TRANSCEND_API_KEY --dataSiloId=70810f2e-cf90-43f6-9776-901a5950599f \
|
|
754
|
+
--file=/Users/transcend/Desktop/test.csv
|
|
755
|
+
```
|
|
756
|
+
|
|
757
|
+
For self-hosted sombras that use an internal key:
|
|
758
|
+
|
|
759
|
+
```sh
|
|
760
|
+
yarn tr-cron-mark-identifiers-completed --auth=$TRANSCEND_API_KEY --dataSiloId=70810f2e-cf90-43f6-9776-901a5950599f \
|
|
761
|
+
--sombraAuth=$SOMBRA_INTERNAL_KEY
|
|
762
|
+
```
|
|
763
|
+
|
|
764
|
+
Specifying the backend URL, needed for US hosted backend infrastructure.
|
|
765
|
+
|
|
766
|
+
```sh
|
|
767
|
+
yarn tr-cron-mark-identifiers-completed --auth=$TRANSCEND_API_KEY --dataSiloId=70810f2e-cf90-43f6-9776-901a5950599f \
|
|
768
|
+
--transcendUrl=https://api.us.transcend.io
|
|
769
|
+
```
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-cron-mark-identifiers-completed.d.ts","sourceRoot":"","sources":["../src/cli-cron-mark-identifiers-completed.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
+
};
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
const yargs_parser_1 = __importDefault(require("yargs-parser"));
|
|
8
|
+
const colors_1 = __importDefault(require("colors"));
|
|
9
|
+
const logger_1 = require("./logger");
|
|
10
|
+
const cron_1 = require("./cron");
|
|
11
|
+
/**
|
|
12
|
+
* Mark all of the identifiers in a cron job CSV as completed.
|
|
13
|
+
*
|
|
14
|
+
* Requires an API key with scope for the cron integration being checked on.
|
|
15
|
+
*
|
|
16
|
+
* Dev Usage:
|
|
17
|
+
* yarn ts-node ./src/cli-cron-mark-identifiers-completed.ts --auth=asd123 \
|
|
18
|
+
* --dataSiloId=92636cda-b7c6-48c6-b1b1-2df574596cbc \
|
|
19
|
+
* --file=/Users/michaelfarrell/Desktop/test.csv
|
|
20
|
+
*
|
|
21
|
+
* Standard usage:
|
|
22
|
+
* yarn tr-pull-cron-mark-identifiers-completed --auth=asd123 \
|
|
23
|
+
* --dataSiloId=92636cda-b7c6-48c6-b1b1-2df574596cbc \
|
|
24
|
+
* --file=/Users/michaelfarrell/Desktop/test.csv
|
|
25
|
+
*/
|
|
26
|
+
async function main() {
|
|
27
|
+
// Parse command line arguments
|
|
28
|
+
const { file = './cron-identifiers.csv', transcendUrl = 'https://api.transcend.io', auth, sombraAuth, dataSiloId, } = (0, yargs_parser_1.default)(process.argv.slice(2));
|
|
29
|
+
// Ensure auth is passed
|
|
30
|
+
if (!auth) {
|
|
31
|
+
logger_1.logger.error(colors_1.default.red('A Transcend API key must be provided. You can specify using --auth=asd123'));
|
|
32
|
+
process.exit(1);
|
|
33
|
+
}
|
|
34
|
+
// Upload privacy requests
|
|
35
|
+
await (0, cron_1.pushCronIdentifiersFromCsv)({
|
|
36
|
+
file,
|
|
37
|
+
transcendUrl,
|
|
38
|
+
auth,
|
|
39
|
+
sombraAuth,
|
|
40
|
+
dataSiloId,
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
main();
|
|
44
|
+
//# sourceMappingURL=cli-cron-mark-identifiers-completed.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-cron-mark-identifiers-completed.js","sourceRoot":"","sources":["../src/cli-cron-mark-identifiers-completed.ts"],"names":[],"mappings":";;;;;;AAEA,gEAAiC;AACjC,oDAA4B;AAE5B,qCAAkC;AAClC,iCAAoD;AAEpD;;;;;;;;;;;;;;GAcG;AACH,KAAK,UAAU,IAAI;IACjB,+BAA+B;IAC/B,MAAM,EACJ,IAAI,GAAG,wBAAwB,EAC/B,YAAY,GAAG,0BAA0B,EACzC,IAAI,EACJ,UAAU,EACV,UAAU,GACX,GAAG,IAAA,sBAAK,EAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAA8B,CAAC;IAE9D,wBAAwB;IACxB,IAAI,CAAC,IAAI,EAAE;QACT,eAAM,CAAC,KAAK,CACV,gBAAM,CAAC,GAAG,CACR,2EAA2E,CAC5E,CACF,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;KACjB;IAED,0BAA0B;IAC1B,MAAM,IAAA,iCAA0B,EAAC;QAC/B,IAAI;QACJ,YAAY;QACZ,IAAI;QACJ,UAAU;QACV,UAAU;KACX,CAAC,CAAC;AACL,CAAC;AAED,IAAI,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-cron-pull-identifiers.d.ts","sourceRoot":"","sources":["../src/cli-cron-pull-identifiers.ts"],"names":[],"mappings":""}
|
|
@@ -15,13 +15,13 @@ const privacy_types_1 = require("@transcend-io/privacy-types");
|
|
|
15
15
|
* Requires an API key with scope for the cron integration being checked on.
|
|
16
16
|
*
|
|
17
17
|
* Dev Usage:
|
|
18
|
-
* yarn ts-node ./src/cli-pull-
|
|
18
|
+
* yarn ts-node ./src/cli-cron-pull-identifiers.ts --auth=asd123 \
|
|
19
19
|
* --dataSiloId=92636cda-b7c6-48c6-b1b1-2df574596cbc \
|
|
20
20
|
* --requestType=ERASURE \
|
|
21
21
|
* --file=/Users/michaelfarrell/Desktop/test.csv
|
|
22
22
|
*
|
|
23
23
|
* Standard usage:
|
|
24
|
-
* yarn tr-pull-
|
|
24
|
+
* yarn tr-cron-pull-identifiers --auth=asd123 \
|
|
25
25
|
* --dataSiloId=92636cda-b7c6-48c6-b1b1-2df574596cbc \
|
|
26
26
|
* --requestType=ERASURE \
|
|
27
27
|
* --file=/Users/michaelfarrell/Desktop/test.csv
|
|
@@ -53,4 +53,4 @@ async function main() {
|
|
|
53
53
|
});
|
|
54
54
|
}
|
|
55
55
|
main();
|
|
56
|
-
//# sourceMappingURL=cli-pull-
|
|
56
|
+
//# sourceMappingURL=cli-cron-pull-identifiers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-pull-
|
|
1
|
+
{"version":3,"file":"cli-cron-pull-identifiers.js","sourceRoot":"","sources":["../src/cli-cron-pull-identifiers.ts"],"names":[],"mappings":";;;;;;AAEA,gEAAiC;AACjC,oDAA4B;AAE5B,qCAAkC;AAClC,iCAAkD;AAClD,+DAA4D;AAE5D;;;;;;;;;;;;;;;;GAgBG;AACH,KAAK,UAAU,IAAI;IACjB,+BAA+B;IAC/B,MAAM,EACJ,IAAI,GAAG,wBAAwB,EAC/B,YAAY,GAAG,0BAA0B,EACzC,IAAI,EACJ,UAAU,EACV,UAAU,EACV,WAAW,EACX,SAAS,GAAG,KAAK,GAClB,GAAG,IAAA,sBAAK,EAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAA8B,CAAC;IAE9D,wBAAwB;IACxB,IAAI,CAAC,IAAI,EAAE;QACT,eAAM,CAAC,KAAK,CACV,gBAAM,CAAC,GAAG,CACR,2EAA2E,CAC5E,CACF,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;KACjB;IAED,wBAAwB;IACxB,8DAA8D;IAC9D,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,6BAAa,CAAC,CAAC,QAAQ,CAAC,WAAkB,CAAC,EAAE;QAC9D,eAAM,CAAC,KAAK,CACV,gBAAM,CAAC,GAAG,CACR,gCAAgC,WAAW,MAAM;YAC/C,sBAAsB,MAAM,CAAC,MAAM,CAAC,6BAAa,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAClE,CACF,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;KACjB;IAED,0BAA0B;IAC1B,MAAM,IAAA,+BAAwB,EAAC;QAC7B,IAAI;QACJ,YAAY;QACZ,SAAS,EAAE,QAAQ,CAAC,SAAS,EAAE,EAAE,CAAC;QAClC,WAAW,EAAE,WAA4B;QACzC,IAAI;QACJ,UAAU;QACV,UAAU;KACX,CAAC,CAAC;AACL,CAAC;AAED,IAAI,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-request-restart.d.ts","sourceRoot":"","sources":["../src/cli-request-restart.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
+
};
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
const yargs_parser_1 = __importDefault(require("yargs-parser"));
|
|
8
|
+
const colors_1 = __importDefault(require("colors"));
|
|
9
|
+
const logger_1 = require("./logger");
|
|
10
|
+
const requests_1 = require("./requests");
|
|
11
|
+
const privacy_types_1 = require("@transcend-io/privacy-types");
|
|
12
|
+
const ONE_MONTH = 30.5 * 24 * 60 * 60 * 1000;
|
|
13
|
+
/**
|
|
14
|
+
* Run a command to bulk restart a set of privacy requests
|
|
15
|
+
*
|
|
16
|
+
* Requires an API key with follow scopes: https://app.transcend.io/infrastructure/api-keys
|
|
17
|
+
* - "Submit New Data Subject Request"
|
|
18
|
+
* - "View the Request Compilation"
|
|
19
|
+
*
|
|
20
|
+
* Dev Usage:
|
|
21
|
+
* yarn ts-node ./src/cli-request-restart.ts --auth=asd123 \
|
|
22
|
+
* --statuses=COMPILING,APPROVING --actions=ERASURE
|
|
23
|
+
*
|
|
24
|
+
* Standard usage:
|
|
25
|
+
* yarn tr-request-restart --auth=asd123 \
|
|
26
|
+
* --statuses=COMPILING,APPROVING --actions=ERASURE
|
|
27
|
+
*/
|
|
28
|
+
async function main() {
|
|
29
|
+
// Parse command line arguments
|
|
30
|
+
const { auth, transcendUrl = 'https://api.transcend.io', sombraAuth,
|
|
31
|
+
/** Restart requests matching these request actions */
|
|
32
|
+
actions,
|
|
33
|
+
/** Restart requests matching these request statuses */
|
|
34
|
+
statuses,
|
|
35
|
+
/** Concurrency to restart requests at */
|
|
36
|
+
concurrency = '20',
|
|
37
|
+
/** List of request IDs */
|
|
38
|
+
requestIds = '',
|
|
39
|
+
/** Filter for requests that were submitted before this date */
|
|
40
|
+
createdAt = new Date().toISOString(),
|
|
41
|
+
/** Requests that have been open for this length of time should be marked as silent mode */
|
|
42
|
+
markSilent = new Date(+new Date() - ONE_MONTH * 3).toISOString(),
|
|
43
|
+
/** Send an email receipt to the restarted requests */
|
|
44
|
+
sendEmailReceipt = 'false',
|
|
45
|
+
/** Copy over all identifiers rather than restarting the request only with the core identifier */
|
|
46
|
+
copyIdentifiers = 'false',
|
|
47
|
+
/** Skip the waiting period when restarting requests */
|
|
48
|
+
skipWaitingPeriod = 'false',
|
|
49
|
+
/** Include a receipt of the requests that were restarted in this file */
|
|
50
|
+
requestReceiptFolder = './privacy-request-upload-receipts', } = (0, yargs_parser_1.default)(process.argv.slice(2));
|
|
51
|
+
// Ensure auth is passed
|
|
52
|
+
if (!auth) {
|
|
53
|
+
logger_1.logger.error(colors_1.default.red('A Transcend API key must be provided. You can specify using --auth=asd123'));
|
|
54
|
+
process.exit(1);
|
|
55
|
+
}
|
|
56
|
+
// Parse request actions
|
|
57
|
+
if (!actions) {
|
|
58
|
+
logger_1.logger.error(colors_1.default.red('Missing required parameter "actions". e.g. --actions=ERASURE,ACCESS'));
|
|
59
|
+
process.exit(1);
|
|
60
|
+
}
|
|
61
|
+
const requestActions = actions.split(',');
|
|
62
|
+
const invalidActions = requestActions.filter((action) => !Object.values(privacy_types_1.RequestAction).includes(action));
|
|
63
|
+
if (invalidActions.length > 0) {
|
|
64
|
+
logger_1.logger.error(colors_1.default.red(`Received invalid action values: "${invalidActions.join(',')}"`));
|
|
65
|
+
process.exit(1);
|
|
66
|
+
}
|
|
67
|
+
// Parse request statuses
|
|
68
|
+
if (!statuses) {
|
|
69
|
+
logger_1.logger.error(colors_1.default.red('Missing required parameter "statuses". e.g. --statuses=COMPILING,APPROVING'));
|
|
70
|
+
process.exit(1);
|
|
71
|
+
}
|
|
72
|
+
const requestStatuses = statuses.split(',');
|
|
73
|
+
const invalidStatuses = requestStatuses.filter((status) => !Object.values(privacy_types_1.RequestStatus).includes(status));
|
|
74
|
+
if (invalidStatuses.length > 0) {
|
|
75
|
+
logger_1.logger.error(colors_1.default.red(`Received invalid status values: "${invalidStatuses.join(',')}"`));
|
|
76
|
+
process.exit(1);
|
|
77
|
+
}
|
|
78
|
+
// Upload privacy requests
|
|
79
|
+
await (0, requests_1.bulkRestartRequests)({
|
|
80
|
+
requestReceiptFolder,
|
|
81
|
+
auth,
|
|
82
|
+
sombraAuth,
|
|
83
|
+
requestActions,
|
|
84
|
+
requestStatuses,
|
|
85
|
+
requestIds: (0, requests_1.splitCsvToList)(requestIds),
|
|
86
|
+
createdAt: new Date(createdAt),
|
|
87
|
+
markSilent: new Date(markSilent),
|
|
88
|
+
sendEmailReceipt: sendEmailReceipt === 'true',
|
|
89
|
+
copyIdentifiers: copyIdentifiers === 'true',
|
|
90
|
+
skipWaitingPeriod: skipWaitingPeriod === 'true',
|
|
91
|
+
concurrency: parseInt(concurrency, 10),
|
|
92
|
+
transcendUrl,
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
main();
|
|
96
|
+
//# sourceMappingURL=cli-request-restart.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-request-restart.js","sourceRoot":"","sources":["../src/cli-request-restart.ts"],"names":[],"mappings":";;;;;;AAEA,gEAAiC;AACjC,oDAA4B;AAE5B,qCAAkC;AAClC,yCAAiE;AACjE,+DAA2E;AAE3E,MAAM,SAAS,GAAG,IAAI,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAE7C;;;;;;;;;;;;;;GAcG;AACH,KAAK,UAAU,IAAI;IACjB,+BAA+B;IAC/B,MAAM,EACJ,IAAI,EACJ,YAAY,GAAG,0BAA0B,EACzC,UAAU;IACV,sDAAsD;IACtD,OAAO;IACP,uDAAuD;IACvD,QAAQ;IACR,yCAAyC;IACzC,WAAW,GAAG,IAAI;IAClB,0BAA0B;IAC1B,UAAU,GAAG,EAAE;IACf,+DAA+D;IAC/D,SAAS,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;IACpC,2FAA2F;IAC3F,UAAU,GAAG,IAAI,IAAI,CAAC,CAAC,IAAI,IAAI,EAAE,GAAG,SAAS,GAAG,CAAC,CAAC,CAAC,WAAW,EAAE;IAChE,sDAAsD;IACtD,gBAAgB,GAAG,OAAO;IAC1B,iGAAiG;IACjG,eAAe,GAAG,OAAO;IACzB,uDAAuD;IACvD,iBAAiB,GAAG,OAAO;IAC3B,yEAAyE;IACzE,oBAAoB,GAAG,mCAAmC,GAC3D,GAAG,IAAA,sBAAK,EAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAA8B,CAAC;IAE9D,wBAAwB;IACxB,IAAI,CAAC,IAAI,EAAE;QACT,eAAM,CAAC,KAAK,CACV,gBAAM,CAAC,GAAG,CACR,2EAA2E,CAC5E,CACF,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;KACjB;IAED,wBAAwB;IACxB,IAAI,CAAC,OAAO,EAAE;QACZ,eAAM,CAAC,KAAK,CACV,gBAAM,CAAC,GAAG,CACR,qEAAqE,CACtE,CACF,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;KACjB;IACD,MAAM,cAAc,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAoB,CAAC;IAC7D,MAAM,cAAc,GAAG,cAAc,CAAC,MAAM,CAC1C,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,6BAAa,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAC3D,CAAC;IACF,IAAI,cAAc,CAAC,MAAM,GAAG,CAAC,EAAE;QAC7B,eAAM,CAAC,KAAK,CACV,gBAAM,CAAC,GAAG,CACR,oCAAoC,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAChE,CACF,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;KACjB;IAED,yBAAyB;IACzB,IAAI,CAAC,QAAQ,EAAE;QACb,eAAM,CAAC,KAAK,CACV,gBAAM,CAAC,GAAG,CACR,4EAA4E,CAC7E,CACF,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;KACjB;IACD,MAAM,eAAe,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAoB,CAAC;IAC/D,MAAM,eAAe,GAAG,eAAe,CAAC,MAAM,CAC5C,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,6BAAa,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAC3D,CAAC;IACF,IAAI,eAAe,CAAC,MAAM,GAAG,CAAC,EAAE;QAC9B,eAAM,CAAC,KAAK,CACV,gBAAM,CAAC,GAAG,CACR,oCAAoC,eAAe,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CACjE,CACF,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;KACjB;IAED,0BAA0B;IAC1B,MAAM,IAAA,8BAAmB,EAAC;QACxB,oBAAoB;QACpB,IAAI;QACJ,UAAU;QACV,cAAc;QACd,eAAe;QACf,UAAU,EAAE,IAAA,yBAAc,EAAC,UAAU,CAAC;QACtC,SAAS,EAAE,IAAI,IAAI,CAAC,SAAS,CAAC;QAC9B,UAAU,EAAE,IAAI,IAAI,CAAC,UAAU,CAAC;QAChC,gBAAgB,EAAE,gBAAgB,KAAK,MAAM;QAC7C,eAAe,EAAE,eAAe,KAAK,MAAM;QAC3C,iBAAiB,EAAE,iBAAiB,KAAK,MAAM;QAC/C,WAAW,EAAE,QAAQ,CAAC,WAAW,EAAE,EAAE,CAAC;QACtC,YAAY;KACb,CAAC,CAAC;AACL,CAAC;AAED,IAAI,EAAE,CAAC"}
|
package/build/cron/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cron/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cron/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,YAAY,CAAC;AAC3B,cAAc,8BAA8B,CAAC;AAC7C,cAAc,+BAA+B,CAAC"}
|
package/build/cron/index.js
CHANGED
|
@@ -13,4 +13,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
13
13
|
__exportStar(require("./pullCronIdentifiersToCsv"), exports);
|
|
14
14
|
__exportStar(require("./pullCronPageOfIdentifiers"), exports);
|
|
15
15
|
__exportStar(require("./writeCsv"), exports);
|
|
16
|
+
__exportStar(require("./pushCronIdentifiersFromCsv"), exports);
|
|
17
|
+
__exportStar(require("./markCronIdentifierCompleted"), exports);
|
|
16
18
|
//# sourceMappingURL=index.js.map
|
package/build/cron/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cron/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6DAA2C;AAC3C,8DAA4C;AAC5C,6CAA2B"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cron/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6DAA2C;AAC3C,8DAA4C;AAC5C,6CAA2B;AAC3B,+DAA6C;AAC7C,gEAA8C"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Got } from 'got';
|
|
2
|
+
import * as t from 'io-ts';
|
|
3
|
+
/**
|
|
4
|
+
* Minimal set required to mark as completed
|
|
5
|
+
*/
|
|
6
|
+
export declare const CronIdentifierPush: t.TypeC<{
|
|
7
|
+
nonce: t.StringC;
|
|
8
|
+
identifier: t.StringC;
|
|
9
|
+
}>;
|
|
10
|
+
/** Type override */
|
|
11
|
+
export declare type CronIdentifierPush = t.TypeOf<typeof CronIdentifierPush>;
|
|
12
|
+
/**
|
|
13
|
+
* Mark an identifier output by the cron job as completed.
|
|
14
|
+
*
|
|
15
|
+
* @see https://docs.transcend.io/docs/api-reference/PUT/v1/data-silo
|
|
16
|
+
* @param sombra - Sombra instance configured to make requests
|
|
17
|
+
* @param options - Additional options
|
|
18
|
+
* @returns Successfully submitted request
|
|
19
|
+
*/
|
|
20
|
+
export declare function markCronIdentifierCompleted(sombra: Got, { nonce, identifier }: CronIdentifierPush): Promise<void>;
|
|
21
|
+
//# sourceMappingURL=markCronIdentifierCompleted.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markCronIdentifierCompleted.d.ts","sourceRoot":"","sources":["../../src/cron/markCronIdentifierCompleted.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC/B,OAAO,KAAK,CAAC,MAAM,OAAO,CAAC;AAE3B;;GAEG;AACH,eAAO,MAAM,kBAAkB;;;EAG7B,CAAC;AAEH,oBAAoB;AACpB,oBAAY,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAErE;;;;;;;GAOG;AACH,wBAAsB,2BAA2B,CAC/C,MAAM,EAAE,GAAG,EACX,EAAE,KAAK,EAAE,UAAU,EAAE,EAAE,kBAAkB,GACxC,OAAO,CAAC,IAAI,CAAC,CAcf"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
+
exports.markCronIdentifierCompleted = exports.CronIdentifierPush = void 0;
|
|
23
|
+
const t = __importStar(require("io-ts"));
|
|
24
|
+
/**
|
|
25
|
+
* Minimal set required to mark as completed
|
|
26
|
+
*/
|
|
27
|
+
exports.CronIdentifierPush = t.type({
|
|
28
|
+
nonce: t.string,
|
|
29
|
+
identifier: t.string,
|
|
30
|
+
});
|
|
31
|
+
/**
|
|
32
|
+
* Mark an identifier output by the cron job as completed.
|
|
33
|
+
*
|
|
34
|
+
* @see https://docs.transcend.io/docs/api-reference/PUT/v1/data-silo
|
|
35
|
+
* @param sombra - Sombra instance configured to make requests
|
|
36
|
+
* @param options - Additional options
|
|
37
|
+
* @returns Successfully submitted request
|
|
38
|
+
*/
|
|
39
|
+
async function markCronIdentifierCompleted(sombra, { nonce, identifier }) {
|
|
40
|
+
// Make the GraphQL request
|
|
41
|
+
await sombra.put('v1/data-silo', {
|
|
42
|
+
headers: {
|
|
43
|
+
'x-transcend-nonce': nonce,
|
|
44
|
+
},
|
|
45
|
+
json: {
|
|
46
|
+
profiles: [
|
|
47
|
+
{
|
|
48
|
+
profileId: identifier,
|
|
49
|
+
},
|
|
50
|
+
],
|
|
51
|
+
},
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
exports.markCronIdentifierCompleted = markCronIdentifierCompleted;
|
|
55
|
+
//# sourceMappingURL=markCronIdentifierCompleted.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markCronIdentifierCompleted.js","sourceRoot":"","sources":["../../src/cron/markCronIdentifierCompleted.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AACA,yCAA2B;AAE3B;;GAEG;AACU,QAAA,kBAAkB,GAAG,CAAC,CAAC,IAAI,CAAC;IACvC,KAAK,EAAE,CAAC,CAAC,MAAM;IACf,UAAU,EAAE,CAAC,CAAC,MAAM;CACrB,CAAC,CAAC;AAKH;;;;;;;GAOG;AACI,KAAK,UAAU,2BAA2B,CAC/C,MAAW,EACX,EAAE,KAAK,EAAE,UAAU,EAAsB;IAEzC,2BAA2B;IAC3B,MAAM,MAAM,CAAC,GAAG,CAAC,cAAc,EAAE;QAC/B,OAAO,EAAE;YACP,mBAAmB,EAAE,KAAK;SAC3B;QACD,IAAI,EAAE;YACJ,QAAQ,EAAE;gBACR;oBACE,SAAS,EAAE,UAAU;iBACtB;aACF;SACF;KACF,CAAC,CAAC;AACL,CAAC;AAjBD,kEAiBC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Given a CSV of cron job outputs, mark all requests as completed in Transcend
|
|
3
|
+
*
|
|
4
|
+
* @param options - Options
|
|
5
|
+
* @returns Number of items marked as completed
|
|
6
|
+
*/
|
|
7
|
+
export declare function pushCronIdentifiersFromCsv({ file, dataSiloId, auth, sombraAuth, concurrency, transcendUrl, }: {
|
|
8
|
+
/** CSV file path */
|
|
9
|
+
file: string;
|
|
10
|
+
/** Transcend API key authentication */
|
|
11
|
+
auth: string;
|
|
12
|
+
/** Data Silo ID to pull down jobs for */
|
|
13
|
+
dataSiloId: string;
|
|
14
|
+
/** Upload concurrency */
|
|
15
|
+
concurrency?: number;
|
|
16
|
+
/** API URL for Transcend backend */
|
|
17
|
+
transcendUrl?: string;
|
|
18
|
+
/** Sombra API key authentication */
|
|
19
|
+
sombraAuth?: string;
|
|
20
|
+
}): Promise<number>;
|
|
21
|
+
//# sourceMappingURL=pushCronIdentifiersFromCsv.d.ts.map
|