@hailer/app-sdk 2.4.0 → 2.4.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.
@@ -162,6 +162,7 @@ export declare class Admin {
162
162
  * @throws {HailerError} if request fails, purchase not found, or not a Hailer invoice purchase
163
163
  */
164
164
  updateInvoiceHandled(request: AdminInvoiceUpdateHandledRequest): Promise<AdminInvoiceUpdateHandledResponse>;
165
+ setSubscriptionActivityId(purchaseId: string, subscriptionActivityId: string): Promise<boolean>;
165
166
  listMonthlyRevenue(request: AdminRevenueListRequest): Promise<AdminRevenueListResponse>;
166
167
  /**
167
168
  * Gets dashboard statistics including counts for users, workspaces, activities, and messages
@@ -24,7 +24,7 @@ export declare class PermissionApi {
24
24
  *
25
25
  * @throws {HailerError} if the request fails
26
26
  */
27
- map: ({ workspaceId }: {
27
+ map: ({ workspaceId }?: {
28
28
  workspaceId?: string | undefined;
29
29
  }) => Promise<PermissionMap>;
30
30
  }
package/lib/types.d.ts CHANGED
@@ -148,15 +148,16 @@ export interface WorkflowField {
148
148
  type: WorkflowFieldType;
149
149
  label: string;
150
150
  required: boolean;
151
- unit: string;
152
- placeholder: string;
153
- description: string;
154
151
  data: string[];
155
152
  functionEnabled: boolean;
156
- editable: boolean;
153
+ unit?: string;
154
+ placeholder?: string;
155
+ description?: string;
156
+ editable?: boolean;
157
157
  functionVariables?: {
158
158
  [key: string]: any;
159
159
  };
160
+ key?: string;
160
161
  }
161
162
  export interface DocumentTemplate {
162
163
  templateId?: string;
@@ -168,7 +169,7 @@ export interface Workflow {
168
169
  name: string;
169
170
  description?: string;
170
171
  fields: {
171
- [fieldId: string]: any;
172
+ [fieldId: string]: WorkflowField;
172
173
  };
173
174
  fieldsOrder: string[];
174
175
  phases: {
@@ -178,9 +179,14 @@ export interface Workflow {
178
179
  enablePredefinedName?: boolean;
179
180
  nameFunctionEnabled?: boolean;
180
181
  nameEditable?: boolean;
181
- productInstalledId: string;
182
+ enableMapLocation?: boolean;
183
+ enableUnlinkedMode?: boolean;
184
+ nameFieldPlaceHolderText?: string;
185
+ order?: number;
186
+ productInstalledId?: string;
182
187
  workspaceId: string;
183
188
  documentTemplates?: DocumentTemplate[];
189
+ key?: string;
184
190
  }
185
191
  export interface WorkflowPhase {
186
192
  _id: string;
@@ -189,6 +195,17 @@ export interface WorkflowPhase {
189
195
  fields?: string[];
190
196
  primaryDateField?: string;
191
197
  primaryNumericField?: string;
198
+ uid?: string;
199
+ created?: number;
200
+ isEndpoint?: boolean;
201
+ possibleNextPhase?: string[];
202
+ possibleNextPhaseSettings?: {
203
+ [phaseId: string]: {
204
+ text?: string;
205
+ };
206
+ };
207
+ color?: string;
208
+ key?: string;
192
209
  }
193
210
  /**
194
211
  * ```ts
@@ -631,7 +648,7 @@ export interface AdminPurchaseData {
631
648
  productName?: string | null;
632
649
  provider?: string;
633
650
  type: string;
634
- purchaseType: 'workspace' | 'product';
651
+ purchaseType: 'workspace' | 'product' | 'token';
635
652
  billingType?: 'subscription' | 'invoice';
636
653
  planName?: 'flexible' | 'pro' | 'business' | 'enterprise';
637
654
  startedAt?: number;
@@ -641,10 +658,18 @@ export interface AdminPurchaseData {
641
658
  customStatus?: string;
642
659
  trialStart?: number;
643
660
  trialEnd?: number;
661
+ invoiceHandled?: boolean;
644
662
  pricePaid?: {
645
663
  amount: number;
646
664
  currency: string;
647
665
  };
666
+ hailer?: {
667
+ tokenAmount?: number;
668
+ tokenRate?: number;
669
+ customerActivityId?: string;
670
+ status?: string;
671
+ paymentMethod?: string;
672
+ };
648
673
  pricing?: {
649
674
  amount: number;
650
675
  currency: string;
@@ -731,6 +756,7 @@ export interface AdminCreateInvoiceIntegrationRequest {
731
756
  planName: 'enterprise';
732
757
  customPrice: number;
733
758
  paymentMethod: 'hailer';
759
+ customerActivityId?: string;
734
760
  }
735
761
  export interface AdminCreateInvoiceIntegrationResponse {
736
762
  success: boolean;
@@ -742,11 +768,14 @@ export interface AdminUpdateWorkspaceSubscriptionRequest {
742
768
  customPrice: number;
743
769
  planName: 'flexible' | 'pro' | 'business' | 'enterprise';
744
770
  tokenAmount?: number;
771
+ customerActivityId?: string;
772
+ skipInvoiceHandledReset?: boolean;
745
773
  }
746
774
  export interface AdminUpdatePurchasePriceRequest {
747
775
  purchaseId: string;
748
776
  workspaceId: string;
749
777
  newPrice: number;
778
+ skipInvoiceHandledReset?: boolean;
750
779
  }
751
780
  export interface AdminWorkspaceUser {
752
781
  _id: string;
@@ -870,7 +899,7 @@ export interface AdminInvoicePurchase {
870
899
  cid: string;
871
900
  workspaceName: string;
872
901
  created: number;
873
- purchaseType: 'workspace' | 'product';
902
+ purchaseType: 'workspace' | 'product' | 'token';
874
903
  type: 'monthly' | 'yearly' | 'one_time';
875
904
  provider: 'hailer';
876
905
  billingType: 'invoice';
@@ -881,17 +910,24 @@ export interface AdminInvoicePurchase {
881
910
  amount: number;
882
911
  currency: string;
883
912
  };
913
+ hailer?: {
914
+ tokenAmount?: number;
915
+ tokenRate?: number;
916
+ customerActivityId?: string;
917
+ };
884
918
  customStatus?: string;
885
919
  invoiceHandled?: boolean;
920
+ pendingAction?: string;
886
921
  startedAt: number;
887
922
  expiresAt?: number;
888
923
  trialStart?: number;
889
924
  trialEnd?: number;
925
+ trialDays?: number;
890
926
  }
891
927
  export interface AdminInvoiceListRequest {
892
928
  filter?: {
893
929
  workspaceId?: string;
894
- purchaseType?: 'workspace' | 'product';
930
+ purchaseType?: 'workspace' | 'product' | 'token';
895
931
  status?: 'handled' | 'unhandled' | 'all';
896
932
  search?: string;
897
933
  };
@@ -906,6 +942,7 @@ export interface AdminInvoiceWorkspaceGroup {
906
942
  cid: string;
907
943
  workspaceName: string;
908
944
  allHandled: boolean;
945
+ customerActivityId?: string;
909
946
  purchases: AdminInvoicePurchase[];
910
947
  }
911
948
  export interface AdminInvoiceListResponse {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hailer/app-sdk",
3
- "version": "2.4.0",
3
+ "version": "2.4.2",
4
4
  "description": "SDK for building Hailer Apps",
5
5
  "author": "",
6
6
  "license": "ISC",
@@ -19,12 +19,12 @@
19
19
  "docs": "typedoc --entryPointStrategy expand ./src && open-cli ./docs/index.html",
20
20
  "test": "vitest run",
21
21
  "test:watch": "vitest",
22
- "release:patch": "npm test && npm version patch -m 'chore: release v%s' && git push && git push --tags",
23
- "release:minor": "npm test && npm version minor -m 'chore: release v%s' && git push && git push --tags",
24
- "release:major": "npm test && npm version major -m 'chore: release v%s' && git push && git push --tags",
25
- "release:beta-patch": "npm test && npm version prerelease --preid=beta -m 'chore: release v%s' && git push && git push --tags",
26
- "release:beta-minor": "npm test && npm version preminor --preid=beta -m 'chore: release v%s' && git push && git push --tags",
27
- "release:beta-major": "npm test && npm version premajor --preid=beta -m 'chore: release v%s' && git push && git push --tags"
22
+ "release:patch": "npm version patch -m 'chore: release v%s' && git push && git push --tags",
23
+ "release:minor": "npm version minor -m 'chore: release v%s' && git push && git push --tags",
24
+ "release:major": "npm version major -m 'chore: release v%s' && git push && git push --tags",
25
+ "release:beta-patch": "npm version prerelease --preid=beta -m 'chore: release v%s' && git push && git push --tags",
26
+ "release:beta-minor": "npm version preminor --preid=beta -m 'chore: release v%s' && git push && git push --tags",
27
+ "release:beta-major": "npm version premajor --preid=beta -m 'chore: release v%s' && git push && git push --tags"
28
28
  },
29
29
  "dependencies": {
30
30
  "@hailer/cli": "1.2.0",