@adhese/sdk-user-sync 0.1.1 → 0.1.2
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 +6 -0
- package/dist/cjs/package.json.cjs +1 -1
- package/dist/package.json.js +1 -1
- package/dist/userSync.d.ts +33 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const name = "@adhese/sdk-user-sync";
|
|
4
|
-
const version = "0.1.
|
|
4
|
+
const version = "0.1.2";
|
|
5
5
|
exports.name = name;
|
|
6
6
|
exports.version = version;
|
|
7
7
|
//# sourceMappingURL=package.json.cjs.map
|
package/dist/package.json.js
CHANGED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { AdhesePlugin } from '@adhese/sdk';
|
|
2
|
+
|
|
3
|
+
type SyncOptions = {
|
|
4
|
+
/**
|
|
5
|
+
* Service handler to sync with. This is provided by Adhese. Make sure to contact Adhese support to have access to this.
|
|
6
|
+
*/
|
|
7
|
+
serviceHandler: string;
|
|
8
|
+
/**
|
|
9
|
+
* List of events to sync
|
|
10
|
+
*/
|
|
11
|
+
events: ReadonlyArray<string>;
|
|
12
|
+
/**
|
|
13
|
+
* User ID that should be synced
|
|
14
|
+
*/
|
|
15
|
+
userId: string;
|
|
16
|
+
/**
|
|
17
|
+
* Expiration time in minutes
|
|
18
|
+
*/
|
|
19
|
+
expiration: number;
|
|
20
|
+
};
|
|
21
|
+
type UserSyncPlugin = {
|
|
22
|
+
name: 'userSync';
|
|
23
|
+
/**
|
|
24
|
+
* Sync user with Adhese. This will send a request to the Adhese user sync endpoint.
|
|
25
|
+
*
|
|
26
|
+
* @warning This method should only be called when the user has given consent to sync their data. Otherwise, it will
|
|
27
|
+
* throw an error.
|
|
28
|
+
*/
|
|
29
|
+
sync(options: SyncOptions): Promise<void>;
|
|
30
|
+
};
|
|
31
|
+
declare const userSyncPlugin: AdhesePlugin<UserSyncPlugin>;
|
|
32
|
+
|
|
33
|
+
export { type SyncOptions, type UserSyncPlugin, userSyncPlugin };
|