@octap/browser-sdk 0.2.0 → 0.3.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/CHANGELOG.md +31 -0
- package/README.md +14 -0
- package/dist/auth.d.ts +46 -5
- package/dist/auth.js +22 -3
- package/dist/auth.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,36 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.3.0
|
|
4
|
+
|
|
5
|
+
No change needed on your page: the new methods are additions. Needs a Core with OCT-280.
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- Phone number (OCT-280): `sendPhoneCode({ phoneNumber, consent })` texts a code to a number the
|
|
10
|
+
signed-in customer wants to add or change to, and `confirmPhone({ phoneNumber, code })` confirms it.
|
|
11
|
+
The new number replaces the old one. Vietnamese mobile numbers only for now, kept as `+84…`. A number
|
|
12
|
+
another customer has fails with status 409, a wrong or expired code with 400, and another code asked
|
|
13
|
+
for too soon with 429. `SentPhoneCode` and `CustomerPhone` are exported.
|
|
14
|
+
|
|
15
|
+
### Changed
|
|
16
|
+
|
|
17
|
+
- A new customer now verifies a phone number on OctaP's sign-in page, with a code by SMS, before
|
|
18
|
+
`signIn()` resolves. Nothing to change on your page: the popup still has 10 minutes. Customers who
|
|
19
|
+
already have a number, or a membership at any business, aren't asked. A customer with a verified
|
|
20
|
+
number who joins your business for the first time is asked once whether to share it with you (OCT-424).
|
|
21
|
+
|
|
22
|
+
## 0.2.1
|
|
23
|
+
|
|
24
|
+
Additive only: types for a use of several vouchers; nothing that worked before changes.
|
|
25
|
+
|
|
26
|
+
### Added
|
|
27
|
+
|
|
28
|
+
- Several vouchers with one signature (OCT-218): `signAndFinalizeVoucherUse` still signs one set of
|
|
29
|
+
bytes; for a use of several vouchers, `signAndFinalizeVoucherUse<FinalizedVoucherUses>()` returns
|
|
30
|
+
`vouchers`, `blockchainDigest` and `orderReference`. `FinalizedVoucherUse` gains `vouchers` and
|
|
31
|
+
`orderReference` and keeps every field it had. `FinalizedVoucher` and `FinalizedVoucherUses` are
|
|
32
|
+
exported.
|
|
33
|
+
|
|
3
34
|
## 0.2.0
|
|
4
35
|
|
|
5
36
|
Breaking. Upgrade together with `@octap/sdk` 0.4, whose `verifyCustomer` takes the new customer
|
package/README.md
CHANGED
|
@@ -54,6 +54,20 @@ const response = await fetch('/api/claim', {
|
|
|
54
54
|
});
|
|
55
55
|
```
|
|
56
56
|
|
|
57
|
+
## Phone number
|
|
58
|
+
|
|
59
|
+
A new customer verifies a phone number on OctaP's sign-in page, with a code by SMS, before sign-in
|
|
60
|
+
finishes. Customers who joined before that aren't asked. A signed-in customer adds a number, or
|
|
61
|
+
changes theirs, from your page:
|
|
62
|
+
|
|
63
|
+
```ts
|
|
64
|
+
await auth.sendPhoneCode({ phoneNumber: '0912 345 678', consent: true }); // the customer agreed to share it
|
|
65
|
+
await auth.confirmPhone({ phoneNumber: '0912 345 678', code: '123456' });
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
The new number replaces the old one. Vietnamese mobile numbers only for now, kept as `+84…`. A
|
|
69
|
+
number another customer has fails with status 409; a wrong or expired code with 400.
|
|
70
|
+
|
|
57
71
|
## Claim a paid voucher
|
|
58
72
|
|
|
59
73
|
Your backend calls `claimVoucher` and returns the result. The customer's device then signs it:
|
package/dist/auth.d.ts
CHANGED
|
@@ -35,7 +35,8 @@ export interface SignableVoucherUse {
|
|
|
35
35
|
digest?: string | null;
|
|
36
36
|
transactionBytes?: string | null;
|
|
37
37
|
}
|
|
38
|
-
|
|
38
|
+
/** One voucher the chain marked used. */
|
|
39
|
+
export interface FinalizedVoucher {
|
|
39
40
|
voucherOwnershipId: string;
|
|
40
41
|
voucherId: string;
|
|
41
42
|
serialCode: string;
|
|
@@ -46,6 +47,15 @@ export interface FinalizedVoucherUse {
|
|
|
46
47
|
discountValue?: string | null;
|
|
47
48
|
blockchainDigest: string;
|
|
48
49
|
}
|
|
50
|
+
/** A use of several vouchers, signed once: every voucher of it, in `serialCode` order. */
|
|
51
|
+
export interface FinalizedVoucherUses {
|
|
52
|
+
vouchers: FinalizedVoucher[];
|
|
53
|
+
blockchainDigest: string;
|
|
54
|
+
orderReference: string | null;
|
|
55
|
+
}
|
|
56
|
+
/** A use of one voucher: its fields at the top level too. */
|
|
57
|
+
export interface FinalizedVoucherUse extends FinalizedVoucher, FinalizedVoucherUses {
|
|
58
|
+
}
|
|
49
59
|
export interface FinalizedClaim {
|
|
50
60
|
transactionId: string;
|
|
51
61
|
organizationEndUserId: string;
|
|
@@ -54,6 +64,18 @@ export interface FinalizedClaim {
|
|
|
54
64
|
status: string;
|
|
55
65
|
blockchainDigest: string;
|
|
56
66
|
}
|
|
67
|
+
/** A code was sent by SMS to `phoneNumber`, as OctaP keeps it (`+84…`). */
|
|
68
|
+
export interface SentPhoneCode {
|
|
69
|
+
phoneNumber: string;
|
|
70
|
+
expiresAt: string;
|
|
71
|
+
/** When `sendPhoneCode` can send another code to this number. */
|
|
72
|
+
resendAfter: string;
|
|
73
|
+
}
|
|
74
|
+
/** The customer's verified number, after `confirmPhone`. */
|
|
75
|
+
export interface CustomerPhone {
|
|
76
|
+
phoneNumber: string;
|
|
77
|
+
phoneVerifiedAt: string;
|
|
78
|
+
}
|
|
57
79
|
export type AuthStateListener = (user: OctapUser | null) => void;
|
|
58
80
|
/**
|
|
59
81
|
* Customer sign-in and signing for one organization. Sign-in happens on OctaP's own page, in a
|
|
@@ -109,12 +131,31 @@ export declare class OctapAuth {
|
|
|
109
131
|
*/
|
|
110
132
|
signAndFinalize(claim: SignableClaim, options?: RequestOptions): Promise<FinalizedClaim>;
|
|
111
133
|
/**
|
|
112
|
-
* Signs the customer's use of a voucher and finalizes it. Show the customer
|
|
113
|
-
* first: this signature is the only thing that can mark their
|
|
114
|
-
* automatically; on `outcome-unknown`, read the
|
|
134
|
+
* Signs the customer's use of a voucher, or of several at once, and finalizes it. Show the customer
|
|
135
|
+
* what they are using first: this one signature is the only thing that can mark their vouchers used.
|
|
136
|
+
* Never retried automatically; on `outcome-unknown`, read the vouchers from your backend. A use of
|
|
137
|
+
* several vouchers answers `FinalizedVoucherUses`: pass it as the type argument.
|
|
115
138
|
*/
|
|
116
|
-
signAndFinalizeVoucherUse(use: SignableVoucherUse, options?: RequestOptions): Promise<
|
|
139
|
+
signAndFinalizeVoucherUse<T extends FinalizedVoucherUses = FinalizedVoucherUse>(use: SignableVoucherUse, options?: RequestOptions): Promise<T>;
|
|
117
140
|
private submitSigned;
|
|
141
|
+
/**
|
|
142
|
+
* Sends a code by SMS to a phone number the signed-in customer wants to add, or change theirs to.
|
|
143
|
+
* `consent` must be `true`: the customer agreed, on your page, to share the number with you.
|
|
144
|
+
* Vietnamese mobile numbers only for now, such as `0912 345 678`. Fails with `api-error` and
|
|
145
|
+
* status 409 for a number another customer has, 429 while another code can't be sent yet.
|
|
146
|
+
*/
|
|
147
|
+
sendPhoneCode(input: {
|
|
148
|
+
phoneNumber: string;
|
|
149
|
+
consent: boolean;
|
|
150
|
+
}, options?: RequestOptions): Promise<SentPhoneCode>;
|
|
151
|
+
/**
|
|
152
|
+
* Confirms the number with the code `sendPhoneCode` sent. It replaces the customer's old number,
|
|
153
|
+
* which is then free. Fails with `api-error` and status 400 for a wrong or expired code.
|
|
154
|
+
*/
|
|
155
|
+
confirmPhone(input: {
|
|
156
|
+
phoneNumber: string;
|
|
157
|
+
code: string;
|
|
158
|
+
}, options?: RequestOptions): Promise<CustomerPhone>;
|
|
118
159
|
/** Ends the session on this page. */
|
|
119
160
|
signOut(): Promise<void>;
|
|
120
161
|
private requireSession;
|
package/dist/auth.js
CHANGED
|
@@ -160,9 +160,10 @@ export class OctapAuth {
|
|
|
160
160
|
return this.submitSigned('/v1/credits/redeem/finalize', claim.digest, claim.transactionBytes, options);
|
|
161
161
|
}
|
|
162
162
|
/**
|
|
163
|
-
* Signs the customer's use of a voucher and finalizes it. Show the customer
|
|
164
|
-
* first: this signature is the only thing that can mark their
|
|
165
|
-
* automatically; on `outcome-unknown`, read the
|
|
163
|
+
* Signs the customer's use of a voucher, or of several at once, and finalizes it. Show the customer
|
|
164
|
+
* what they are using first: this one signature is the only thing that can mark their vouchers used.
|
|
165
|
+
* Never retried automatically; on `outcome-unknown`, read the vouchers from your backend. A use of
|
|
166
|
+
* several vouchers answers `FinalizedVoucherUses`: pass it as the type argument.
|
|
166
167
|
*/
|
|
167
168
|
async signAndFinalizeVoucherUse(use, options = {}) {
|
|
168
169
|
if (!use.digest || !use.transactionBytes) {
|
|
@@ -183,6 +184,24 @@ export class OctapAuth {
|
|
|
183
184
|
: new OctapAuthError('outcome-unknown', 'The result of this transaction is not known yet. Check the claim before trying again.', err instanceof OctapAuthError ? { status: err.status, body: err.body } : {});
|
|
184
185
|
}
|
|
185
186
|
}
|
|
187
|
+
/**
|
|
188
|
+
* Sends a code by SMS to a phone number the signed-in customer wants to add, or change theirs to.
|
|
189
|
+
* `consent` must be `true`: the customer agreed, on your page, to share the number with you.
|
|
190
|
+
* Vietnamese mobile numbers only for now, such as `0912 345 678`. Fails with `api-error` and
|
|
191
|
+
* status 409 for a number another customer has, 429 while another code can't be sent yet.
|
|
192
|
+
*/
|
|
193
|
+
async sendPhoneCode(input, options = {}) {
|
|
194
|
+
const customerToken = await this.getIdToken();
|
|
195
|
+
return this.api.post('/v1/identity/phone/send', { ...input, customerToken }, options);
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* Confirms the number with the code `sendPhoneCode` sent. It replaces the customer's old number,
|
|
199
|
+
* which is then free. Fails with `api-error` and status 400 for a wrong or expired code.
|
|
200
|
+
*/
|
|
201
|
+
async confirmPhone(input, options = {}) {
|
|
202
|
+
const customerToken = await this.getIdToken();
|
|
203
|
+
return this.api.post('/v1/identity/phone/confirm', { ...input, customerToken }, options);
|
|
204
|
+
}
|
|
186
205
|
/** Ends the session on this page. */
|
|
187
206
|
async signOut() {
|
|
188
207
|
this.endSession();
|
package/dist/auth.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAuB,MAAM,eAAe,CAAC;AAC/E,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EACL,kBAAkB,GAKnB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,eAAe,EAAqB,MAAM,oBAAoB,CAAC;AACxE,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAE9E,6FAA6F;AAC7F,MAAM,CAAC,MAAM,oBAAoB,GAAG,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAuB,MAAM,eAAe,CAAC;AAC/E,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EACL,kBAAkB,GAKnB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,eAAe,EAAqB,MAAM,oBAAoB,CAAC;AACxE,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAE9E,6FAA6F;AAC7F,MAAM,CAAC,MAAM,oBAAoB,GAAG,uBAAuB,CAAC;AAsF5D,MAAM,kBAAkB,GAAG,MAAM,CAAC;AAClC,0FAA0F;AAC1F,MAAM,mBAAmB,GAAG,MAAM,CAAC;AACnC,sDAAsD;AACtD,MAAM,YAAY,GAAG,aAAa,CAAC;AAEnC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D,MAAM,CAAC,IAAI,GAAG,QAAQ,CAAC;QACvB,MAAM,CAAC,WAAW,GAAG,OAAO,CAAC,KAAK,IAAI,qBAAqB,CAAC;QAC5D,IAAI,OAAO,CAAC,SAAS;YAAE,MAAM,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;QAC5D,MAAM,CAAC,gBAAgB,CAAC,OAAO,EAAE,GAAG,EAAE;YACpC,IAAI,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,CAAC,GAAY,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC;QAC/D,CAAC,CAAC,CAAC;QACH,OAAO,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;IAClC,CAAC;CACF;AAED,MAAM,UAAU,eAAe,CAAC,OAAyB;IACvD,OAAO,IAAI,SAAS,CAAC,OAAO,CAAC,CAAC;AAChC,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { DEFAULT_API_BASE_URL, OctapAuth, createOctapAuth, type AuthStateListener, type FinalizedClaim, type FinalizedVoucherUse, type OctapAuthOptions, type RenderOptions, type SignableClaim, type SignableVoucherUse, } from './auth.js';
|
|
1
|
+
export { DEFAULT_API_BASE_URL, OctapAuth, createOctapAuth, type AuthStateListener, type CustomerPhone, type FinalizedClaim, type FinalizedVoucher, type FinalizedVoucherUse, type FinalizedVoucherUses, type OctapAuthOptions, type RenderOptions, type SentPhoneCode, type SignableClaim, type SignableVoucherUse, } from './auth.js';
|
|
2
2
|
export type { RequestOptions } from './core-api.js';
|
|
3
3
|
export { OctapAuthError, type OctapAuthErrorCode } from './errors.js';
|
|
4
4
|
export type { OctapUser, Persistence } from './session-store.js';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,SAAS,EACT,eAAe,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,SAAS,EACT,eAAe,GAYhB,MAAM,WAAW,CAAC;AAEnB,OAAO,EAAE,cAAc,EAA2B,MAAM,aAAa,CAAC"}
|