posemesh-domain-http 1.5.3

HTTP client library for interacting with AukiLabs domain data services, supporting both native and WebAssembly targets.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
use crate::domain_data::{
    DomainData, DomainDataMetadata, DownloadQuery, UploadDomainData, delete_by_id, download_by_id,
    download_metadata_v1, download_v1_stream, upload_v1,
};
use futures::channel::mpsc::Receiver;
use serde::{Deserialize, Serialize};

pub use crate::auth;
use crate::auth::TokenCache;
pub use crate::config;
use crate::discovery::{DiscoveryService, DomainWithToken, ListDomainsResponse};
use crate::errors::DomainError;
pub use crate::reconstruction::JobRequest;

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ListDomainsQuery {
    pub portal_id: Option<String>,
    pub portal_short_id: Option<String>,
    pub org: String,
    pub domain_server_id: Option<String>,
}

#[derive(Debug, Clone)]
pub struct DomainClient {
    discovery_client: DiscoveryService,
    pub client_id: String,
}

impl DomainClient {
    pub fn new(api_url: &str, dds_url: &str, client_id: &str) -> Self {
        if client_id.is_empty() {
            panic!("client_id is empty");
        }
        Self {
            discovery_client: DiscoveryService::new(api_url, dds_url, client_id),
            client_id: client_id.to_string(),
        }
    }

    pub async fn new_with_app_credential(
        api_url: &str,
        dds_url: &str,
        client_id: &str,
        app_key: &str,
        app_secret: &str,
    ) -> Result<Self, DomainError> {
        let mut dc = DomainClient::new(api_url, dds_url, client_id);
        let _ = dc
            .discovery_client
            .sign_in_as_auki_app(app_key, app_secret)
            .await?;
        Ok(dc)
    }

    pub async fn new_with_user_credential(
        api_url: &str,
        dds_url: &str,
        client_id: &str,
        email: &str,
        password: &str,
        remember_password: bool,
    ) -> Result<Self, DomainError> {
        let mut dc = DomainClient::new(api_url, dds_url, client_id);
        let _ = dc
            .discovery_client
            .sign_in_with_auki_account(email, password, remember_password)
            .await?;
        Ok(dc)
    }

    pub fn with_oidc_access_token(&self, token: &str) -> Self {
        Self {
            discovery_client: self.discovery_client.with_oidc_access_token(token),
            client_id: self.client_id.clone(),
        }
    }

    pub async fn download_domain_data_stream(
        &self,
        domain_id: &str,
        query: &DownloadQuery,
    ) -> Result<Receiver<Result<DomainData, DomainError>>, DomainError> {
        let domain = self.discovery_client.auth_domain(domain_id).await?;
        let rx = download_v1_stream(
            &domain.domain.domain_server.url,
            &self.client_id,
            &domain.get_access_token(),
            domain_id,
            query,
        )
        .await?;
        Ok(rx)
    }

    pub async fn download_domain_data(
        &self,
        domain_id: &str,
        query: &DownloadQuery,
    ) -> Result<Vec<DomainData>, DomainError> {
        use futures::StreamExt;
        let mut rx = self.download_domain_data_stream(domain_id, query).await?;

        let mut results = Vec::new();
        while let Some(result) = rx.next().await {
            results.push(result?);
        }
        Ok(results)
    }

    #[cfg(not(target_family = "wasm"))]
    pub async fn upload_domain_data_stream(
        &self,
        domain_id: &str,
        data: Receiver<UploadDomainData>,
    ) -> Result<Vec<DomainDataMetadata>, DomainError> {
        use crate::{auth::TokenCache, domain_data::upload_v1_stream};
        let domain = self.discovery_client.auth_domain(domain_id).await?;
        upload_v1_stream(
            &domain.domain.domain_server.url,
            &domain.get_access_token(),
            domain_id,
            data,
        )
        .await
    }

    pub async fn upload_domain_data(
        &self,
        domain_id: &str,
        data: Vec<UploadDomainData>,
    ) -> Result<Vec<DomainDataMetadata>, DomainError> {
        let domain = self.discovery_client.auth_domain(domain_id).await?;
        upload_v1(
            &domain.domain.domain_server.url,
            &domain.get_access_token(),
            domain_id,
            data,
        )
        .await
    }

    pub async fn download_metadata(
        &self,
        domain_id: &str,
        query: &DownloadQuery,
    ) -> Result<Vec<DomainDataMetadata>, DomainError> {
        let domain = self.discovery_client.auth_domain(domain_id).await?;
        download_metadata_v1(
            &domain.domain.domain_server.url,
            &self.client_id,
            &domain.get_access_token(),
            domain_id,
            query,
        )
        .await
    }

    pub async fn download_domain_data_by_id(
        &self,
        domain_id: &str,
        id: &str,
    ) -> Result<Vec<u8>, DomainError> {
        let domain = self.discovery_client.auth_domain(domain_id).await?;
        download_by_id(
            &domain.domain.domain_server.url,
            &self.client_id,
            &domain.get_access_token(),
            domain_id,
            id,
        )
        .await
    }

    pub async fn delete_domain_data_by_id(
        &self,
        domain_id: &str,
        id: &str,
    ) -> Result<(), DomainError> {
        let domain = self.discovery_client.auth_domain(domain_id).await?;
        delete_by_id(
            &domain.domain.domain_server.url,
            &domain.get_access_token(),
            domain_id,
            id,
        )
        .await
    }

    pub async fn submit_job_request_v1(
        &self,
        domain_id: &str,
        request: &JobRequest,
    ) -> Result<reqwest::Response, DomainError> {
        let domain = self.discovery_client.auth_domain(domain_id).await?;
        crate::reconstruction::forward_job_request_v1(
            &domain.domain.domain_server.url,
            &self.client_id,
            &domain.get_access_token(),
            domain_id,
            request,
        )
        .await
    }

    /// Lists domains the caller has access to.
    ///
    /// # Arguments
    /// * `query` - The `ListDomainsQuery` object containing the query parameters.
    ///
    /// - org: (required) The organization to list domains from:
    ///   - "own": returns domains in your own organization.
    ///   - a UUID: returns domains in that specific organization.
    ///   - "all": returns domains across all organizations. When filtering by 'portal' (see below), this works without restrictions.
    ///     Otherwise, 'domain_server_id' is required and the domain server must belong to your org.
    ///     Not available for app tokens without a portal filter.
    /// - portal_id: (optional) Full UUID of a portal to filter domains. Mutually exclusive with 'portal_short_id'.
    /// - portal_short_id: (optional) Short ID of a portal to filter domains. Mutually exclusive with 'portal_id'.
    /// - domain_server_id: (optional) UUID of the domain server to filter domains. Ignored if a portal filter is active.
    ///
    /// # Returns
    /// * `ListDomainsResponse` - The list of domains the caller has access to.
    ///
    pub async fn list_domains(
        &self,
        query: &ListDomainsQuery,
    ) -> Result<ListDomainsResponse, DomainError> {
        if query.portal_id.is_none() && query.portal_short_id.is_none() {
            self.discovery_client
                .list_domains(&query.org, query.domain_server_id.as_deref())
                .await
        } else {
            self.discovery_client
                .list_domains_by_portal(
                    query.portal_id.as_deref(),
                    query.portal_short_id.as_deref(),
                    &query.org,
                )
                .await
        }
    }

    pub async fn create_domain(
        &self,
        name: &str,
        domain_server_id: Option<String>,
        domain_server_url: Option<String>,
        redirect_url: Option<String>,
    ) -> Result<DomainWithToken, DomainError> {
        self.discovery_client
            .create_domain(name, domain_server_id, domain_server_url, redirect_url)
            .await
    }

    pub async fn delete_domain(&self, domain_id: &str) -> Result<(), DomainError> {
        let domain = self.discovery_client.auth_domain(domain_id).await?;
        self.discovery_client
            .delete_domain(&domain.get_access_token(), domain_id)
            .await
    }
}

#[cfg(not(target_family = "wasm"))]
#[cfg(test)]
mod tests {
    use crate::{
        auth::AuthClient,
        discovery::OWN_DOMAINS_ORG,
        domain_data::{DomainAction, UploadDomainData},
    };

    use super::*;
    use futures::channel::mpsc;
    use tokio::spawn;

    fn get_config() -> (config::Config, String) {
        if std::path::Path::new("../.env.local").exists() {
            dotenvy::from_filename("../.env.local").ok();
        }
        dotenvy::dotenv().ok();
        let config = config::Config::from_env().unwrap();
        (config, std::env::var("DOMAIN_ID").unwrap())
    }

    async fn create_test_domain(config: &config::Config) -> Result<DomainWithToken, DomainError> {
        let client = DomainClient::new_with_user_credential(
            &config.api_url,
            &config.dds_url,
            &config.client_id,
            &config.email.clone().unwrap(),
            &config.password.clone().unwrap(),
            true,
        )
        .await
        .expect("Failed to create test client");
        client
            .create_domain(
                &format!("test_domain_{}", uuid::Uuid::new_v4()),
                None,
                Some(std::env::var("TEST_DOMAIN_SERVER_URL").unwrap()),
                None,
            )
            .await
    }

    async fn delete_test_domain(
        config: &config::Config,
        domain_id: &str,
    ) -> Result<(), DomainError> {
        let client = DomainClient::new_with_user_credential(
            &config.api_url,
            &config.dds_url,
            &config.client_id,
            &config.email.clone().unwrap(),
            &config.password.clone().unwrap(),
            true,
        )
        .await
        .expect("Failed to create test client");
        client.delete_domain(domain_id).await
    }

    async fn create_test_domain_data(
        config: &config::Config,
        domain_id: &str,
    ) -> Result<Vec<DomainDataMetadata>, DomainError> {
        let client = DomainClient::new_with_user_credential(
            &config.api_url,
            &config.dds_url,
            &config.client_id,
            &config.email.clone().unwrap(),
            &config.password.clone().unwrap(),
            true,
        )
        .await
        .expect("Failed to create test client");

        let data = vec![UploadDomainData {
            action: DomainAction::Create {
                name: "to be deleted".to_string(),
                data_type: "test".to_string(),
            },
            data: "{\"test\": \"test\"}".as_bytes().to_vec(),
        }];
        client.upload_domain_data(domain_id, data).await
    }

    #[tokio::test]
    async fn get_organization_id() {
        let config = get_config();
        let mut client = AuthClient::new(&config.0.api_url, &config.0.client_id);
        client
            .sign_in_with_app_credentials(&config.0.app_key.unwrap(), &config.0.app_secret.unwrap())
            .await
            .expect("Failed to sign in with app credentials");
        let token = client
            .get_dds_access_token(None)
            .await
            .expect("Failed to get DDS access token");
        let claims = auth::parse_jwt(&token).expect("Failed to parse JWT");
        assert!(claims.org.is_some());
    }

    #[tokio::test]
    async fn test_download_domain_data_with_app_credential() {
        // Create a test client
        let config = get_config();
        let config = config.0.clone();
        let client = DomainClient::new_with_app_credential(
            &config.api_url,
            &config.dds_url,
            &config.client_id,
            &config.app_key.clone().unwrap(),
            &config.app_secret.clone().unwrap(),
        )
        .await
        .expect("Failed to create client");

        let domain = create_test_domain(&config)
            .await
            .expect("Failed to create test domain");
        let domain_id = domain.domain.id.clone();

        let created = create_test_domain_data(&config, &domain_id)
            .await
            .expect("Failed to create test domain data");
        assert_eq!(created.len(), 1);
        assert_eq!(created[0].name, "to be deleted");
        assert_eq!(created[0].data_type, "test");

        // Create a test query
        let query = DownloadQuery {
            ids: vec![],
            name: None,
            data_type: Some("test".to_string()),
        };

        // Test the download function
        let result = client.download_domain_data(&domain_id, &query).await;

        assert!(result.is_ok(), "error message : {:?}", result.err());

        let results = result.unwrap();
        assert!(!results.is_empty());
        for result in results {
            assert_eq!(result.metadata.data_type, "test");
        }

        // Delete the domain
        delete_test_domain(&config, &domain_id)
            .await
            .expect("Failed to delete test domain");
    }

    #[tokio::test]
    async fn test_upload_domain_data_with_user_credential() {
        use futures::SinkExt;
        let config = get_config();
        let client = DomainClient::new_with_user_credential(
            &config.0.api_url,
            &config.0.dds_url,
            &config.0.client_id,
            &config.0.email.clone().unwrap(),
            &config.0.password.clone().unwrap(),
            true,
        )
        .await
        .expect("Failed to create client");

        let domain = create_test_domain(&config.0)
            .await
            .expect("Failed to create test domain");
        let domain_id = domain.domain.id.clone();

        let created = create_test_domain_data(&config.0, &domain_id)
            .await
            .expect("Failed to create test domain data");
        assert_eq!(created.len(), 1);
        assert_eq!(created[0].name, "to be deleted");
        assert_eq!(created[0].data_type, "test");

        let data = vec![
            UploadDomainData {
                action: DomainAction::Update {
                    id: created[0].id.clone(),
                },
                data: "{\"test\": \"test updated\"}".as_bytes().to_vec(),
            },
            UploadDomainData {
                action: DomainAction::Create {
                    name: "to be deleted2".to_string(),
                    data_type: "test".to_string(),
                },
                data: "{\"test\": \"test\"}".as_bytes().to_vec(),
            },
        ];
        let (mut tx, rx) = mpsc::channel(10);
        spawn(async move {
            for d in data {
                tx.send(d).await.unwrap();
            }
            tx.close().await.unwrap();
        });
        let result = client.upload_domain_data_stream(&domain_id, rx).await;
        assert!(result.is_ok(), "error message : {:?}", result.err());
        let created2 = result.unwrap();
        assert_eq!(created2.len(), 2);

        let ids = created2
            .iter()
            .map(|d| d.id.clone())
            .collect::<Vec<String>>();
        assert_eq!(ids.len(), 2);
        // Create a test query
        let query = DownloadQuery {
            ids,
            name: None,
            data_type: None,
        };

        // Test the download function
        let result = client.download_domain_data(&domain_id, &query).await;

        assert!(result.is_ok(), "error message : {:?}", result.err());

        let mut to_delete = None;
        let mut count = 0;
        let results = result.unwrap();
        for result in results {
            count += 1;
            if result.metadata.id == created[0].id {
                assert_eq!(result.data, b"{\"test\": \"test updated\"}");
                continue;
            } else {
                assert_eq!(result.data, b"{\"test\": \"test\"}");
            }
            to_delete = Some(result.metadata.id.clone());
        }
        assert_eq!(count, 2);
        assert!(to_delete.is_some());

        // Delete the one whose id is not "a8"
        let delete_result = client
            .delete_domain_data_by_id(&domain_id, &to_delete.unwrap())
            .await;
        assert!(
            delete_result.is_ok(),
            "Failed to delete data by id: {:?}",
            delete_result.err()
        );

        // Delete the domain
        delete_test_domain(&config.0, &domain_id)
            .await
            .expect("Failed to delete test domain");
    }

    #[tokio::test]
    async fn test_download_domain_data_by_id() {
        let config = get_config();
        let client = DomainClient::new_with_app_credential(
            &config.0.api_url,
            &config.0.dds_url,
            &config.0.client_id,
            &config.0.app_key.clone().unwrap(),
            &config.0.app_secret.clone().unwrap(),
        )
        .await
        .expect("Failed to create client");

        let domain = create_test_domain(&config.0)
            .await
            .expect("Failed to create test domain");
        let domain_id = domain.domain.id.clone();

        let created = create_test_domain_data(&config.0, &domain_id)
            .await
            .expect("Failed to create test domain data");
        assert_eq!(created.len(), 1);
        assert_eq!(created[0].name, "to be deleted");
        assert_eq!(created[0].data_type, "test");

        // Now test download by id
        let download_result = client
            .download_domain_data_by_id(&domain_id, &created[0].id)
            .await;

        assert!(
            download_result.is_ok(),
            "download by id failed: {:?}",
            download_result.err()
        );
        let downloaded_bytes = download_result.unwrap();
        assert_eq!(downloaded_bytes, b"{\"test\": \"test\"}".to_vec());

        // Delete the domain
        delete_test_domain(&config.0, &domain_id)
            .await
            .expect("Failed to delete test domain");
    }

    #[tokio::test]
    async fn test_download_domain_metadata() {
        let config = get_config();
        let client = DomainClient::new_with_app_credential(
            &config.0.api_url,
            &config.0.dds_url,
            &config.0.client_id,
            &config.0.app_key.clone().unwrap(),
            &config.0.app_secret.clone().unwrap(),
        )
        .await
        .expect("Failed to create client");

        let domain = create_test_domain(&config.0)
            .await
            .expect("Failed to create test domain");
        let domain_id = domain.domain.id.clone();

        let created = create_test_domain_data(&config.0, &domain_id)
            .await
            .expect("Failed to create test domain data");
        assert_eq!(created.len(), 1);
        assert_eq!(created[0].name, "to be deleted");
        assert_eq!(created[0].data_type, "test");

        // Download all metadata for the domain
        let result = client
            .download_metadata(
                &domain_id,
                &DownloadQuery {
                    ids: vec![],
                    name: None,
                    data_type: Some("test".to_string()),
                },
            )
            .await;
        assert!(
            result.is_ok(),
            "Failed to download domain metadata: {:?}",
            result.err()
        );
        let result = result.unwrap();
        assert!(!result.is_empty());
        for meta in result {
            assert!(!meta.id.is_empty());
            assert_eq!(meta.domain_id, domain_id);
            assert!(!meta.name.is_empty());
            assert_eq!(meta.data_type, "test");
        }

        // Delete the domain
        delete_test_domain(&config.0, &domain_id)
            .await
            .expect("Failed to delete test domain");
    }

    #[tokio::test]
    async fn test_load_domain_with_oidc_access_token() {
        let config = get_config();
        // Assume we have a function to get a valid oidc_access_token for testing
        let oidc_access_token =
            std::env::var("AUTH_TEST_TOKEN").expect("AUTH_TEST_TOKEN env var not set");
        if oidc_access_token.is_empty() {
            eprintln!("Missing AUTH_TEST_TOKEN, skipping test");
            return;
        }

        let client =
            DiscoveryService::new(&config.0.api_url, &config.0.dds_url, &config.0.client_id);

        let domain = client
            .with_oidc_access_token(&oidc_access_token)
            .auth_domain(&config.1)
            .await;
        assert!(domain.is_ok(), "Failed to get domain: {:?}", domain.err());
        assert_eq!(domain.unwrap().domain.id, config.1);
    }

    #[tokio::test]
    async fn test_list_domains() {
        let config = get_config();
        let client = DomainClient::new_with_app_credential(
            &config.0.api_url,
            &config.0.dds_url,
            &config.0.client_id,
            &config.0.app_key.unwrap(),
            &config.0.app_secret.unwrap(),
        )
        .await
        .expect("Failed to create client");

        let org = std::env::var("TEST_ORGANIZATION").unwrap_or("own".to_string());
        let result = client
            .list_domains(&ListDomainsQuery {
                portal_id: None,
                portal_short_id: None,
                org,
                domain_server_id: None,
            })
            .await
            .unwrap();
        assert!(!result.domains.is_empty(), "No domains found");
    }

    #[tokio::test]
    async fn test_list_domains_by_domain_server_id() {
        let config = get_config();
        let client = DomainClient::new_with_app_credential(
            &config.0.api_url,
            &config.0.dds_url,
            &config.0.client_id,
            &config.0.app_key.clone().unwrap(),
            &config.0.app_secret.clone().unwrap(),
        )
        .await
        .expect("Failed to create client");

        // Use a known domain_server_id from one of the domains
        let all_domains = client
            .list_domains(&ListDomainsQuery {
                portal_id: None,
                portal_short_id: None,
                org: OWN_DOMAINS_ORG.to_string(),
                domain_server_id: None,
            })
            .await
            .expect("Failed to list all domains");
        assert!(!all_domains.domains.is_empty(), "No domains found");

        let domain_server_id = &all_domains.domains[0].domain_server_id;

        let filtered_domains = client
            .list_domains(&ListDomainsQuery {
                portal_id: None,
                portal_short_id: None,
                org: OWN_DOMAINS_ORG.to_string(),
                domain_server_id: Some(domain_server_id.clone()),
            })
            .await
            .expect("Failed to list domains by domain_server_id");

        // Make sure every returned domain matches the domain_server_id
        assert!(
            !filtered_domains.domains.is_empty(),
            "Filtered domains should not be empty"
        );
        for domain in &filtered_domains.domains {
            assert_eq!(
                &domain.domain_server_id, domain_server_id,
                "Domain server id should match the filter"
            );
        }
    }

    #[tokio::test]
    async fn test_submit_job_request_v1_with_invalid_processing_type() {
        let config = get_config();
        let client = DomainClient::new_with_user_credential(
            &config.0.api_url,
            &config.0.dds_url,
            &config.0.client_id,
            &config.0.email.unwrap(),
            &config.0.password.unwrap(),
            true,
        )
        .await
        .expect("Failed to create client");

        let job_request = JobRequest {
            processing_type: "invalid_processing_type".to_string(),
            ..Default::default()
        };
        let res = client
            .submit_job_request_v1(&config.1, &job_request)
            .await
            .expect_err("Failed to submit job request");
        assert_eq!(
            res.to_string(),
            "Auki response - status: 400 Bad Request, error: Failed to process domain. invalid processing type"
        );
    }
}