@seamapi/http 1.26.1 → 1.28.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 +6 -1
- package/dist/connect.cjs +24 -1
- package/dist/connect.cjs.map +1 -1
- package/dist/connect.d.cts +18 -16
- package/lib/seam/connect/options.d.ts +3 -1
- package/lib/seam/connect/options.js.map +1 -1
- package/lib/seam/connect/parse-options.js +29 -1
- package/lib/seam/connect/parse-options.js.map +1 -1
- package/lib/seam/connect/resolve-action-attempt.d.ts +16 -16
- package/lib/seam/connect/seam-http-multi-workspace.d.ts +1 -1
- package/lib/seam/connect/seam-http-multi-workspace.js +1 -1
- package/lib/seam/connect/seam-http-multi-workspace.js.map +1 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +3 -3
- package/src/lib/seam/connect/options.ts +4 -0
- package/src/lib/seam/connect/parse-options.ts +42 -0
- package/src/lib/seam/connect/seam-http-multi-workspace.ts +1 -1
- package/src/lib/version.ts +1 -1
|
@@ -140,6 +140,7 @@ export declare const resolveActionAttempt: <T extends {
|
|
|
140
140
|
door_names?: string[] | undefined;
|
|
141
141
|
} | undefined;
|
|
142
142
|
is_one_time_use?: boolean | undefined;
|
|
143
|
+
issued_at?: string | null | undefined;
|
|
143
144
|
external_type?: "pti_card" | "brivo_credential" | "hid_credential" | "visionline_card" | "salto_ks_credential" | "assa_abloy_vostio_key" | "salto_space_key" | undefined;
|
|
144
145
|
external_type_display_name?: string | undefined;
|
|
145
146
|
acs_user_id?: string | undefined;
|
|
@@ -147,7 +148,6 @@ export declare const resolveActionAttempt: <T extends {
|
|
|
147
148
|
parent_acs_credential_id?: string | undefined;
|
|
148
149
|
card_number?: string | null | undefined;
|
|
149
150
|
is_issued?: boolean | undefined;
|
|
150
|
-
issued_at?: string | null | undefined;
|
|
151
151
|
is_multi_phone_sync_credential?: boolean | undefined;
|
|
152
152
|
is_latest_desired_state_synced_with_provider?: boolean | null | undefined;
|
|
153
153
|
latest_desired_state_synced_with_provider_at?: string | null | undefined;
|
|
@@ -209,6 +209,7 @@ export declare const resolveActionAttempt: <T extends {
|
|
|
209
209
|
door_names?: string[] | undefined;
|
|
210
210
|
} | undefined;
|
|
211
211
|
is_one_time_use?: boolean | undefined;
|
|
212
|
+
issued_at?: string | null | undefined;
|
|
212
213
|
external_type?: "pti_card" | "brivo_credential" | "hid_credential" | "visionline_card" | "salto_ks_credential" | "assa_abloy_vostio_key" | "salto_space_key" | undefined;
|
|
213
214
|
external_type_display_name?: string | undefined;
|
|
214
215
|
acs_user_id?: string | undefined;
|
|
@@ -216,7 +217,6 @@ export declare const resolveActionAttempt: <T extends {
|
|
|
216
217
|
parent_acs_credential_id?: string | undefined;
|
|
217
218
|
card_number?: string | null | undefined;
|
|
218
219
|
is_issued?: boolean | undefined;
|
|
219
|
-
issued_at?: string | null | undefined;
|
|
220
220
|
is_multi_phone_sync_credential?: boolean | undefined;
|
|
221
221
|
is_latest_desired_state_synced_with_provider?: boolean | null | undefined;
|
|
222
222
|
latest_desired_state_synced_with_provider_at?: string | null | undefined;
|
|
@@ -306,6 +306,7 @@ export declare const resolveActionAttempt: <T extends {
|
|
|
306
306
|
door_names?: string[] | undefined;
|
|
307
307
|
} | undefined;
|
|
308
308
|
is_one_time_use?: boolean | undefined;
|
|
309
|
+
issued_at?: string | null | undefined;
|
|
309
310
|
external_type?: "pti_card" | "brivo_credential" | "hid_credential" | "visionline_card" | "salto_ks_credential" | "assa_abloy_vostio_key" | "salto_space_key" | undefined;
|
|
310
311
|
external_type_display_name?: string | undefined;
|
|
311
312
|
acs_user_id?: string | undefined;
|
|
@@ -313,7 +314,6 @@ export declare const resolveActionAttempt: <T extends {
|
|
|
313
314
|
parent_acs_credential_id?: string | undefined;
|
|
314
315
|
card_number?: string | null | undefined;
|
|
315
316
|
is_issued?: boolean | undefined;
|
|
316
|
-
issued_at?: string | null | undefined;
|
|
317
317
|
is_multi_phone_sync_credential?: boolean | undefined;
|
|
318
318
|
is_latest_desired_state_synced_with_provider?: boolean | null | undefined;
|
|
319
319
|
latest_desired_state_synced_with_provider_at?: string | null | undefined;
|
|
@@ -375,6 +375,7 @@ export declare const resolveActionAttempt: <T extends {
|
|
|
375
375
|
door_names?: string[] | undefined;
|
|
376
376
|
} | undefined;
|
|
377
377
|
is_one_time_use?: boolean | undefined;
|
|
378
|
+
issued_at?: string | null | undefined;
|
|
378
379
|
external_type?: "pti_card" | "brivo_credential" | "hid_credential" | "visionline_card" | "salto_ks_credential" | "assa_abloy_vostio_key" | "salto_space_key" | undefined;
|
|
379
380
|
external_type_display_name?: string | undefined;
|
|
380
381
|
acs_user_id?: string | undefined;
|
|
@@ -382,7 +383,6 @@ export declare const resolveActionAttempt: <T extends {
|
|
|
382
383
|
parent_acs_credential_id?: string | undefined;
|
|
383
384
|
card_number?: string | null | undefined;
|
|
384
385
|
is_issued?: boolean | undefined;
|
|
385
|
-
issued_at?: string | null | undefined;
|
|
386
386
|
is_multi_phone_sync_credential?: boolean | undefined;
|
|
387
387
|
is_latest_desired_state_synced_with_provider?: boolean | null | undefined;
|
|
388
388
|
latest_desired_state_synced_with_provider_at?: string | null | undefined;
|
|
@@ -787,6 +787,7 @@ export declare const isSeamActionAttemptError: <T extends {
|
|
|
787
787
|
door_names?: string[] | undefined;
|
|
788
788
|
} | undefined;
|
|
789
789
|
is_one_time_use?: boolean | undefined;
|
|
790
|
+
issued_at?: string | null | undefined;
|
|
790
791
|
external_type?: "pti_card" | "brivo_credential" | "hid_credential" | "visionline_card" | "salto_ks_credential" | "assa_abloy_vostio_key" | "salto_space_key" | undefined;
|
|
791
792
|
external_type_display_name?: string | undefined;
|
|
792
793
|
acs_user_id?: string | undefined;
|
|
@@ -794,7 +795,6 @@ export declare const isSeamActionAttemptError: <T extends {
|
|
|
794
795
|
parent_acs_credential_id?: string | undefined;
|
|
795
796
|
card_number?: string | null | undefined;
|
|
796
797
|
is_issued?: boolean | undefined;
|
|
797
|
-
issued_at?: string | null | undefined;
|
|
798
798
|
is_multi_phone_sync_credential?: boolean | undefined;
|
|
799
799
|
is_latest_desired_state_synced_with_provider?: boolean | null | undefined;
|
|
800
800
|
latest_desired_state_synced_with_provider_at?: string | null | undefined;
|
|
@@ -856,6 +856,7 @@ export declare const isSeamActionAttemptError: <T extends {
|
|
|
856
856
|
door_names?: string[] | undefined;
|
|
857
857
|
} | undefined;
|
|
858
858
|
is_one_time_use?: boolean | undefined;
|
|
859
|
+
issued_at?: string | null | undefined;
|
|
859
860
|
external_type?: "pti_card" | "brivo_credential" | "hid_credential" | "visionline_card" | "salto_ks_credential" | "assa_abloy_vostio_key" | "salto_space_key" | undefined;
|
|
860
861
|
external_type_display_name?: string | undefined;
|
|
861
862
|
acs_user_id?: string | undefined;
|
|
@@ -863,7 +864,6 @@ export declare const isSeamActionAttemptError: <T extends {
|
|
|
863
864
|
parent_acs_credential_id?: string | undefined;
|
|
864
865
|
card_number?: string | null | undefined;
|
|
865
866
|
is_issued?: boolean | undefined;
|
|
866
|
-
issued_at?: string | null | undefined;
|
|
867
867
|
is_multi_phone_sync_credential?: boolean | undefined;
|
|
868
868
|
is_latest_desired_state_synced_with_provider?: boolean | null | undefined;
|
|
869
869
|
latest_desired_state_synced_with_provider_at?: string | null | undefined;
|
|
@@ -953,6 +953,7 @@ export declare const isSeamActionAttemptError: <T extends {
|
|
|
953
953
|
door_names?: string[] | undefined;
|
|
954
954
|
} | undefined;
|
|
955
955
|
is_one_time_use?: boolean | undefined;
|
|
956
|
+
issued_at?: string | null | undefined;
|
|
956
957
|
external_type?: "pti_card" | "brivo_credential" | "hid_credential" | "visionline_card" | "salto_ks_credential" | "assa_abloy_vostio_key" | "salto_space_key" | undefined;
|
|
957
958
|
external_type_display_name?: string | undefined;
|
|
958
959
|
acs_user_id?: string | undefined;
|
|
@@ -960,7 +961,6 @@ export declare const isSeamActionAttemptError: <T extends {
|
|
|
960
961
|
parent_acs_credential_id?: string | undefined;
|
|
961
962
|
card_number?: string | null | undefined;
|
|
962
963
|
is_issued?: boolean | undefined;
|
|
963
|
-
issued_at?: string | null | undefined;
|
|
964
964
|
is_multi_phone_sync_credential?: boolean | undefined;
|
|
965
965
|
is_latest_desired_state_synced_with_provider?: boolean | null | undefined;
|
|
966
966
|
latest_desired_state_synced_with_provider_at?: string | null | undefined;
|
|
@@ -1022,6 +1022,7 @@ export declare const isSeamActionAttemptError: <T extends {
|
|
|
1022
1022
|
door_names?: string[] | undefined;
|
|
1023
1023
|
} | undefined;
|
|
1024
1024
|
is_one_time_use?: boolean | undefined;
|
|
1025
|
+
issued_at?: string | null | undefined;
|
|
1025
1026
|
external_type?: "pti_card" | "brivo_credential" | "hid_credential" | "visionline_card" | "salto_ks_credential" | "assa_abloy_vostio_key" | "salto_space_key" | undefined;
|
|
1026
1027
|
external_type_display_name?: string | undefined;
|
|
1027
1028
|
acs_user_id?: string | undefined;
|
|
@@ -1029,7 +1030,6 @@ export declare const isSeamActionAttemptError: <T extends {
|
|
|
1029
1030
|
parent_acs_credential_id?: string | undefined;
|
|
1030
1031
|
card_number?: string | null | undefined;
|
|
1031
1032
|
is_issued?: boolean | undefined;
|
|
1032
|
-
issued_at?: string | null | undefined;
|
|
1033
1033
|
is_multi_phone_sync_credential?: boolean | undefined;
|
|
1034
1034
|
is_latest_desired_state_synced_with_provider?: boolean | null | undefined;
|
|
1035
1035
|
latest_desired_state_synced_with_provider_at?: string | null | undefined;
|
|
@@ -1436,6 +1436,7 @@ export declare const isSeamActionAttemptFailedError: <T extends {
|
|
|
1436
1436
|
door_names?: string[] | undefined;
|
|
1437
1437
|
} | undefined;
|
|
1438
1438
|
is_one_time_use?: boolean | undefined;
|
|
1439
|
+
issued_at?: string | null | undefined;
|
|
1439
1440
|
external_type?: "pti_card" | "brivo_credential" | "hid_credential" | "visionline_card" | "salto_ks_credential" | "assa_abloy_vostio_key" | "salto_space_key" | undefined;
|
|
1440
1441
|
external_type_display_name?: string | undefined;
|
|
1441
1442
|
acs_user_id?: string | undefined;
|
|
@@ -1443,7 +1444,6 @@ export declare const isSeamActionAttemptFailedError: <T extends {
|
|
|
1443
1444
|
parent_acs_credential_id?: string | undefined;
|
|
1444
1445
|
card_number?: string | null | undefined;
|
|
1445
1446
|
is_issued?: boolean | undefined;
|
|
1446
|
-
issued_at?: string | null | undefined;
|
|
1447
1447
|
is_multi_phone_sync_credential?: boolean | undefined;
|
|
1448
1448
|
is_latest_desired_state_synced_with_provider?: boolean | null | undefined;
|
|
1449
1449
|
latest_desired_state_synced_with_provider_at?: string | null | undefined;
|
|
@@ -1505,6 +1505,7 @@ export declare const isSeamActionAttemptFailedError: <T extends {
|
|
|
1505
1505
|
door_names?: string[] | undefined;
|
|
1506
1506
|
} | undefined;
|
|
1507
1507
|
is_one_time_use?: boolean | undefined;
|
|
1508
|
+
issued_at?: string | null | undefined;
|
|
1508
1509
|
external_type?: "pti_card" | "brivo_credential" | "hid_credential" | "visionline_card" | "salto_ks_credential" | "assa_abloy_vostio_key" | "salto_space_key" | undefined;
|
|
1509
1510
|
external_type_display_name?: string | undefined;
|
|
1510
1511
|
acs_user_id?: string | undefined;
|
|
@@ -1512,7 +1513,6 @@ export declare const isSeamActionAttemptFailedError: <T extends {
|
|
|
1512
1513
|
parent_acs_credential_id?: string | undefined;
|
|
1513
1514
|
card_number?: string | null | undefined;
|
|
1514
1515
|
is_issued?: boolean | undefined;
|
|
1515
|
-
issued_at?: string | null | undefined;
|
|
1516
1516
|
is_multi_phone_sync_credential?: boolean | undefined;
|
|
1517
1517
|
is_latest_desired_state_synced_with_provider?: boolean | null | undefined;
|
|
1518
1518
|
latest_desired_state_synced_with_provider_at?: string | null | undefined;
|
|
@@ -1602,6 +1602,7 @@ export declare const isSeamActionAttemptFailedError: <T extends {
|
|
|
1602
1602
|
door_names?: string[] | undefined;
|
|
1603
1603
|
} | undefined;
|
|
1604
1604
|
is_one_time_use?: boolean | undefined;
|
|
1605
|
+
issued_at?: string | null | undefined;
|
|
1605
1606
|
external_type?: "pti_card" | "brivo_credential" | "hid_credential" | "visionline_card" | "salto_ks_credential" | "assa_abloy_vostio_key" | "salto_space_key" | undefined;
|
|
1606
1607
|
external_type_display_name?: string | undefined;
|
|
1607
1608
|
acs_user_id?: string | undefined;
|
|
@@ -1609,7 +1610,6 @@ export declare const isSeamActionAttemptFailedError: <T extends {
|
|
|
1609
1610
|
parent_acs_credential_id?: string | undefined;
|
|
1610
1611
|
card_number?: string | null | undefined;
|
|
1611
1612
|
is_issued?: boolean | undefined;
|
|
1612
|
-
issued_at?: string | null | undefined;
|
|
1613
1613
|
is_multi_phone_sync_credential?: boolean | undefined;
|
|
1614
1614
|
is_latest_desired_state_synced_with_provider?: boolean | null | undefined;
|
|
1615
1615
|
latest_desired_state_synced_with_provider_at?: string | null | undefined;
|
|
@@ -1671,6 +1671,7 @@ export declare const isSeamActionAttemptFailedError: <T extends {
|
|
|
1671
1671
|
door_names?: string[] | undefined;
|
|
1672
1672
|
} | undefined;
|
|
1673
1673
|
is_one_time_use?: boolean | undefined;
|
|
1674
|
+
issued_at?: string | null | undefined;
|
|
1674
1675
|
external_type?: "pti_card" | "brivo_credential" | "hid_credential" | "visionline_card" | "salto_ks_credential" | "assa_abloy_vostio_key" | "salto_space_key" | undefined;
|
|
1675
1676
|
external_type_display_name?: string | undefined;
|
|
1676
1677
|
acs_user_id?: string | undefined;
|
|
@@ -1678,7 +1679,6 @@ export declare const isSeamActionAttemptFailedError: <T extends {
|
|
|
1678
1679
|
parent_acs_credential_id?: string | undefined;
|
|
1679
1680
|
card_number?: string | null | undefined;
|
|
1680
1681
|
is_issued?: boolean | undefined;
|
|
1681
|
-
issued_at?: string | null | undefined;
|
|
1682
1682
|
is_multi_phone_sync_credential?: boolean | undefined;
|
|
1683
1683
|
is_latest_desired_state_synced_with_provider?: boolean | null | undefined;
|
|
1684
1684
|
latest_desired_state_synced_with_provider_at?: string | null | undefined;
|
|
@@ -2085,6 +2085,7 @@ export declare const isSeamActionAttemptTimeoutError: <T extends {
|
|
|
2085
2085
|
door_names?: string[] | undefined;
|
|
2086
2086
|
} | undefined;
|
|
2087
2087
|
is_one_time_use?: boolean | undefined;
|
|
2088
|
+
issued_at?: string | null | undefined;
|
|
2088
2089
|
external_type?: "pti_card" | "brivo_credential" | "hid_credential" | "visionline_card" | "salto_ks_credential" | "assa_abloy_vostio_key" | "salto_space_key" | undefined;
|
|
2089
2090
|
external_type_display_name?: string | undefined;
|
|
2090
2091
|
acs_user_id?: string | undefined;
|
|
@@ -2092,7 +2093,6 @@ export declare const isSeamActionAttemptTimeoutError: <T extends {
|
|
|
2092
2093
|
parent_acs_credential_id?: string | undefined;
|
|
2093
2094
|
card_number?: string | null | undefined;
|
|
2094
2095
|
is_issued?: boolean | undefined;
|
|
2095
|
-
issued_at?: string | null | undefined;
|
|
2096
2096
|
is_multi_phone_sync_credential?: boolean | undefined;
|
|
2097
2097
|
is_latest_desired_state_synced_with_provider?: boolean | null | undefined;
|
|
2098
2098
|
latest_desired_state_synced_with_provider_at?: string | null | undefined;
|
|
@@ -2154,6 +2154,7 @@ export declare const isSeamActionAttemptTimeoutError: <T extends {
|
|
|
2154
2154
|
door_names?: string[] | undefined;
|
|
2155
2155
|
} | undefined;
|
|
2156
2156
|
is_one_time_use?: boolean | undefined;
|
|
2157
|
+
issued_at?: string | null | undefined;
|
|
2157
2158
|
external_type?: "pti_card" | "brivo_credential" | "hid_credential" | "visionline_card" | "salto_ks_credential" | "assa_abloy_vostio_key" | "salto_space_key" | undefined;
|
|
2158
2159
|
external_type_display_name?: string | undefined;
|
|
2159
2160
|
acs_user_id?: string | undefined;
|
|
@@ -2161,7 +2162,6 @@ export declare const isSeamActionAttemptTimeoutError: <T extends {
|
|
|
2161
2162
|
parent_acs_credential_id?: string | undefined;
|
|
2162
2163
|
card_number?: string | null | undefined;
|
|
2163
2164
|
is_issued?: boolean | undefined;
|
|
2164
|
-
issued_at?: string | null | undefined;
|
|
2165
2165
|
is_multi_phone_sync_credential?: boolean | undefined;
|
|
2166
2166
|
is_latest_desired_state_synced_with_provider?: boolean | null | undefined;
|
|
2167
2167
|
latest_desired_state_synced_with_provider_at?: string | null | undefined;
|
|
@@ -2251,6 +2251,7 @@ export declare const isSeamActionAttemptTimeoutError: <T extends {
|
|
|
2251
2251
|
door_names?: string[] | undefined;
|
|
2252
2252
|
} | undefined;
|
|
2253
2253
|
is_one_time_use?: boolean | undefined;
|
|
2254
|
+
issued_at?: string | null | undefined;
|
|
2254
2255
|
external_type?: "pti_card" | "brivo_credential" | "hid_credential" | "visionline_card" | "salto_ks_credential" | "assa_abloy_vostio_key" | "salto_space_key" | undefined;
|
|
2255
2256
|
external_type_display_name?: string | undefined;
|
|
2256
2257
|
acs_user_id?: string | undefined;
|
|
@@ -2258,7 +2259,6 @@ export declare const isSeamActionAttemptTimeoutError: <T extends {
|
|
|
2258
2259
|
parent_acs_credential_id?: string | undefined;
|
|
2259
2260
|
card_number?: string | null | undefined;
|
|
2260
2261
|
is_issued?: boolean | undefined;
|
|
2261
|
-
issued_at?: string | null | undefined;
|
|
2262
2262
|
is_multi_phone_sync_credential?: boolean | undefined;
|
|
2263
2263
|
is_latest_desired_state_synced_with_provider?: boolean | null | undefined;
|
|
2264
2264
|
latest_desired_state_synced_with_provider_at?: string | null | undefined;
|
|
@@ -2320,6 +2320,7 @@ export declare const isSeamActionAttemptTimeoutError: <T extends {
|
|
|
2320
2320
|
door_names?: string[] | undefined;
|
|
2321
2321
|
} | undefined;
|
|
2322
2322
|
is_one_time_use?: boolean | undefined;
|
|
2323
|
+
issued_at?: string | null | undefined;
|
|
2323
2324
|
external_type?: "pti_card" | "brivo_credential" | "hid_credential" | "visionline_card" | "salto_ks_credential" | "assa_abloy_vostio_key" | "salto_space_key" | undefined;
|
|
2324
2325
|
external_type_display_name?: string | undefined;
|
|
2325
2326
|
acs_user_id?: string | undefined;
|
|
@@ -2327,7 +2328,6 @@ export declare const isSeamActionAttemptTimeoutError: <T extends {
|
|
|
2327
2328
|
parent_acs_credential_id?: string | undefined;
|
|
2328
2329
|
card_number?: string | null | undefined;
|
|
2329
2330
|
is_issued?: boolean | undefined;
|
|
2330
|
-
issued_at?: string | null | undefined;
|
|
2331
2331
|
is_multi_phone_sync_credential?: boolean | undefined;
|
|
2332
2332
|
is_latest_desired_state_synced_with_provider?: boolean | null | undefined;
|
|
2333
2333
|
latest_desired_state_synced_with_provider_at?: string | null | undefined;
|
|
@@ -4,7 +4,7 @@ import { SeamHttpWorkspaces } from './routes/index.js';
|
|
|
4
4
|
export declare class SeamHttpMultiWorkspace {
|
|
5
5
|
client: Client;
|
|
6
6
|
readonly defaults: Required<SeamHttpRequestOptions>;
|
|
7
|
-
constructor(options
|
|
7
|
+
constructor(options?: SeamHttpMultiWorkspaceOptions);
|
|
8
8
|
static fromClient(client: SeamHttpMultiWorkspaceOptionsWithClient['client'], options?: Omit<SeamHttpMultiWorkspaceOptionsWithClient, 'client'>): SeamHttpMultiWorkspace;
|
|
9
9
|
static fromConsoleSessionToken(consoleSessionToken: SeamHttpMultiWorkspaceOptionsWithConsoleSessionToken['consoleSessionToken'], options?: Omit<SeamHttpMultiWorkspaceOptionsWithConsoleSessionToken, 'consoleSessionToken'>): SeamHttpMultiWorkspace;
|
|
10
10
|
static fromPersonalAccessToken(personalAccessToken: SeamHttpMultiWorkspaceOptionsWithPersonalAccessToken['personalAccessToken'], options?: Omit<SeamHttpMultiWorkspaceOptionsWithPersonalAccessToken, 'personalAccessToken'>): SeamHttpMultiWorkspace;
|
|
@@ -3,7 +3,7 @@ import { isSeamHttpMultiWorkspaceOptionsWithClient, isSeamHttpMultiWorkspaceOpti
|
|
|
3
3
|
import { limitToSeamHttpRequestOptions, parseOptions } from './parse-options.js';
|
|
4
4
|
import { SeamHttpWorkspaces } from './routes/index.js';
|
|
5
5
|
export class SeamHttpMultiWorkspace {
|
|
6
|
-
constructor(options) {
|
|
6
|
+
constructor(options = {}) {
|
|
7
7
|
const opts = parseOptions(options);
|
|
8
8
|
this.client = 'client' in opts ? opts.client : createClient(opts);
|
|
9
9
|
this.defaults = limitToSeamHttpRequestOptions(opts);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"seam-http-multi-workspace.js","sourceRoot":"","sources":["../../../src/lib/seam/connect/seam-http-multi-workspace.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,YAAY,EAAE,MAAM,aAAa,CAAA;AACvD,OAAO,EACL,yCAAyC,EACzC,sDAAsD,EACtD,sDAAsD,EACtD,yCAAyC,GAM1C,MAAM,cAAc,CAAA;AACrB,OAAO,EAAE,6BAA6B,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAChF,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AAEtD,MAAM,OAAO,sBAAsB;IAIjC,YAAY,
|
|
1
|
+
{"version":3,"file":"seam-http-multi-workspace.js","sourceRoot":"","sources":["../../../src/lib/seam/connect/seam-http-multi-workspace.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,YAAY,EAAE,MAAM,aAAa,CAAA;AACvD,OAAO,EACL,yCAAyC,EACzC,sDAAsD,EACtD,sDAAsD,EACtD,yCAAyC,GAM1C,MAAM,cAAc,CAAA;AACrB,OAAO,EAAE,6BAA6B,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAChF,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AAEtD,MAAM,OAAO,sBAAsB;IAIjC,YAAY,UAAyC,EAAE;QACrD,MAAM,IAAI,GAAG,YAAY,CAAC,OAAO,CAAC,CAAA;QAClC,IAAI,CAAC,MAAM,GAAG,QAAQ,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,YAAY,CAAC,IAAI,CAAC,CAAA;QACjE,IAAI,CAAC,QAAQ,GAAG,6BAA6B,CAAC,IAAI,CAAC,CAAA;IACrD,CAAC;IAED,MAAM,CAAC,UAAU,CACf,MAAyD,EACzD,UAAmE,EAAE;QAErE,MAAM,kBAAkB,GAAG,EAAE,GAAG,OAAO,EAAE,MAAM,EAAE,CAAA;QACjD,IAAI,CAAC,yCAAyC,CAAC,kBAAkB,CAAC,EAAE,CAAC;YACnE,MAAM,IAAI,yCAAyC,CAAC,gBAAgB,CAAC,CAAA;QACvE,CAAC;QACD,OAAO,IAAI,sBAAsB,CAAC,kBAAkB,CAAC,CAAA;IACvD,CAAC;IAED,MAAM,CAAC,uBAAuB,CAC5B,mBAAgG,EAChG,UAGI,EAAE;QAEN,MAAM,kBAAkB,GAAG,EAAE,GAAG,OAAO,EAAE,mBAAmB,EAAE,CAAA;QAC9D,IACE,CAAC,sDAAsD,CACrD,kBAAkB,CACnB,EACD,CAAC;YACD,MAAM,IAAI,yCAAyC,CACjD,6BAA6B,CAC9B,CAAA;QACH,CAAC;QACD,OAAO,IAAI,sBAAsB,CAAC,kBAAkB,CAAC,CAAA;IACvD,CAAC;IAED,MAAM,CAAC,uBAAuB,CAC5B,mBAAgG,EAChG,UAGI,EAAE;QAEN,MAAM,kBAAkB,GAAG,EAAE,GAAG,OAAO,EAAE,mBAAmB,EAAE,CAAA;QAC9D,IACE,CAAC,sDAAsD,CACrD,kBAAkB,CACnB,EACD,CAAC;YACD,MAAM,IAAI,yCAAyC,CACjD,6BAA6B,CAC9B,CAAA;QACH,CAAC;QACD,OAAO,IAAI,sBAAsB,CAAC,kBAAkB,CAAC,CAAA;IACvD,CAAC;IAED,IAAI,UAAU;QACZ,OAAO,kBAAkB,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAA;IAClE,CAAC;CACF"}
|
package/lib/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const seamapiJavascriptHttpVersion = "1.
|
|
1
|
+
declare const seamapiJavascriptHttpVersion = "1.28.0";
|
|
2
2
|
export default seamapiJavascriptHttpVersion;
|
package/lib/version.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seamapi/http",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.28.0",
|
|
4
4
|
"description": "JavaScript HTTP client for the Seam API written in TypeScript.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
"npm": ">= 9.0.0"
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {
|
|
87
|
-
"@seamapi/types": "^1.
|
|
87
|
+
"@seamapi/types": "^1.370.3"
|
|
88
88
|
},
|
|
89
89
|
"peerDependenciesMeta": {
|
|
90
90
|
"@seamapi/types": {
|
|
@@ -99,7 +99,7 @@
|
|
|
99
99
|
},
|
|
100
100
|
"devDependencies": {
|
|
101
101
|
"@seamapi/fake-seam-connect": "^1.77.0",
|
|
102
|
-
"@seamapi/types": "1.
|
|
102
|
+
"@seamapi/types": "1.370.3",
|
|
103
103
|
"@types/eslint": "^8.44.2",
|
|
104
104
|
"@types/jsonwebtoken": "^9.0.6",
|
|
105
105
|
"@types/node": "^20.8.10",
|
|
@@ -3,6 +3,7 @@ import { isSeamHttpRequestOption } from './parse-options.js'
|
|
|
3
3
|
import type { ResolveActionAttemptOptions } from './resolve-action-attempt.js'
|
|
4
4
|
|
|
5
5
|
export type SeamHttpMultiWorkspaceOptions =
|
|
6
|
+
| SeamHttpMultiWorkspaceOptionsFromEnv
|
|
6
7
|
| SeamHttpMultiWorkspaceOptionsWithClient
|
|
7
8
|
| SeamHttpMultiWorkspaceOptionsWithConsoleSessionToken
|
|
8
9
|
| SeamHttpMultiWorkspaceOptionsWithPersonalAccessToken
|
|
@@ -28,6 +29,9 @@ export interface SeamHttpFromPublishableKeyOptions
|
|
|
28
29
|
|
|
29
30
|
export interface SeamHttpOptionsFromEnv extends SeamHttpCommonOptions {}
|
|
30
31
|
|
|
32
|
+
export interface SeamHttpMultiWorkspaceOptionsFromEnv
|
|
33
|
+
extends SeamHttpCommonOptions {}
|
|
34
|
+
|
|
31
35
|
export interface SeamHttpMultiWorkspaceOptionsWithClient
|
|
32
36
|
extends SeamHttpRequestOptions {
|
|
33
37
|
client: Client
|
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
isSeamHttpMultiWorkspaceOptionsWithClient,
|
|
8
8
|
isSeamHttpOptionsWithClient,
|
|
9
9
|
isSeamHttpOptionsWithClientSessionToken,
|
|
10
|
+
SeamHttpInvalidOptionsError,
|
|
10
11
|
type SeamHttpMultiWorkspaceOptions,
|
|
11
12
|
type SeamHttpOptions,
|
|
12
13
|
type SeamHttpRequestOptions,
|
|
@@ -76,9 +77,31 @@ const getNormalizedOptions = (
|
|
|
76
77
|
const apiKey =
|
|
77
78
|
'apiKey' in options ? options.apiKey : getApiKeyFromEnv(options)
|
|
78
79
|
|
|
80
|
+
const personalAccessToken =
|
|
81
|
+
'personalAccessToken' in options
|
|
82
|
+
? options.personalAccessToken
|
|
83
|
+
: getPersonalAccessTokenFromEnv(options)
|
|
84
|
+
|
|
85
|
+
const workspaceId =
|
|
86
|
+
'workspaceId' in options ? options.workspaceId : getWorkspaceIdFromEnv()
|
|
87
|
+
|
|
88
|
+
if (
|
|
89
|
+
apiKey != null &&
|
|
90
|
+
personalAccessToken != null &&
|
|
91
|
+
!('apiKey' in options) &&
|
|
92
|
+
!('personalAccessToken' in options)
|
|
93
|
+
) {
|
|
94
|
+
throw new SeamHttpInvalidOptionsError(
|
|
95
|
+
'Both SEAM_API_KEY and SEAM_PERSONAL_ACCESS_TOKEN environment variables are defined. Please use only one authentication method.',
|
|
96
|
+
)
|
|
97
|
+
}
|
|
98
|
+
|
|
79
99
|
return {
|
|
80
100
|
...options,
|
|
81
101
|
...(apiKey != null ? { apiKey } : {}),
|
|
102
|
+
...(personalAccessToken != null && workspaceId != null
|
|
103
|
+
? { personalAccessToken, workspaceId }
|
|
104
|
+
: {}),
|
|
82
105
|
...requestOptions,
|
|
83
106
|
}
|
|
84
107
|
}
|
|
@@ -98,6 +121,25 @@ const getApiKeyFromEnv = (
|
|
|
98
121
|
return globalThis.process?.env?.SEAM_API_KEY
|
|
99
122
|
}
|
|
100
123
|
|
|
124
|
+
const getPersonalAccessTokenFromEnv = (
|
|
125
|
+
options: SeamHttpOptions,
|
|
126
|
+
): string | null | undefined => {
|
|
127
|
+
if ('apiKey' in options && options.apiKey != null) {
|
|
128
|
+
return null
|
|
129
|
+
}
|
|
130
|
+
if ('clientSessionToken' in options && options.clientSessionToken != null) {
|
|
131
|
+
return null
|
|
132
|
+
}
|
|
133
|
+
if ('consoleSessionToken' in options && options.consoleSessionToken != null) {
|
|
134
|
+
return null
|
|
135
|
+
}
|
|
136
|
+
return globalThis.process?.env?.['SEAM_PERSONAL_ACCESS_TOKEN']
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
const getWorkspaceIdFromEnv = (): string | null | undefined => {
|
|
140
|
+
return globalThis.process?.env?.['SEAM_WORKSPACE_ID']
|
|
141
|
+
}
|
|
142
|
+
|
|
101
143
|
const getEndpointFromEnv = (): string | null | undefined => {
|
|
102
144
|
if (globalThis.process?.env?.SEAM_API_URL != null) {
|
|
103
145
|
// eslint-disable-next-line no-console
|
|
@@ -17,7 +17,7 @@ export class SeamHttpMultiWorkspace {
|
|
|
17
17
|
client: Client
|
|
18
18
|
readonly defaults: Required<SeamHttpRequestOptions>
|
|
19
19
|
|
|
20
|
-
constructor(options: SeamHttpMultiWorkspaceOptions) {
|
|
20
|
+
constructor(options: SeamHttpMultiWorkspaceOptions = {}) {
|
|
21
21
|
const opts = parseOptions(options)
|
|
22
22
|
this.client = 'client' in opts ? opts.client : createClient(opts)
|
|
23
23
|
this.defaults = limitToSeamHttpRequestOptions(opts)
|
package/src/lib/version.ts
CHANGED