@delegance/sdk 0.2.1 → 0.3.0

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.d.mts CHANGED
@@ -232,7 +232,7 @@ interface RequestOptions {
232
232
  isFormData?: boolean;
233
233
  }
234
234
  /** Kept equal to package.json "version"; a unit test fails on drift. */
235
- declare const SDK_VERSION = "0.2.1";
235
+ declare const SDK_VERSION = "0.3.0";
236
236
  /**
237
237
  * Canonical default API origin (WS0/WS1 shared constant, the SDK-package
238
238
  * source of truth; the CLI mirror lives in cli/src/utils/config.ts).
@@ -2305,6 +2305,19 @@ interface CreateAccountResult {
2305
2305
  /** e.g. 'address_not_saved': the account exists but the server could not store part of it. */
2306
2306
  warnings?: string[];
2307
2307
  }
2308
+ /** GET /api/v1/legal/terms: what the user is asked to accept. */
2309
+ interface TermsInfo {
2310
+ version: string;
2311
+ termsUrl: string;
2312
+ privacyUrl: string;
2313
+ slaUrl: string;
2314
+ /** One-line summaries to show beside the links (the self-directed placement disclosure first). */
2315
+ summaries: string[];
2316
+ brokerReview: {
2317
+ email: string;
2318
+ command: string;
2319
+ };
2320
+ }
2308
2321
  interface EnrollResult {
2309
2322
  enrollmentId: string;
2310
2323
  expiresAt: string;
@@ -2329,10 +2342,18 @@ declare class SignupModule {
2329
2342
  createAccount(input: CreateAccountInput, opts?: {
2330
2343
  idempotencyKey?: string;
2331
2344
  }): Promise<CreateAccountResult>;
2345
+ /** The current Terms of Service version and links. Public: no key. */
2346
+ getTerms(): Promise<TermsInfo>;
2347
+ /**
2348
+ * Register this terminal. The server refuses without `termsAccepted: true`
2349
+ * and the CURRENT `termsVersion` (from `getTerms`).
2350
+ */
2332
2351
  enroll(bootstrapKey: string, input: {
2333
2352
  deviceSecretHash: string;
2334
2353
  firstName: string;
2335
2354
  lastName: string;
2355
+ termsAccepted: true;
2356
+ termsVersion: string;
2336
2357
  }): Promise<EnrollResult>;
2337
2358
  requestVerification(bootstrapKey: string): Promise<{
2338
2359
  sentTo?: string;
@@ -2353,6 +2374,27 @@ declare class SignupModule {
2353
2374
  }): Promise<ExchangeResult>;
2354
2375
  }
2355
2376
 
2377
+ /**
2378
+ * Terms Module: read and accept the Delegance Terms of Service with a key.
2379
+ *
2380
+ * A v1 bind can require acceptance of the CURRENT version on file for the
2381
+ * key's user. After the Terms change, `accept` records the new version on
2382
+ * that user's profile (the server stamps the time).
2383
+ */
2384
+
2385
+ interface TermsAcceptance {
2386
+ version: string;
2387
+ acceptedAt: string;
2388
+ }
2389
+ declare class TermsModule {
2390
+ private http;
2391
+ constructor(http: HttpClient);
2392
+ /** The current version, the Terms / Privacy / SLA links, and the summaries to show. */
2393
+ get(): Promise<TermsInfo>;
2394
+ /** Accept `version` (it must be the current one; read it with `get`). */
2395
+ accept(version: string): Promise<TermsAcceptance>;
2396
+ }
2397
+
2356
2398
  interface PollOptions {
2357
2399
  timeoutMs?: number;
2358
2400
  intervalMs?: number;
@@ -2504,6 +2546,7 @@ declare class DeleganceClient {
2504
2546
  readonly claims: ClaimsModule;
2505
2547
  /** Report a bug, an idea, or a question to Delegance */
2506
2548
  readonly feedback: FeedbackModule;
2549
+ readonly terms: TermsModule;
2507
2550
  /** The calling key: info and refresh */
2508
2551
  readonly auth: AuthModule;
2509
2552
  /**
@@ -2576,4 +2619,4 @@ declare function createDeviceLogin(config?: {
2576
2619
  retries?: number;
2577
2620
  }): DeviceLoginModule;
2578
2621
 
2579
- export { type APIKey, type APIResponse, API_KEY_SCOPES, type ApiKey, type ApiKeyInfo, type ApiKeyScope, ApiKeysModule, type AppetiteJobStatus, type AppetiteMatch, type AppetiteMatchInput, type AppetiteMatchResult, type AppetiteMatchStart, AppetiteModule, AuthModule, AuthenticationError, type BindRequestResult, type BindStepUpRequired, type BondToolResult, BondsModule, type BrokerHandoffQuestions, type BrokerHandoffResult, type COI, COIModule, type CancellationReason, type CancellationRequestInput, type CancellationSignInput, type CancellationSignResult, type CancellationStatus, type Carrier, type CarrierAppetiteResult, type CarrierQuote, type CertificateHolder, type ChatMessage, ChatModule, type ChatOptions, type ChatResponse, type ClaimSummary, ClaimsModule, CompaniesModule, type Company, type CompanySize, CompanySizeSchema, type CreateAPIKeyInput, type CreateAccountInput, type CreateAccountResult, type CreateApiKeyInput, type CreateCompanyInput, CreateCompanySchema, type CreateLeadInput, type CreateLeadResult, type CreatedAPIKey, type CreatedApiKey, DEFAULT_BASE_URL, type DailyUsage, type DailyUsageOptions, DeleganceClient, type DeleganceClientConfig, DeleganceError, DeviceLoginModule, type DeviceLoginPoll, type DeviceLoginStart, type Document, type DocumentFacts, type DocumentStatus, DocumentStatusSchema, type DocumentType, DocumentTypeSchema, type DocumentWithExtraction, DocumentsModule, type EnrollResult, type ExchangeResult, type ExtractedPolicy, FEEDBACK_MESSAGE_MAX, type FastBindInput, type FeedbackContext, FeedbackModule, type FeedbackType, type FileClaimInput, type FinancingOffer, ForbiddenError, type GenerateCOIRequest, type GenerateCOIResponse, type GetPolicyResponse, type GetQuoteResponse, type GetSOVResponse, type IdempotencyOptions, type InstantQuestion, type InstantQuestionOption, type InstantQuoteStatus, InstantQuotesModule, type InstantSession, type InstantSubmitResult, KnowledgeModule, type KnowledgeSearchResult, type LeadAddress, LeadsModule, type ListApiKeysOptions, type ListCOIsResponse, type ListCarriersResponse, type ListCompaniesOptions, type ListDocumentsOptions, type ListNotecardsOptions, type ListPoliciesOptions, type ListPoliciesResponse, type ListQuotesOptions, type ListQuotesResponse, type ListSOVsOptions, type ListSOVsResponse, type MeterUsage, NotFoundError, NotImplementedError, type Notecard, OnboardingModule, type OnboardingNextStep, type OnboardingState, type OnboardingStateData, type OnboardingStatus, type PaginatedResponse, type PaymentRequest, PaymentsModule, PoliciesModule, type Policy, type PolicyCoverage, type Quote, type QuoteRequest, QuotesModule, RateLimitError, type RateLimitStatus, type RotateResult, SDK_VERSION, type SOV, type SOVLocation, SOVModule, type SearchInput, SignupModule, type StartBondQuoteInput, type SubmitFeedbackInput, type SubmitQuoteResponse, type UploadDocumentInput, type UploadSOVRequest, type UploadSOVResponse, UsageModule, type UsageSummary, ValidationError, type WaitForExtractionOptions, type WaitForMatchOptions, createClientFromEnv, createDeviceLogin, createSignup, newDeviceSecret };
2622
+ export { type APIKey, type APIResponse, API_KEY_SCOPES, type ApiKey, type ApiKeyInfo, type ApiKeyScope, ApiKeysModule, type AppetiteJobStatus, type AppetiteMatch, type AppetiteMatchInput, type AppetiteMatchResult, type AppetiteMatchStart, AppetiteModule, AuthModule, AuthenticationError, type BindRequestResult, type BindStepUpRequired, type BondToolResult, BondsModule, type BrokerHandoffQuestions, type BrokerHandoffResult, type COI, COIModule, type CancellationReason, type CancellationRequestInput, type CancellationSignInput, type CancellationSignResult, type CancellationStatus, type Carrier, type CarrierAppetiteResult, type CarrierQuote, type CertificateHolder, type ChatMessage, ChatModule, type ChatOptions, type ChatResponse, type ClaimSummary, ClaimsModule, CompaniesModule, type Company, type CompanySize, CompanySizeSchema, type CreateAPIKeyInput, type CreateAccountInput, type CreateAccountResult, type CreateApiKeyInput, type CreateCompanyInput, CreateCompanySchema, type CreateLeadInput, type CreateLeadResult, type CreatedAPIKey, type CreatedApiKey, DEFAULT_BASE_URL, type DailyUsage, type DailyUsageOptions, DeleganceClient, type DeleganceClientConfig, DeleganceError, DeviceLoginModule, type DeviceLoginPoll, type DeviceLoginStart, type Document, type DocumentFacts, type DocumentStatus, DocumentStatusSchema, type DocumentType, DocumentTypeSchema, type DocumentWithExtraction, DocumentsModule, type EnrollResult, type ExchangeResult, type ExtractedPolicy, FEEDBACK_MESSAGE_MAX, type FastBindInput, type FeedbackContext, FeedbackModule, type FeedbackType, type FileClaimInput, type FinancingOffer, ForbiddenError, type GenerateCOIRequest, type GenerateCOIResponse, type GetPolicyResponse, type GetQuoteResponse, type GetSOVResponse, type IdempotencyOptions, type InstantQuestion, type InstantQuestionOption, type InstantQuoteStatus, InstantQuotesModule, type InstantSession, type InstantSubmitResult, KnowledgeModule, type KnowledgeSearchResult, type LeadAddress, LeadsModule, type ListApiKeysOptions, type ListCOIsResponse, type ListCarriersResponse, type ListCompaniesOptions, type ListDocumentsOptions, type ListNotecardsOptions, type ListPoliciesOptions, type ListPoliciesResponse, type ListQuotesOptions, type ListQuotesResponse, type ListSOVsOptions, type ListSOVsResponse, type MeterUsage, NotFoundError, NotImplementedError, type Notecard, OnboardingModule, type OnboardingNextStep, type OnboardingState, type OnboardingStateData, type OnboardingStatus, type PaginatedResponse, type PaymentRequest, PaymentsModule, PoliciesModule, type Policy, type PolicyCoverage, type Quote, type QuoteRequest, QuotesModule, RateLimitError, type RateLimitStatus, type RotateResult, SDK_VERSION, type SOV, type SOVLocation, SOVModule, type SearchInput, SignupModule, type StartBondQuoteInput, type SubmitFeedbackInput, type SubmitQuoteResponse, type TermsAcceptance, type TermsInfo, TermsModule, type UploadDocumentInput, type UploadSOVRequest, type UploadSOVResponse, UsageModule, type UsageSummary, ValidationError, type WaitForExtractionOptions, type WaitForMatchOptions, createClientFromEnv, createDeviceLogin, createSignup, newDeviceSecret };
package/dist/index.d.ts CHANGED
@@ -232,7 +232,7 @@ interface RequestOptions {
232
232
  isFormData?: boolean;
233
233
  }
234
234
  /** Kept equal to package.json "version"; a unit test fails on drift. */
235
- declare const SDK_VERSION = "0.2.1";
235
+ declare const SDK_VERSION = "0.3.0";
236
236
  /**
237
237
  * Canonical default API origin (WS0/WS1 shared constant, the SDK-package
238
238
  * source of truth; the CLI mirror lives in cli/src/utils/config.ts).
@@ -2305,6 +2305,19 @@ interface CreateAccountResult {
2305
2305
  /** e.g. 'address_not_saved': the account exists but the server could not store part of it. */
2306
2306
  warnings?: string[];
2307
2307
  }
2308
+ /** GET /api/v1/legal/terms: what the user is asked to accept. */
2309
+ interface TermsInfo {
2310
+ version: string;
2311
+ termsUrl: string;
2312
+ privacyUrl: string;
2313
+ slaUrl: string;
2314
+ /** One-line summaries to show beside the links (the self-directed placement disclosure first). */
2315
+ summaries: string[];
2316
+ brokerReview: {
2317
+ email: string;
2318
+ command: string;
2319
+ };
2320
+ }
2308
2321
  interface EnrollResult {
2309
2322
  enrollmentId: string;
2310
2323
  expiresAt: string;
@@ -2329,10 +2342,18 @@ declare class SignupModule {
2329
2342
  createAccount(input: CreateAccountInput, opts?: {
2330
2343
  idempotencyKey?: string;
2331
2344
  }): Promise<CreateAccountResult>;
2345
+ /** The current Terms of Service version and links. Public: no key. */
2346
+ getTerms(): Promise<TermsInfo>;
2347
+ /**
2348
+ * Register this terminal. The server refuses without `termsAccepted: true`
2349
+ * and the CURRENT `termsVersion` (from `getTerms`).
2350
+ */
2332
2351
  enroll(bootstrapKey: string, input: {
2333
2352
  deviceSecretHash: string;
2334
2353
  firstName: string;
2335
2354
  lastName: string;
2355
+ termsAccepted: true;
2356
+ termsVersion: string;
2336
2357
  }): Promise<EnrollResult>;
2337
2358
  requestVerification(bootstrapKey: string): Promise<{
2338
2359
  sentTo?: string;
@@ -2353,6 +2374,27 @@ declare class SignupModule {
2353
2374
  }): Promise<ExchangeResult>;
2354
2375
  }
2355
2376
 
2377
+ /**
2378
+ * Terms Module: read and accept the Delegance Terms of Service with a key.
2379
+ *
2380
+ * A v1 bind can require acceptance of the CURRENT version on file for the
2381
+ * key's user. After the Terms change, `accept` records the new version on
2382
+ * that user's profile (the server stamps the time).
2383
+ */
2384
+
2385
+ interface TermsAcceptance {
2386
+ version: string;
2387
+ acceptedAt: string;
2388
+ }
2389
+ declare class TermsModule {
2390
+ private http;
2391
+ constructor(http: HttpClient);
2392
+ /** The current version, the Terms / Privacy / SLA links, and the summaries to show. */
2393
+ get(): Promise<TermsInfo>;
2394
+ /** Accept `version` (it must be the current one; read it with `get`). */
2395
+ accept(version: string): Promise<TermsAcceptance>;
2396
+ }
2397
+
2356
2398
  interface PollOptions {
2357
2399
  timeoutMs?: number;
2358
2400
  intervalMs?: number;
@@ -2504,6 +2546,7 @@ declare class DeleganceClient {
2504
2546
  readonly claims: ClaimsModule;
2505
2547
  /** Report a bug, an idea, or a question to Delegance */
2506
2548
  readonly feedback: FeedbackModule;
2549
+ readonly terms: TermsModule;
2507
2550
  /** The calling key: info and refresh */
2508
2551
  readonly auth: AuthModule;
2509
2552
  /**
@@ -2576,4 +2619,4 @@ declare function createDeviceLogin(config?: {
2576
2619
  retries?: number;
2577
2620
  }): DeviceLoginModule;
2578
2621
 
2579
- export { type APIKey, type APIResponse, API_KEY_SCOPES, type ApiKey, type ApiKeyInfo, type ApiKeyScope, ApiKeysModule, type AppetiteJobStatus, type AppetiteMatch, type AppetiteMatchInput, type AppetiteMatchResult, type AppetiteMatchStart, AppetiteModule, AuthModule, AuthenticationError, type BindRequestResult, type BindStepUpRequired, type BondToolResult, BondsModule, type BrokerHandoffQuestions, type BrokerHandoffResult, type COI, COIModule, type CancellationReason, type CancellationRequestInput, type CancellationSignInput, type CancellationSignResult, type CancellationStatus, type Carrier, type CarrierAppetiteResult, type CarrierQuote, type CertificateHolder, type ChatMessage, ChatModule, type ChatOptions, type ChatResponse, type ClaimSummary, ClaimsModule, CompaniesModule, type Company, type CompanySize, CompanySizeSchema, type CreateAPIKeyInput, type CreateAccountInput, type CreateAccountResult, type CreateApiKeyInput, type CreateCompanyInput, CreateCompanySchema, type CreateLeadInput, type CreateLeadResult, type CreatedAPIKey, type CreatedApiKey, DEFAULT_BASE_URL, type DailyUsage, type DailyUsageOptions, DeleganceClient, type DeleganceClientConfig, DeleganceError, DeviceLoginModule, type DeviceLoginPoll, type DeviceLoginStart, type Document, type DocumentFacts, type DocumentStatus, DocumentStatusSchema, type DocumentType, DocumentTypeSchema, type DocumentWithExtraction, DocumentsModule, type EnrollResult, type ExchangeResult, type ExtractedPolicy, FEEDBACK_MESSAGE_MAX, type FastBindInput, type FeedbackContext, FeedbackModule, type FeedbackType, type FileClaimInput, type FinancingOffer, ForbiddenError, type GenerateCOIRequest, type GenerateCOIResponse, type GetPolicyResponse, type GetQuoteResponse, type GetSOVResponse, type IdempotencyOptions, type InstantQuestion, type InstantQuestionOption, type InstantQuoteStatus, InstantQuotesModule, type InstantSession, type InstantSubmitResult, KnowledgeModule, type KnowledgeSearchResult, type LeadAddress, LeadsModule, type ListApiKeysOptions, type ListCOIsResponse, type ListCarriersResponse, type ListCompaniesOptions, type ListDocumentsOptions, type ListNotecardsOptions, type ListPoliciesOptions, type ListPoliciesResponse, type ListQuotesOptions, type ListQuotesResponse, type ListSOVsOptions, type ListSOVsResponse, type MeterUsage, NotFoundError, NotImplementedError, type Notecard, OnboardingModule, type OnboardingNextStep, type OnboardingState, type OnboardingStateData, type OnboardingStatus, type PaginatedResponse, type PaymentRequest, PaymentsModule, PoliciesModule, type Policy, type PolicyCoverage, type Quote, type QuoteRequest, QuotesModule, RateLimitError, type RateLimitStatus, type RotateResult, SDK_VERSION, type SOV, type SOVLocation, SOVModule, type SearchInput, SignupModule, type StartBondQuoteInput, type SubmitFeedbackInput, type SubmitQuoteResponse, type UploadDocumentInput, type UploadSOVRequest, type UploadSOVResponse, UsageModule, type UsageSummary, ValidationError, type WaitForExtractionOptions, type WaitForMatchOptions, createClientFromEnv, createDeviceLogin, createSignup, newDeviceSecret };
2622
+ export { type APIKey, type APIResponse, API_KEY_SCOPES, type ApiKey, type ApiKeyInfo, type ApiKeyScope, ApiKeysModule, type AppetiteJobStatus, type AppetiteMatch, type AppetiteMatchInput, type AppetiteMatchResult, type AppetiteMatchStart, AppetiteModule, AuthModule, AuthenticationError, type BindRequestResult, type BindStepUpRequired, type BondToolResult, BondsModule, type BrokerHandoffQuestions, type BrokerHandoffResult, type COI, COIModule, type CancellationReason, type CancellationRequestInput, type CancellationSignInput, type CancellationSignResult, type CancellationStatus, type Carrier, type CarrierAppetiteResult, type CarrierQuote, type CertificateHolder, type ChatMessage, ChatModule, type ChatOptions, type ChatResponse, type ClaimSummary, ClaimsModule, CompaniesModule, type Company, type CompanySize, CompanySizeSchema, type CreateAPIKeyInput, type CreateAccountInput, type CreateAccountResult, type CreateApiKeyInput, type CreateCompanyInput, CreateCompanySchema, type CreateLeadInput, type CreateLeadResult, type CreatedAPIKey, type CreatedApiKey, DEFAULT_BASE_URL, type DailyUsage, type DailyUsageOptions, DeleganceClient, type DeleganceClientConfig, DeleganceError, DeviceLoginModule, type DeviceLoginPoll, type DeviceLoginStart, type Document, type DocumentFacts, type DocumentStatus, DocumentStatusSchema, type DocumentType, DocumentTypeSchema, type DocumentWithExtraction, DocumentsModule, type EnrollResult, type ExchangeResult, type ExtractedPolicy, FEEDBACK_MESSAGE_MAX, type FastBindInput, type FeedbackContext, FeedbackModule, type FeedbackType, type FileClaimInput, type FinancingOffer, ForbiddenError, type GenerateCOIRequest, type GenerateCOIResponse, type GetPolicyResponse, type GetQuoteResponse, type GetSOVResponse, type IdempotencyOptions, type InstantQuestion, type InstantQuestionOption, type InstantQuoteStatus, InstantQuotesModule, type InstantSession, type InstantSubmitResult, KnowledgeModule, type KnowledgeSearchResult, type LeadAddress, LeadsModule, type ListApiKeysOptions, type ListCOIsResponse, type ListCarriersResponse, type ListCompaniesOptions, type ListDocumentsOptions, type ListNotecardsOptions, type ListPoliciesOptions, type ListPoliciesResponse, type ListQuotesOptions, type ListQuotesResponse, type ListSOVsOptions, type ListSOVsResponse, type MeterUsage, NotFoundError, NotImplementedError, type Notecard, OnboardingModule, type OnboardingNextStep, type OnboardingState, type OnboardingStateData, type OnboardingStatus, type PaginatedResponse, type PaymentRequest, PaymentsModule, PoliciesModule, type Policy, type PolicyCoverage, type Quote, type QuoteRequest, QuotesModule, RateLimitError, type RateLimitStatus, type RotateResult, SDK_VERSION, type SOV, type SOVLocation, SOVModule, type SearchInput, SignupModule, type StartBondQuoteInput, type SubmitFeedbackInput, type SubmitQuoteResponse, type TermsAcceptance, type TermsInfo, TermsModule, type UploadDocumentInput, type UploadSOVRequest, type UploadSOVResponse, UsageModule, type UsageSummary, ValidationError, type WaitForExtractionOptions, type WaitForMatchOptions, createClientFromEnv, createDeviceLogin, createSignup, newDeviceSecret };
package/dist/index.js CHANGED
@@ -55,6 +55,7 @@ __export(index_exports, {
55
55
  SDK_VERSION: () => SDK_VERSION,
56
56
  SOVModule: () => SOVModule,
57
57
  SignupModule: () => SignupModule,
58
+ TermsModule: () => TermsModule,
58
59
  UsageModule: () => UsageModule,
59
60
  ValidationError: () => ValidationError,
60
61
  createClientFromEnv: () => createClientFromEnv,
@@ -157,7 +158,7 @@ var NotImplementedError = class extends DeleganceError {
157
158
  };
158
159
 
159
160
  // src/utils/http.ts
160
- var SDK_VERSION = "0.2.1";
161
+ var SDK_VERSION = "0.3.0";
161
162
  var DEFAULT_BASE_URL = "https://portal.delegancebrokerage.com";
162
163
  function isRetryableStatus(status) {
163
164
  return status >= 500 && status !== 501;
@@ -1850,6 +1851,27 @@ var FeedbackModule = class {
1850
1851
  }
1851
1852
  };
1852
1853
 
1854
+ // src/modules/terms.ts
1855
+ var TermsModule = class {
1856
+ constructor(http) {
1857
+ this.http = http;
1858
+ }
1859
+ /** The current version, the Terms / Privacy / SLA links, and the summaries to show. */
1860
+ async get() {
1861
+ const res = await this.http.request({ method: "GET", path: "/api/v1/legal/terms" });
1862
+ return res.data;
1863
+ }
1864
+ /** Accept `version` (it must be the current one; read it with `get`). */
1865
+ async accept(version) {
1866
+ const res = await this.http.request({
1867
+ method: "POST",
1868
+ path: "/api/v1/legal/terms/accept",
1869
+ body: { termsAccepted: true, termsVersion: version }
1870
+ });
1871
+ return res.data;
1872
+ }
1873
+ };
1874
+
1853
1875
  // src/modules/signup.ts
1854
1876
  var import_crypto7 = require("crypto");
1855
1877
 
@@ -1901,6 +1923,15 @@ var SignupModule = class {
1901
1923
  ...res.warnings?.length ? { warnings: res.warnings } : {}
1902
1924
  };
1903
1925
  }
1926
+ /** The current Terms of Service version and links. Public: no key. */
1927
+ async getTerms() {
1928
+ const res = await this.makeHttp("").request({ method: "GET", path: "/api/v1/legal/terms" });
1929
+ return res.data;
1930
+ }
1931
+ /**
1932
+ * Register this terminal. The server refuses without `termsAccepted: true`
1933
+ * and the CURRENT `termsVersion` (from `getTerms`).
1934
+ */
1904
1935
  async enroll(bootstrapKey, input) {
1905
1936
  const res = await this.makeHttp(bootstrapKey).request({
1906
1937
  method: "POST",
@@ -2031,6 +2062,7 @@ var DeleganceClient = class {
2031
2062
  this.claims = new ClaimsModule(this.http);
2032
2063
  this.feedback = new FeedbackModule(this.http);
2033
2064
  this.auth = new AuthModule(this.http);
2065
+ this.terms = new TermsModule(this.http);
2034
2066
  }
2035
2067
  /**
2036
2068
  * Get the SDK version
@@ -2114,6 +2146,7 @@ function createDeviceLogin(config = {}) {
2114
2146
  SDK_VERSION,
2115
2147
  SOVModule,
2116
2148
  SignupModule,
2149
+ TermsModule,
2117
2150
  UsageModule,
2118
2151
  ValidationError,
2119
2152
  createClientFromEnv,
package/dist/index.mjs CHANGED
@@ -91,7 +91,7 @@ var NotImplementedError = class extends DeleganceError {
91
91
  };
92
92
 
93
93
  // src/utils/http.ts
94
- var SDK_VERSION = "0.2.1";
94
+ var SDK_VERSION = "0.3.0";
95
95
  var DEFAULT_BASE_URL = "https://portal.delegancebrokerage.com";
96
96
  function isRetryableStatus(status) {
97
97
  return status >= 500 && status !== 501;
@@ -1784,6 +1784,27 @@ var FeedbackModule = class {
1784
1784
  }
1785
1785
  };
1786
1786
 
1787
+ // src/modules/terms.ts
1788
+ var TermsModule = class {
1789
+ constructor(http) {
1790
+ this.http = http;
1791
+ }
1792
+ /** The current version, the Terms / Privacy / SLA links, and the summaries to show. */
1793
+ async get() {
1794
+ const res = await this.http.request({ method: "GET", path: "/api/v1/legal/terms" });
1795
+ return res.data;
1796
+ }
1797
+ /** Accept `version` (it must be the current one; read it with `get`). */
1798
+ async accept(version) {
1799
+ const res = await this.http.request({
1800
+ method: "POST",
1801
+ path: "/api/v1/legal/terms/accept",
1802
+ body: { termsAccepted: true, termsVersion: version }
1803
+ });
1804
+ return res.data;
1805
+ }
1806
+ };
1807
+
1787
1808
  // src/modules/signup.ts
1788
1809
  import { createHash, randomBytes, randomUUID as randomUUID7 } from "crypto";
1789
1810
 
@@ -1835,6 +1856,15 @@ var SignupModule = class {
1835
1856
  ...res.warnings?.length ? { warnings: res.warnings } : {}
1836
1857
  };
1837
1858
  }
1859
+ /** The current Terms of Service version and links. Public: no key. */
1860
+ async getTerms() {
1861
+ const res = await this.makeHttp("").request({ method: "GET", path: "/api/v1/legal/terms" });
1862
+ return res.data;
1863
+ }
1864
+ /**
1865
+ * Register this terminal. The server refuses without `termsAccepted: true`
1866
+ * and the CURRENT `termsVersion` (from `getTerms`).
1867
+ */
1838
1868
  async enroll(bootstrapKey, input) {
1839
1869
  const res = await this.makeHttp(bootstrapKey).request({
1840
1870
  method: "POST",
@@ -1965,6 +1995,7 @@ var DeleganceClient = class {
1965
1995
  this.claims = new ClaimsModule(this.http);
1966
1996
  this.feedback = new FeedbackModule(this.http);
1967
1997
  this.auth = new AuthModule(this.http);
1998
+ this.terms = new TermsModule(this.http);
1968
1999
  }
1969
2000
  /**
1970
2001
  * Get the SDK version
@@ -2047,6 +2078,7 @@ export {
2047
2078
  SDK_VERSION,
2048
2079
  SOVModule,
2049
2080
  SignupModule,
2081
+ TermsModule,
2050
2082
  UsageModule,
2051
2083
  ValidationError,
2052
2084
  createClientFromEnv,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@delegance/sdk",
3
- "version": "0.2.1",
3
+ "version": "0.3.0",
4
4
  "description": "Get commercial insurance quotes from your code: TypeScript SDK for the Delegance API (instant quotes, signup, policies, certificates)",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",