@proveanything/smartlinks 1.15.11 → 1.15.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/authKit.d.ts +110 -13
- package/dist/api/authKit.js +172 -18
- package/dist/docs/API_SUMMARY.md +148 -20
- package/dist/docs/analytics-metadata-conventions.md +4 -0
- package/dist/docs/analytics.md +37 -3
- package/dist/docs/auth-kit.md +132 -0
- package/dist/openapi.yaml +435 -2
- package/dist/types/analytics.d.ts +37 -2
- package/dist/types/authKit.d.ts +99 -0
- package/dist/types/collection.d.ts +23 -0
- package/docs/API_SUMMARY.md +148 -20
- package/docs/analytics-metadata-conventions.md +4 -0
- package/docs/analytics.md +37 -3
- package/docs/auth-kit.md +132 -0
- package/openapi.yaml +435 -2
- package/package.json +1 -1
package/dist/openapi.yaml
CHANGED
|
@@ -8077,7 +8077,7 @@ paths:
|
|
|
8077
8077
|
get:
|
|
8078
8078
|
tags:
|
|
8079
8079
|
- authKit
|
|
8080
|
-
summary:
|
|
8080
|
+
summary: Revoke a single trusted device by id (authenticated).
|
|
8081
8081
|
operationId: authKit_load
|
|
8082
8082
|
security: []
|
|
8083
8083
|
parameters:
|
|
@@ -8291,7 +8291,7 @@ paths:
|
|
|
8291
8291
|
post:
|
|
8292
8292
|
tags:
|
|
8293
8293
|
- authKit
|
|
8294
|
-
summary:
|
|
8294
|
+
summary: authKit.appleLogin
|
|
8295
8295
|
operationId: authKit_appleLogin
|
|
8296
8296
|
security: []
|
|
8297
8297
|
parameters:
|
|
@@ -8970,6 +8970,285 @@ paths:
|
|
|
8970
8970
|
application/json:
|
|
8971
8971
|
schema:
|
|
8972
8972
|
$ref: "#/components/schemas/UpsertContactRequest"
|
|
8973
|
+
/authkit/{clientId}/mfa/challenge/recovery-code:
|
|
8974
|
+
post:
|
|
8975
|
+
tags:
|
|
8976
|
+
- authKit
|
|
8977
|
+
summary: Finalize a challenged login using a single-use recovery code instead of a sent code (public).
|
|
8978
|
+
operationId: authKit_mfaRecoveryCode
|
|
8979
|
+
security: []
|
|
8980
|
+
parameters:
|
|
8981
|
+
- name: clientId
|
|
8982
|
+
in: path
|
|
8983
|
+
required: true
|
|
8984
|
+
schema:
|
|
8985
|
+
type: string
|
|
8986
|
+
responses:
|
|
8987
|
+
200:
|
|
8988
|
+
description: Success
|
|
8989
|
+
content:
|
|
8990
|
+
application/json:
|
|
8991
|
+
schema:
|
|
8992
|
+
$ref: "#/components/schemas/MfaFinalizeResponse"
|
|
8993
|
+
400:
|
|
8994
|
+
description: Bad request
|
|
8995
|
+
401:
|
|
8996
|
+
description: Unauthorized
|
|
8997
|
+
404:
|
|
8998
|
+
description: Not found
|
|
8999
|
+
/authkit/{clientId}/mfa/challenge/send:
|
|
9000
|
+
post:
|
|
9001
|
+
tags:
|
|
9002
|
+
- authKit
|
|
9003
|
+
summary: Send (or resend) an MFA challenge code to the given factor (public).
|
|
9004
|
+
operationId: authKit_mfaChallengeSend
|
|
9005
|
+
security: []
|
|
9006
|
+
parameters:
|
|
9007
|
+
- name: clientId
|
|
9008
|
+
in: path
|
|
9009
|
+
required: true
|
|
9010
|
+
schema:
|
|
9011
|
+
type: string
|
|
9012
|
+
responses:
|
|
9013
|
+
200:
|
|
9014
|
+
description: Success
|
|
9015
|
+
content:
|
|
9016
|
+
application/json:
|
|
9017
|
+
schema:
|
|
9018
|
+
$ref: "#/components/schemas/MfaChallengeSendResponse"
|
|
9019
|
+
400:
|
|
9020
|
+
description: Bad request
|
|
9021
|
+
401:
|
|
9022
|
+
description: Unauthorized
|
|
9023
|
+
404:
|
|
9024
|
+
description: Not found
|
|
9025
|
+
requestBody:
|
|
9026
|
+
required: true
|
|
9027
|
+
content:
|
|
9028
|
+
application/json:
|
|
9029
|
+
schema:
|
|
9030
|
+
type: string
|
|
9031
|
+
enum:
|
|
9032
|
+
- email
|
|
9033
|
+
- sms
|
|
9034
|
+
/authkit/{clientId}/mfa/challenge/verify:
|
|
9035
|
+
post:
|
|
9036
|
+
tags:
|
|
9037
|
+
- authKit
|
|
9038
|
+
summary: Verify an MFA challenge code and finalize the login (public).
|
|
9039
|
+
operationId: authKit_mfaChallengeVerify
|
|
9040
|
+
security: []
|
|
9041
|
+
parameters:
|
|
9042
|
+
- name: clientId
|
|
9043
|
+
in: path
|
|
9044
|
+
required: true
|
|
9045
|
+
schema:
|
|
9046
|
+
type: string
|
|
9047
|
+
responses:
|
|
9048
|
+
200:
|
|
9049
|
+
description: Success
|
|
9050
|
+
content:
|
|
9051
|
+
application/json:
|
|
9052
|
+
schema:
|
|
9053
|
+
$ref: "#/components/schemas/MfaFinalizeResponse"
|
|
9054
|
+
400:
|
|
9055
|
+
description: Bad request
|
|
9056
|
+
401:
|
|
9057
|
+
description: Unauthorized
|
|
9058
|
+
404:
|
|
9059
|
+
description: Not found
|
|
9060
|
+
/authkit/{clientId}/mfa/factors:
|
|
9061
|
+
get:
|
|
9062
|
+
tags:
|
|
9063
|
+
- authKit
|
|
9064
|
+
summary: List enrolled factors and recovery-code count for the current user (authenticated).
|
|
9065
|
+
operationId: authKit_getMfaFactors
|
|
9066
|
+
security: []
|
|
9067
|
+
parameters:
|
|
9068
|
+
- name: clientId
|
|
9069
|
+
in: path
|
|
9070
|
+
required: true
|
|
9071
|
+
schema:
|
|
9072
|
+
type: string
|
|
9073
|
+
responses:
|
|
9074
|
+
200:
|
|
9075
|
+
description: Success
|
|
9076
|
+
content:
|
|
9077
|
+
application/json:
|
|
9078
|
+
schema:
|
|
9079
|
+
$ref: "#/components/schemas/MfaFactorsResponse"
|
|
9080
|
+
400:
|
|
9081
|
+
description: Bad request
|
|
9082
|
+
401:
|
|
9083
|
+
description: Unauthorized
|
|
9084
|
+
404:
|
|
9085
|
+
description: Not found
|
|
9086
|
+
/authkit/{clientId}/mfa/factors/email/confirm:
|
|
9087
|
+
post:
|
|
9088
|
+
tags:
|
|
9089
|
+
- authKit
|
|
9090
|
+
summary: "Confirm email-factor enrollment with the code sent by {@link enrollEmailMfa} (authenticated)."
|
|
9091
|
+
operationId: authKit_confirmEmailMfa
|
|
9092
|
+
security: []
|
|
9093
|
+
parameters:
|
|
9094
|
+
- name: clientId
|
|
9095
|
+
in: path
|
|
9096
|
+
required: true
|
|
9097
|
+
schema:
|
|
9098
|
+
type: string
|
|
9099
|
+
responses:
|
|
9100
|
+
200:
|
|
9101
|
+
description: Success
|
|
9102
|
+
content:
|
|
9103
|
+
application/json:
|
|
9104
|
+
schema:
|
|
9105
|
+
$ref: "#/components/schemas/MfaEnrolledResponse"
|
|
9106
|
+
400:
|
|
9107
|
+
description: Bad request
|
|
9108
|
+
401:
|
|
9109
|
+
description: Unauthorized
|
|
9110
|
+
404:
|
|
9111
|
+
description: Not found
|
|
9112
|
+
/authkit/{clientId}/mfa/factors/email/enroll:
|
|
9113
|
+
post:
|
|
9114
|
+
tags:
|
|
9115
|
+
- authKit
|
|
9116
|
+
summary: "Begin email-factor enrollment; sends a code to the account's existing email (authenticated)."
|
|
9117
|
+
operationId: authKit_enrollEmailMfa
|
|
9118
|
+
security: []
|
|
9119
|
+
parameters:
|
|
9120
|
+
- name: clientId
|
|
9121
|
+
in: path
|
|
9122
|
+
required: true
|
|
9123
|
+
schema:
|
|
9124
|
+
type: string
|
|
9125
|
+
responses:
|
|
9126
|
+
200:
|
|
9127
|
+
description: Success
|
|
9128
|
+
content:
|
|
9129
|
+
application/json:
|
|
9130
|
+
schema:
|
|
9131
|
+
$ref: "#/components/schemas/MfaEnrollSendResponse"
|
|
9132
|
+
400:
|
|
9133
|
+
description: Bad request
|
|
9134
|
+
401:
|
|
9135
|
+
description: Unauthorized
|
|
9136
|
+
404:
|
|
9137
|
+
description: Not found
|
|
9138
|
+
/authkit/{clientId}/mfa/factors/sms/confirm:
|
|
9139
|
+
post:
|
|
9140
|
+
tags:
|
|
9141
|
+
- authKit
|
|
9142
|
+
summary: "Confirm SMS-factor enrollment with the code sent by {@link enrollSmsMfa} (authenticated)."
|
|
9143
|
+
operationId: authKit_confirmSmsMfa
|
|
9144
|
+
security: []
|
|
9145
|
+
parameters:
|
|
9146
|
+
- name: clientId
|
|
9147
|
+
in: path
|
|
9148
|
+
required: true
|
|
9149
|
+
schema:
|
|
9150
|
+
type: string
|
|
9151
|
+
responses:
|
|
9152
|
+
200:
|
|
9153
|
+
description: Success
|
|
9154
|
+
content:
|
|
9155
|
+
application/json:
|
|
9156
|
+
schema:
|
|
9157
|
+
$ref: "#/components/schemas/MfaEnrolledResponse"
|
|
9158
|
+
400:
|
|
9159
|
+
description: Bad request
|
|
9160
|
+
401:
|
|
9161
|
+
description: Unauthorized
|
|
9162
|
+
404:
|
|
9163
|
+
description: Not found
|
|
9164
|
+
/authkit/{clientId}/mfa/factors/sms/enroll:
|
|
9165
|
+
post:
|
|
9166
|
+
tags:
|
|
9167
|
+
- authKit
|
|
9168
|
+
summary: Begin SMS-factor enrollment; sends a code to the given phone number (authenticated).
|
|
9169
|
+
operationId: authKit_enrollSmsMfa
|
|
9170
|
+
security: []
|
|
9171
|
+
parameters:
|
|
9172
|
+
- name: clientId
|
|
9173
|
+
in: path
|
|
9174
|
+
required: true
|
|
9175
|
+
schema:
|
|
9176
|
+
type: string
|
|
9177
|
+
responses:
|
|
9178
|
+
200:
|
|
9179
|
+
description: Success
|
|
9180
|
+
content:
|
|
9181
|
+
application/json:
|
|
9182
|
+
schema:
|
|
9183
|
+
$ref: "#/components/schemas/MfaEnrollSendResponse"
|
|
9184
|
+
400:
|
|
9185
|
+
description: Bad request
|
|
9186
|
+
401:
|
|
9187
|
+
description: Unauthorized
|
|
9188
|
+
404:
|
|
9189
|
+
description: Not found
|
|
9190
|
+
/authkit/{clientId}/mfa/factors/{factor}:
|
|
9191
|
+
get:
|
|
9192
|
+
tags:
|
|
9193
|
+
- authKit
|
|
9194
|
+
summary: Remove an enrolled MFA factor (authenticated).
|
|
9195
|
+
operationId: authKit_removeMfaFactor
|
|
9196
|
+
security: []
|
|
9197
|
+
parameters:
|
|
9198
|
+
- name: clientId
|
|
9199
|
+
in: path
|
|
9200
|
+
required: true
|
|
9201
|
+
schema:
|
|
9202
|
+
type: string
|
|
9203
|
+
- name: factor
|
|
9204
|
+
in: path
|
|
9205
|
+
required: true
|
|
9206
|
+
schema:
|
|
9207
|
+
type: string
|
|
9208
|
+
responses:
|
|
9209
|
+
200:
|
|
9210
|
+
description: Success
|
|
9211
|
+
content:
|
|
9212
|
+
application/json:
|
|
9213
|
+
schema:
|
|
9214
|
+
$ref: "#/components/schemas/SuccessResponse"
|
|
9215
|
+
400:
|
|
9216
|
+
description: Bad request
|
|
9217
|
+
401:
|
|
9218
|
+
description: Unauthorized
|
|
9219
|
+
404:
|
|
9220
|
+
description: Not found
|
|
9221
|
+
/authkit/{clientId}/mfa/trusted-devices/{id}:
|
|
9222
|
+
delete:
|
|
9223
|
+
tags:
|
|
9224
|
+
- authKit
|
|
9225
|
+
summary: Revoke a single trusted device by id (authenticated).
|
|
9226
|
+
operationId: authKit_revokeTrustedDevice
|
|
9227
|
+
security: []
|
|
9228
|
+
parameters:
|
|
9229
|
+
- name: clientId
|
|
9230
|
+
in: path
|
|
9231
|
+
required: true
|
|
9232
|
+
schema:
|
|
9233
|
+
type: string
|
|
9234
|
+
- name: id
|
|
9235
|
+
in: path
|
|
9236
|
+
required: true
|
|
9237
|
+
schema:
|
|
9238
|
+
type: string
|
|
9239
|
+
responses:
|
|
9240
|
+
200:
|
|
9241
|
+
description: Success
|
|
9242
|
+
content:
|
|
9243
|
+
application/json:
|
|
9244
|
+
schema:
|
|
9245
|
+
$ref: "#/components/schemas/SuccessResponse"
|
|
9246
|
+
400:
|
|
9247
|
+
description: Bad request
|
|
9248
|
+
401:
|
|
9249
|
+
description: Unauthorized
|
|
9250
|
+
404:
|
|
9251
|
+
description: Not found
|
|
8973
9252
|
/platform/location:
|
|
8974
9253
|
post:
|
|
8975
9254
|
tags:
|
|
@@ -14979,6 +15258,8 @@ components:
|
|
|
14979
15258
|
type: boolean
|
|
14980
15259
|
location:
|
|
14981
15260
|
$ref: "#/components/schemas/AnalyticsLocation"
|
|
15261
|
+
source:
|
|
15262
|
+
type: string
|
|
14982
15263
|
metadata:
|
|
14983
15264
|
type: object
|
|
14984
15265
|
additionalProperties: true
|
|
@@ -15014,6 +15295,8 @@ components:
|
|
|
15014
15295
|
$ref: "#/components/schemas/AnalyticsLocation"
|
|
15015
15296
|
isAdmin:
|
|
15016
15297
|
type: boolean
|
|
15298
|
+
redirectMode:
|
|
15299
|
+
type: string
|
|
15017
15300
|
metadata:
|
|
15018
15301
|
type: object
|
|
15019
15302
|
additionalProperties: true
|
|
@@ -15222,6 +15505,16 @@ components:
|
|
|
15222
15505
|
type: boolean
|
|
15223
15506
|
hasLocation:
|
|
15224
15507
|
type: boolean
|
|
15508
|
+
sources:
|
|
15509
|
+
type: array
|
|
15510
|
+
items:
|
|
15511
|
+
type: string
|
|
15512
|
+
redirectMode:
|
|
15513
|
+
type: string
|
|
15514
|
+
redirectModes:
|
|
15515
|
+
type: array
|
|
15516
|
+
items:
|
|
15517
|
+
type: string
|
|
15225
15518
|
AnalyticsSummaryRequest:
|
|
15226
15519
|
type: object
|
|
15227
15520
|
properties:
|
|
@@ -18416,6 +18709,126 @@ components:
|
|
|
18416
18709
|
userInfo:
|
|
18417
18710
|
type: object
|
|
18418
18711
|
additionalProperties: true
|
|
18712
|
+
trustedDeviceToken:
|
|
18713
|
+
type: string
|
|
18714
|
+
MfaRequiredDetails:
|
|
18715
|
+
type: object
|
|
18716
|
+
properties:
|
|
18717
|
+
mfaSessionToken:
|
|
18718
|
+
type: string
|
|
18719
|
+
availableFactors:
|
|
18720
|
+
type: array
|
|
18721
|
+
items:
|
|
18722
|
+
type: string
|
|
18723
|
+
enum:
|
|
18724
|
+
- email
|
|
18725
|
+
- sms
|
|
18726
|
+
preferredFactor:
|
|
18727
|
+
type: string
|
|
18728
|
+
enum:
|
|
18729
|
+
- email
|
|
18730
|
+
- sms
|
|
18731
|
+
maskedDestinations:
|
|
18732
|
+
type: object
|
|
18733
|
+
additionalProperties: true
|
|
18734
|
+
required:
|
|
18735
|
+
- mfaSessionToken
|
|
18736
|
+
- availableFactors
|
|
18737
|
+
- preferredFactor
|
|
18738
|
+
- maskedDestinations
|
|
18739
|
+
MfaChallengeSendResponse:
|
|
18740
|
+
type: object
|
|
18741
|
+
properties:
|
|
18742
|
+
success:
|
|
18743
|
+
type: object
|
|
18744
|
+
additionalProperties: true
|
|
18745
|
+
factor:
|
|
18746
|
+
type: string
|
|
18747
|
+
enum:
|
|
18748
|
+
- email
|
|
18749
|
+
- sms
|
|
18750
|
+
destination:
|
|
18751
|
+
type: string
|
|
18752
|
+
expiresAt:
|
|
18753
|
+
type: string
|
|
18754
|
+
required:
|
|
18755
|
+
- success
|
|
18756
|
+
- factor
|
|
18757
|
+
- destination
|
|
18758
|
+
- expiresAt
|
|
18759
|
+
MfaFinalizeResponse:
|
|
18760
|
+
type: object
|
|
18761
|
+
properties:
|
|
18762
|
+
trustedDeviceToken:
|
|
18763
|
+
type: string
|
|
18764
|
+
trustedDeviceExpiresAt:
|
|
18765
|
+
type: string
|
|
18766
|
+
MfaEnrollSendResponse:
|
|
18767
|
+
type: object
|
|
18768
|
+
properties:
|
|
18769
|
+
mfaSessionToken:
|
|
18770
|
+
type: string
|
|
18771
|
+
destination:
|
|
18772
|
+
type: string
|
|
18773
|
+
expiresAt:
|
|
18774
|
+
type: string
|
|
18775
|
+
required:
|
|
18776
|
+
- mfaSessionToken
|
|
18777
|
+
- destination
|
|
18778
|
+
- expiresAt
|
|
18779
|
+
MfaEnrolledResponse:
|
|
18780
|
+
type: object
|
|
18781
|
+
properties:
|
|
18782
|
+
enrolled:
|
|
18783
|
+
type: object
|
|
18784
|
+
additionalProperties: true
|
|
18785
|
+
factor:
|
|
18786
|
+
type: string
|
|
18787
|
+
enum:
|
|
18788
|
+
- email
|
|
18789
|
+
- sms
|
|
18790
|
+
required:
|
|
18791
|
+
- enrolled
|
|
18792
|
+
- factor
|
|
18793
|
+
MfaFactorsResponse:
|
|
18794
|
+
type: object
|
|
18795
|
+
properties:
|
|
18796
|
+
enrolledFactors:
|
|
18797
|
+
type: object
|
|
18798
|
+
additionalProperties: true
|
|
18799
|
+
email:
|
|
18800
|
+
type: object
|
|
18801
|
+
additionalProperties: true
|
|
18802
|
+
sms:
|
|
18803
|
+
type: object
|
|
18804
|
+
additionalProperties: true
|
|
18805
|
+
recoveryCodesRemaining:
|
|
18806
|
+
type: number
|
|
18807
|
+
mfaEnabledForClient:
|
|
18808
|
+
type: boolean
|
|
18809
|
+
required:
|
|
18810
|
+
- enrolledFactors
|
|
18811
|
+
- recoveryCodesRemaining
|
|
18812
|
+
- mfaEnabledForClient
|
|
18813
|
+
TrustedDevice:
|
|
18814
|
+
type: object
|
|
18815
|
+
properties:
|
|
18816
|
+
id:
|
|
18817
|
+
type: string
|
|
18818
|
+
label:
|
|
18819
|
+
type: string
|
|
18820
|
+
createdAtMs:
|
|
18821
|
+
type: number
|
|
18822
|
+
lastUsedAtMs:
|
|
18823
|
+
type: number
|
|
18824
|
+
expiresAtMs:
|
|
18825
|
+
type: number
|
|
18826
|
+
required:
|
|
18827
|
+
- id
|
|
18828
|
+
- label
|
|
18829
|
+
- createdAtMs
|
|
18830
|
+
- lastUsedAtMs
|
|
18831
|
+
- expiresAtMs
|
|
18419
18832
|
MagicLinkSendResponse:
|
|
18420
18833
|
type: object
|
|
18421
18834
|
properties:
|
|
@@ -19312,6 +19725,11 @@ components:
|
|
|
19312
19725
|
type: boolean
|
|
19313
19726
|
defaultAuthKitId:
|
|
19314
19727
|
type: string
|
|
19728
|
+
admin:
|
|
19729
|
+
type: object
|
|
19730
|
+
additionalProperties: true
|
|
19731
|
+
redirect:
|
|
19732
|
+
$ref: "#/components/schemas/CollectionRedirectConfig"
|
|
19315
19733
|
required:
|
|
19316
19734
|
- id
|
|
19317
19735
|
- title
|
|
@@ -19326,6 +19744,21 @@ components:
|
|
|
19326
19744
|
- roles
|
|
19327
19745
|
- shortId
|
|
19328
19746
|
- defaultAuthKitId
|
|
19747
|
+
CollectionRedirectConfig:
|
|
19748
|
+
type: object
|
|
19749
|
+
properties:
|
|
19750
|
+
mode:
|
|
19751
|
+
type: string
|
|
19752
|
+
enum:
|
|
19753
|
+
- fixed
|
|
19754
|
+
- dynamic
|
|
19755
|
+
- deep
|
|
19756
|
+
url:
|
|
19757
|
+
type: string
|
|
19758
|
+
template:
|
|
19759
|
+
type: string
|
|
19760
|
+
required:
|
|
19761
|
+
- mode
|
|
19329
19762
|
HubAvailabilityResponse:
|
|
19330
19763
|
type: object
|
|
19331
19764
|
properties:
|
|
@@ -5,6 +5,13 @@
|
|
|
5
5
|
* analytics, click tracking, and tag scan analytics for collection dashboards.
|
|
6
6
|
*/
|
|
7
7
|
export type AnalyticsSource = 'events' | 'tag';
|
|
8
|
+
/**
|
|
9
|
+
* Includes `scan_redirect` - logged automatically by the server (not the
|
|
10
|
+
* client) at the moment a GS1 digital-link scan, claim short-link scan, or
|
|
11
|
+
* NFC tap decides on a redirect destination, before the client ever loads
|
|
12
|
+
* anything. Distinct from `scan_tag`, which the client still writes on
|
|
13
|
+
* landing exactly as before.
|
|
14
|
+
*/
|
|
8
15
|
export type AnalyticsEventType = string;
|
|
9
16
|
export type AnalyticsGranularity = 'hour' | 'day' | 'week' | 'month';
|
|
10
17
|
export type AnalyticsMetric = 'count' | 'uniqueSessions' | 'uniqueVisitors';
|
|
@@ -59,6 +66,12 @@ export interface CollectionAnalyticsEvent extends AnalyticsStandardEventFields {
|
|
|
59
66
|
path?: string;
|
|
60
67
|
isExternal?: boolean;
|
|
61
68
|
location?: AnalyticsLocation;
|
|
69
|
+
/**
|
|
70
|
+
* Free-form identifier for which client app logged the event, e.g.
|
|
71
|
+
* `'portal'`, `'hub'`. No enum/whitelist - send whatever string identifies
|
|
72
|
+
* your app. Web-events only; not recorded on tag events.
|
|
73
|
+
*/
|
|
74
|
+
source?: string;
|
|
62
75
|
metadata?: Record<string, any>;
|
|
63
76
|
}
|
|
64
77
|
export interface TagAnalyticsEvent extends AnalyticsStandardEventFields {
|
|
@@ -75,6 +88,13 @@ export interface TagAnalyticsEvent extends AnalyticsStandardEventFields {
|
|
|
75
88
|
path?: string;
|
|
76
89
|
location?: AnalyticsLocation;
|
|
77
90
|
isAdmin?: boolean;
|
|
91
|
+
/**
|
|
92
|
+
* Only relevant if you're logging a redirect-style event yourself. In
|
|
93
|
+
* practice this is mostly written by the server automatically at the
|
|
94
|
+
* moment a GS1 digital-link scan, claim short-link scan, or NFC tap
|
|
95
|
+
* decides on a redirect destination - see the `scan_redirect` eventType.
|
|
96
|
+
*/
|
|
97
|
+
redirectMode?: string;
|
|
78
98
|
metadata?: Record<string, any>;
|
|
79
99
|
}
|
|
80
100
|
export interface AnalyticsTrackOptions {
|
|
@@ -171,6 +191,21 @@ export interface AnalyticsFilterRequest {
|
|
|
171
191
|
claimIds?: string[];
|
|
172
192
|
isAdmin?: boolean;
|
|
173
193
|
hasLocation?: boolean;
|
|
194
|
+
/**
|
|
195
|
+
* Filter web-events rows by the `source` column (list-match). Web-events
|
|
196
|
+
* only - has no effect on `source: 'tag'` queries.
|
|
197
|
+
*
|
|
198
|
+
* There is deliberately no singular `source` filter: the request's own
|
|
199
|
+
* top-level `source` field (`'events'` vs `'tag'`) already owns that name
|
|
200
|
+
* as the table selector and predates this column - same word, two
|
|
201
|
+
* different things. Use a single-element array (`sources: ['portal']`)
|
|
202
|
+
* for an exact-match filter.
|
|
203
|
+
*/
|
|
204
|
+
sources?: string[];
|
|
205
|
+
/** Filter tag-events rows by `redirectMode`. Tag-events only. */
|
|
206
|
+
redirectMode?: string;
|
|
207
|
+
/** Filter tag-events rows by `redirectMode` (list-match). Tag-events only. */
|
|
208
|
+
redirectModes?: string[];
|
|
174
209
|
}
|
|
175
210
|
export interface AnalyticsSummaryRequest extends AnalyticsFilterRequest {
|
|
176
211
|
source: AnalyticsSource;
|
|
@@ -215,8 +250,8 @@ export interface AnalyticsTimeseriesResponse {
|
|
|
215
250
|
metric: AnalyticsMetric;
|
|
216
251
|
rows: AnalyticsTimeseriesRow[];
|
|
217
252
|
}
|
|
218
|
-
export type EventAnalyticsDimension = 'eventType' | 'country' | 'linkId' | 'href' | 'path' | 'appId' | 'destinationAppId' | 'deviceType' | 'isExternal' | 'productId' | 'proofId' | 'batchId' | 'variantId' | 'sessionId' | 'metadata';
|
|
219
|
-
export type TagAnalyticsDimension = 'eventType' | 'country' | 'codeId' | 'claimId' | 'proofId' | 'productId' | 'batchId' | 'variantId' | 'deviceType' | 'sessionId' | 'isAdmin' | 'location' | 'metadata';
|
|
253
|
+
export type EventAnalyticsDimension = 'eventType' | 'country' | 'linkId' | 'href' | 'path' | 'appId' | 'destinationAppId' | 'deviceType' | 'isExternal' | 'productId' | 'proofId' | 'batchId' | 'variantId' | 'sessionId' | 'metadata' | 'source';
|
|
254
|
+
export type TagAnalyticsDimension = 'eventType' | 'country' | 'codeId' | 'claimId' | 'proofId' | 'productId' | 'batchId' | 'variantId' | 'deviceType' | 'sessionId' | 'isAdmin' | 'location' | 'metadata' | 'redirectMode';
|
|
220
255
|
export interface AnalyticsBreakdownRequest extends AnalyticsFilterRequest {
|
|
221
256
|
source: AnalyticsSource;
|
|
222
257
|
dimension: EventAnalyticsDimension | TagAnalyticsDimension;
|
package/dist/types/authKit.d.ts
CHANGED
|
@@ -112,6 +112,12 @@ export interface AppleLoginOptions {
|
|
|
112
112
|
email?: string;
|
|
113
113
|
name?: string;
|
|
114
114
|
};
|
|
115
|
+
/**
|
|
116
|
+
* A previously-issued trusted-device token (from a prior MFA `challenge/verify`
|
|
117
|
+
* or `challenge/recovery-code` response). If still valid, the server skips any
|
|
118
|
+
* step-up challenge for this login. See `SDK_AUTHKIT_MFA_UPDATE.md` §3.
|
|
119
|
+
*/
|
|
120
|
+
trustedDeviceToken?: string;
|
|
115
121
|
}
|
|
116
122
|
/**
|
|
117
123
|
* Server-defined error codes returned by AuthKit federated-login endpoints
|
|
@@ -120,6 +126,99 @@ export interface AppleLoginOptions {
|
|
|
120
126
|
* in `SmartlinksApiError.details`.
|
|
121
127
|
*/
|
|
122
128
|
export type AuthKitErrorCode = 'MISSING_APPLE_TOKEN' | 'APPLE_AUTH_NOT_CONFIGURED' | 'INVALID_APPLE_TOKEN' | 'ACCOUNT_EXISTS_UNVERIFIED' | 'APPLE_AUTH_FAILED';
|
|
129
|
+
/**
|
|
130
|
+
* Details carried on the `MFA_REQUIRED` error thrown by any session-issuing login method
|
|
131
|
+
* (see the gate list above) when the client's MFA policy requires a step-up. Surfaced as
|
|
132
|
+
* `err.details` (or `err.errorResponse.details`) on the `SmartlinksApiError` — the login
|
|
133
|
+
* method never resolves in this case, it throws a 403 instead.
|
|
134
|
+
*/
|
|
135
|
+
export interface MfaRequiredDetails {
|
|
136
|
+
/** Short-lived (10 min) and single-use. Pass it to every challenge/finalize call below. */
|
|
137
|
+
mfaSessionToken: string;
|
|
138
|
+
/** Only factors the user actually enrolled. */
|
|
139
|
+
availableFactors: Array<'email' | 'sms'>;
|
|
140
|
+
/** `sms` is preferred over `email` when both are enrolled. */
|
|
141
|
+
preferredFactor: 'email' | 'sms';
|
|
142
|
+
maskedDestinations: {
|
|
143
|
+
email?: string;
|
|
144
|
+
sms?: string;
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
/** Response from {@link authKit.mfaChallengeSend}. */
|
|
148
|
+
export interface MfaChallengeSendResponse {
|
|
149
|
+
success: true;
|
|
150
|
+
factor: 'email' | 'sms';
|
|
151
|
+
/** Masked, e.g. `"j***@x.com"` or `"+1******1234"`. */
|
|
152
|
+
destination: string;
|
|
153
|
+
/** ISO timestamp, 10 minutes from send. */
|
|
154
|
+
expiresAt: string;
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Response from {@link authKit.mfaChallengeVerify} / {@link authKit.mfaRecoveryCode}.
|
|
158
|
+
* Same shape as a normal login response, plus trusted-device fields when the caller sent
|
|
159
|
+
* `trustDevice: true`.
|
|
160
|
+
*/
|
|
161
|
+
export interface MfaFinalizeResponse extends AuthLoginResponse {
|
|
162
|
+
/**
|
|
163
|
+
* Present only when the challenge was completed with `trustDevice: true`. Persist it
|
|
164
|
+
* alongside the refresh token (same secure storage) and send it as `trustedDeviceToken`
|
|
165
|
+
* on future calls to any gated login method ({@link authKit.login},
|
|
166
|
+
* {@link authKit.googleLogin}, {@link authKit.appleLogin}, {@link authKit.verifyPhoneCode},
|
|
167
|
+
* {@link authKit.verifyMagicLink}, {@link authKit.exchangeWhatsAppSession}) to skip the
|
|
168
|
+
* challenge on this device — it isn't tied to which method the user challenged through.
|
|
169
|
+
*/
|
|
170
|
+
trustedDeviceToken?: string;
|
|
171
|
+
trustedDeviceExpiresAt?: string;
|
|
172
|
+
}
|
|
173
|
+
/** Response from {@link authKit.enrollEmailMfa} / {@link authKit.enrollSmsMfa}. */
|
|
174
|
+
export interface MfaEnrollSendResponse {
|
|
175
|
+
mfaSessionToken: string;
|
|
176
|
+
destination: string;
|
|
177
|
+
expiresAt: string;
|
|
178
|
+
}
|
|
179
|
+
/** Response from {@link authKit.confirmEmailMfa} / {@link authKit.confirmSmsMfa}. */
|
|
180
|
+
export interface MfaEnrolledResponse {
|
|
181
|
+
enrolled: true;
|
|
182
|
+
factor: 'email' | 'sms';
|
|
183
|
+
}
|
|
184
|
+
/** Response from {@link authKit.getMfaFactors}. */
|
|
185
|
+
export interface MfaFactorsResponse {
|
|
186
|
+
enrolledFactors: {
|
|
187
|
+
email?: {
|
|
188
|
+
enrolledAt: string;
|
|
189
|
+
destination: string;
|
|
190
|
+
};
|
|
191
|
+
sms?: {
|
|
192
|
+
enrolledAt: string;
|
|
193
|
+
destination: string;
|
|
194
|
+
};
|
|
195
|
+
};
|
|
196
|
+
recoveryCodesRemaining: number;
|
|
197
|
+
mfaEnabledForClient: boolean;
|
|
198
|
+
}
|
|
199
|
+
/** One entry from {@link authKit.listTrustedDevices}. */
|
|
200
|
+
export interface TrustedDevice {
|
|
201
|
+
id: string;
|
|
202
|
+
label: string | null;
|
|
203
|
+
createdAtMs: number;
|
|
204
|
+
lastUsedAtMs: number;
|
|
205
|
+
expiresAtMs: number;
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* Server-defined error codes for the step-up MFA flow, surfaced via
|
|
209
|
+
* `SmartlinksApiError.errorCode`.
|
|
210
|
+
*
|
|
211
|
+
* - `MFA_REQUIRED` (403) — from any session-issuing login method; see {@link MfaRequiredDetails}.
|
|
212
|
+
* - `INVALID_MFA_CODE` (401) — wrong code; let the user retry (attempts are capped, see next).
|
|
213
|
+
* - `MFA_TOO_MANY_ATTEMPTS` (429) — 5 wrong attempts; the challenge is burned, restart from `login()`.
|
|
214
|
+
* - `MFA_FACTOR_NOT_ENROLLED` (400) — requested factor isn't enrolled (or disabled for the
|
|
215
|
+
* client) — a programming error if the UI only offers `availableFactors`.
|
|
216
|
+
* - `MFA_SESSION_EXPIRED` (401) — `mfaSessionToken` past its 10-minute TTL; restart from `login()`.
|
|
217
|
+
* - `MFA_SESSION_INVALID` (401) — unknown/wrong-client/already-consumed token, or (on enroll
|
|
218
|
+
* confirm) mismatched user; restart the enroll/challenge flow.
|
|
219
|
+
* - `RECOVERY_CODE_INVALID` (401) — wrong or already-used recovery code.
|
|
220
|
+
*/
|
|
221
|
+
export type MfaErrorCode = 'MFA_REQUIRED' | 'INVALID_MFA_CODE' | 'MFA_TOO_MANY_ATTEMPTS' | 'MFA_FACTOR_NOT_ENROLLED' | 'MFA_SESSION_EXPIRED' | 'MFA_SESSION_INVALID' | 'RECOVERY_CODE_INVALID';
|
|
123
222
|
export interface MagicLinkSendResponse {
|
|
124
223
|
success: boolean;
|
|
125
224
|
message: string;
|