@nokinc-flur/sdk 0.1.4 → 0.1.5

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.ts CHANGED
@@ -176,6 +176,15 @@ type PushRegisterInput = {
176
176
  platform: PushPlatform;
177
177
  token: string;
178
178
  };
179
+ type CreatePayLinkResponse = {
180
+ token: string;
181
+ };
182
+ type ResolvePayLinkResponse = {
183
+ recipientUserId: string;
184
+ displayName: string;
185
+ normalizedIdentifier: string;
186
+ isActive: boolean;
187
+ };
179
188
  type AuthorizedOptions = {
180
189
  accessToken: string;
181
190
  };
@@ -254,6 +263,8 @@ declare class FlurClient {
254
263
  registerPushToken(input: PushRegisterInput, options: AuthorizedOptions): Promise<{
255
264
  ok: boolean;
256
265
  }>;
266
+ createPayLink(options: AuthorizedOptions): Promise<CreatePayLinkResponse>;
267
+ resolvePayLink(token: string, options: AuthorizedOptions): Promise<ResolvePayLinkResponse>;
257
268
  private requestJson;
258
269
  }
259
270
 
@@ -268,4 +279,4 @@ declare class FlurError extends Error {
268
279
  });
269
280
  }
270
281
 
271
- export { type AccountActivityItem, type AccountSummaryResponse, type AuthLogoutInput, type AuthRefreshInput, type AuthRefreshResponse, type AuthorizeSendWithBiometricInput, type AuthorizedOptions, type BiometricSigner, type CreateTransferOptions, type DeviceTrustState, FlurClient, type FlurClientOptions, FlurError, type ListTransactionsOptions, type Money, type OnboardingCompleteInput, type OnboardingCompleteResponse, type OnboardingFallback, type OnboardingRiskReason, type OnboardingStartInput, type OnboardingStartResponse, type PinSetInput, type PinVerifyInput, type PushPlatform, type PushRegisterInput, type RecipientResolveInput, type RecipientResolveResponse, type RegisterDeviceInput, type RegisterDeviceResponse, type RegisterSendDeviceKeyInput, type SendChallengeInput, type SendChallengeResponse, type SendMoneyInput, type SendMoneyOptions, type SendVerifyInput, type SendVerifyResponse, type TransactionDetailResponse, type TransactionDirection, type TransactionsListResponse, type TransferInput, type TransferResponse, type TransferStatus, formatAmount, moneyMinorToNumber, normalizeE164, parseAmountInput };
282
+ export { type AccountActivityItem, type AccountSummaryResponse, type AuthLogoutInput, type AuthRefreshInput, type AuthRefreshResponse, type AuthorizeSendWithBiometricInput, type AuthorizedOptions, type BiometricSigner, type CreatePayLinkResponse, type CreateTransferOptions, type DeviceTrustState, FlurClient, type FlurClientOptions, FlurError, type ListTransactionsOptions, type Money, type OnboardingCompleteInput, type OnboardingCompleteResponse, type OnboardingFallback, type OnboardingRiskReason, type OnboardingStartInput, type OnboardingStartResponse, type PinSetInput, type PinVerifyInput, type PushPlatform, type PushRegisterInput, type RecipientResolveInput, type RecipientResolveResponse, type RegisterDeviceInput, type RegisterDeviceResponse, type RegisterSendDeviceKeyInput, type ResolvePayLinkResponse, type SendChallengeInput, type SendChallengeResponse, type SendMoneyInput, type SendMoneyOptions, type SendVerifyInput, type SendVerifyResponse, type TransactionDetailResponse, type TransactionDirection, type TransactionsListResponse, type TransferInput, type TransferResponse, type TransferStatus, formatAmount, moneyMinorToNumber, normalizeE164, parseAmountInput };
package/dist/index.js CHANGED
@@ -176,6 +176,15 @@ var PushRegisterRequestSchema = z.object({
176
176
  platform: z.enum(["ios", "android", "web"]),
177
177
  token: z.string().min(16)
178
178
  });
179
+ var CreatePayLinkResponseSchema = z.object({
180
+ token: z.string().min(1)
181
+ });
182
+ var ResolvePayLinkResponseSchema = z.object({
183
+ recipientUserId: UuidSchema,
184
+ displayName: z.string().min(1),
185
+ normalizedIdentifier: z.string().regex(E164Regex),
186
+ isActive: z.boolean()
187
+ });
179
188
 
180
189
  // src/errors.ts
181
190
  var backendErrorCodeSet = /* @__PURE__ */ new Set([
@@ -624,6 +633,34 @@ var FlurClient = class {
624
633
  input
625
634
  );
626
635
  }
636
+ async createPayLink(options) {
637
+ return this.requestJson(
638
+ "/api/v1/pay-links",
639
+ {
640
+ method: "POST",
641
+ headers: {
642
+ "content-type": "application/json",
643
+ authorization: `Bearer ${options.accessToken}`
644
+ }
645
+ },
646
+ void 0,
647
+ CreatePayLinkResponseSchema
648
+ );
649
+ }
650
+ async resolvePayLink(token, options) {
651
+ const encodedToken = encodeURIComponent(token);
652
+ return this.requestJson(
653
+ `/api/v1/pay-links/${encodedToken}`,
654
+ {
655
+ method: "GET",
656
+ headers: {
657
+ authorization: `Bearer ${options.accessToken}`
658
+ }
659
+ },
660
+ void 0,
661
+ ResolvePayLinkResponseSchema
662
+ );
663
+ }
627
664
  async requestJson(path, init, requestSchema, responseSchema, input) {
628
665
  const url = `${this.baseUrl}${path}`;
629
666
  const controller = new AbortController();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nokinc-flur/sdk",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "Flur Wallet SDK (sprint 1 scaffold)",
5
5
  "license": "MIT",
6
6
  "type": "module",