@chift/chift-nodejs 1.0.19 → 1.0.21

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.
@@ -60,6 +60,18 @@ const Sync = (internalApi, body) => {
60
60
  const myflow = (0, flow_1.Flow)(_internalApi, createFlowData, data.syncid, data.consumers, process);
61
61
  return myflow;
62
62
  });
63
+ const sendCustomEvent = (flowid, eventData) => __awaiter(void 0, void 0, void 0, function* () {
64
+ const { data } = yield _internalApi.post(`/syncs/${syncid}/flows/${flowid}/event`, eventData);
65
+ return data;
66
+ });
67
+ const getConsumerExecutions = (consumerid, flowid) => __awaiter(void 0, void 0, void 0, function* () {
68
+ const { data } = yield _internalApi.get(`/consumers/${consumerid}/syncs/${syncid}/flows/${flowid}/executions`);
69
+ return data;
70
+ });
71
+ const getExecution = (flowid, executionid) => __awaiter(void 0, void 0, void 0, function* () {
72
+ const { data } = yield _internalApi.get(`/syncs/${syncid}/flows/${flowid}/executions/${executionid}`);
73
+ return data;
74
+ });
63
75
  return {
64
76
  createFlow,
65
77
  getFlows,
@@ -68,6 +80,9 @@ const Sync = (internalApi, body) => {
68
80
  name,
69
81
  consumers,
70
82
  syncid,
83
+ sendCustomEvent,
84
+ getConsumerExecutions,
85
+ getExecution,
71
86
  };
72
87
  };
73
88
  exports.Sync = Sync;
@@ -6,6 +6,9 @@ export type SyncsAPI = {
6
6
  getSyncs: () => Promise<ReturnType<typeof Sync>[]>;
7
7
  getSyncById: (syncid: string) => Promise<ReturnType<typeof Sync>>;
8
8
  updateSync: (body?: components['schemas']['CreateSyncItem']) => Promise<ReturnType<typeof Sync>>;
9
+ sendCustomEvent: (syncid: string, flowid: string, body: components['schemas']['PostSyncFlowEvent']) => Promise<components['schemas']['TriggerResponse']>;
10
+ getConsumerExecutions: (consumerid: string, syncid: string, flowid: string) => Promise<components['schemas']['ChainExecutionItem'][]>;
11
+ getExecution: (syncid: string, flowid: string, executionid: string) => Promise<components['schemas']['ChainExecutionItem']>;
9
12
  };
10
13
  declare const Syncs: (internalApi: InternalAPI) => SyncsAPI;
11
14
  export { Syncs };
@@ -29,11 +29,26 @@ const Syncs = (internalApi) => {
29
29
  const { data, } = yield _internalApi.patch('/syncs', body);
30
30
  return (0, sync_1.Sync)(_internalApi, data);
31
31
  });
32
+ const sendCustomEvent = (syncid, flowid, body) => __awaiter(void 0, void 0, void 0, function* () {
33
+ const { data } = yield _internalApi.post(`/syncs/${syncid}/flows/${flowid}/event`, body);
34
+ return data;
35
+ });
36
+ const getConsumerExecutions = (consumerid, syncid, flowid) => __awaiter(void 0, void 0, void 0, function* () {
37
+ const { data } = yield _internalApi.get(`/consumers/${consumerid}/syncs/${syncid}/flows/${flowid}/executions`);
38
+ return data;
39
+ });
40
+ const getExecution = (syncid, flowid, executionid) => __awaiter(void 0, void 0, void 0, function* () {
41
+ const { data } = yield _internalApi.get(`/syncs/${syncid}/flows/${flowid}/executions/${executionid}`);
42
+ return data;
43
+ });
32
44
  return {
33
45
  createSync,
34
46
  getSyncs,
35
47
  getSyncById,
36
48
  updateSync,
49
+ sendCustomEvent,
50
+ getConsumerExecutions,
51
+ getExecution,
37
52
  };
38
53
  };
39
54
  exports.Syncs = Syncs;
@@ -10,6 +10,7 @@ declare const Webhooks: (internalApi: InternalAPI) => {
10
10
  consumerid: string;
11
11
  name: string;
12
12
  email?: string | undefined;
13
+ internal_reference?: string | undefined;
13
14
  redirect_url?: string | undefined;
14
15
  }>;
15
16
  getWebhookById: (webhookId: string) => Promise<{
@@ -26,6 +27,7 @@ declare const Webhooks: (internalApi: InternalAPI) => {
26
27
  consumerid: string;
27
28
  name: string;
28
29
  email?: string | undefined;
30
+ internal_reference?: string | undefined;
29
31
  redirect_url?: string | undefined;
30
32
  }>;
31
33
  unRegisterWebhook: (webhookId: string) => Promise<{