@knocklabs/client 0.16.1 → 0.16.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
  # Changelog
2
2
 
3
+ ## 0.16.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 5a19d82: fix: knock.users.identify passes data through query params
8
+
3
9
  ## 0.16.1
4
10
 
5
11
  ### Patch Changes
package/dist/cjs/api.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";var a=Object.defineProperty;var n=(t,e,s)=>e in t?a(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s;var r=(t,e,s)=>n(t,typeof e!="symbol"?e+"":e,s);Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const u=require("axios"),l=require("axios-retry"),c=require("phoenix"),i=t=>t&&typeof t=="object"&&"default"in t?t:{default:t},d=i(u),o=i(l);class h{constructor(e){r(this,"host");r(this,"apiKey");r(this,"userToken");r(this,"axiosClient");r(this,"socket");this.host=e.host,this.apiKey=e.apiKey,this.userToken=e.userToken||null,this.axiosClient=d.default.create({baseURL:this.host,headers:{Accept:"application/json","Content-Type":"application/json",Authorization:`Bearer ${this.apiKey}`,"X-Knock-User-Token":this.userToken,"X-Knock-Client":this.getKnockClientHeader()}}),typeof window<"u"&&(this.socket=new c.Socket(`${this.host.replace("http","ws")}/ws/v1`,{params:{user_token:this.userToken,api_key:this.apiKey}})),o.default(this.axiosClient,{retries:3,retryCondition:this.canRetryRequest,retryDelay:o.default.exponentialDelay})}async makeRequest(e){try{const s=await this.axiosClient(e);return{statusCode:s.status<300?"ok":"error",body:s.data,error:void 0,status:s.status}}catch(s){return console.error(s),{statusCode:"error",status:500,body:void 0,error:s}}}canRetryRequest(e){return o.default.isNetworkError(e)?!0:e.response?e.response.status>=500&&e.response.status<=599||e.response.status===429:!1}getKnockClientHeader(){return"Knock/ClientJS 0.16.1"}}exports.default=h;
1
+ "use strict";var a=Object.defineProperty;var n=(t,e,s)=>e in t?a(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s;var r=(t,e,s)=>n(t,typeof e!="symbol"?e+"":e,s);Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const u=require("axios"),l=require("axios-retry"),c=require("phoenix"),i=t=>t&&typeof t=="object"&&"default"in t?t:{default:t},d=i(u),o=i(l);class h{constructor(e){r(this,"host");r(this,"apiKey");r(this,"userToken");r(this,"axiosClient");r(this,"socket");this.host=e.host,this.apiKey=e.apiKey,this.userToken=e.userToken||null,this.axiosClient=d.default.create({baseURL:this.host,headers:{Accept:"application/json","Content-Type":"application/json",Authorization:`Bearer ${this.apiKey}`,"X-Knock-User-Token":this.userToken,"X-Knock-Client":this.getKnockClientHeader()}}),typeof window<"u"&&(this.socket=new c.Socket(`${this.host.replace("http","ws")}/ws/v1`,{params:{user_token:this.userToken,api_key:this.apiKey}})),o.default(this.axiosClient,{retries:3,retryCondition:this.canRetryRequest,retryDelay:o.default.exponentialDelay})}async makeRequest(e){try{const s=await this.axiosClient(e);return{statusCode:s.status<300?"ok":"error",body:s.data,error:void 0,status:s.status}}catch(s){return console.error(s),{statusCode:"error",status:500,body:void 0,error:s}}}canRetryRequest(e){return o.default.isNetworkError(e)?!0:e.response?e.response.status>=500&&e.response.status<=599||e.response.status===429:!1}getKnockClientHeader(){return"Knock/ClientJS 0.16.2"}}exports.default=h;
2
2
  //# sourceMappingURL=api.js.map
@@ -1,2 +1,2 @@
1
- "use strict";var u=Object.defineProperty;var h=(n,e,t)=>e in n?u(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var a=(n,e,t)=>h(n,typeof e!="symbol"?e+"":e,t);Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const i=require("../guide/client.js"),r="default";class l{constructor(e){a(this,"instance");this.instance=e}async get(){this.instance.failIfNotAuthenticated();const e=await this.instance.client().makeRequest({method:"GET",url:`/v1/users/${this.instance.userId}`});return this.handleResponse(e)}async identify(e={}){this.instance.failIfNotAuthenticated();const t=await this.instance.client().makeRequest({method:"PUT",url:`/v1/users/${this.instance.userId}`,params:e});return this.handleResponse(t)}async getAllPreferences(){this.instance.failIfNotAuthenticated();const e=await this.instance.client().makeRequest({method:"GET",url:`/v1/users/${this.instance.userId}/preferences`});return this.handleResponse(e)}async getPreferences(e={}){this.instance.failIfNotAuthenticated();const t=e.preferenceSet||r,s=await this.instance.client().makeRequest({method:"GET",url:`/v1/users/${this.instance.userId}/preferences/${t}`,params:{tenant:e.tenant}});return this.handleResponse(s)}async setPreferences(e,t={}){this.instance.failIfNotAuthenticated();const s=t.preferenceSet||r,c=await this.instance.client().makeRequest({method:"PUT",url:`/v1/users/${this.instance.userId}/preferences/${s}`,data:e});return this.handleResponse(c)}async getChannelData(e){this.instance.failIfNotAuthenticated();const t=await this.instance.client().makeRequest({method:"GET",url:`/v1/users/${this.instance.userId}/channel_data/${e.channelId}`});return this.handleResponse(t)}async setChannelData({channelId:e,channelData:t}){this.instance.failIfNotAuthenticated();const s=await this.instance.client().makeRequest({method:"PUT",url:`/v1/users/${this.instance.userId}/channel_data/${e}`,data:{data:t}});return this.handleResponse(s)}async getGuides(e,t){const s=await this.instance.client().makeRequest({method:"GET",url:`${i.guidesApiRootPath(this.instance.userId)}/${e}`,params:t});return this.handleResponse(s)}async markGuideStepAs(e,t){const s=await this.instance.client().makeRequest({method:"PUT",url:`${i.guidesApiRootPath(this.instance.userId)}/messages/${t.message_id}/${e}`,data:t});return this.handleResponse(s)}handleResponse(e){if(e.statusCode==="error")throw new Error(e.error||e.body);return e.body}}exports.default=l;
1
+ "use strict";var u=Object.defineProperty;var h=(n,e,t)=>e in n?u(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var a=(n,e,t)=>h(n,typeof e!="symbol"?e+"":e,t);Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const i=require("../guide/client.js"),r="default";class l{constructor(e){a(this,"instance");this.instance=e}async get(){this.instance.failIfNotAuthenticated();const e=await this.instance.client().makeRequest({method:"GET",url:`/v1/users/${this.instance.userId}`});return this.handleResponse(e)}async identify(e={}){this.instance.failIfNotAuthenticated();const t=await this.instance.client().makeRequest({method:"PUT",url:`/v1/users/${this.instance.userId}`,data:e});return this.handleResponse(t)}async getAllPreferences(){this.instance.failIfNotAuthenticated();const e=await this.instance.client().makeRequest({method:"GET",url:`/v1/users/${this.instance.userId}/preferences`});return this.handleResponse(e)}async getPreferences(e={}){this.instance.failIfNotAuthenticated();const t=e.preferenceSet||r,s=await this.instance.client().makeRequest({method:"GET",url:`/v1/users/${this.instance.userId}/preferences/${t}`,params:{tenant:e.tenant}});return this.handleResponse(s)}async setPreferences(e,t={}){this.instance.failIfNotAuthenticated();const s=t.preferenceSet||r,c=await this.instance.client().makeRequest({method:"PUT",url:`/v1/users/${this.instance.userId}/preferences/${s}`,data:e});return this.handleResponse(c)}async getChannelData(e){this.instance.failIfNotAuthenticated();const t=await this.instance.client().makeRequest({method:"GET",url:`/v1/users/${this.instance.userId}/channel_data/${e.channelId}`});return this.handleResponse(t)}async setChannelData({channelId:e,channelData:t}){this.instance.failIfNotAuthenticated();const s=await this.instance.client().makeRequest({method:"PUT",url:`/v1/users/${this.instance.userId}/channel_data/${e}`,data:{data:t}});return this.handleResponse(s)}async getGuides(e,t){const s=await this.instance.client().makeRequest({method:"GET",url:`${i.guidesApiRootPath(this.instance.userId)}/${e}`,params:t});return this.handleResponse(s)}async markGuideStepAs(e,t){const s=await this.instance.client().makeRequest({method:"PUT",url:`${i.guidesApiRootPath(this.instance.userId)}/messages/${t.message_id}/${e}`,data:t});return this.handleResponse(s)}handleResponse(e){if(e.statusCode==="error")throw new Error(e.error||e.body);return e.body}}exports.default=l;
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../src/clients/users/index.ts"],"sourcesContent":["import { GenericData } from \"@knocklabs/types\";\n\nimport { ApiResponse } from \"../../api\";\nimport { ChannelData, User } from \"../../interfaces\";\nimport Knock from \"../../knock\";\nimport { guidesApiRootPath } from \"../guide/client\";\nimport { GuideEngagementEventBaseParams } from \"../guide/types\";\nimport {\n GetPreferencesOptions,\n PreferenceOptions,\n PreferenceSet,\n SetPreferencesProperties,\n} from \"../preferences/interfaces\";\n\nimport { GetChannelDataInput, SetChannelDataInput } from \"./interfaces\";\n\nconst DEFAULT_PREFERENCE_SET_ID = \"default\";\n\nclass UserClient {\n private instance: Knock;\n\n constructor(instance: Knock) {\n this.instance = instance;\n }\n\n async get() {\n this.instance.failIfNotAuthenticated();\n\n const result = await this.instance.client().makeRequest({\n method: \"GET\",\n url: `/v1/users/${this.instance.userId}`,\n });\n\n return this.handleResponse<User>(result);\n }\n\n async identify(props: GenericData = {}) {\n this.instance.failIfNotAuthenticated();\n\n const result = await this.instance.client().makeRequest({\n method: \"PUT\",\n url: `/v1/users/${this.instance.userId}`,\n params: props,\n });\n\n return this.handleResponse<User>(result);\n }\n\n async getAllPreferences() {\n this.instance.failIfNotAuthenticated();\n\n const result = await this.instance.client().makeRequest({\n method: \"GET\",\n url: `/v1/users/${this.instance.userId}/preferences`,\n });\n\n return this.handleResponse<PreferenceSet[]>(result);\n }\n\n async getPreferences(\n options: GetPreferencesOptions = {},\n ): Promise<PreferenceSet> {\n this.instance.failIfNotAuthenticated();\n const preferenceSetId = options.preferenceSet || DEFAULT_PREFERENCE_SET_ID;\n\n const result = await this.instance.client().makeRequest({\n method: \"GET\",\n url: `/v1/users/${this.instance.userId}/preferences/${preferenceSetId}`,\n params: { tenant: options.tenant },\n });\n\n return this.handleResponse<PreferenceSet>(result);\n }\n\n async setPreferences(\n preferenceSet: SetPreferencesProperties,\n options: PreferenceOptions = {},\n ): Promise<PreferenceSet> {\n this.instance.failIfNotAuthenticated();\n const preferenceSetId = options.preferenceSet || DEFAULT_PREFERENCE_SET_ID;\n\n const result = await this.instance.client().makeRequest({\n method: \"PUT\",\n url: `/v1/users/${this.instance.userId}/preferences/${preferenceSetId}`,\n data: preferenceSet,\n });\n\n return this.handleResponse<PreferenceSet>(result);\n }\n\n async getChannelData<T = GenericData>(params: GetChannelDataInput) {\n this.instance.failIfNotAuthenticated();\n\n const result = await this.instance.client().makeRequest({\n method: \"GET\",\n url: `/v1/users/${this.instance.userId}/channel_data/${params.channelId}`,\n });\n\n return this.handleResponse<ChannelData<T>>(result);\n }\n\n async setChannelData<T = GenericData>({\n channelId,\n channelData,\n }: SetChannelDataInput) {\n this.instance.failIfNotAuthenticated();\n\n const result = await this.instance.client().makeRequest({\n method: \"PUT\",\n url: `/v1/users/${this.instance.userId}/channel_data/${channelId}`,\n data: { data: channelData },\n });\n\n return this.handleResponse<ChannelData<T>>(result);\n }\n\n async getGuides<P, R>(channelId: string, params: P) {\n const result = await this.instance.client().makeRequest({\n method: \"GET\",\n url: `${guidesApiRootPath(this.instance.userId)}/${channelId}`,\n params,\n });\n\n return this.handleResponse<R>(result);\n }\n\n async markGuideStepAs<P extends GuideEngagementEventBaseParams, R>(\n status: \"seen\" | \"interacted\" | \"archived\",\n params: P,\n ) {\n const result = await this.instance.client().makeRequest({\n method: \"PUT\",\n url: `${guidesApiRootPath(this.instance.userId)}/messages/${params.message_id}/${status}`,\n data: params,\n });\n\n return this.handleResponse<R>(result);\n }\n\n private handleResponse<T>(response: ApiResponse) {\n if (response.statusCode === \"error\") {\n throw new Error(response.error || response.body);\n }\n\n return response.body as T;\n }\n}\n\nexport default UserClient;\n"],"names":["DEFAULT_PREFERENCE_SET_ID","UserClient","instance","__publicField","result","props","options","preferenceSetId","preferenceSet","params","channelId","channelData","guidesApiRootPath","status","response"],"mappings":"sTAgBMA,EAA4B,UAElC,MAAMC,CAAW,CAGf,YAAYC,EAAiB,CAFrBC,EAAA,iBAGN,KAAK,SAAWD,CAAA,CAGlB,MAAM,KAAM,CACV,KAAK,SA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C,MAAML,EAAS,MAAM,KAAK,SAAS,OAAA,EAAS,YAAY,CACtD,OAAQ,MACR,IAAK,aAAa,KAAK,SAAS,MAAM,iBAAiBK,EAAO,SAAS,EAAA,CACxE,EAEM,OAAA,KAAK,eAA+BL,CAAM,CAAA,CAGnD,MAAM,eAAgC,CACpC,UAAAM,EACA,YAAAC,CAAA,EACsB,CACtB,KAAK,SAAS,uBAAuB,EAErC,MAAMP,EAAS,MAAM,KAAK,SAAS,OAAA,EAAS,YAAY,CACtD,OAAQ,MACR,IAAK,aAAa,KAAK,SAAS,MAAM,iBAAiBM,CAAS,GAChE,KAAM,CAAE,KAAMC,CAAY,CAAA,CAC3B,EAEM,OAAA,KAAK,eAA+BP,CAAM,CAAA,CAGnD,MAAM,UAAgBM,EAAmBD,EAAW,CAClD,MAAML,EAAS,MAAM,KAAK,SAAS,OAAA,EAAS,YAAY,CACtD,OAAQ,MACR,IAAK,GAAGQ,EAAAA,kBAAkB,KAAK,SAAS,MAAM,CAAC,IAAIF,CAAS,GAC5D,OAAAD,CAAA,CACD,EAEM,OAAA,KAAK,eAAkBL,CAAM,CAAA,CAGtC,MAAM,gBACJS,EACAJ,EACA,CACA,MAAML,EAAS,MAAM,KAAK,SAAS,OAAA,EAAS,YAAY,CACtD,OAAQ,MACR,IAAK,GAAGQ,oBAAkB,KAAK,SAAS,MAAM,CAAC,aAAaH,EAAO,UAAU,IAAII,CAAM,GACvF,KAAMJ,CAAA,CACP,EAEM,OAAA,KAAK,eAAkBL,CAAM,CAAA,CAG9B,eAAkBU,EAAuB,CAC3C,GAAAA,EAAS,aAAe,QAC1B,MAAM,IAAI,MAAMA,EAAS,OAASA,EAAS,IAAI,EAGjD,OAAOA,EAAS,IAAA,CAEpB"}
1
+ {"version":3,"file":"index.js","sources":["../../../../src/clients/users/index.ts"],"sourcesContent":["import { GenericData } from \"@knocklabs/types\";\n\nimport { ApiResponse } from \"../../api\";\nimport { ChannelData, User } from \"../../interfaces\";\nimport Knock from \"../../knock\";\nimport { guidesApiRootPath } from \"../guide/client\";\nimport { GuideEngagementEventBaseParams } from \"../guide/types\";\nimport {\n GetPreferencesOptions,\n PreferenceOptions,\n PreferenceSet,\n SetPreferencesProperties,\n} from \"../preferences/interfaces\";\n\nimport { GetChannelDataInput, SetChannelDataInput } from \"./interfaces\";\n\nconst DEFAULT_PREFERENCE_SET_ID = \"default\";\n\nclass UserClient {\n private instance: Knock;\n\n constructor(instance: Knock) {\n this.instance = instance;\n }\n\n async get() {\n this.instance.failIfNotAuthenticated();\n\n const result = await this.instance.client().makeRequest({\n method: \"GET\",\n url: `/v1/users/${this.instance.userId}`,\n });\n\n return this.handleResponse<User>(result);\n }\n\n async identify(props: GenericData = {}) {\n this.instance.failIfNotAuthenticated();\n\n const result = await this.instance.client().makeRequest({\n method: \"PUT\",\n url: `/v1/users/${this.instance.userId}`,\n data: props,\n });\n\n return this.handleResponse<User>(result);\n }\n\n async getAllPreferences() {\n this.instance.failIfNotAuthenticated();\n\n const result = await this.instance.client().makeRequest({\n method: \"GET\",\n url: `/v1/users/${this.instance.userId}/preferences`,\n });\n\n return this.handleResponse<PreferenceSet[]>(result);\n }\n\n async getPreferences(\n options: GetPreferencesOptions = {},\n ): Promise<PreferenceSet> {\n this.instance.failIfNotAuthenticated();\n const preferenceSetId = options.preferenceSet || DEFAULT_PREFERENCE_SET_ID;\n\n const result = await this.instance.client().makeRequest({\n method: \"GET\",\n url: `/v1/users/${this.instance.userId}/preferences/${preferenceSetId}`,\n params: { tenant: options.tenant },\n });\n\n return this.handleResponse<PreferenceSet>(result);\n }\n\n async setPreferences(\n preferenceSet: SetPreferencesProperties,\n options: PreferenceOptions = {},\n ): Promise<PreferenceSet> {\n this.instance.failIfNotAuthenticated();\n const preferenceSetId = options.preferenceSet || DEFAULT_PREFERENCE_SET_ID;\n\n const result = await this.instance.client().makeRequest({\n method: \"PUT\",\n url: `/v1/users/${this.instance.userId}/preferences/${preferenceSetId}`,\n data: preferenceSet,\n });\n\n return this.handleResponse<PreferenceSet>(result);\n }\n\n async getChannelData<T = GenericData>(params: GetChannelDataInput) {\n this.instance.failIfNotAuthenticated();\n\n const result = await this.instance.client().makeRequest({\n method: \"GET\",\n url: `/v1/users/${this.instance.userId}/channel_data/${params.channelId}`,\n });\n\n return this.handleResponse<ChannelData<T>>(result);\n }\n\n async setChannelData<T = GenericData>({\n channelId,\n channelData,\n }: SetChannelDataInput) {\n this.instance.failIfNotAuthenticated();\n\n const result = await this.instance.client().makeRequest({\n method: \"PUT\",\n url: `/v1/users/${this.instance.userId}/channel_data/${channelId}`,\n data: { data: channelData },\n });\n\n return this.handleResponse<ChannelData<T>>(result);\n }\n\n async getGuides<P, R>(channelId: string, params: P) {\n const result = await this.instance.client().makeRequest({\n method: \"GET\",\n url: `${guidesApiRootPath(this.instance.userId)}/${channelId}`,\n params,\n });\n\n return this.handleResponse<R>(result);\n }\n\n async markGuideStepAs<P extends GuideEngagementEventBaseParams, R>(\n status: \"seen\" | \"interacted\" | \"archived\",\n params: P,\n ) {\n const result = await this.instance.client().makeRequest({\n method: \"PUT\",\n url: `${guidesApiRootPath(this.instance.userId)}/messages/${params.message_id}/${status}`,\n data: params,\n });\n\n return this.handleResponse<R>(result);\n }\n\n private handleResponse<T>(response: ApiResponse) {\n if (response.statusCode === \"error\") {\n throw new Error(response.error || response.body);\n }\n\n return response.body as T;\n }\n}\n\nexport default UserClient;\n"],"names":["DEFAULT_PREFERENCE_SET_ID","UserClient","instance","__publicField","result","props","options","preferenceSetId","preferenceSet","params","channelId","channelData","guidesApiRootPath","status","response"],"mappings":"sTAgBMA,EAA4B,UAElC,MAAMC,CAAW,CAGf,YAAYC,EAAiB,CAFrBC,EAAA,iBAGN,KAAK,SAAWD,CAAA,CAGlB,MAAM,KAAM,CACV,KAAK,SAAS,uBAAuB,EAErC,MAAME,EAAS,MAAM,KAAK,SAAS,OAAA,EAAS,YAAY,CACtD,OAAQ,MACR,IAAK,aAAa,KAAK,SAAS,MAAM,EAAA,CACvC,E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ACxE,EAEM,OAAA,KAAK,eAA+BL,CAAM,CAAA,CAGnD,MAAM,eAAgC,CACpC,UAAAM,EACA,YAAAC,CAAA,EACsB,CACtB,KAAK,SAAS,uBAAuB,EAErC,MAAMP,EAAS,MAAM,KAAK,SAAS,OAAA,EAAS,YAAY,CACtD,OAAQ,MACR,IAAK,aAAa,KAAK,SAAS,MAAM,iBAAiBM,CAAS,GAChE,KAAM,CAAE,KAAMC,CAAY,CAAA,CAC3B,EAEM,OAAA,KAAK,eAA+BP,CAAM,CAAA,CAGnD,MAAM,UAAgBM,EAAmBD,EAAW,CAClD,MAAML,EAAS,MAAM,KAAK,SAAS,OAAA,EAAS,YAAY,CACtD,OAAQ,MACR,IAAK,GAAGQ,EAAAA,kBAAkB,KAAK,SAAS,MAAM,CAAC,IAAIF,CAAS,GAC5D,OAAAD,CAAA,CACD,EAEM,OAAA,KAAK,eAAkBL,CAAM,CAAA,CAGtC,MAAM,gBACJS,EACAJ,EACA,CACA,MAAML,EAAS,MAAM,KAAK,SAAS,OAAA,EAAS,YAAY,CACtD,OAAQ,MACR,IAAK,GAAGQ,oBAAkB,KAAK,SAAS,MAAM,CAAC,aAAaH,EAAO,UAAU,IAAII,CAAM,GACvF,KAAMJ,CAAA,CACP,EAEM,OAAA,KAAK,eAAkBL,CAAM,CAAA,CAG9B,eAAkBU,EAAuB,CAC3C,GAAAA,EAAS,aAAe,QAC1B,MAAM,IAAI,MAAMA,EAAS,OAASA,EAAS,IAAI,EAGjD,OAAOA,EAAS,IAAA,CAEpB"}
package/dist/esm/api.mjs CHANGED
@@ -53,7 +53,7 @@ class k {
53
53
  return o.isNetworkError(e) ? !0 : e.response ? e.response.status >= 500 && e.response.status <= 599 || e.response.status === 429 : !1;
54
54
  }
55
55
  getKnockClientHeader() {
56
- return "Knock/ClientJS 0.16.1";
56
+ return "Knock/ClientJS 0.16.2";
57
57
  }
58
58
  }
59
59
  export {
@@ -21,7 +21,7 @@ class o {
21
21
  const t = await this.instance.client().makeRequest({
22
22
  method: "PUT",
23
23
  url: `/v1/users/${this.instance.userId}`,
24
- params: e
24
+ data: e
25
25
  });
26
26
  return this.handleResponse(t);
27
27
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../../../../src/clients/users/index.ts"],"sourcesContent":["import { GenericData } from \"@knocklabs/types\";\n\nimport { ApiResponse } from \"../../api\";\nimport { ChannelData, User } from \"../../interfaces\";\nimport Knock from \"../../knock\";\nimport { guidesApiRootPath } from \"../guide/client\";\nimport { GuideEngagementEventBaseParams } from \"../guide/types\";\nimport {\n GetPreferencesOptions,\n PreferenceOptions,\n PreferenceSet,\n SetPreferencesProperties,\n} from \"../preferences/interfaces\";\n\nimport { GetChannelDataInput, SetChannelDataInput } from \"./interfaces\";\n\nconst DEFAULT_PREFERENCE_SET_ID = \"default\";\n\nclass UserClient {\n private instance: Knock;\n\n constructor(instance: Knock) {\n this.instance = instance;\n }\n\n async get() {\n this.instance.failIfNotAuthenticated();\n\n const result = await this.instance.client().makeRequest({\n method: \"GET\",\n url: `/v1/users/${this.instance.userId}`,\n });\n\n return this.handleResponse<User>(result);\n }\n\n async identify(props: GenericData = {}) {\n this.instance.failIfNotAuthenticated();\n\n const result = await this.instance.client().makeRequest({\n method: \"PUT\",\n url: `/v1/users/${this.instance.userId}`,\n params: props,\n });\n\n return this.handleResponse<User>(result);\n }\n\n async getAllPreferences() {\n this.instance.failIfNotAuthenticated();\n\n const result = await this.instance.client().makeRequest({\n method: \"GET\",\n url: `/v1/users/${this.instance.userId}/preferences`,\n });\n\n return this.handleResponse<PreferenceSet[]>(result);\n }\n\n async getPreferences(\n options: GetPreferencesOptions = {},\n ): Promise<PreferenceSet> {\n this.instance.failIfNotAuthenticated();\n const preferenceSetId = options.preferenceSet || DEFAULT_PREFERENCE_SET_ID;\n\n const result = await this.instance.client().makeRequest({\n method: \"GET\",\n url: `/v1/users/${this.instance.userId}/preferences/${preferenceSetId}`,\n params: { tenant: options.tenant },\n });\n\n return this.handleResponse<PreferenceSet>(result);\n }\n\n async setPreferences(\n preferenceSet: SetPreferencesProperties,\n options: PreferenceOptions = {},\n ): Promise<PreferenceSet> {\n this.instance.failIfNotAuthenticated();\n const preferenceSetId = options.preferenceSet || DEFAULT_PREFERENCE_SET_ID;\n\n const result = await this.instance.client().makeRequest({\n method: \"PUT\",\n url: `/v1/users/${this.instance.userId}/preferences/${preferenceSetId}`,\n data: preferenceSet,\n });\n\n return this.handleResponse<PreferenceSet>(result);\n }\n\n async getChannelData<T = GenericData>(params: GetChannelDataInput) {\n this.instance.failIfNotAuthenticated();\n\n const result = await this.instance.client().makeRequest({\n method: \"GET\",\n url: `/v1/users/${this.instance.userId}/channel_data/${params.channelId}`,\n });\n\n return this.handleResponse<ChannelData<T>>(result);\n }\n\n async setChannelData<T = GenericData>({\n channelId,\n channelData,\n }: SetChannelDataInput) {\n this.instance.failIfNotAuthenticated();\n\n const result = await this.instance.client().makeRequest({\n method: \"PUT\",\n url: `/v1/users/${this.instance.userId}/channel_data/${channelId}`,\n data: { data: channelData },\n });\n\n return this.handleResponse<ChannelData<T>>(result);\n }\n\n async getGuides<P, R>(channelId: string, params: P) {\n const result = await this.instance.client().makeRequest({\n method: \"GET\",\n url: `${guidesApiRootPath(this.instance.userId)}/${channelId}`,\n params,\n });\n\n return this.handleResponse<R>(result);\n }\n\n async markGuideStepAs<P extends GuideEngagementEventBaseParams, R>(\n status: \"seen\" | \"interacted\" | \"archived\",\n params: P,\n ) {\n const result = await this.instance.client().makeRequest({\n method: \"PUT\",\n url: `${guidesApiRootPath(this.instance.userId)}/messages/${params.message_id}/${status}`,\n data: params,\n });\n\n return this.handleResponse<R>(result);\n }\n\n private handleResponse<T>(response: ApiResponse) {\n if (response.statusCode === \"error\") {\n throw new Error(response.error || response.body);\n }\n\n return response.body as T;\n }\n}\n\nexport default UserClient;\n"],"names":["DEFAULT_PREFERENCE_SET_ID","UserClient","instance","__publicField","result","props","options","preferenceSetId","preferenceSet","params","channelId","channelData","guidesApiR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EAAS,YAAY;AAAA,MACtD,QAAQ;AAAA,MACR,KAAK,GAAGQ,EAAkB,KAAK,SAAS,MAAM,CAAC,aAAaH,EAAO,UAAU,IAAII,CAAM;AAAA,MACvF,MAAMJ;AAAA,IAAA,CACP;AAEM,WAAA,KAAK,eAAkBL,CAAM;AAAA,EAAA;AAAA,EAG9B,eAAkBU,GAAuB;AAC3C,QAAAA,EAAS,eAAe;AAC1B,YAAM,IAAI,MAAMA,EAAS,SAASA,EAAS,IAAI;AAGjD,WAAOA,EAAS;AAAA,EAAA;AAEpB;"}
1
+ {"version":3,"file":"index.mjs","sources":["../../../../src/clients/users/index.ts"],"sourcesContent":["import { GenericData } from \"@knocklabs/types\";\n\nimport { ApiResponse } from \"../../api\";\nimport { ChannelData, User } from \"../../interfaces\";\nimport Knock from \"../../knock\";\nimport { guidesApiRootPath } from \"../guide/client\";\nimport { GuideEngagementEventBaseParams } from \"../guide/types\";\nimport {\n GetPreferencesOptions,\n PreferenceOptions,\n PreferenceSet,\n SetPreferencesProperties,\n} from \"../preferences/interfaces\";\n\nimport { GetChannelDataInput, SetChannelDataInput } from \"./interfaces\";\n\nconst DEFAULT_PREFERENCE_SET_ID = \"default\";\n\nclass UserClient {\n private instance: Knock;\n\n constructor(instance: Knock) {\n this.instance = instance;\n }\n\n async get() {\n this.instance.failIfNotAuthenticated();\n\n const result = await this.instance.client().makeRequest({\n method: \"GET\",\n url: `/v1/users/${this.instance.userId}`,\n });\n\n return this.handleResponse<User>(result);\n }\n\n async identify(props: GenericData = {}) {\n this.instance.failIfNotAuthenticated();\n\n const result = await this.instance.client().makeRequest({\n method: \"PUT\",\n url: `/v1/users/${this.instance.userId}`,\n data: props,\n });\n\n return this.handleResponse<User>(result);\n }\n\n async getAllPreferences() {\n this.instance.failIfNotAuthenticated();\n\n const result = await this.instance.client().makeRequest({\n method: \"GET\",\n url: `/v1/users/${this.instance.userId}/preferences`,\n });\n\n return this.handleResponse<PreferenceSet[]>(result);\n }\n\n async getPreferences(\n options: GetPreferencesOptions = {},\n ): Promise<PreferenceSet> {\n this.instance.failIfNotAuthenticated();\n const preferenceSetId = options.preferenceSet || DEFAULT_PREFERENCE_SET_ID;\n\n const result = await this.instance.client().makeRequest({\n method: \"GET\",\n url: `/v1/users/${this.instance.userId}/preferences/${preferenceSetId}`,\n params: { tenant: options.tenant },\n });\n\n return this.handleResponse<PreferenceSet>(result);\n }\n\n async setPreferences(\n preferenceSet: SetPreferencesProperties,\n options: PreferenceOptions = {},\n ): Promise<PreferenceSet> {\n this.instance.failIfNotAuthenticated();\n const preferenceSetId = options.preferenceSet || DEFAULT_PREFERENCE_SET_ID;\n\n const result = await this.instance.client().makeRequest({\n method: \"PUT\",\n url: `/v1/users/${this.instance.userId}/preferences/${preferenceSetId}`,\n data: preferenceSet,\n });\n\n return this.handleResponse<PreferenceSet>(result);\n }\n\n async getChannelData<T = GenericData>(params: GetChannelDataInput) {\n this.instance.failIfNotAuthenticated();\n\n const result = await this.instance.client().makeRequest({\n method: \"GET\",\n url: `/v1/users/${this.instance.userId}/channel_data/${params.channelId}`,\n });\n\n return this.handleResponse<ChannelData<T>>(result);\n }\n\n async setChannelData<T = GenericData>({\n channelId,\n channelData,\n }: SetChannelDataInput) {\n this.instance.failIfNotAuthenticated();\n\n const result = await this.instance.client().makeRequest({\n method: \"PUT\",\n url: `/v1/users/${this.instance.userId}/channel_data/${channelId}`,\n data: { data: channelData },\n });\n\n return this.handleResponse<ChannelData<T>>(result);\n }\n\n async getGuides<P, R>(channelId: string, params: P) {\n const result = await this.instance.client().makeRequest({\n method: \"GET\",\n url: `${guidesApiRootPath(this.instance.userId)}/${channelId}`,\n params,\n });\n\n return this.handleResponse<R>(result);\n }\n\n async markGuideStepAs<P extends GuideEngagementEventBaseParams, R>(\n status: \"seen\" | \"interacted\" | \"archived\",\n params: P,\n ) {\n const result = await this.instance.client().makeRequest({\n method: \"PUT\",\n url: `${guidesApiRootPath(this.instance.userId)}/messages/${params.message_id}/${status}`,\n data: params,\n });\n\n return this.handleResponse<R>(result);\n }\n\n private handleResponse<T>(response: ApiResponse) {\n if (response.statusCode === \"error\") {\n throw new Error(response.error || response.body);\n }\n\n return response.body as T;\n }\n}\n\nexport default UserClient;\n"],"names":["DEFAULT_PREFERENCE_SET_ID","UserClient","instance","__publicField","result","props","options","preferenceSetId","preferenceSet","params","channelId","channelData","guidesApiRootPath","status","response"],"mappings":";;;;AAgBA,MAAMA,IAA4B;AAElC,MAAMC,EAAW;AAAA,EAGf,YAAYC,GAAiB;AAFrB,IAAAC,EAAA;AAGN,SAAK,WAAWD;AAAA,EAAA;AAAA,EAGlB,MAAM,MAAM;AACV,SAAK,SAAS,uBAAuB;AAErC,UAAME,IAAS,MAAM,KAAK,SAAS,OAAA,EAAS,YAAY;AAAA,MACtD,QAAQ;AAAA,MACR,KAAK,aAAa,KAAK,SAAS,MAAM;AAAA,IAAA,CACvC;AAEM,WAAA,KAAK,eAAqBA,CAAM;AAAA,EAAA;AAAA,EAGzC,MAAM,SAASC,IAAqB,IAAI;AACtC,SAAK,SAAS,uBAAuB;AAErC,UAAMD,IAAS,MAAM,KAAK,SAAS,OAAA,EAAS,YAAY;AAAA,MACtD,QAAQ;AAAA,MACR,KAAK,aAAa,KAAK,SAAS,MAAM;AAAA,MACtC,MAAMC;AAAA,IAAA,CACP;AAEM,WAAA,KAAK,eAAqBD,CAAM;AAAA,EAAA;AAAA,EAGzC,MAAM,oBAAoB;AACxB,SAAK,SAAS,uBAAuB;AAErC,UAAMA,IAAS,MAAM,KAAK,SAAS,OAAA,EAAS,YAAY;AAAA,MACtD,QAAQ;AAAA,MACR,KAAK,aAAa,KAAK,SAAS,MAAM;AAAA,IAAA,CACvC;AAEM,WAAA,KAAK,eAAgCA,CAAM;AAAA,EAAA;AAAA,EAGpD,MAAM,eACJE,IAAiC,IACT;AACxB,SAAK,SAAS,uBAAuB;AAC/B,UAAAC,IAAkBD,EAAQ,iBAAiBN,GAE3CI,IAAS,MAAM,KAAK,SAAS,OAA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AAAA,MACR,KAAK,GAAGQ,EAAkB,KAAK,SAAS,MAAM,CAAC,IAAIF,CAAS;AAAA,MAC5D,QAAAD;AAAA,IAAA,CACD;AAEM,WAAA,KAAK,eAAkBL,CAAM;AAAA,EAAA;AAAA,EAGtC,MAAM,gBACJS,GACAJ,GACA;AACA,UAAML,IAAS,MAAM,KAAK,SAAS,OAAA,EAAS,YAAY;AAAA,MACtD,QAAQ;AAAA,MACR,KAAK,GAAGQ,EAAkB,KAAK,SAAS,MAAM,CAAC,aAAaH,EAAO,UAAU,IAAII,CAAM;AAAA,MACvF,MAAMJ;AAAA,IAAA,CACP;AAEM,WAAA,KAAK,eAAkBL,CAAM;AAAA,EAAA;AAAA,EAG9B,eAAkBU,GAAuB;AAC3C,QAAAA,EAAS,eAAe;AAC1B,YAAM,IAAI,MAAMA,EAAS,SAASA,EAAS,IAAI;AAGjD,WAAOA,EAAS;AAAA,EAAA;AAEpB;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@knocklabs/client",
3
- "version": "0.16.1",
3
+ "version": "0.16.2",
4
4
  "description": "The clientside library for interacting with Knock",
5
5
  "homepage": "https://github.com/knocklabs/javascript/tree/main/packages/client",
6
6
  "author": "@knocklabs",
@@ -40,7 +40,7 @@ class UserClient {
40
40
  const result = await this.instance.client().makeRequest({
41
41
  method: "PUT",
42
42
  url: `/v1/users/${this.instance.userId}`,
43
- params: props,
43
+ data: props,
44
44
  });
45
45
 
46
46
  return this.handleResponse<User>(result);