@insurup/sdk 0.1.2 → 0.1.4

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/dist/index.cjs CHANGED
@@ -15,50 +15,15 @@ var __copyProps = (to, from, except, desc) => {
15
15
  }
16
16
  return to;
17
17
  };
18
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
18
19
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
20
 
20
21
  // src/index.ts
21
22
  var index_exports = {};
22
23
  __export(index_exports, {
23
- ALL_AGENT_USER_FIELDS: () => ALL_AGENT_USER_FIELDS,
24
- ALL_CASE_FIELDS: () => ALL_CASE_FIELDS,
25
- ALL_CUSTOMER_FIELDS: () => ALL_CUSTOMER_FIELDS,
26
- ALL_FILE_POLICY_TRANSFER_FIELDS: () => ALL_FILE_POLICY_TRANSFER_FIELDS,
27
- ALL_POLICY_FIELDS: () => ALL_POLICY_FIELDS,
28
- ALL_POLICY_TRANSFER_FIELDS: () => ALL_POLICY_TRANSFER_FIELDS,
29
- ALL_PROPOSAL_FIELDS: () => ALL_PROPOSAL_FIELDS,
30
- ALL_WEBHOOK_DELIVERY_FIELDS: () => ALL_WEBHOOK_DELIVERY_FIELDS,
31
- AgentInsuranceCompanyType: () => AgentInsuranceCompanyType,
32
- AgentUserState: () => AgentUserState,
33
- AracSegment: () => AracSegment,
34
- AssetType: () => AssetType,
35
- B2CConfigFieldType: () => B2CConfigFieldType,
36
- CallCenterImplementation: () => CallCenterImplementation,
37
- CancelCaseSubType: () => CancelCaseSubType,
38
- CaseActivityAction: () => CaseActivityAction,
39
- CaseMainState: () => CaseMainState,
40
- CaseRepresentativeAssignmentMode: () => CaseRepresentativeAssignmentMode,
41
- CaseStatus: () => CaseStatus,
42
- CaseSubState: () => CaseSubState,
43
- CaseType: () => CaseType,
44
- Channel: () => Channel,
45
- ComplaintCaseSubType: () => ComplaintCaseSubType,
46
- ConsentType: () => ConsentType,
47
- ContactFlowState: () => ContactFlowState,
48
- ContactState: () => ContactState,
49
- ContactType: () => ContactType,
50
- Currency: () => Currency,
51
- CustomerType: () => CustomerType,
52
- DateOnly: () => DateOnly,
53
- DateTime: () => DateTime,
54
24
  DefaultInsurUpClient: () => DefaultInsurUpClient,
55
- Disease: () => Disease,
56
- EducationStatus: () => EducationStatus,
57
- EndorsementCaseSubType: () => EndorsementCaseSubType,
58
25
  Endpoints: () => endpoints_exports,
59
- Gender: () => Gender,
60
26
  GraphQLTransport: () => GraphQLTransport,
61
- HastaneAgi: () => HastaneAgi,
62
27
  InsurUpAgentBranchClient: () => InsurUpAgentBranchClient,
63
28
  InsurUpAgentClient: () => InsurUpAgentClient,
64
29
  InsurUpAgentRoleClient: () => InsurUpAgentRoleClient,
@@ -70,6 +35,7 @@ __export(index_exports, {
70
35
  InsurUpCustomerClient: () => InsurUpCustomerClient,
71
36
  InsurUpError: () => InsurUpError,
72
37
  InsurUpFileClient: () => InsurUpFileClient,
38
+ InsurUpGraphQLErrorCode: () => InsurUpGraphQLErrorCode,
73
39
  InsurUpInsuranceClient: () => InsurUpInsuranceClient,
74
40
  InsurUpLanguageClient: () => InsurUpLanguageClient,
75
41
  InsurUpPolicyClient: () => InsurUpPolicyClient,
@@ -79,55 +45,21 @@ __export(index_exports, {
79
45
  InsurUpTemplateClient: () => InsurUpTemplateClient,
80
46
  InsurUpVehicleClient: () => InsurUpVehicleClient,
81
47
  InsurUpWebhookClient: () => InsurUpWebhookClient,
82
- InsuranceProductType: () => InsuranceProductType,
83
- InsuranceSyncState: () => InsuranceSyncState,
84
- Job: () => Job,
85
- LossPayeeClauseType: () => LossPayeeClauseType,
86
- MaritalStatus: () => MaritalStatus,
87
- Nationality: () => Nationality,
88
- OnarimServisTuru: () => OnarimServisTuru,
89
- PaymentOption: () => PaymentOption,
90
- PolicyState: () => PolicyState,
91
- PolicyTransferCompanyFailureReason: () => PolicyTransferCompanyFailureReason,
92
- PolicyTransferTriggerStatus: () => PolicyTransferTriggerStatus,
93
- ProductBranch: () => ProductBranch,
94
- PropertyDamageStatus: () => PropertyDamageStatus,
95
- PropertyOwnershipType: () => PropertyOwnershipType,
96
- PropertyStructure: () => PropertyStructure,
97
- PropertyUtilizationStyle: () => PropertyUtilizationStyle,
98
- ProposalProductState: () => ProposalProductState,
99
- ProposalState: () => ProposalState,
100
- RobotMode: () => RobotMode,
101
- SaglikPaketiTedaviSekli: () => SaglikPaketiTedaviSekli,
102
- SaleOpportunityCaseSubType: () => SaleOpportunityCaseSubType,
103
- SmsImplementation: () => SmsImplementation,
104
- SortEnumType: () => SortEnumType,
105
- Surgery: () => Surgery,
106
- TasinanYuk: () => TasinanYuk,
107
- TransferredPolicyFailureReason: () => TransferredPolicyFailureReason,
108
- TransferredPolicySkipReason: () => TransferredPolicySkipReason,
109
- TransferredPolicyStatus: () => TransferredPolicyStatus,
110
- UserType: () => UserType,
111
48
  VERSION: () => VERSION,
112
- VehicleAccessoryType: () => VehicleAccessoryType,
113
- VehicleFuelType: () => VehicleFuelType,
114
- VehicleUtilizationStyle: () => VehicleUtilizationStyle,
115
- WebhookDeliveryState: () => WebhookDeliveryState,
116
- WebhookEvent: () => WebhookEvent,
117
- YedekParcaTuru: () => YedekParcaTuru,
118
- buildFieldSelection: () => buildFieldSelection,
49
+ createGraphQLErrors: () => createGraphQLErrors,
119
50
  extractError: () => extractError,
120
51
  getDataOrThrow: () => getDataOrThrow,
121
- mergeCoverage: () => mergeCoverage,
122
- throwIfError: () => throwIfError
52
+ getGraphQLDataOrThrow: () => getGraphQLDataOrThrow,
53
+ throwIfError: () => throwIfError,
54
+ throwIfGraphQLError: () => throwIfGraphQLError
123
55
  });
124
56
  module.exports = __toCommonJS(index_exports);
125
57
 
126
58
  // package.json
127
59
  var package_default = {
128
60
  name: "@insurup/sdk",
129
- version: "0.1.2",
130
- description: "Type-safe TypeScript SDK for the InsurUp insurance platform with GraphQL support. Zero dependencies, tree-shakeable, works everywhere.",
61
+ version: "0.1.4",
62
+ description: "Type-safe TypeScript SDK for the InsurUp insurance platform with GraphQL support. Tree-shakeable, works everywhere.",
131
63
  keywords: [
132
64
  "insurup",
133
65
  "insurance",
@@ -143,13 +75,13 @@ var package_default = {
143
75
  ],
144
76
  author: "InsurUp Team",
145
77
  license: "MIT",
146
- homepage: "https://github.com/InsurUp/ts-sdk#readme",
78
+ homepage: "https://github.com/InsurUp/ts-toolkit#readme",
147
79
  repository: {
148
80
  type: "git",
149
- url: "git+https://github.com/InsurUp/ts-sdk.git"
81
+ url: "git+https://github.com/InsurUp/ts-toolkit.git"
150
82
  },
151
83
  bugs: {
152
- url: "https://github.com/InsurUp/ts-sdk/issues"
84
+ url: "https://github.com/InsurUp/ts-toolkit/issues"
153
85
  },
154
86
  engines: {
155
87
  node: ">=18"
@@ -167,6 +99,10 @@ var package_default = {
167
99
  types: "./dist/index.d.ts",
168
100
  import: "./dist/index.js",
169
101
  require: "./dist/index.cjs"
102
+ },
103
+ "./browser": {
104
+ types: "./dist/index.d.ts",
105
+ import: "./dist/index.browser.js"
170
106
  }
171
107
  },
172
108
  scripts: {
@@ -180,6 +116,9 @@ var package_default = {
180
116
  "test:watch": "vitest",
181
117
  "test:coverage": "vitest run --coverage"
182
118
  },
119
+ publishConfig: {
120
+ access: "public"
121
+ },
183
122
  devDependencies: {
184
123
  "@eslint/js": "^9.39.2",
185
124
  "@vitest/coverage-v8": "^4.0.17",
@@ -194,7 +133,9 @@ var package_default = {
194
133
  "typescript-eslint": "^8.53.1",
195
134
  vitest: "^4.0.17"
196
135
  },
197
- dependencies: {}
136
+ dependencies: {
137
+ "@insurup/contracts": "workspace:*"
138
+ }
198
139
  };
199
140
 
200
141
  // src/version.ts
@@ -228,6 +169,21 @@ var InsurUpServerErrorType = /* @__PURE__ */ ((InsurUpServerErrorType2) => {
228
169
  InsurUpServerErrorType2["Upstream"] = "Upstream";
229
170
  return InsurUpServerErrorType2;
230
171
  })(InsurUpServerErrorType || {});
172
+ var InsurUpGraphQLErrorCode = /* @__PURE__ */ ((InsurUpGraphQLErrorCode2) => {
173
+ InsurUpGraphQLErrorCode2["Forbidden"] = "FORBIDDEN";
174
+ InsurUpGraphQLErrorCode2["Unauthorized"] = "UNAUTHORIZED";
175
+ InsurUpGraphQLErrorCode2["NotFound"] = "NOT_FOUND";
176
+ InsurUpGraphQLErrorCode2["BadRequest"] = "BAD_REQUEST";
177
+ InsurUpGraphQLErrorCode2["Conflict"] = "CONFLICT";
178
+ InsurUpGraphQLErrorCode2["NotSupported"] = "NOT_SUPPORTED";
179
+ InsurUpGraphQLErrorCode2["UpstreamError"] = "UPSTREAM_ERROR";
180
+ InsurUpGraphQLErrorCode2["InternalError"] = "INTERNAL_ERROR";
181
+ InsurUpGraphQLErrorCode2["ValidationError"] = "VALIDATION_ERROR";
182
+ InsurUpGraphQLErrorCode2["FilterRequired"] = "FILTER_REQUIRED";
183
+ InsurUpGraphQLErrorCode2["FilterMaxSpanExceeded"] = "FILTER_MAX_SPAN_EXCEEDED";
184
+ InsurUpGraphQLErrorCode2["Unknown"] = "UNKNOWN";
185
+ return InsurUpGraphQLErrorCode2;
186
+ })(InsurUpGraphQLErrorCode || {});
231
187
 
232
188
  // src/core/errors.ts
233
189
  var ERROR_TYPE_URLS = {
@@ -367,7 +323,7 @@ function extractError(error) {
367
323
  }
368
324
  var InsurUpError = class extends Error {
369
325
  /**
370
- * The original client or server error object
326
+ * The original client, server, or GraphQL error object
371
327
  */
372
328
  error;
373
329
  constructor(error) {
@@ -405,6 +361,26 @@ function throwIfError(result) {
405
361
  }
406
362
  throw new InsurUpError(result);
407
363
  }
364
+ function getGraphQLDataOrThrow(result) {
365
+ if (result.isSuccess) {
366
+ return result.data;
367
+ }
368
+ throw new InsurUpError(result);
369
+ }
370
+ function throwIfGraphQLError(result) {
371
+ if (result.isSuccess) {
372
+ return;
373
+ }
374
+ throw new InsurUpError(result);
375
+ }
376
+ function createGraphQLErrors(errors) {
377
+ return {
378
+ kind: "graphql-error",
379
+ isSuccess: false,
380
+ message: errors[0]?.message ?? "Unknown GraphQL error",
381
+ errors
382
+ };
383
+ }
408
384
 
409
385
  // src/core/config.ts
410
386
  var DEFAULT_RETRY_OPTIONS = {
@@ -963,7 +939,8 @@ var HttpTransport = class {
963
939
  ...this.options.customHeaders,
964
940
  ...additionalHeaders
965
941
  };
966
- if (typeof window === "undefined" && this.options.userAgent) {
942
+ const isBrowser = typeof globalThis === "object" && "window" in globalThis;
943
+ if (!isBrowser && this.options.userAgent) {
967
944
  headers["User-Agent"] = this.options.userAgent;
968
945
  }
969
946
  if (this.options.tokenProvider) {
@@ -1241,6 +1218,69 @@ var HttpTransport = class {
1241
1218
  };
1242
1219
 
1243
1220
  // src/client/graphql.ts
1221
+ function mapGraphQLErrorCode(code) {
1222
+ if (typeof code !== "string") {
1223
+ return "UNKNOWN" /* Unknown */;
1224
+ }
1225
+ const upperCode = code.toUpperCase();
1226
+ switch (upperCode) {
1227
+ case "FORBIDDEN":
1228
+ return "FORBIDDEN" /* Forbidden */;
1229
+ case "UNAUTHORIZED":
1230
+ return "UNAUTHORIZED" /* Unauthorized */;
1231
+ case "NOT_FOUND":
1232
+ return "NOT_FOUND" /* NotFound */;
1233
+ case "BAD_REQUEST":
1234
+ return "BAD_REQUEST" /* BadRequest */;
1235
+ case "CONFLICT":
1236
+ return "CONFLICT" /* Conflict */;
1237
+ case "NOT_SUPPORTED":
1238
+ return "NOT_SUPPORTED" /* NotSupported */;
1239
+ case "UPSTREAM_ERROR":
1240
+ return "UPSTREAM_ERROR" /* UpstreamError */;
1241
+ case "INTERNAL_ERROR":
1242
+ return "INTERNAL_ERROR" /* InternalError */;
1243
+ case "VALIDATION_ERROR":
1244
+ return "VALIDATION_ERROR" /* ValidationError */;
1245
+ case "FILTER_REQUIRED":
1246
+ return "FILTER_REQUIRED" /* FilterRequired */;
1247
+ case "FILTER_MAX_SPAN_EXCEEDED":
1248
+ return "FILTER_MAX_SPAN_EXCEEDED" /* FilterMaxSpanExceeded */;
1249
+ default:
1250
+ return "UNKNOWN" /* Unknown */;
1251
+ }
1252
+ }
1253
+ function parseExtensions(raw) {
1254
+ if (!raw) {
1255
+ return void 0;
1256
+ }
1257
+ const extensions = {
1258
+ ...raw,
1259
+ code: mapGraphQLErrorCode(raw.code),
1260
+ traceId: typeof raw.traceId === "string" ? raw.traceId : void 0,
1261
+ codes: Array.isArray(raw.codes) ? raw.codes.filter((c) => typeof c === "string") : void 0,
1262
+ template: typeof raw.template === "string" ? raw.template : void 0,
1263
+ templateArgs: typeof raw.templateArgs === "object" && raw.templateArgs !== null ? raw.templateArgs : void 0,
1264
+ suggestions: Array.isArray(raw.suggestions) ? raw.suggestions.filter((s) => typeof s === "string") : void 0
1265
+ };
1266
+ return extensions;
1267
+ }
1268
+ function parseGraphQLErrors(rawErrors) {
1269
+ return rawErrors.map((error) => {
1270
+ const locations = error.locations?.map(
1271
+ (loc) => ({
1272
+ line: loc.line,
1273
+ column: loc.column
1274
+ })
1275
+ );
1276
+ return {
1277
+ message: error.message,
1278
+ locations,
1279
+ path: error.path,
1280
+ extensions: parseExtensions(error.extensions)
1281
+ };
1282
+ });
1283
+ }
1244
1284
  var GraphQLTransport = class {
1245
1285
  constructor(http) {
1246
1286
  this.http = http;
@@ -1250,7 +1290,7 @@ var GraphQLTransport = class {
1250
1290
  * @param query The GraphQL query string
1251
1291
  * @param variables Optional variables for the query
1252
1292
  * @param options Optional request options
1253
- * @returns Promise resolving to InsurUpResult<T>
1293
+ * @returns Promise resolving to InsurUpGraphQLResult<T>
1254
1294
  */
1255
1295
  async query(query, variables, options) {
1256
1296
  const payload = {
@@ -1267,15 +1307,8 @@ var GraphQLTransport = class {
1267
1307
  }
1268
1308
  const response = result.data;
1269
1309
  if (response.errors && response.errors.length > 0) {
1270
- const firstError = response.errors[0];
1271
- const clientError = {
1272
- kind: "client-error",
1273
- isSuccess: false,
1274
- message: firstError.message,
1275
- type: "Unknown" /* Unknown */,
1276
- error: response.errors
1277
- };
1278
- return clientError;
1310
+ const parsedErrors = parseGraphQLErrors(response.errors);
1311
+ return createGraphQLErrors(parsedErrors);
1279
1312
  }
1280
1313
  if (!response.data) {
1281
1314
  return createDeserializationError(
@@ -2566,155 +2599,9 @@ var InsurUpAgentSetupClient = class {
2566
2599
  }
2567
2600
  };
2568
2601
 
2569
- // src/contracts/graphql/agentUsers.ts
2570
- var ALL_AGENT_USER_FIELDS = [
2571
- // Primitive fields
2572
- "id",
2573
- "email",
2574
- "firstName",
2575
- "lastName",
2576
- "name",
2577
- "phoneNumber",
2578
- "phoneNumberCountryCode",
2579
- "state",
2580
- "createdAt",
2581
- "lastLoginAt",
2582
- // Nested roles fields
2583
- "roles.id",
2584
- "roles.name",
2585
- "roles.isAdmin",
2586
- // Nested branches fields
2587
- "branches.id",
2588
- "branches.name",
2589
- "branches.parentId",
2590
- "branches.parentName",
2591
- "branches.level",
2592
- "branches.hierarchy"
2593
- ];
2594
-
2595
- // src/contracts/common.date.ts
2596
- var DateTime = class _DateTime {
2597
- _value;
2598
- constructor(value) {
2599
- this._value = typeof value === "string" ? new Date(value) : value;
2600
- }
2601
- /** Creates DateTime from a native Date object */
2602
- static fromDate(date) {
2603
- return new _DateTime(date);
2604
- }
2605
- /** Creates DateTime from current time */
2606
- static now() {
2607
- return new _DateTime(/* @__PURE__ */ new Date());
2608
- }
2609
- /** Returns the native Date object */
2610
- toDate() {
2611
- return this._value;
2612
- }
2613
- /** Returns ISO 8601 string representation */
2614
- toISOString() {
2615
- return this._value.toISOString();
2616
- }
2617
- /** Returns ISO 8601 string (for JSON serialization) */
2618
- toJSON() {
2619
- return this.toISOString();
2620
- }
2621
- /** Returns ISO 8601 string */
2622
- toString() {
2623
- return this.toISOString();
2624
- }
2625
- /** Returns timestamp in milliseconds */
2626
- valueOf() {
2627
- return this._value.valueOf();
2628
- }
2629
- };
2630
- var DateOnly = class _DateOnly {
2631
- _year;
2632
- _month;
2633
- _day;
2634
- constructor(value) {
2635
- if (typeof value === "string") {
2636
- const parts = value.split("-").map(Number);
2637
- this._year = parts[0] ?? 0;
2638
- this._month = parts[1] ?? 1;
2639
- this._day = parts[2] ?? 1;
2640
- } else {
2641
- this._year = value.getUTCFullYear();
2642
- this._month = value.getUTCMonth() + 1;
2643
- this._day = value.getUTCDate();
2644
- }
2645
- }
2646
- /** Creates DateOnly from a native Date object */
2647
- static fromDate(date) {
2648
- return new _DateOnly(date);
2649
- }
2650
- /** Creates DateOnly from current date */
2651
- static today() {
2652
- return new _DateOnly(/* @__PURE__ */ new Date());
2653
- }
2654
- /** Returns the native Date object (at midnight UTC) */
2655
- toDate() {
2656
- return new Date(Date.UTC(this._year, this._month - 1, this._day));
2657
- }
2658
- /** Returns YYYY-MM-DD string representation */
2659
- toString() {
2660
- const y = this._year.toString().padStart(4, "0");
2661
- const m = this._month.toString().padStart(2, "0");
2662
- const d = this._day.toString().padStart(2, "0");
2663
- return `${y}-${m}-${d}`;
2664
- }
2665
- /** Returns YYYY-MM-DD string (for JSON serialization) */
2666
- toJSON() {
2667
- return this.toString();
2668
- }
2669
- /** Returns timestamp in milliseconds */
2670
- valueOf() {
2671
- return this.toDate().valueOf();
2672
- }
2673
- /** Gets the year */
2674
- get year() {
2675
- return this._year;
2676
- }
2677
- /** Gets the month (1-12) */
2678
- get month() {
2679
- return this._month;
2680
- }
2681
- /** Gets the day (1-31) */
2682
- get day() {
2683
- return this._day;
2684
- }
2685
- };
2686
-
2687
- // src/contracts/graphql/common.ts
2688
- var SortEnumType = /* @__PURE__ */ ((SortEnumType2) => {
2689
- SortEnumType2["ASC"] = "ASC";
2690
- SortEnumType2["DESC"] = "DESC";
2691
- return SortEnumType2;
2692
- })(SortEnumType || {});
2693
- function buildFieldSelection(fields, indent = " ") {
2694
- const simpleFields = [];
2695
- const nestedFields = /* @__PURE__ */ new Map();
2696
- for (const field of fields) {
2697
- const dotIndex = field.indexOf(".");
2698
- if (dotIndex !== -1) {
2699
- const parent = field.slice(0, dotIndex);
2700
- const nested = field.slice(dotIndex + 1);
2701
- if (!nestedFields.has(parent)) {
2702
- nestedFields.set(parent, []);
2703
- }
2704
- nestedFields.get(parent).push(nested);
2705
- } else {
2706
- simpleFields.push(field);
2707
- }
2708
- }
2709
- const selections = [...simpleFields];
2710
- for (const [parent, nestedKeys] of nestedFields) {
2711
- selections.push(`${parent} { ${nestedKeys.join(" ")} }`);
2712
- }
2713
- return selections.join(`
2714
- ${indent}`);
2715
- }
2716
-
2717
2602
  // src/clients/agentUser.ts
2603
+ var import_contracts = require("@insurup/contracts");
2604
+ var import_contracts2 = require("@insurup/contracts");
2718
2605
  var InsurUpAgentUserClient = class {
2719
2606
  constructor(http, graphql) {
2720
2607
  this.http = http;
@@ -2924,14 +2811,14 @@ var InsurUpAgentUserClient = class {
2924
2811
  * @param requestOptions Query options including pagination, filters, search, and field selection
2925
2812
  * @returns Paginated connection of agent users with type-narrowed fields
2926
2813
  */
2927
- async getAgentUsers(requestOptions) {
2814
+ async getAgentUsers(requestOptions, options) {
2928
2815
  if (!this.graphql) {
2929
2816
  throw new Error(
2930
2817
  "GraphQL transport is not available. Ensure the client is properly initialized."
2931
2818
  );
2932
2819
  }
2933
- const fields = requestOptions?.select ?? ALL_AGENT_USER_FIELDS;
2934
- const fieldSelection = buildFieldSelection(fields);
2820
+ const fields = requestOptions?.select ?? import_contracts.ALL_AGENT_USER_FIELDS;
2821
+ const fieldSelection = (0, import_contracts2.buildFieldSelection)(fields);
2935
2822
  const query = `
2936
2823
  query GetAgentUsers(
2937
2824
  $first: Int
@@ -2964,9 +2851,6 @@ var InsurUpAgentUserClient = class {
2964
2851
  ${fieldSelection}
2965
2852
  }
2966
2853
  }
2967
- nodes {
2968
- ${fieldSelection}
2969
- }
2970
2854
  }
2971
2855
  }
2972
2856
  `;
@@ -2979,53 +2863,25 @@ var InsurUpAgentUserClient = class {
2979
2863
  filter: requestOptions?.filter,
2980
2864
  order: requestOptions?.order
2981
2865
  };
2982
- const result = await this.graphql.query(query, variables);
2866
+ const result = await this.graphql.query(query, variables, options);
2983
2867
  if (!result.isSuccess) {
2984
2868
  return result;
2985
2869
  }
2870
+ const edges = result.data.agentUsersNew.edges;
2871
+ const nodes = edges?.map((edge) => edge?.node ?? null) ?? null;
2986
2872
  return {
2987
2873
  ...result,
2988
- data: result.data.agentUsersNew
2874
+ data: {
2875
+ ...result.data.agentUsersNew,
2876
+ nodes
2877
+ }
2989
2878
  };
2990
2879
  }
2991
2880
  };
2992
2881
 
2993
- // src/contracts/graphql/customers.ts
2994
- var ALL_CUSTOMER_FIELDS = [
2995
- // Primitive fields
2996
- "agentBranchId",
2997
- "id",
2998
- "name",
2999
- "identityNumber",
3000
- "taxNumber",
3001
- "type",
3002
- "primaryEmail",
3003
- "primaryPhoneNumber",
3004
- "primaryPhoneNumberCountryCode",
3005
- "cityText",
3006
- "cityValue",
3007
- "districtText",
3008
- "districtValue",
3009
- "createdAt",
3010
- "birthDate",
3011
- "gender",
3012
- "educationStatus",
3013
- "nationality",
3014
- "maritalStatus",
3015
- "job",
3016
- "passportNumber",
3017
- "searchScore",
3018
- // Nested agentBranch fields
3019
- "agentBranch.id",
3020
- "agentBranch.name",
3021
- "agentBranch.parentId",
3022
- "agentBranch.parentName",
3023
- // Nested consents fields
3024
- "consents.consentType",
3025
- "consents.isActive"
3026
- ];
3027
-
3028
2882
  // src/clients/customer.ts
2883
+ var import_contracts3 = require("@insurup/contracts");
2884
+ var import_contracts4 = require("@insurup/contracts");
3029
2885
  var InsurUpCustomerClient = class {
3030
2886
  constructor(http, graphql) {
3031
2887
  this.http = http;
@@ -3035,9 +2891,22 @@ var InsurUpCustomerClient = class {
3035
2891
  * Creates a new customer profile with essential personal and contact information.
3036
2892
  */
3037
2893
  async createCustomer(request, options) {
2894
+ const { type, ...rest } = request;
2895
+ let $type;
2896
+ switch (type) {
2897
+ case import_contracts3.CustomerType.Individual:
2898
+ $type = "individual";
2899
+ break;
2900
+ case import_contracts3.CustomerType.Company:
2901
+ $type = "company";
2902
+ break;
2903
+ case import_contracts3.CustomerType.Foreign:
2904
+ $type = "foreign";
2905
+ break;
2906
+ }
3038
2907
  return this.http.post(
3039
2908
  endpoints.customers.createCustomer,
3040
- request,
2909
+ { $type, ...rest },
3041
2910
  options
3042
2911
  );
3043
2912
  }
@@ -3427,23 +3296,24 @@ var InsurUpCustomerClient = class {
3427
3296
  * @param requestOptions Query options including pagination, filters, search, and field selection
3428
3297
  * @returns Paginated connection of customers with type-narrowed fields
3429
3298
  */
3430
- async getCustomers(requestOptions) {
3299
+ async getCustomers(requestOptions, options) {
3431
3300
  if (!this.graphql) {
3432
3301
  throw new Error(
3433
3302
  "GraphQL transport is not available. Ensure the client is properly initialized."
3434
3303
  );
3435
3304
  }
3436
- const fields = requestOptions?.select ?? ALL_CUSTOMER_FIELDS;
3437
- const fieldSelection = buildFieldSelection(fields);
3305
+ const fields = requestOptions?.select ?? import_contracts3.ALL_CUSTOMER_FIELDS;
3306
+ const fieldSelection = (0, import_contracts4.buildFieldSelection)(fields);
3307
+ const includeTotalCount = requestOptions?.includeTotalCount !== false;
3438
3308
  const query = `
3439
3309
  query GetCustomers(
3440
3310
  $first: Int
3441
3311
  $after: String
3442
3312
  $last: Int
3443
3313
  $before: String
3444
- $search: QueryCustomerModelSearchInput
3445
- $filter: QueryCustomerModelFilterInput
3446
- $order: [QueryCustomerModelSortInput!]
3314
+ $search: searching_QueryCustomerModelFilterInput
3315
+ $filter: filtering_QueryCustomerModelFilterInput
3316
+ $order: [sorting_QueryCustomerModelSortInput!]
3447
3317
  ) {
3448
3318
  customersNew(
3449
3319
  first: $first
@@ -3451,7 +3321,7 @@ var InsurUpCustomerClient = class {
3451
3321
  last: $last
3452
3322
  before: $before
3453
3323
  search: $search
3454
- where: $filter
3324
+ filter: $filter
3455
3325
  order: $order
3456
3326
  ) {
3457
3327
  pageInfo {
@@ -3460,7 +3330,7 @@ var InsurUpCustomerClient = class {
3460
3330
  startCursor
3461
3331
  endCursor
3462
3332
  }
3463
- totalCount
3333
+ ${includeTotalCount ? "totalCount" : ""}
3464
3334
  edges {
3465
3335
  cursor
3466
3336
  node {
@@ -3489,7 +3359,7 @@ var InsurUpCustomerClient = class {
3489
3359
  variables.filter = requestOptions.filter;
3490
3360
  if (requestOptions?.order !== void 0)
3491
3361
  variables.order = requestOptions.order;
3492
- const result = await this.graphql.query(query, variables);
3362
+ const result = await this.graphql.query(query, variables, options);
3493
3363
  if (!result.isSuccess) {
3494
3364
  return result;
3495
3365
  }
@@ -3843,121 +3713,11 @@ var InsurUpPropertyClient = class {
3843
3713
  }
3844
3714
  };
3845
3715
 
3846
- // src/contracts/graphql/policies.ts
3847
- var UserType = /* @__PURE__ */ ((UserType2) => {
3848
- UserType2["None"] = "NONE";
3849
- UserType2["AdminPanel"] = "ADMIN_PANEL";
3850
- UserType2["Agent"] = "AGENT";
3851
- UserType2["Customer"] = "CUSTOMER";
3852
- return UserType2;
3853
- })(UserType || {});
3854
- var ALL_POLICY_FIELDS = [
3855
- // Primitive fields
3856
- "agentBranchId",
3857
- "id",
3858
- "insurerCustomerId",
3859
- "insuredCustomerId",
3860
- "installmentNumber",
3861
- "productBranch",
3862
- "netPremium",
3863
- "grossPremium",
3864
- "commission",
3865
- "paymentType",
3866
- "currency",
3867
- "insuranceCompanyProposalNumber",
3868
- "insuranceCompanyPolicyNumber",
3869
- "createdAt",
3870
- "startDate",
3871
- "endDate",
3872
- "arrangementDate",
3873
- "insuredCustomerName",
3874
- "insuredCustomerIdentityNumber",
3875
- "insuredCustomerTaxNumber",
3876
- "insuredCustomerType",
3877
- "insuredCustomerCityText",
3878
- "insuredCustomerCityValue",
3879
- "insuredCustomerDistrictText",
3880
- "insuredCustomerDistrictValue",
3881
- "insuredCustomerBirthDate",
3882
- "insurerCustomerName",
3883
- "insurerCustomerIdentityNumber",
3884
- "insurerCustomerTaxNumber",
3885
- "insurerCustomerCityText",
3886
- "insurerCustomerCityValue",
3887
- "insurerCustomerDistrictText",
3888
- "insurerCustomerDistrictValue",
3889
- "insurerCustomerBirthDate",
3890
- "vehiclePlateCode",
3891
- "vehiclePlateCity",
3892
- "vehicleDocumentSerialCode",
3893
- "vehicleDocumentSerialNumber",
3894
- "vehicleModelBrandText",
3895
- "vehicleModelBrandValue",
3896
- "vehicleModelTypeText",
3897
- "vehicleModelTypeValue",
3898
- "vehicleModelYear",
3899
- "vehicleFuelType",
3900
- "productId",
3901
- "productName",
3902
- "insuranceCompanyId",
3903
- "insuranceCompanyName",
3904
- "insuranceCompanyLogo",
3905
- "state",
3906
- "propertyNumber",
3907
- "daskOldPolicyNumber",
3908
- "daskPolicyNumber",
3909
- "vehicleId",
3910
- "propertyId",
3911
- "channel",
3912
- "campaign",
3913
- // Nested agentBranch fields
3914
- "agentBranch.id",
3915
- "agentBranch.name",
3916
- "agentBranch.parentId",
3917
- "agentBranch.parentName",
3918
- // Nested createdBy fields
3919
- "createdBy.id",
3920
- "createdBy.name",
3921
- "createdBy.email",
3922
- "createdBy.userType",
3923
- // Nested representedBy fields
3924
- "representedBy.id",
3925
- "representedBy.name",
3926
- "representedBy.email",
3927
- "representedBy.userType"
3928
- ];
3929
-
3930
- // src/contracts/graphql/policyTransfers.ts
3931
- var ALL_POLICY_TRANSFER_FIELDS = [
3932
- "id",
3933
- "startDate",
3934
- "endDate",
3935
- "insuranceCompanyCount",
3936
- "policyTransferTriggerCount",
3937
- "policyCount"
3938
- ];
3939
-
3940
- // src/contracts/graphql/filePolicyTransfers.ts
3941
- var ALL_FILE_POLICY_TRANSFER_FIELDS = [
3942
- // Primitive fields
3943
- "id",
3944
- "insuranceCompanyId",
3945
- "insuranceCompanyName",
3946
- "insuranceCompanyLogo",
3947
- "fileName",
3948
- "fileUrl",
3949
- "createdAt",
3950
- "totalPolicyCount",
3951
- "completedPolicyCount",
3952
- "failedPolicyCount",
3953
- // Nested createdBy fields
3954
- "createdBy.id",
3955
- "createdBy.name",
3956
- "createdBy.email",
3957
- "createdBy.userType"
3958
- ];
3959
-
3960
3716
  // src/clients/policy.ts
3717
+ var import_contracts5 = require("@insurup/contracts");
3718
+ var import_contracts6 = require("@insurup/contracts");
3719
+ var import_contracts7 = require("@insurup/contracts");
3720
+ var import_contracts8 = require("@insurup/contracts");
3961
3721
  var InsurUpPolicyClient = class {
3962
3722
  constructor(http, graphql) {
3963
3723
  this.http = http;
@@ -4263,14 +4023,15 @@ var InsurUpPolicyClient = class {
4263
4023
  * @param requestOptions Query options including pagination, filters, search, and field selection
4264
4024
  * @returns Paginated connection of policies with type-narrowed fields
4265
4025
  */
4266
- async getPolicies(requestOptions) {
4026
+ async getPolicies(requestOptions, options) {
4267
4027
  if (!this.graphql) {
4268
4028
  throw new Error(
4269
4029
  "GraphQL transport is not available. Ensure the client is properly initialized."
4270
4030
  );
4271
4031
  }
4272
- const fields = requestOptions?.select ?? ALL_POLICY_FIELDS;
4273
- const fieldSelection = buildFieldSelection(fields);
4032
+ const fields = requestOptions?.select ?? import_contracts5.ALL_POLICY_FIELDS;
4033
+ const fieldSelection = (0, import_contracts8.buildFieldSelection)(fields);
4034
+ const includeTotalCount = requestOptions?.includeTotalCount !== false;
4274
4035
  const query = `
4275
4036
  query GetPolicies(
4276
4037
  $first: Int
@@ -4296,16 +4057,13 @@ var InsurUpPolicyClient = class {
4296
4057
  startCursor
4297
4058
  endCursor
4298
4059
  }
4299
- totalCount
4060
+ ${includeTotalCount ? "totalCount" : ""}
4300
4061
  edges {
4301
4062
  cursor
4302
4063
  node {
4303
4064
  ${fieldSelection}
4304
4065
  }
4305
4066
  }
4306
- nodes {
4307
- ${fieldSelection}
4308
- }
4309
4067
  }
4310
4068
  }
4311
4069
  `;
@@ -4318,13 +4076,18 @@ var InsurUpPolicyClient = class {
4318
4076
  filter: requestOptions?.filter,
4319
4077
  order: requestOptions?.order
4320
4078
  };
4321
- const result = await this.graphql.query(query, variables);
4079
+ const result = await this.graphql.query(query, variables, options);
4322
4080
  if (!result.isSuccess) {
4323
4081
  return result;
4324
4082
  }
4083
+ const edges = result.data.policiesNew.edges;
4084
+ const nodes = edges?.map((edge) => edge?.node ?? null) ?? null;
4325
4085
  return {
4326
4086
  ...result,
4327
- data: result.data.policiesNew
4087
+ data: {
4088
+ ...result.data.policiesNew,
4089
+ nodes
4090
+ }
4328
4091
  };
4329
4092
  }
4330
4093
  /**
@@ -4341,14 +4104,14 @@ var InsurUpPolicyClient = class {
4341
4104
  * @param requestOptions Query options including pagination, filters, search, and field selection
4342
4105
  * @returns Paginated connection of policy transfers with type-narrowed fields
4343
4106
  */
4344
- async getPolicyTransfers(requestOptions) {
4107
+ async getPolicyTransfers(requestOptions, options) {
4345
4108
  if (!this.graphql) {
4346
4109
  throw new Error(
4347
4110
  "GraphQL transport is not available. Ensure the client is properly initialized."
4348
4111
  );
4349
4112
  }
4350
- const fields = requestOptions?.select ?? ALL_POLICY_TRANSFER_FIELDS;
4351
- const fieldSelection = buildFieldSelection(fields);
4113
+ const fields = requestOptions?.select ?? import_contracts6.ALL_POLICY_TRANSFER_FIELDS;
4114
+ const fieldSelection = (0, import_contracts8.buildFieldSelection)(fields);
4352
4115
  const query = `
4353
4116
  query GetPolicyTransfers(
4354
4117
  $first: Int
@@ -4381,9 +4144,6 @@ var InsurUpPolicyClient = class {
4381
4144
  ${fieldSelection}
4382
4145
  }
4383
4146
  }
4384
- nodes {
4385
- ${fieldSelection}
4386
- }
4387
4147
  }
4388
4148
  }
4389
4149
  `;
@@ -4396,13 +4156,18 @@ var InsurUpPolicyClient = class {
4396
4156
  filter: requestOptions?.filter,
4397
4157
  order: requestOptions?.order
4398
4158
  };
4399
- const result = await this.graphql.query(query, variables);
4159
+ const result = await this.graphql.query(query, variables, options);
4400
4160
  if (!result.isSuccess) {
4401
4161
  return result;
4402
4162
  }
4163
+ const edges = result.data.policyTransfersNew.edges;
4164
+ const nodes = edges?.map((edge) => edge?.node ?? null) ?? null;
4403
4165
  return {
4404
4166
  ...result,
4405
- data: result.data.policyTransfersNew
4167
+ data: {
4168
+ ...result.data.policyTransfersNew,
4169
+ nodes
4170
+ }
4406
4171
  };
4407
4172
  }
4408
4173
  /**
@@ -4419,14 +4184,14 @@ var InsurUpPolicyClient = class {
4419
4184
  * @param requestOptions Query options including pagination, filters, search, and field selection
4420
4185
  * @returns Paginated connection of file policy transfers with type-narrowed fields
4421
4186
  */
4422
- async getFilePolicyTransfers(requestOptions) {
4187
+ async getFilePolicyTransfers(requestOptions, options) {
4423
4188
  if (!this.graphql) {
4424
4189
  throw new Error(
4425
4190
  "GraphQL transport is not available. Ensure the client is properly initialized."
4426
4191
  );
4427
4192
  }
4428
- const fields = requestOptions?.select ?? ALL_FILE_POLICY_TRANSFER_FIELDS;
4429
- const fieldSelection = buildFieldSelection(fields);
4193
+ const fields = requestOptions?.select ?? import_contracts7.ALL_FILE_POLICY_TRANSFER_FIELDS;
4194
+ const fieldSelection = (0, import_contracts8.buildFieldSelection)(fields);
4430
4195
  const query = `
4431
4196
  query GetFilePolicyTransfers(
4432
4197
  $first: Int
@@ -4459,9 +4224,6 @@ var InsurUpPolicyClient = class {
4459
4224
  ${fieldSelection}
4460
4225
  }
4461
4226
  }
4462
- nodes {
4463
- ${fieldSelection}
4464
- }
4465
4227
  }
4466
4228
  }
4467
4229
  `;
@@ -4474,110 +4236,25 @@ var InsurUpPolicyClient = class {
4474
4236
  filter: requestOptions?.filter,
4475
4237
  order: requestOptions?.order
4476
4238
  };
4477
- const result = await this.graphql.query(query, variables);
4239
+ const result = await this.graphql.query(query, variables, options);
4478
4240
  if (!result.isSuccess) {
4479
4241
  return result;
4480
4242
  }
4243
+ const edges = result.data.filePolicyTransfersNew.edges;
4244
+ const nodes = edges?.map((edge) => edge?.node ?? null) ?? null;
4481
4245
  return {
4482
4246
  ...result,
4483
- data: result.data.filePolicyTransfersNew
4247
+ data: {
4248
+ ...result.data.filePolicyTransfersNew,
4249
+ nodes
4250
+ }
4484
4251
  };
4485
4252
  }
4486
4253
  };
4487
4254
 
4488
- // src/contracts/graphql/cases.ts
4489
- var ALL_CASE_FIELDS = [
4490
- // Primitive fields
4491
- "agentBranchId",
4492
- "id",
4493
- "ref",
4494
- "type",
4495
- "status",
4496
- "cancelSubType",
4497
- "saleOpportunitySubType",
4498
- "endorsementSubType",
4499
- "complaintSubType",
4500
- "mainState",
4501
- "subState",
4502
- "productBranch",
4503
- "channel",
4504
- "createdAt",
4505
- "createdByName",
4506
- "createdById",
4507
- "createdByEmail",
4508
- "createdByType",
4509
- "representedByName",
4510
- "representedById",
4511
- "representedByEmail",
4512
- "representedByType",
4513
- "policyEndDate",
4514
- "assetType",
4515
- "assetId",
4516
- "sourceCaseId",
4517
- "policyCount",
4518
- "proposalCount",
4519
- "lastProposalDate",
4520
- "lastPolicyDate",
4521
- "lastUpdateDate",
4522
- "lastUpdatedByName",
4523
- "lastUpdatedById",
4524
- "lastUpdatedByEmail",
4525
- "lastUpdatedByType",
4526
- "priorityScore",
4527
- "customerId",
4528
- "customerName",
4529
- "customerType",
4530
- "customerIdentity",
4531
- "customerCityText",
4532
- "customerCityValue",
4533
- "customerDistrictText",
4534
- "customerDistrictValue",
4535
- "customerPrimaryPhoneNumber",
4536
- "customerPrimaryPhoneCountryCode",
4537
- "customerPrimaryEmail",
4538
- "customerBirthDate",
4539
- "customerPassportNumber",
4540
- "customerJob",
4541
- "vehiclePlateCode",
4542
- "vehiclePlateCity",
4543
- "vehicleModelBrandText",
4544
- "vehicleModelBrandValue",
4545
- "vehicleModelTypeText",
4546
- "vehicleModelTypeValue",
4547
- "vehicleModelYear",
4548
- "vehicleUtilizationStyle",
4549
- "vehicleEngineNumber",
4550
- "vehicleChassisNumber",
4551
- "vehicleRegistrationDate",
4552
- "vehicleFuelType",
4553
- "vehicleSeatNumber",
4554
- "vehicleDocumentSerialCode",
4555
- "vehicleDocumentSerialNumber",
4556
- "propertyNumber",
4557
- "propertySquareMeter",
4558
- "propertyConstructionYear",
4559
- "propertyDamageStatus",
4560
- "propertyFloorNumber",
4561
- "propertyStructure",
4562
- "propertyUtilizationStyle",
4563
- "propertyOwnershipType",
4564
- "propertyDaskPolicyNumber",
4565
- "advertisingSource",
4566
- "advertisingCampaign",
4567
- "searchScore",
4568
- // Nested agentBranch fields
4569
- "agentBranch.id",
4570
- "agentBranch.name",
4571
- "agentBranch.parentId",
4572
- "agentBranch.parentName",
4573
- // Nested priorityRuleHits fields
4574
- "priorityRuleHits.label",
4575
- "priorityRuleHits.description",
4576
- "priorityRuleHits.ruleName",
4577
- "priorityRuleHits.score"
4578
- ];
4579
-
4580
4255
  // src/clients/case.ts
4256
+ var import_contracts9 = require("@insurup/contracts");
4257
+ var import_contracts10 = require("@insurup/contracts");
4581
4258
  var InsurUpCaseClient = class {
4582
4259
  constructor(http, graphql) {
4583
4260
  this.http = http;
@@ -4783,8 +4460,9 @@ var InsurUpCaseClient = class {
4783
4460
  * @returns Funnel analytics response / Huni analitiği yanıtı
4784
4461
  */
4785
4462
  async getSalesOpportunityFunnelAnalytics(request, options) {
4786
- return await this.http.get(
4463
+ return await this.http.post(
4787
4464
  cases.getSalesOpportunityFunnelAnalytics.definition,
4465
+ request,
4788
4466
  options
4789
4467
  );
4790
4468
  }
@@ -4869,14 +4547,14 @@ var InsurUpCaseClient = class {
4869
4547
  * @param requestOptions Query options including pagination, filters, search, and field selection
4870
4548
  * @returns Paginated connection of cases with type-narrowed fields
4871
4549
  */
4872
- async getCases(requestOptions) {
4550
+ async getCases(requestOptions, options) {
4873
4551
  if (!this.graphql) {
4874
4552
  throw new Error(
4875
4553
  "GraphQL transport is not available. Ensure the client is properly initialized."
4876
4554
  );
4877
4555
  }
4878
- const fields = requestOptions?.select ?? ALL_CASE_FIELDS;
4879
- const fieldSelection = buildFieldSelection(fields);
4556
+ const fields = requestOptions?.select ?? import_contracts9.ALL_CASE_FIELDS;
4557
+ const fieldSelection = (0, import_contracts10.buildFieldSelection)(fields);
4880
4558
  const query = `
4881
4559
  query GetCases(
4882
4560
  $first: Int
@@ -4909,9 +4587,6 @@ var InsurUpCaseClient = class {
4909
4587
  ${fieldSelection}
4910
4588
  }
4911
4589
  }
4912
- nodes {
4913
- ${fieldSelection}
4914
- }
4915
4590
  }
4916
4591
  }
4917
4592
  `;
@@ -4924,37 +4599,25 @@ var InsurUpCaseClient = class {
4924
4599
  filter: requestOptions?.filter,
4925
4600
  order: requestOptions?.order
4926
4601
  };
4927
- const result = await this.graphql.query(query, variables);
4602
+ const result = await this.graphql.query(query, variables, options);
4928
4603
  if (!result.isSuccess) {
4929
4604
  return result;
4930
4605
  }
4606
+ const edges = result.data.casesNew.edges;
4607
+ const nodes = edges?.map((edge) => edge?.node ?? null) ?? null;
4931
4608
  return {
4932
4609
  ...result,
4933
- data: result.data.casesNew
4610
+ data: {
4611
+ ...result.data.casesNew,
4612
+ nodes
4613
+ }
4934
4614
  };
4935
4615
  }
4936
4616
  };
4937
4617
 
4938
- // src/contracts/graphql/webhookDeliveries.ts
4939
- var WebhookDeliveryState = /* @__PURE__ */ ((WebhookDeliveryState2) => {
4940
- WebhookDeliveryState2["Pending"] = "PENDING";
4941
- WebhookDeliveryState2["Success"] = "SUCCESS";
4942
- WebhookDeliveryState2["Failed"] = "FAILED";
4943
- return WebhookDeliveryState2;
4944
- })(WebhookDeliveryState || {});
4945
- var ALL_WEBHOOK_DELIVERY_FIELDS = [
4946
- "id",
4947
- "webhookId",
4948
- "webhookName",
4949
- "event",
4950
- "state",
4951
- "responseStatusCode",
4952
- "createdAt",
4953
- "completedAt",
4954
- "retryCount"
4955
- ];
4956
-
4957
4618
  // src/clients/webhook.ts
4619
+ var import_contracts11 = require("@insurup/contracts");
4620
+ var import_contracts12 = require("@insurup/contracts");
4958
4621
  var InsurUpWebhookClient = class {
4959
4622
  constructor(http, graphql) {
4960
4623
  this.http = http;
@@ -5078,14 +4741,14 @@ var InsurUpWebhookClient = class {
5078
4741
  * @param requestOptions Query options including pagination, filters, search, and field selection
5079
4742
  * @returns Paginated connection of webhook deliveries with type-narrowed fields
5080
4743
  */
5081
- async getWebhookDeliveries(requestOptions) {
4744
+ async getWebhookDeliveries(requestOptions, options) {
5082
4745
  if (!this.graphql) {
5083
4746
  throw new Error(
5084
4747
  "GraphQL transport is not available. Ensure the client is properly initialized."
5085
4748
  );
5086
4749
  }
5087
- const fields = requestOptions?.select ?? ALL_WEBHOOK_DELIVERY_FIELDS;
5088
- const fieldSelection = buildFieldSelection(fields);
4750
+ const fields = requestOptions?.select ?? import_contracts11.ALL_WEBHOOK_DELIVERY_FIELDS;
4751
+ const fieldSelection = (0, import_contracts12.buildFieldSelection)(fields);
5089
4752
  const query = `
5090
4753
  query GetWebhookDeliveries(
5091
4754
  $first: Int
@@ -5118,9 +4781,6 @@ var InsurUpWebhookClient = class {
5118
4781
  ${fieldSelection}
5119
4782
  }
5120
4783
  }
5121
- nodes {
5122
- ${fieldSelection}
5123
- }
5124
4784
  }
5125
4785
  }
5126
4786
  `;
@@ -5133,13 +4793,18 @@ var InsurUpWebhookClient = class {
5133
4793
  filter: requestOptions?.filter,
5134
4794
  order: requestOptions?.order
5135
4795
  };
5136
- const result = await this.graphql.query(query, variables);
4796
+ const result = await this.graphql.query(query, variables, options);
5137
4797
  if (!result.isSuccess) {
5138
4798
  return result;
5139
4799
  }
4800
+ const edges = result.data.webhookDeliveriesNew.edges;
4801
+ const nodes = edges?.map((edge) => edge?.node ?? null) ?? null;
5140
4802
  return {
5141
4803
  ...result,
5142
- data: result.data.webhookDeliveriesNew
4804
+ data: {
4805
+ ...result.data.webhookDeliveriesNew,
4806
+ nodes
4807
+ }
5143
4808
  };
5144
4809
  }
5145
4810
  };
@@ -5393,60 +5058,9 @@ var InsurUpInsuranceClient = class {
5393
5058
  }
5394
5059
  };
5395
5060
 
5396
- // src/contracts/graphql/proposals.ts
5397
- var ALL_PROPOSAL_FIELDS = [
5398
- // Primitive fields
5399
- "agentBranchId",
5400
- "id",
5401
- "productBranch",
5402
- "state",
5403
- "insurerCustomerId",
5404
- "insuredCustomerId",
5405
- "productsCount",
5406
- "succeedProductsCount",
5407
- "createdAt",
5408
- "successRate",
5409
- "insuredCustomerName",
5410
- "insuredCustomerIdentityNumber",
5411
- "insuredCustomerTaxNumber",
5412
- "insuredCustomerType",
5413
- "lowestPremium",
5414
- "highestPremium",
5415
- "channel",
5416
- "insuredCustomerCityText",
5417
- "insuredCustomerCityValue",
5418
- "insuredCustomerDistrictText",
5419
- "insuredCustomerDistrictValue",
5420
- "insuredCustomerPhoneNumber",
5421
- "insuredCustomerPhoneNumberCountryCode",
5422
- "insuredCustomerEmail",
5423
- "vehiclePlateCode",
5424
- "vehiclePlateCity",
5425
- "vehicleDocumentSerialCode",
5426
- "vehicleDocumentSerialNumber",
5427
- "vehicleModelBrandText",
5428
- "vehicleModelBrandValue",
5429
- "vehicleModelTypeText",
5430
- "vehicleModelTypeValue",
5431
- "vehicleModelYear",
5432
- "vehicleFuelType",
5433
- "utilizationStyle",
5434
- "insuredCustomerBirthDate",
5435
- "vehicleId",
5436
- "propertyId",
5437
- // Nested agentBranch fields
5438
- "agentBranch.id",
5439
- "agentBranch.name",
5440
- "agentBranch.parentId",
5441
- "agentBranch.parentName",
5442
- // Nested agentUserCreatedBy fields
5443
- "agentUserCreatedBy.id",
5444
- "agentUserCreatedBy.name",
5445
- "agentUserCreatedBy.email",
5446
- "agentUserCreatedBy.userType"
5447
- ];
5448
-
5449
5061
  // src/clients/proposal.ts
5062
+ var import_contracts13 = require("@insurup/contracts");
5063
+ var import_contracts14 = require("@insurup/contracts");
5450
5064
  var InsurUpProposalClient = class {
5451
5065
  constructor(http, graphql) {
5452
5066
  this.http = http;
@@ -5802,14 +5416,14 @@ var InsurUpProposalClient = class {
5802
5416
  * @param requestOptions Query options including pagination, filters, search, and field selection
5803
5417
  * @returns Paginated connection of proposals with type-narrowed fields
5804
5418
  */
5805
- async getProposals(requestOptions) {
5419
+ async getProposals(requestOptions, options) {
5806
5420
  if (!this.graphql) {
5807
5421
  throw new Error(
5808
5422
  "GraphQL transport is not available. Ensure the client is properly initialized."
5809
5423
  );
5810
5424
  }
5811
- const fields = requestOptions?.select ?? ALL_PROPOSAL_FIELDS;
5812
- const fieldSelection = buildFieldSelection(fields);
5425
+ const fields = requestOptions?.select ?? import_contracts13.ALL_PROPOSAL_FIELDS;
5426
+ const fieldSelection = (0, import_contracts14.buildFieldSelection)(fields);
5813
5427
  const query = `
5814
5428
  query GetProposals(
5815
5429
  $first: Int
@@ -5842,9 +5456,6 @@ var InsurUpProposalClient = class {
5842
5456
  ${fieldSelection}
5843
5457
  }
5844
5458
  }
5845
- nodes {
5846
- ${fieldSelection}
5847
- }
5848
5459
  }
5849
5460
  }
5850
5461
  `;
@@ -5857,13 +5468,18 @@ var InsurUpProposalClient = class {
5857
5468
  filter: requestOptions?.filter,
5858
5469
  order: requestOptions?.order
5859
5470
  };
5860
- const result = await this.graphql.query(query, variables);
5471
+ const result = await this.graphql.query(query, variables, options);
5861
5472
  if (!result.isSuccess) {
5862
5473
  return result;
5863
5474
  }
5475
+ const edges = result.data.proposalsNew.edges;
5476
+ const nodes = edges?.map((edge) => edge?.node ?? null) ?? null;
5864
5477
  return {
5865
5478
  ...result,
5866
- data: result.data.proposalsNew
5479
+ data: {
5480
+ ...result.data.proposalsNew,
5481
+ nodes
5482
+ }
5867
5483
  };
5868
5484
  }
5869
5485
  };
@@ -6145,700 +5761,13 @@ var DefaultInsurUpClient = class {
6145
5761
  }
6146
5762
  };
6147
5763
 
6148
- // src/contracts/common.base.ts
6149
- var Channel = /* @__PURE__ */ ((Channel2) => {
6150
- Channel2["Unknown"] = "UNKNOWN";
6151
- Channel2["Manual"] = "MANUAL";
6152
- Channel2["Website"] = "WEBSITE";
6153
- Channel2["GoogleAds"] = "GOOGLE_ADS";
6154
- Channel2["CallCenter"] = "CALL_CENTER";
6155
- Channel2["SocialMedia"] = "SOCIAL_MEDIA";
6156
- Channel2["MobileApp"] = "MOBILE_APP";
6157
- Channel2["OfflineProposalForm"] = "OFFLINE_PROPOSAL_FORM";
6158
- Channel2["Field"] = "FIELD";
6159
- Channel2["PrintMedia"] = "PRINT_MEDIA";
6160
- Channel2["FairEvent"] = "FAIR_EVENT";
6161
- Channel2["BusinessPartner"] = "BUSINESS_PARTNER";
6162
- Channel2["Chatbot"] = "CHATBOT";
6163
- return Channel2;
6164
- })(Channel || {});
6165
- var AssetType = /* @__PURE__ */ ((AssetType2) => {
6166
- AssetType2["Vehicle"] = "VEHICLE";
6167
- AssetType2["Property"] = "PROPERTY";
6168
- return AssetType2;
6169
- })(AssetType || {});
6170
- var CustomerType = /* @__PURE__ */ ((CustomerType2) => {
6171
- CustomerType2["Individual"] = "INDIVIDUAL";
6172
- CustomerType2["Company"] = "COMPANY";
6173
- CustomerType2["Foreign"] = "FOREIGN";
6174
- return CustomerType2;
6175
- })(CustomerType || {});
6176
- var ProductBranch = /* @__PURE__ */ ((ProductBranch2) => {
6177
- ProductBranch2["Kasko"] = "KASKO";
6178
- ProductBranch2["Dask"] = "DASK";
6179
- ProductBranch2["Konut"] = "KONUT";
6180
- ProductBranch2["Trafik"] = "TRAFIK";
6181
- ProductBranch2["Tss"] = "TSS";
6182
- ProductBranch2["Imm"] = "IMM";
6183
- ProductBranch2["YesilKart"] = "YESIL_KART";
6184
- ProductBranch2["FerdiKaza"] = "FERDI_KAZA";
6185
- ProductBranch2["GrupHayat"] = "GRUP_HAYAT";
6186
- ProductBranch2["Saglik"] = "SAGLIK";
6187
- ProductBranch2["KartKimlikKoruma"] = "KART_KIMLIK_KORUMA";
6188
- ProductBranch2["UcuncuSahisMaliSorumluluk"] = "UCUNCU_SAHIS_MALI_SORUMLULUK";
6189
- ProductBranch2["IsyeriYangin"] = "ISYERI_YANGIN";
6190
- ProductBranch2["Seyahat"] = "SEYAHAT";
6191
- ProductBranch2["ElektronikCihaz"] = "ELEKTRONIK_CIHAZ";
6192
- ProductBranch2["Pet"] = "PET";
6193
- ProductBranch2["Bes"] = "BES";
6194
- ProductBranch2["InsaatAllRisk"] = "INSAAT_ALL_RISK";
6195
- ProductBranch2["LeasingAllRisk"] = "LEASING_ALL_RISK";
6196
- ProductBranch2["MontajAllRisk"] = "MONTAJ_ALL_RISK";
6197
- ProductBranch2["Nakliyat"] = "NAKLIYAT";
6198
- ProductBranch2["OzelGuvenlikMaliSorumluluk"] = "OZEL_GUVENLIK_MALI_SORUMLULUK";
6199
- ProductBranch2["AkilliTelefon"] = "AKILLI_TELEFON";
6200
- ProductBranch2["TehlikeliMaddelerMaliSorumluluk"] = "TEHLIKELI_MADDELER_MALI_SORUMLULUK";
6201
- ProductBranch2["YatGemiGezintiTeknesi"] = "YAT_GEMI_GEZINTI_TEKNESI";
6202
- ProductBranch2["Tarim"] = "TARIM";
6203
- ProductBranch2["MeslekiSorumluluk"] = "MESLEKI_SORUMLULUK";
6204
- ProductBranch2["Alacak"] = "ALACAK";
6205
- ProductBranch2["IsverenMaliMesuliyet"] = "ISVEREN_MALI_MESULIYET";
6206
- ProductBranch2["Muhendislik"] = "MUHENDISLIK";
6207
- ProductBranch2["HukuksalKoruma"] = "HUKUKSAL_KORUMA";
6208
- ProductBranch2["IlkAtesKonut"] = "ILK_ATES_KONUT";
6209
- ProductBranch2["Kefalet"] = "KEFALET";
6210
- return ProductBranch2;
6211
- })(ProductBranch || {});
6212
- var Currency = /* @__PURE__ */ ((Currency2) => {
6213
- Currency2["Unknown"] = "UNKNOWN";
6214
- Currency2["TurkishLira"] = "TURKISH_LIRA";
6215
- Currency2["UnitedStatesDollar"] = "UNITED_STATES_DOLLAR";
6216
- Currency2["Euro"] = "EURO";
6217
- return Currency2;
6218
- })(Currency || {});
6219
- var PaymentOption = /* @__PURE__ */ ((PaymentOption2) => {
6220
- PaymentOption2["Unknown"] = "UNKNOWN";
6221
- PaymentOption2["SyncCreditCard"] = "SYNC_CREDIT_CARD";
6222
- PaymentOption2["SyncOpenAccount"] = "SYNC_OPEN_ACCOUNT";
6223
- PaymentOption2["Async3dSecure"] = "ASYNC_3D_SECURE";
6224
- PaymentOption2["AsyncInsuranceCompanyRedirect"] = "ASYNC_INSURANCE_COMPANY_REDIRECT";
6225
- PaymentOption2["AsyncThirdParty3dSecure"] = "ASYNC_THIRD_PARTY_3D_SECURE";
6226
- return PaymentOption2;
6227
- })(PaymentOption || {});
6228
- var PolicyState = /* @__PURE__ */ ((PolicyState2) => {
6229
- PolicyState2["Active"] = "ACTIVE";
6230
- PolicyState2["EndOfLife"] = "END_OF_LIFE";
6231
- PolicyState2["Cancelled"] = "CANCELLED";
6232
- return PolicyState2;
6233
- })(PolicyState || {});
6234
- var InsuranceProductType = /* @__PURE__ */ ((InsuranceProductType2) => {
6235
- InsuranceProductType2["WebService"] = "WEB_SERVICE";
6236
- InsuranceProductType2["Robot"] = "ROBOT";
6237
- return InsuranceProductType2;
6238
- })(InsuranceProductType || {});
6239
-
6240
- // src/contracts/common.coverage.ts
6241
- var OnarimServisTuru = /* @__PURE__ */ ((OnarimServisTuru2) => {
6242
- OnarimServisTuru2["Belirsiz"] = "BELIRSIZ";
6243
- OnarimServisTuru2["AnlasmaliOzelServis"] = "ANLASMALI_OZEL_SERVIS";
6244
- OnarimServisTuru2["AnlasmaliYetkiliServis"] = "ANLASMALI_YETKILI_SERVIS";
6245
- OnarimServisTuru2["YetkiliServis"] = "YETKILI_SERVIS";
6246
- OnarimServisTuru2["OzelServis"] = "OZEL_SERVIS";
6247
- OnarimServisTuru2["SigortaliBelirler"] = "SIGORTALI_BELIRLER";
6248
- return OnarimServisTuru2;
6249
- })(OnarimServisTuru || {});
6250
- var YedekParcaTuru = /* @__PURE__ */ ((YedekParcaTuru2) => {
6251
- YedekParcaTuru2["Belirsiz"] = "BELIRSIZ";
6252
- YedekParcaTuru2["OrijinalParca"] = "ORIJINAL_PARCA";
6253
- YedekParcaTuru2["EsdegerParca"] = "ESDEGER_PARCA";
6254
- return YedekParcaTuru2;
6255
- })(YedekParcaTuru || {});
6256
- var AracSegment = /* @__PURE__ */ ((AracSegment2) => {
6257
- AracSegment2["A"] = "A";
6258
- AracSegment2["B"] = "B";
6259
- AracSegment2["C"] = "C";
6260
- AracSegment2["D"] = "D";
6261
- AracSegment2["E"] = "E";
6262
- AracSegment2["F"] = "F";
6263
- AracSegment2["SegmenteSegment"] = "SEGMENTE_SEGMENT";
6264
- return AracSegment2;
6265
- })(AracSegment || {});
6266
- var HastaneAgi = /* @__PURE__ */ ((HastaneAgi2) => {
6267
- HastaneAgi2["Bilinmiyor"] = "BILINMIYOR";
6268
- HastaneAgi2["DarKapsam"] = "DAR_KAPSAM";
6269
- HastaneAgi2["StandartKapsam"] = "STANDART_KAPSAM";
6270
- HastaneAgi2["GenisKapsam"] = "GENIS_KAPSAM";
6271
- return HastaneAgi2;
6272
- })(HastaneAgi || {});
6273
- var SaglikPaketiTedaviSekli = /* @__PURE__ */ ((SaglikPaketiTedaviSekli2) => {
6274
- SaglikPaketiTedaviSekli2["Bilinmiyor"] = "BILINMIYOR";
6275
- SaglikPaketiTedaviSekli2["Yatarak"] = "YATARAK";
6276
- SaglikPaketiTedaviSekli2["YatarakAyakta"] = "YATARAK_AYAKTA";
6277
- return SaglikPaketiTedaviSekli2;
6278
- })(SaglikPaketiTedaviSekli || {});
6279
- var TasinanYuk = /* @__PURE__ */ ((TasinanYuk2) => {
6280
- TasinanYuk2["Belirsiz"] = "BELIRSIZ";
6281
- TasinanYuk2["Yok"] = "YOK";
6282
- TasinanYuk2["AgacKutukleriveKereste"] = "AGAC_KUTUKLERIVE_KERESTE";
6283
- TasinanYuk2["Akaryakit"] = "AKARYAKIT";
6284
- TasinanYuk2["AyakkabiSaraciye"] = "AYAKKABI_SARACIYE";
6285
- TasinanYuk2["BakkaliyeveSharkuteriUrunleri"] = "BAKKALIYE_VE_SHARKUTERI_URUNLERI";
6286
- TasinanYuk2["BilumumKirtasiyeMalzemeleri"] = "BILUMUM_KIRTASIYE_MALZEMELERI";
6287
- TasinanYuk2["DokmeSuveSut"] = "DOKME_SU_VE_SUT";
6288
- TasinanYuk2["HaliveKilim"] = "HALI_VE_KILIM";
6289
- TasinanYuk2["HamYariMamulveMamulKagit"] = "HAM_YARI_MAMUL_VE_MAMUL_KAGIT";
6290
- TasinanYuk2["HazirBeton"] = "HAZIR_BETON";
6291
- TasinanYuk2["HerNeviEvAletleri"] = "HER_NEVI_EV_ALETLERI";
6292
- TasinanYuk2["HerTurluDokmeKomurvOdun"] = "HER_TURLU_DOKME_KOMUR_V_ODUN";
6293
- TasinanYuk2["HububatveBakliyat"] = "HUBUBAT_VE_BAKLIYAT";
6294
- TasinanYuk2["KabaInsaatMalzemeleri"] = "KABA_INSAAT_MALZEMELERI";
6295
- TasinanYuk2["LastikKaucukUrunleri"] = "LASTIK_KAUCUK_URUNLERI";
6296
- TasinanYuk2["LikidKimyeviMadde"] = "LIKID_KIMYEVI_MADDE";
6297
- TasinanYuk2["LpgGazTupu"] = "LPG_GAZ_TUPU";
6298
- TasinanYuk2["MakineAksamveYedekleri"] = "MAKINE_AKSAM_VE_YEDEKLERI";
6299
- TasinanYuk2["MobilyaMalzemesi"] = "MOBILYA_MALZEMESI";
6300
- TasinanYuk2["MuhtelifEvEsyasi"] = "MUHTELIF_EV_ESYASI";
6301
- TasinanYuk2["OtoYedekParcalari"] = "OTO_YEDEK_PARCALARI";
6302
- TasinanYuk2["PlastikMamulleri"] = "PLASTIK_MAMULLERI";
6303
- TasinanYuk2["SentetikElyafUrunleri"] = "SENTETIK_ELYAF_URUNLERI";
6304
- TasinanYuk2["SentetikPlastikBoyaUrunleri"] = "SENTETIK_PLASTIK_BOYA_URUNLERI";
6305
- TasinanYuk2["TekstilUrunleri"] = "TEKSTIL_URUNLERI";
6306
- TasinanYuk2["TemizlikMaddeleri"] = "TEMIZLIK_MADDELERI";
6307
- TasinanYuk2["YasMeyveveSebze"] = "YAS_MEYVE_VE_SEBZE";
6308
- return TasinanYuk2;
6309
- })(TasinanYuk || {});
6310
- function isCoverageValue(value) {
6311
- return typeof value === "object" && value !== null && "$type" in value && typeof value.$type === "string";
6312
- }
6313
- function mergeCoverage(...coverages) {
6314
- if (coverages.length === 0) {
6315
- throw new Error("Cannot merge empty coverage array");
6316
- }
6317
- const validCoverages = coverages.filter(
6318
- (coverage) => coverage != null
6319
- );
6320
- if (validCoverages.length === 0) {
6321
- throw new Error("No valid coverages to merge");
6322
- }
6323
- const firstCoverage = validCoverages[0];
6324
- const productBranch = firstCoverage.productBranch;
6325
- for (const coverage of validCoverages) {
6326
- if (coverage.productBranch !== productBranch) {
6327
- throw new Error(
6328
- `All coverages must have the same productBranch. Expected: ${productBranch}, but found: ${coverage.productBranch}`
6329
- );
6330
- }
6331
- }
6332
- const mergeCoverageValue = (values) => {
6333
- const definedValues = values.filter(
6334
- (value) => value != null
6335
- );
6336
- if (definedValues.length === 0) {
6337
- return void 0;
6338
- }
6339
- const nonUndefinedValues = definedValues.filter(
6340
- (value) => value.$type !== "UNDEFINED"
6341
- );
6342
- if (nonUndefinedValues.length > 0) {
6343
- return nonUndefinedValues[nonUndefinedValues.length - 1];
6344
- }
6345
- return { $type: "UNDEFINED" };
6346
- };
6347
- const mergeProperty = (values) => {
6348
- const definedValues = values.filter((value) => value != null);
6349
- return definedValues.length > 0 ? definedValues[definedValues.length - 1] : void 0;
6350
- };
6351
- const allKeys = /* @__PURE__ */ new Set();
6352
- for (const coverage of validCoverages) {
6353
- Object.keys(coverage).forEach((key) => {
6354
- if (key !== "productBranch") {
6355
- allKeys.add(key);
6356
- }
6357
- });
6358
- }
6359
- const merged = {
6360
- productBranch
6361
- };
6362
- for (const key of allKeys) {
6363
- const values = validCoverages.map(
6364
- (coverage) => coverage[key]
6365
- );
6366
- const sampleValue = values.find((v) => v != null);
6367
- if (isCoverageValue(sampleValue)) {
6368
- merged[key] = mergeCoverageValue(values);
6369
- } else {
6370
- merged[key] = mergeProperty(values);
6371
- }
6372
- }
6373
- return merged;
6374
- }
6375
-
6376
- // src/contracts/common.policy.ts
6377
- var PolicyTransferTriggerStatus = /* @__PURE__ */ ((PolicyTransferTriggerStatus2) => {
6378
- PolicyTransferTriggerStatus2["Succeeded"] = "SUCCEEDED";
6379
- PolicyTransferTriggerStatus2["Failed"] = "TRIGGER_STATUS_FAILED";
6380
- return PolicyTransferTriggerStatus2;
6381
- })(PolicyTransferTriggerStatus || {});
6382
- var PolicyTransferCompanyFailureReason = /* @__PURE__ */ ((PolicyTransferCompanyFailureReason2) => {
6383
- PolicyTransferCompanyFailureReason2["Unknown"] = "UNKNOWN";
6384
- PolicyTransferCompanyFailureReason2["CouldNotFetchPolicies"] = "COULD_NOT_FETCH_POLICIES";
6385
- return PolicyTransferCompanyFailureReason2;
6386
- })(PolicyTransferCompanyFailureReason || {});
6387
- var TransferredPolicyStatus = /* @__PURE__ */ ((TransferredPolicyStatus2) => {
6388
- TransferredPolicyStatus2["Success"] = "SUCCESS";
6389
- TransferredPolicyStatus2["Failed"] = "TRANSFER_FAILED";
6390
- TransferredPolicyStatus2["Skipped"] = "TRANSFER_SKIPPED";
6391
- return TransferredPolicyStatus2;
6392
- })(TransferredPolicyStatus || {});
6393
- var TransferredPolicySkipReason = /* @__PURE__ */ ((TransferredPolicySkipReason2) => {
6394
- TransferredPolicySkipReason2["Unknown"] = "UNKNOWN";
6395
- TransferredPolicySkipReason2["AlreadyTransferred"] = "SKIP_ALREADY_TRANSFERRED";
6396
- TransferredPolicySkipReason2["PreviousVersionNotFound"] = "PREVIOUS_VERSION_NOT_FOUND";
6397
- TransferredPolicySkipReason2["ProductBranchNotSupported"] = "PRODUCT_BRANCH_NOT_SUPPORTED";
6398
- TransferredPolicySkipReason2["ProductNotSupported"] = "PRODUCT_NOT_SUPPORTED";
6399
- return TransferredPolicySkipReason2;
6400
- })(TransferredPolicySkipReason || {});
6401
- var TransferredPolicyFailureReason = /* @__PURE__ */ ((TransferredPolicyFailureReason2) => {
6402
- TransferredPolicyFailureReason2["Unknown"] = "UNKNOWN";
6403
- TransferredPolicyFailureReason2["InvalidCustomerIdentityNumber"] = "INVALID_CUSTOMER_IDENTITY_NUMBER";
6404
- TransferredPolicyFailureReason2["InvalidCustomerCompanyTitle"] = "INVALID_CUSTOMER_COMPANY_TITLE";
6405
- TransferredPolicyFailureReason2["InvalidCustomerTaxNumber"] = "INVALID_CUSTOMER_TAX_NUMBER";
6406
- TransferredPolicyFailureReason2["InvalidCustomerType"] = "INVALID_CUSTOMER_TYPE";
6407
- TransferredPolicyFailureReason2["InvalidVehicle"] = "INVALID_VEHICLE";
6408
- TransferredPolicyFailureReason2["InvalidProperty"] = "INVALID_PROPERTY";
6409
- TransferredPolicyFailureReason2["InvalidEndDate"] = "INVALID_END_DATE";
6410
- TransferredPolicyFailureReason2["InvalidStartDate"] = "INVALID_START_DATE";
6411
- TransferredPolicyFailureReason2["InvalidProposalNumber"] = "INVALID_PROPOSAL_NUMBER";
6412
- TransferredPolicyFailureReason2["InvalidPremium"] = "INVALID_PREMIUM";
6413
- TransferredPolicyFailureReason2["InvalidCommission"] = "INVALID_COMMISSION";
6414
- TransferredPolicyFailureReason2["InvalidPaymentType"] = "INVALID_PAYMENT_TYPE";
6415
- TransferredPolicyFailureReason2["InvalidInsuredCustomer"] = "INVALID_INSURED_CUSTOMER";
6416
- TransferredPolicyFailureReason2["InvalidInsurerCustomer"] = "INVALID_INSURER_CUSTOMER";
6417
- return TransferredPolicyFailureReason2;
6418
- })(TransferredPolicyFailureReason || {});
6419
-
6420
- // src/contracts/common.property.ts
6421
- var PropertyStructure = /* @__PURE__ */ ((PropertyStructure2) => {
6422
- PropertyStructure2["Unknown"] = "UNKNOWN";
6423
- PropertyStructure2["SteelReinforcedConcrete"] = "STEEL_REINFORCED_CONCRETE";
6424
- PropertyStructure2["Other"] = "OTHER";
6425
- return PropertyStructure2;
6426
- })(PropertyStructure || {});
6427
- var PropertyDamageStatus = /* @__PURE__ */ ((PropertyDamageStatus2) => {
6428
- PropertyDamageStatus2["Unknown"] = "UNKNOWN";
6429
- PropertyDamageStatus2["None"] = "NONE";
6430
- PropertyDamageStatus2["SlightlyDamaged"] = "SLIGHTLY_DAMAGED";
6431
- PropertyDamageStatus2["ModeratelyDamaged"] = "MODERATELY_DAMAGED";
6432
- PropertyDamageStatus2["SeverelyDamaged"] = "SEVERELY_DAMAGED";
6433
- return PropertyDamageStatus2;
6434
- })(PropertyDamageStatus || {});
6435
- var PropertyUtilizationStyle = /* @__PURE__ */ ((PropertyUtilizationStyle2) => {
6436
- PropertyUtilizationStyle2["Unknown"] = "UNKNOWN";
6437
- PropertyUtilizationStyle2["House"] = "HOUSE";
6438
- PropertyUtilizationStyle2["Business"] = "BUSINESS";
6439
- PropertyUtilizationStyle2["Other"] = "OTHER";
6440
- return PropertyUtilizationStyle2;
6441
- })(PropertyUtilizationStyle || {});
6442
- var PropertyOwnershipType = /* @__PURE__ */ ((PropertyOwnershipType2) => {
6443
- PropertyOwnershipType2["Unknown"] = "UNKNOWN";
6444
- PropertyOwnershipType2["Proprietor"] = "PROPRIETOR";
6445
- PropertyOwnershipType2["Tenant"] = "TENANT";
6446
- return PropertyOwnershipType2;
6447
- })(PropertyOwnershipType || {});
6448
- var LossPayeeClauseType = /* @__PURE__ */ ((LossPayeeClauseType2) => {
6449
- LossPayeeClauseType2["Bank"] = "BANK";
6450
- LossPayeeClauseType2["FinancialInstitution"] = "FINANCIAL_INSTITUTION";
6451
- return LossPayeeClauseType2;
6452
- })(LossPayeeClauseType || {});
6453
-
6454
- // src/contracts/common.vehicle.ts
6455
- var VehicleUtilizationStyle = /* @__PURE__ */ ((VehicleUtilizationStyle2) => {
6456
- VehicleUtilizationStyle2["Unknown"] = "UNKNOWN";
6457
- VehicleUtilizationStyle2["PrivateCar"] = "PRIVATE_CAR";
6458
- VehicleUtilizationStyle2["Taxi"] = "TAXI";
6459
- VehicleUtilizationStyle2["RouteBasedMinibus"] = "ROUTE_BASED_MINIBUS";
6460
- VehicleUtilizationStyle2["MediumBus"] = "MEDIUM_BUS";
6461
- VehicleUtilizationStyle2["LargeBus"] = "LARGE_BUS";
6462
- VehicleUtilizationStyle2["PickupTruck"] = "PICKUP_TRUCK";
6463
- VehicleUtilizationStyle2["PanelVan"] = "PANEL_VAN";
6464
- VehicleUtilizationStyle2["Truck"] = "TRUCK";
6465
- VehicleUtilizationStyle2["Tractor"] = "TRACTOR";
6466
- VehicleUtilizationStyle2["Motorcycle"] = "MOTORCYCLE";
6467
- VehicleUtilizationStyle2["RentalCar"] = "RENTAL_CAR";
6468
- VehicleUtilizationStyle2["ArmoredVehicle"] = "ARMORED_VEHICLE";
6469
- VehicleUtilizationStyle2["MinibusSharedTaxi"] = "MINIBUS_SHARED_TAXI";
6470
- VehicleUtilizationStyle2["Jeep"] = "JEEP";
6471
- VehicleUtilizationStyle2["JeepSAV"] = "JEEP_SAV";
6472
- VehicleUtilizationStyle2["JeepSUV"] = "JEEP_SUV";
6473
- VehicleUtilizationStyle2["Hearse"] = "HEARSE";
6474
- VehicleUtilizationStyle2["ChauffeuredRentalCar"] = "CHAUFFEURED_RENTAL_CAR";
6475
- VehicleUtilizationStyle2["OperationalRental"] = "OPERATIONAL_RENTAL";
6476
- VehicleUtilizationStyle2["PrivateMinibus"] = "PRIVATE_MINIBUS";
6477
- VehicleUtilizationStyle2["RouteMinibus"] = "ROUTE_MINIBUS";
6478
- VehicleUtilizationStyle2["ServiceMinibus"] = "SERVICE_MINIBUS";
6479
- return VehicleUtilizationStyle2;
6480
- })(VehicleUtilizationStyle || {});
6481
- var VehicleFuelType = /* @__PURE__ */ ((VehicleFuelType2) => {
6482
- VehicleFuelType2["Gasoline"] = "GASOLINE";
6483
- VehicleFuelType2["Diesel"] = "DIESEL";
6484
- VehicleFuelType2["Lpg"] = "LPG";
6485
- VehicleFuelType2["Electric"] = "ELECTRIC";
6486
- VehicleFuelType2["LpgGasoline"] = "LPG_GASOLINE";
6487
- VehicleFuelType2["Hybrid"] = "HYBRID";
6488
- return VehicleFuelType2;
6489
- })(VehicleFuelType || {});
6490
- var VehicleAccessoryType = /* @__PURE__ */ ((VehicleAccessoryType2) => {
6491
- VehicleAccessoryType2["Audio"] = "audio";
6492
- VehicleAccessoryType2["Display"] = "display";
6493
- VehicleAccessoryType2["Other"] = "other";
6494
- return VehicleAccessoryType2;
6495
- })(VehicleAccessoryType || {});
6496
-
6497
- // src/contracts/customers.ts
6498
- var Gender = /* @__PURE__ */ ((Gender2) => {
6499
- Gender2["Unknown"] = "UNKNOWN";
6500
- Gender2["Male"] = "MALE";
6501
- Gender2["Female"] = "FEMALE";
6502
- Gender2["Other"] = "OTHER";
6503
- return Gender2;
6504
- })(Gender || {});
6505
- var EducationStatus = /* @__PURE__ */ ((EducationStatus2) => {
6506
- EducationStatus2["Unknown"] = "UNKNOWN";
6507
- EducationStatus2["PrimarySchool"] = "PRIMARY_SCHOOL";
6508
- EducationStatus2["MiddleSchool"] = "MIDDLE_SCHOOL";
6509
- EducationStatus2["HighSchool"] = "HIGH_SCHOOL";
6510
- EducationStatus2["University"] = "UNIVERSITY";
6511
- EducationStatus2["Postgraduate"] = "POSTGRADUATE";
6512
- EducationStatus2["Doctorate"] = "DOCTORATE";
6513
- EducationStatus2["Other"] = "OTHER";
6514
- return EducationStatus2;
6515
- })(EducationStatus || {});
6516
- var Nationality = /* @__PURE__ */ ((Nationality2) => {
6517
- Nationality2["Unknown"] = "UNKNOWN";
6518
- Nationality2["Turk"] = "TURK";
6519
- Nationality2["Other"] = "OTHER";
6520
- return Nationality2;
6521
- })(Nationality || {});
6522
- var MaritalStatus = /* @__PURE__ */ ((MaritalStatus2) => {
6523
- MaritalStatus2["Unknown"] = "UNKNOWN";
6524
- MaritalStatus2["Single"] = "SINGLE";
6525
- MaritalStatus2["Married"] = "MARRIED";
6526
- return MaritalStatus2;
6527
- })(MaritalStatus || {});
6528
- var Job = /* @__PURE__ */ ((Job2) => {
6529
- Job2["Unknown"] = "UNKNOWN";
6530
- Job2["Banker"] = "BANKER";
6531
- Job2["CorporateEmployee"] = "CORPORATE_EMPLOYEE";
6532
- Job2["LtdEmployee"] = "LTD_EMPLOYEE";
6533
- Job2["Police"] = "POLICE";
6534
- Job2["MilitaryPersonnel"] = "MILITARY_PERSONNEL";
6535
- Job2["RetiredSpouse"] = "RETIRED_SPOUSE";
6536
- Job2["Teacher"] = "TEACHER";
6537
- Job2["Doctor"] = "DOCTOR";
6538
- Job2["Pharmacist"] = "PHARMACIST";
6539
- Job2["Nurse"] = "NURSE";
6540
- Job2["HealthcareWorker"] = "HEALTHCARE_WORKER";
6541
- Job2["Lawyer"] = "LAWYER";
6542
- Job2["Judge"] = "JUDGE";
6543
- Job2["Prosecutor"] = "PROSECUTOR";
6544
- Job2["Freelancer"] = "FREELANCER";
6545
- Job2["Farmer"] = "FARMER";
6546
- Job2["Instructor"] = "INSTRUCTOR";
6547
- Job2["ReligiousOfficial"] = "RELIGIOUS_OFFICIAL";
6548
- Job2["AssociationManager"] = "ASSOCIATION_MANAGER";
6549
- Job2["Officer"] = "OFFICER";
6550
- Job2["Retired"] = "RETIRED";
6551
- Job2["Housewife"] = "HOUSEWIFE";
6552
- return Job2;
6553
- })(Job || {});
6554
- var ContactFlowState = /* @__PURE__ */ ((ContactFlowState2) => {
6555
- ContactFlowState2["Active"] = "ACTIVE";
6556
- ContactFlowState2["Succeeded"] = "SUCCEEDED";
6557
- ContactFlowState2["Failed"] = "FAILED";
6558
- return ContactFlowState2;
6559
- })(ContactFlowState || {});
6560
- var ContactType = /* @__PURE__ */ ((ContactType2) => {
6561
- ContactType2["PhoneCall"] = "PHONE_CALL";
6562
- return ContactType2;
6563
- })(ContactType || {});
6564
- var ContactState = /* @__PURE__ */ ((ContactState2) => {
6565
- ContactState2["Planned"] = "PLANNED";
6566
- ContactState2["Occurred"] = "OCCURRED";
6567
- ContactState2["NotOccurred"] = "NOT_OCCURRED";
6568
- return ContactState2;
6569
- })(ContactState || {});
6570
- var Surgery = /* @__PURE__ */ ((Surgery2) => {
6571
- Surgery2["Other"] = "OTHER";
6572
- Surgery2["OrganTransplant"] = "ORGAN_TRANSPLANT";
6573
- Surgery2["BoneMarrowTransplant"] = "BONE_MARROW_TRANSPLANT";
6574
- Surgery2["HeartSurgery"] = "HEART_SURGERY";
6575
- Surgery2["BrainSurgery"] = "BRAIN_SURGERY";
6576
- return Surgery2;
6577
- })(Surgery || {});
6578
- var Disease = /* @__PURE__ */ ((Disease2) => {
6579
- Disease2["Other"] = "OTHER";
6580
- Disease2["KidneyFailure"] = "KIDNEY_FAILURE";
6581
- Disease2["Cancer"] = "CANCER";
6582
- Disease2["LiverDisease"] = "LIVER_DISEASE";
6583
- Disease2["HeartFailure"] = "HEART_FAILURE";
6584
- Disease2["HeartRhythmAndConductionDisorders"] = "HEART_RHYTHM_AND_CONDUCTION_DISORDERS";
6585
- Disease2["ImmuneSystemDisorders"] = "IMMUNE_SYSTEM_DISORDERS";
6586
- return Disease2;
6587
- })(Disease || {});
6588
- var ConsentType = /* @__PURE__ */ ((ConsentType2) => {
6589
- ConsentType2["KVKK"] = "KVKK";
6590
- ConsentType2["ETK"] = "ETK";
6591
- return ConsentType2;
6592
- })(ConsentType || {});
6593
-
6594
- // src/contracts/cases.ts
6595
- var CaseType = /* @__PURE__ */ ((CaseType2) => {
6596
- CaseType2["SaleOpportunity"] = "SALE_OPPORTUNITY";
6597
- CaseType2["Endorsement"] = "ENDORSEMENT";
6598
- CaseType2["Cancel"] = "CANCEL";
6599
- CaseType2["Complaint"] = "COMPLAINT";
6600
- return CaseType2;
6601
- })(CaseType || {});
6602
- var CaseMainState = /* @__PURE__ */ ((CaseMainState2) => {
6603
- CaseMainState2["Fail"] = "FAIL";
6604
- CaseMainState2["Open"] = "OPEN";
6605
- CaseMainState2["InProgress"] = "IN_PROGRESS";
6606
- CaseMainState2["Success"] = "SUCCESS";
6607
- return CaseMainState2;
6608
- })(CaseMainState || {});
6609
- var CaseSubState = /* @__PURE__ */ ((CaseSubState2) => {
6610
- CaseSubState2["FailNoResponse"] = "FAIL_NO_RESPONSE";
6611
- CaseSubState2["FailInvalidCase"] = "FAIL_INVALID_CASE";
6612
- CaseSubState2["FailCustomerWithdrawn"] = "FAIL_CUSTOMER_WITHDRAWN";
6613
- CaseSubState2["FailPaymentError"] = "FAIL_PAYMENT_ERROR";
6614
- CaseSubState2["FailDeclinedCardInformation"] = "FAIL_DECLINED_CARD_INFORMATION";
6615
- CaseSubState2["FailForeignUser"] = "FAIL_FOREIGN_USER";
6616
- CaseSubState2["FailTakenElsewhere"] = "FAIL_TAKEN_ELSEWHERE";
6617
- CaseSubState2["FailPriceTooHigh"] = "FAIL_PRICE_TOO_HIGH";
6618
- CaseSubState2["FailAssetAcquisition"] = "FAIL_ASSET_ACQUISITION";
6619
- CaseSubState2["FailAssetSold"] = "FAIL_ASSET_SOLD";
6620
- CaseSubState2["FailUnresolved"] = "FAIL_UNRESOLVED";
6621
- CaseSubState2["FailReferredToLegal"] = "FAIL_REFERRED_TO_LEGAL";
6622
- CaseSubState2["FailCustomerUnsatisfied"] = "FAIL_CUSTOMER_UNSATISFIED";
6623
- CaseSubState2["FailMissingDocuments"] = "FAIL_MISSING_DOCUMENTS";
6624
- CaseSubState2["FailInsurerDenied"] = "FAIL_INSURER_DENIED";
6625
- CaseSubState2["FailConditionsNotMet"] = "FAIL_CONDITIONS_NOT_MET";
6626
- CaseSubState2["OpenInitial"] = "OPEN_INITIAL";
6627
- CaseSubState2["OpenCollectingInformation"] = "OPEN_COLLECTING_INFORMATION";
6628
- CaseSubState2["OpenDelayed"] = "OPEN_DELAYED";
6629
- CaseSubState2["OpenWaiting"] = "OPEN_WAITING";
6630
- CaseSubState2["InProgressUnderAnalysis"] = "IN_PROGRESS_UNDER_ANALYSIS";
6631
- CaseSubState2["InProgressProposalPrepared"] = "IN_PROGRESS_PROPOSAL_PREPARED";
6632
- CaseSubState2["InProgressAwaitingApproval"] = "IN_PROGRESS_AWAITING_APPROVAL";
6633
- CaseSubState2["InProgressToBeRecontacted"] = "IN_PROGRESS_TO_BE_RECONTACTED";
6634
- CaseSubState2["SuccessCompleted"] = "SUCCESS_COMPLETED";
6635
- return CaseSubState2;
6636
- })(CaseSubState || {});
6637
- var CaseStatus = /* @__PURE__ */ ((CaseStatus2) => {
6638
- CaseStatus2["Open"] = "OPEN";
6639
- CaseStatus2["Delayed"] = "DELAYED";
6640
- CaseStatus2["Success"] = "SUCCESS";
6641
- CaseStatus2["Fail"] = "FAIL";
6642
- return CaseStatus2;
6643
- })(CaseStatus || {});
6644
- var SaleOpportunityCaseSubType = /* @__PURE__ */ ((SaleOpportunityCaseSubType2) => {
6645
- SaleOpportunityCaseSubType2["NewSale"] = "NEW_SALE";
6646
- SaleOpportunityCaseSubType2["CrossSale"] = "CROSS_SALE";
6647
- SaleOpportunityCaseSubType2["Renewal"] = "RENEWAL";
6648
- return SaleOpportunityCaseSubType2;
6649
- })(SaleOpportunityCaseSubType || {});
6650
- var CancelCaseSubType = /* @__PURE__ */ ((CancelCaseSubType2) => {
6651
- CancelCaseSubType2["OnlineCancellationRefund"] = "ONLINE_CANCELLATION_REFUND";
6652
- CancelCaseSubType2["MebCancellation"] = "MEB_CANCELLATION";
6653
- CancelCaseSubType2["PartialCancellation"] = "PARTIAL_CANCELLATION";
6654
- CancelCaseSubType2["CancellationFromSale"] = "CANCELLATION_FROM_SALE";
6655
- CancelCaseSubType2["CancellationDueToCollection"] = "CANCELLATION_DUE_TO_COLLECTION";
6656
- CancelCaseSubType2["CancellationDueToDamage"] = "CANCELLATION_DUE_TO_DAMAGE";
6657
- return CancelCaseSubType2;
6658
- })(CancelCaseSubType || {});
6659
- var ComplaintCaseSubType = /* @__PURE__ */ ((ComplaintCaseSubType2) => {
6660
- ComplaintCaseSubType2["ConsultantError"] = "CONSULTANT_ERROR";
6661
- ComplaintCaseSubType2["PolicyOperations"] = "POLICY_OPERATIONS";
6662
- ComplaintCaseSubType2["Collection"] = "COLLECTION";
6663
- ComplaintCaseSubType2["DueToFrequentCalls"] = "DUE_TO_FREQUENT_CALLS";
6664
- ComplaintCaseSubType2["Fraud"] = "FRAUD";
6665
- ComplaintCaseSubType2["Damage"] = "DAMAGE";
6666
- ComplaintCaseSubType2["ErroneousTransaction"] = "ERRONEOUS_TRANSACTION";
6667
- ComplaintCaseSubType2["DelayInOperations"] = "DELAY_IN_OPERATIONS";
6668
- ComplaintCaseSubType2["OnlineTransactionErrors"] = "ONLINE_TRANSACTION_ERRORS";
6669
- ComplaintCaseSubType2["DelayInCancellationPeriod"] = "DELAY_IN_CANCELLATION_PERIOD";
6670
- ComplaintCaseSubType2["NonReceiptOfPolicyOrEndorsement"] = "NON_RECEIPT_OF_POLICY_OR_ENDORSEMENT";
6671
- ComplaintCaseSubType2["NonProductionOfPolicyOrEndorsement"] = "NON_PRODUCTION_OF_POLICY_OR_ENDORSEMENT";
6672
- ComplaintCaseSubType2["DelayInEndorsementOperations"] = "DELAY_IN_ENDORSEMENT_OPERATIONS";
6673
- ComplaintCaseSubType2["ErroneousPremiumCollection"] = "ERRONEOUS_PREMIUM_COLLECTION";
6674
- ComplaintCaseSubType2["NonDeliveryOfRefundReceipt"] = "NON_DELIVERY_OF_REFUND_RECEIPT";
6675
- ComplaintCaseSubType2["NonRefundOfPremium"] = "NON_REFUND_OF_PREMIUM";
6676
- ComplaintCaseSubType2["StaffAttitude"] = "STAFF_ATTITUDE";
6677
- ComplaintCaseSubType2["InsufficientOrErroneousInformation"] = "INSUFFICIENT_OR_ERRONEOUS_INFORMATION";
6678
- ComplaintCaseSubType2["NoTimelyResponse"] = "NO_TIMELY_RESPONSE";
6679
- return ComplaintCaseSubType2;
6680
- })(ComplaintCaseSubType || {});
6681
- var EndorsementCaseSubType = /* @__PURE__ */ ((EndorsementCaseSubType2) => {
6682
- EndorsementCaseSubType2["VehicleChange"] = "VEHICLE_CHANGE";
6683
- EndorsementCaseSubType2["ValueIncrease"] = "VALUE_INCREASE";
6684
- EndorsementCaseSubType2["NoClaimBonusTransfer"] = "NO_CLAIM_BONUS_TRANSFER";
6685
- EndorsementCaseSubType2["CoverageChange"] = "COVERAGE_CHANGE";
6686
- EndorsementCaseSubType2["UsageTypeChange"] = "USAGE_TYPE_CHANGE";
6687
- EndorsementCaseSubType2["TransferRequest"] = "TRANSFER_REQUEST";
6688
- EndorsementCaseSubType2["LicensePlateChange"] = "LICENSE_PLATE_CHANGE";
6689
- EndorsementCaseSubType2["BrandModelChange"] = "BRAND_MODEL_CHANGE";
6690
- EndorsementCaseSubType2["EngineChassisNumberChange"] = "ENGINE_CHASSIS_NUMBER_CHANGE";
6691
- EndorsementCaseSubType2["ContactAddressChange"] = "CONTACT_ADDRESS_CHANGE";
6692
- EndorsementCaseSubType2["Other"] = "OTHER";
6693
- EndorsementCaseSubType2["PledgeeCorrectionAddition"] = "PLEDGEE_CORRECTION_ADDITION";
6694
- return EndorsementCaseSubType2;
6695
- })(EndorsementCaseSubType || {});
6696
- var CaseActivityAction = /* @__PURE__ */ ((CaseActivityAction2) => {
6697
- CaseActivityAction2["Created"] = "CREATED";
6698
- CaseActivityAction2["Updated"] = "UPDATED";
6699
- CaseActivityAction2["StateChanged"] = "STATE_CHANGED";
6700
- CaseActivityAction2["ChannelChanged"] = "CHANNEL_CHANGED";
6701
- CaseActivityAction2["RepresentativeAssigned"] = "REPRESENTATIVE_ASSIGNED";
6702
- CaseActivityAction2["NoteAdded"] = "NOTE_ADDED";
6703
- CaseActivityAction2["AssetSet"] = "ASSET_SET";
6704
- CaseActivityAction2["PolicyAdded"] = "POLICY_ADDED";
6705
- CaseActivityAction2["ProposalAdded"] = "PROPOSAL_ADDED";
6706
- CaseActivityAction2["PolicyEndDateSet"] = "POLICY_END_DATE_SET";
6707
- CaseActivityAction2["CustomerUpdated"] = "CUSTOMER_UPDATED";
6708
- CaseActivityAction2["AssetUpdated"] = "ASSET_UPDATED";
6709
- CaseActivityAction2["PriorityAssessed"] = "PRIORITY_ASSESSED";
6710
- CaseActivityAction2["ProposalProductPurchaseAttempted"] = "PROPOSAL_PRODUCT_PURCHASE_ATTEMPTED";
6711
- return CaseActivityAction2;
6712
- })(CaseActivityAction || {});
6713
-
6714
- // src/contracts/agents.ts
6715
- var RobotMode = /* @__PURE__ */ ((RobotMode2) => {
6716
- RobotMode2["None"] = "NONE";
6717
- RobotMode2["Desktop"] = "DESKTOP";
6718
- RobotMode2["Server"] = "SERVER";
6719
- return RobotMode2;
6720
- })(RobotMode || {});
6721
- var CaseRepresentativeAssignmentMode = /* @__PURE__ */ ((CaseRepresentativeAssignmentMode2) => {
6722
- CaseRepresentativeAssignmentMode2["None"] = "NONE";
6723
- CaseRepresentativeAssignmentMode2["Random"] = "RANDOM";
6724
- CaseRepresentativeAssignmentMode2["RoundRobin"] = "ROUND_ROBIN";
6725
- CaseRepresentativeAssignmentMode2["BranchImportanceBalance"] = "BRANCH_IMPORTANCE_BALANCE";
6726
- return CaseRepresentativeAssignmentMode2;
6727
- })(CaseRepresentativeAssignmentMode || {});
6728
- var InsuranceSyncState = /* @__PURE__ */ ((InsuranceSyncState2) => {
6729
- InsuranceSyncState2["Pending"] = "PENDING";
6730
- InsuranceSyncState2["Failed"] = "FAILED";
6731
- InsuranceSyncState2["Succeed"] = "SUCCEED";
6732
- return InsuranceSyncState2;
6733
- })(InsuranceSyncState || {});
6734
- var AgentInsuranceCompanyType = /* @__PURE__ */ ((AgentInsuranceCompanyType2) => {
6735
- AgentInsuranceCompanyType2["WebService"] = "WEB_SERVICE";
6736
- AgentInsuranceCompanyType2["Robot"] = "ROBOT";
6737
- return AgentInsuranceCompanyType2;
6738
- })(AgentInsuranceCompanyType || {});
6739
- var SmsImplementation = /* @__PURE__ */ ((SmsImplementation2) => {
6740
- SmsImplementation2["Default"] = "Default";
6741
- SmsImplementation2["Teknomart"] = "Teknomart";
6742
- SmsImplementation2["ArtiKurumsal"] = "ArtiKurumsal";
6743
- SmsImplementation2["Verimor"] = "Verimor";
6744
- return SmsImplementation2;
6745
- })(SmsImplementation || {});
6746
- var CallCenterImplementation = /* @__PURE__ */ ((CallCenterImplementation2) => {
6747
- CallCenterImplementation2["None"] = "None";
6748
- CallCenterImplementation2["AloTech"] = "AloTech";
6749
- return CallCenterImplementation2;
6750
- })(CallCenterImplementation || {});
6751
- var AgentUserState = /* @__PURE__ */ ((AgentUserState2) => {
6752
- AgentUserState2["Pending"] = "PENDING";
6753
- AgentUserState2["Active"] = "ACTIVE";
6754
- AgentUserState2["Inactive"] = "INACTIVE";
6755
- return AgentUserState2;
6756
- })(AgentUserState || {});
6757
- var B2CConfigFieldType = /* @__PURE__ */ ((B2CConfigFieldType2) => {
6758
- B2CConfigFieldType2[B2CConfigFieldType2["Object"] = 1] = "Object";
6759
- B2CConfigFieldType2[B2CConfigFieldType2["Array"] = 2] = "Array";
6760
- B2CConfigFieldType2[B2CConfigFieldType2["Text"] = 3] = "Text";
6761
- B2CConfigFieldType2[B2CConfigFieldType2["Number"] = 4] = "Number";
6762
- B2CConfigFieldType2[B2CConfigFieldType2["Boolean"] = 5] = "Boolean";
6763
- B2CConfigFieldType2[B2CConfigFieldType2["File"] = 6] = "File";
6764
- B2CConfigFieldType2[B2CConfigFieldType2["Color"] = 7] = "Color";
6765
- B2CConfigFieldType2[B2CConfigFieldType2["ProductBranch"] = 8] = "ProductBranch";
6766
- B2CConfigFieldType2[B2CConfigFieldType2["Icon"] = 9] = "Icon";
6767
- B2CConfigFieldType2[B2CConfigFieldType2["InsuranceCompany"] = 10] = "InsuranceCompany";
6768
- B2CConfigFieldType2[B2CConfigFieldType2["MultiLineText"] = 11] = "MultiLineText";
6769
- B2CConfigFieldType2[B2CConfigFieldType2["InsuranceProduct"] = 12] = "InsuranceProduct";
6770
- return B2CConfigFieldType2;
6771
- })(B2CConfigFieldType || {});
6772
-
6773
- // src/contracts/webhooks.ts
6774
- var WebhookEvent = /* @__PURE__ */ ((WebhookEvent2) => {
6775
- WebhookEvent2["ProposalPremiumReceived"] = "proposal_premium.received";
6776
- WebhookEvent2["ProposalPremiumPurchasing"] = "proposal_premium.purchasing";
6777
- WebhookEvent2["ProposalPremiumPurchased"] = "proposal_premium.purchased";
6778
- WebhookEvent2["ProposalPremiumPurchaseFailed"] = "proposal_premium.purchase_failed";
6779
- WebhookEvent2["PolicyCreated"] = "policy.created";
6780
- WebhookEvent2["PolicyUpdated"] = "policy.updated";
6781
- return WebhookEvent2;
6782
- })(WebhookEvent || {});
6783
-
6784
- // src/contracts/proposals.ts
6785
- var ProposalState = /* @__PURE__ */ ((ProposalState2) => {
6786
- ProposalState2["Waiting"] = "WAITING";
6787
- ProposalState2["Active"] = "ACTIVE";
6788
- ProposalState2["Purchasing"] = "PURCHASING";
6789
- ProposalState2["Purchased"] = "PURCHASED";
6790
- ProposalState2["Failed"] = "FAILED";
6791
- return ProposalState2;
6792
- })(ProposalState || {});
6793
- var ProposalProductState = /* @__PURE__ */ ((ProposalProductState2) => {
6794
- ProposalProductState2["Waiting"] = "WAITING";
6795
- ProposalProductState2["Failed"] = "FAILED";
6796
- ProposalProductState2["Active"] = "ACTIVE";
6797
- ProposalProductState2["Purchasing"] = "PURCHASING";
6798
- ProposalProductState2["Purchased"] = "PURCHASED";
6799
- return ProposalProductState2;
6800
- })(ProposalProductState || {});
5764
+ // src/index.ts
5765
+ __reExport(index_exports, require("@insurup/contracts"), module.exports);
6801
5766
  // Annotate the CommonJS export names for ESM import in node:
6802
5767
  0 && (module.exports = {
6803
- ALL_AGENT_USER_FIELDS,
6804
- ALL_CASE_FIELDS,
6805
- ALL_CUSTOMER_FIELDS,
6806
- ALL_FILE_POLICY_TRANSFER_FIELDS,
6807
- ALL_POLICY_FIELDS,
6808
- ALL_POLICY_TRANSFER_FIELDS,
6809
- ALL_PROPOSAL_FIELDS,
6810
- ALL_WEBHOOK_DELIVERY_FIELDS,
6811
- AgentInsuranceCompanyType,
6812
- AgentUserState,
6813
- AracSegment,
6814
- AssetType,
6815
- B2CConfigFieldType,
6816
- CallCenterImplementation,
6817
- CancelCaseSubType,
6818
- CaseActivityAction,
6819
- CaseMainState,
6820
- CaseRepresentativeAssignmentMode,
6821
- CaseStatus,
6822
- CaseSubState,
6823
- CaseType,
6824
- Channel,
6825
- ComplaintCaseSubType,
6826
- ConsentType,
6827
- ContactFlowState,
6828
- ContactState,
6829
- ContactType,
6830
- Currency,
6831
- CustomerType,
6832
- DateOnly,
6833
- DateTime,
6834
5768
  DefaultInsurUpClient,
6835
- Disease,
6836
- EducationStatus,
6837
- EndorsementCaseSubType,
6838
5769
  Endpoints,
6839
- Gender,
6840
5770
  GraphQLTransport,
6841
- HastaneAgi,
6842
5771
  InsurUpAgentBranchClient,
6843
5772
  InsurUpAgentClient,
6844
5773
  InsurUpAgentRoleClient,
@@ -6850,6 +5779,7 @@ var ProposalProductState = /* @__PURE__ */ ((ProposalProductState2) => {
6850
5779
  InsurUpCustomerClient,
6851
5780
  InsurUpError,
6852
5781
  InsurUpFileClient,
5782
+ InsurUpGraphQLErrorCode,
6853
5783
  InsurUpInsuranceClient,
6854
5784
  InsurUpLanguageClient,
6855
5785
  InsurUpPolicyClient,
@@ -6859,46 +5789,13 @@ var ProposalProductState = /* @__PURE__ */ ((ProposalProductState2) => {
6859
5789
  InsurUpTemplateClient,
6860
5790
  InsurUpVehicleClient,
6861
5791
  InsurUpWebhookClient,
6862
- InsuranceProductType,
6863
- InsuranceSyncState,
6864
- Job,
6865
- LossPayeeClauseType,
6866
- MaritalStatus,
6867
- Nationality,
6868
- OnarimServisTuru,
6869
- PaymentOption,
6870
- PolicyState,
6871
- PolicyTransferCompanyFailureReason,
6872
- PolicyTransferTriggerStatus,
6873
- ProductBranch,
6874
- PropertyDamageStatus,
6875
- PropertyOwnershipType,
6876
- PropertyStructure,
6877
- PropertyUtilizationStyle,
6878
- ProposalProductState,
6879
- ProposalState,
6880
- RobotMode,
6881
- SaglikPaketiTedaviSekli,
6882
- SaleOpportunityCaseSubType,
6883
- SmsImplementation,
6884
- SortEnumType,
6885
- Surgery,
6886
- TasinanYuk,
6887
- TransferredPolicyFailureReason,
6888
- TransferredPolicySkipReason,
6889
- TransferredPolicyStatus,
6890
- UserType,
6891
5792
  VERSION,
6892
- VehicleAccessoryType,
6893
- VehicleFuelType,
6894
- VehicleUtilizationStyle,
6895
- WebhookDeliveryState,
6896
- WebhookEvent,
6897
- YedekParcaTuru,
6898
- buildFieldSelection,
5793
+ createGraphQLErrors,
6899
5794
  extractError,
6900
5795
  getDataOrThrow,
6901
- mergeCoverage,
6902
- throwIfError
5796
+ getGraphQLDataOrThrow,
5797
+ throwIfError,
5798
+ throwIfGraphQLError,
5799
+ ...require("@insurup/contracts")
6903
5800
  });
6904
5801
  //# sourceMappingURL=index.cjs.map