@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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # @adhese/sdk-user-sync
2
2
 
3
+ ## 0.1.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 1feb9ff: Fix types not being published
8
+
3
9
  ## 0.1.1
4
10
 
5
11
  ### Patch Changes
@@ -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.1";
4
+ const version = "0.1.2";
5
5
  exports.name = name;
6
6
  exports.version = version;
7
7
  //# sourceMappingURL=package.json.cjs.map
@@ -1,5 +1,5 @@
1
1
  const name = "@adhese/sdk-user-sync";
2
- const version = "0.1.1";
2
+ const version = "0.1.2";
3
3
  export {
4
4
  name,
5
5
  version
@@ -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 };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@adhese/sdk-user-sync",
3
3
  "type": "module",
4
- "version": "0.1.1",
4
+ "version": "0.1.2",
5
5
  "description": "Adhese SDK",
6
6
  "repository": {
7
7
  "type": "git",