@puntjes/sdk 2.0.0 → 2.2.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.
@@ -1,4 +1,5 @@
1
1
  export declare const ErrorCode: {
2
+ readonly AppleWalletUnavailable: "APPLE_WALLET_UNAVAILABLE";
2
3
  readonly BatchTooLarge: "BATCH_TOO_LARGE";
3
4
  readonly BranchInactive: "BRANCH_INACTIVE";
4
5
  readonly BranchNotFound: "BRANCH_NOT_FOUND";
@@ -1,5 +1,6 @@
1
1
  // This file is generated by tools/codegen.ts from the x-error-codes of spec/api.json. Do not edit.
2
2
  export const ErrorCode = {
3
+ AppleWalletUnavailable: 'APPLE_WALLET_UNAVAILABLE',
3
4
  BatchTooLarge: 'BATCH_TOO_LARGE',
4
5
  BranchInactive: 'BRANCH_INACTIVE',
5
6
  BranchNotFound: 'BRANCH_NOT_FOUND',
@@ -53,6 +54,7 @@ export const ErrorCode = {
53
54
  WalletNotFound: 'WALLET_NOT_FOUND',
54
55
  };
55
56
  export const errorCodeStatus = {
57
+ APPLE_WALLET_UNAVAILABLE: 503,
56
58
  BATCH_TOO_LARGE: 422,
57
59
  BRANCH_INACTIVE: 422,
58
60
  BRANCH_NOT_FOUND: 422,
@@ -1,2 +1,2 @@
1
1
  export { type Options, PuntjesApi } from './sdk.gen.js';
2
- export type { AdjustWalletApiData, AdjustWalletData, AdjustWalletError, AdjustWalletErrors, AdjustWalletResponse, AdjustWalletResponses, AnniversaryCampaignConfigData, BranchReferenceData, BulkUpsertProductsData, BulkUpsertProductsError, BulkUpsertProductsErrors, BulkUpsertProductsResponse, BulkUpsertProductsResponses, BulkUpsertResponseData, BulkUpsertResultData, BulkUpsertSummaryData, CampaignListData, CampaignProductRuleData, CampaignStatusData, CampaignVoucherLookupData, CampaignVoucherVerificationData, CategoryRevenueData, CheckHealthData, CheckHealthError, CheckHealthErrors, CheckHealthResponse, CheckHealthResponses, ClientOptions, CommerceStatisticsData, CreateCustomerData, CreateIdentifierData, CreateProductData, CreateProductData2, CreateProductError, CreateProductErrors, CreateProductResponse, CreateProductResponses, CreateRedemptionData, CreateRewardFromProductData, CreateRewardFromProductData2, CreateRewardFromProductError, CreateRewardFromProductErrors, CreateRewardFromProductResponse, CreateRewardFromProductResponses, CreateTransactionData, CreateTransactionItemData, CustomerData, CustomerDetailData, CustomerIdentifierData, CustomerLookupData, CustomerStatusData, CustomerVoucherData, DateRangeRecurrenceData, DaysOfWeekRecurrenceData, DeleteProductData, DeleteProductError, DeleteProductErrors, DeleteProductResponse, DeleteProductResponses, DiscountGiftData, DiscountRedemptionData, DownloadWalletPassData, DownloadWalletPassError, DownloadWalletPassErrors, DownloadWalletPassResponse, DownloadWalletPassResponses, EarnResultData, ErrorResponse, FixedDiscountData, FreeProductGiftData, FreeProductRedemptionData, GiftProductData, GoogleWalletPassData, ItemizedStatisticsData, LedgerEntryData, LinkCustomerExternalIdData, LinkCustomerExternalIdError, LinkCustomerExternalIdErrors, LinkCustomerExternalIdResponse, LinkCustomerExternalIdResponses, LinkExternalIdData, ListCampaignsData, ListCampaignsError, ListCampaignsErrors, ListCampaignsResponse, ListCampaignsResponses, ListCustomerRedemptionsData, ListCustomerRedemptionsError, ListCustomerRedemptionsErrors, ListCustomerRedemptionsResponse, ListCustomerRedemptionsResponses, ListCustomerTransactionsData, ListCustomerTransactionsError, ListCustomerTransactionsErrors, ListCustomerTransactionsResponse, ListCustomerTransactionsResponses, ListCustomerVouchersData, ListCustomerVouchersError, ListCustomerVouchersErrors, ListCustomerVouchersResponse, ListCustomerVouchersResponses, ListLedgerEntriesData, ListLedgerEntriesError, ListLedgerEntriesErrors, ListLedgerEntriesResponse, ListLedgerEntriesResponses, ListProductsData, ListProductsError, ListProductsErrors, ListProductsResponse, ListProductsResponses, ListRewardsData, ListRewardsError, ListRewardsErrors, ListRewardsResponse, ListRewardsResponses, LookupCustomerData, LookupCustomerError, LookupCustomerErrors, LookupCustomerResponse, LookupCustomerResponses, LookupRedemptionData, LookupRedemptionError, LookupRedemptionErrors, LookupRedemptionResponse, LookupRedemptionResponses, LookupVoucherData, LookupVoucherError, LookupVoucherErrors, LookupVoucherResponse, LookupVoucherResponses, LoyaltyStatisticsData, MomentCampaignConfigData, NthPurchaseCampaignConfigData, PaginationLinks, PaginationMeta, PercentageDiscountData, PointsGiftData, ProductData, RedeemRewardData, RedeemRewardError, RedeemRewardErrors, RedeemRewardResponse, RedeemRewardResponses, RedemptionCreatedData, RedemptionCustomerData, RedemptionLookupData, RedemptionRewardData, RedemptionVerificationData, RegisterCustomerData, RegisterCustomerError, RegisterCustomerErrors, RegisterCustomerResponse, RegisterCustomerResponses, ReplaceCustomerByExternalIdData, ReplaceCustomerByExternalIdError, ReplaceCustomerByExternalIdErrors, ReplaceCustomerByExternalIdResponse, ReplaceCustomerByExternalIdResponses, RewardCatalogItemData, RewardData, RewardStatusData, SendLoyaltyCardByExternalIdData, SendLoyaltyCardByExternalIdError, SendLoyaltyCardByExternalIdErrors, SendLoyaltyCardByExternalIdResponse, SendLoyaltyCardByExternalIdResponses, SendLoyaltyCardData, SendLoyaltyCardError, SendLoyaltyCardErrors, SendLoyaltyCardRequestData, SendLoyaltyCardResponse, SendLoyaltyCardResponses, SendLoyaltyCardResultData, ShowCustomerData, ShowCustomerError, ShowCustomerErrors, ShowCustomerResponse, ShowCustomerResponses, ShowMeData, ShowMeError, ShowMeErrors, ShowMeResponse, ShowMeResponses, ShowProductData, ShowProductError, ShowProductErrors, ShowProductResponse, ShowProductResponses, ShowStatisticsData, ShowStatisticsError, ShowStatisticsErrors, ShowStatisticsResponse, ShowStatisticsResponses, ShowWalletData, ShowWalletError, ShowWalletErrors, ShowWalletResponse, ShowWalletResponses, SpecificDatesRecurrenceData, StatisticsApiData, StatisticsPeriodData, SubmitTransactionData, SubmitTransactionError, SubmitTransactionErrors, SubmitTransactionResponse, SubmitTransactionResponses, TopProductData, TransactionCampaignConfigData, TransactionData, TransactionItemData, UpdateCustomerByExternalIdData, UpdateCustomerByExternalIdError, UpdateCustomerByExternalIdErrors, UpdateCustomerByExternalIdResponse, UpdateCustomerByExternalIdResponses, UpdateCustomerData, UpdateProductData, UpdateProductData2, UpdateProductError, UpdateProductErrors, UpdateProductResponse, UpdateProductResponses, UpsertProductData, UpsertProductData2, UpsertProductError, UpsertProductErrors, UpsertProductResponse, UpsertProductResponses, VendorBrandingData, VerifyCampaignVoucherData, VerifyRedemptionData, VerifyRedemptionError, VerifyRedemptionErrors, VerifyRedemptionResponse, VerifyRedemptionResponses, VerifyVoucherData, VerifyVoucherError, VerifyVoucherErrors, VerifyVoucherResponse, VerifyVoucherResponses, VolumeBucketData, VoucherFixedDiscountData, VoucherGiftProductData, VoucherPercentageDiscountData, WalletData, WinBackCampaignConfigData } from './types.gen.js';
2
+ export type { AdjustWalletApiData, AdjustWalletData, AdjustWalletError, AdjustWalletErrors, AdjustWalletResponse, AdjustWalletResponses, AnniversaryCampaignConfigData, BranchReferenceData, BulkUpsertProductsData, BulkUpsertProductsError, BulkUpsertProductsErrors, BulkUpsertProductsResponse, BulkUpsertProductsResponses, BulkUpsertResponseData, BulkUpsertResultData, BulkUpsertSummaryData, CampaignListData, CampaignProductRuleData, CampaignStatusData, CampaignVoucherLookupData, CampaignVoucherVerificationData, CategoryRevenueData, CheckHealthData, CheckHealthError, CheckHealthErrors, CheckHealthResponse, CheckHealthResponses, ClientOptions, CommerceStatisticsData, CreateCustomerData, CreateIdentifierData, CreateProductData, CreateProductData2, CreateProductError, CreateProductErrors, CreateProductResponse, CreateProductResponses, CreateRedemptionData, CreateRewardFromProductData, CreateRewardFromProductData2, CreateRewardFromProductError, CreateRewardFromProductErrors, CreateRewardFromProductResponse, CreateRewardFromProductResponses, CreateTransactionData, CreateTransactionItemData, CustomerData, CustomerDetailData, CustomerIdentifierData, CustomerLookupData, CustomerStatusData, CustomerVoucherData, DateRangeRecurrenceData, DaysOfWeekRecurrenceData, DeleteProductData, DeleteProductError, DeleteProductErrors, DeleteProductResponse, DeleteProductResponses, DiscountGiftData, DiscountRedemptionData, DownloadWalletPassData, DownloadWalletPassError, DownloadWalletPassErrors, DownloadWalletPassResponse, DownloadWalletPassResponses, EarnResultData, ErrorResponse, FixedDiscountData, FreeProductGiftData, FreeProductRedemptionData, GiftProductData, GoogleWalletPassData, ItemizedStatisticsData, LedgerEntryData, LinkCustomerExternalIdData, LinkCustomerExternalIdError, LinkCustomerExternalIdErrors, LinkCustomerExternalIdResponse, LinkCustomerExternalIdResponses, LinkExternalIdData, ListBranchesData, ListBranchesError, ListBranchesErrors, ListBranchesResponse, ListBranchesResponses, ListCampaignsData, ListCampaignsError, ListCampaignsErrors, ListCampaignsResponse, ListCampaignsResponses, ListCustomerRedemptionsData, ListCustomerRedemptionsError, ListCustomerRedemptionsErrors, ListCustomerRedemptionsResponse, ListCustomerRedemptionsResponses, ListCustomerTransactionsData, ListCustomerTransactionsError, ListCustomerTransactionsErrors, ListCustomerTransactionsResponse, ListCustomerTransactionsResponses, ListCustomerVouchersData, ListCustomerVouchersError, ListCustomerVouchersErrors, ListCustomerVouchersResponse, ListCustomerVouchersResponses, ListLedgerEntriesData, ListLedgerEntriesError, ListLedgerEntriesErrors, ListLedgerEntriesResponse, ListLedgerEntriesResponses, ListProductsData, ListProductsError, ListProductsErrors, ListProductsResponse, ListProductsResponses, ListRewardsData, ListRewardsError, ListRewardsErrors, ListRewardsResponse, ListRewardsResponses, LookupCustomerData, LookupCustomerError, LookupCustomerErrors, LookupCustomerResponse, LookupCustomerResponses, LookupRedemptionData, LookupRedemptionError, LookupRedemptionErrors, LookupRedemptionResponse, LookupRedemptionResponses, LookupVoucherData, LookupVoucherError, LookupVoucherErrors, LookupVoucherResponse, LookupVoucherResponses, LoyaltyStatisticsData, MomentCampaignConfigData, NthPurchaseCampaignConfigData, PaginationLinks, PaginationMeta, PercentageDiscountData, PointsGiftData, ProductData, RedeemRewardData, RedeemRewardError, RedeemRewardErrors, RedeemRewardResponse, RedeemRewardResponses, RedemptionCreatedData, RedemptionCustomerData, RedemptionLookupData, RedemptionRewardData, RedemptionVerificationData, RegisterCustomerData, RegisterCustomerError, RegisterCustomerErrors, RegisterCustomerResponse, RegisterCustomerResponses, ReplaceCustomerByExternalIdData, ReplaceCustomerByExternalIdError, ReplaceCustomerByExternalIdErrors, ReplaceCustomerByExternalIdResponse, ReplaceCustomerByExternalIdResponses, RewardCatalogItemData, RewardData, RewardStatusData, SendLoyaltyCardByExternalIdData, SendLoyaltyCardByExternalIdError, SendLoyaltyCardByExternalIdErrors, SendLoyaltyCardByExternalIdResponse, SendLoyaltyCardByExternalIdResponses, SendLoyaltyCardData, SendLoyaltyCardError, SendLoyaltyCardErrors, SendLoyaltyCardRequestData, SendLoyaltyCardResponse, SendLoyaltyCardResponses, SendLoyaltyCardResultData, ShowCustomerData, ShowCustomerError, ShowCustomerErrors, ShowCustomerResponse, ShowCustomerResponses, ShowMeData, ShowMeError, ShowMeErrors, ShowMeResponse, ShowMeResponses, ShowProductData, ShowProductError, ShowProductErrors, ShowProductResponse, ShowProductResponses, ShowStatisticsData, ShowStatisticsError, ShowStatisticsErrors, ShowStatisticsResponse, ShowStatisticsResponses, ShowWalletData, ShowWalletError, ShowWalletErrors, ShowWalletResponse, ShowWalletResponses, SpecificDatesRecurrenceData, StatisticsApiData, StatisticsPeriodData, SubmitTransactionData, SubmitTransactionError, SubmitTransactionErrors, SubmitTransactionResponse, SubmitTransactionResponses, TopProductData, TransactionCampaignConfigData, TransactionData, TransactionItemData, UpdateCustomerByExternalIdData, UpdateCustomerByExternalIdError, UpdateCustomerByExternalIdErrors, UpdateCustomerByExternalIdResponse, UpdateCustomerByExternalIdResponses, UpdateCustomerData, UpdateProductData, UpdateProductData2, UpdateProductError, UpdateProductErrors, UpdateProductResponse, UpdateProductResponses, UpsertProductData, UpsertProductData2, UpsertProductError, UpsertProductErrors, UpsertProductResponse, UpsertProductResponses, VendorBrandingData, VerifyCampaignVoucherData, VerifyRedemptionData, VerifyRedemptionData2, VerifyRedemptionError, VerifyRedemptionErrors, VerifyRedemptionResponse, VerifyRedemptionResponses, VerifyVoucherData, VerifyVoucherError, VerifyVoucherErrors, VerifyVoucherResponse, VerifyVoucherResponses, VolumeBucketData, VoucherFixedDiscountData, VoucherGiftProductData, VoucherPercentageDiscountData, WalletData, WinBackCampaignConfigData } from './types.gen.js';
@@ -1,5 +1,5 @@
1
1
  import type { Client, ClientMeta, Options as Options2, RequestResult, TDataShape } from './client/index.js';
2
- import type { AdjustWalletData, AdjustWalletErrors, AdjustWalletResponses, BulkUpsertProductsData, BulkUpsertProductsErrors, BulkUpsertProductsResponses, CheckHealthData, CheckHealthErrors, CheckHealthResponses, CreateProductData2, CreateProductErrors, CreateProductResponses, CreateRewardFromProductData2, CreateRewardFromProductErrors, CreateRewardFromProductResponses, DeleteProductData, DeleteProductErrors, DeleteProductResponses, DownloadWalletPassData, DownloadWalletPassErrors, DownloadWalletPassResponses, LinkCustomerExternalIdData, LinkCustomerExternalIdErrors, LinkCustomerExternalIdResponses, ListCampaignsData, ListCampaignsErrors, ListCampaignsResponses, ListCustomerRedemptionsData, ListCustomerRedemptionsErrors, ListCustomerRedemptionsResponses, ListCustomerTransactionsData, ListCustomerTransactionsErrors, ListCustomerTransactionsResponses, ListCustomerVouchersData, ListCustomerVouchersErrors, ListCustomerVouchersResponses, ListLedgerEntriesData, ListLedgerEntriesErrors, ListLedgerEntriesResponses, ListProductsData, ListProductsErrors, ListProductsResponses, ListRewardsData, ListRewardsErrors, ListRewardsResponses, LookupCustomerData, LookupCustomerErrors, LookupCustomerResponses, LookupRedemptionData, LookupRedemptionErrors, LookupRedemptionResponses, LookupVoucherData, LookupVoucherErrors, LookupVoucherResponses, RedeemRewardData, RedeemRewardErrors, RedeemRewardResponses, RegisterCustomerData, RegisterCustomerErrors, RegisterCustomerResponses, ReplaceCustomerByExternalIdData, ReplaceCustomerByExternalIdErrors, ReplaceCustomerByExternalIdResponses, SendLoyaltyCardByExternalIdData, SendLoyaltyCardByExternalIdErrors, SendLoyaltyCardByExternalIdResponses, SendLoyaltyCardData, SendLoyaltyCardErrors, SendLoyaltyCardResponses, ShowCustomerData, ShowCustomerErrors, ShowCustomerResponses, ShowMeData, ShowMeErrors, ShowMeResponses, ShowProductData, ShowProductErrors, ShowProductResponses, ShowStatisticsData, ShowStatisticsErrors, ShowStatisticsResponses, ShowWalletData, ShowWalletErrors, ShowWalletResponses, SubmitTransactionData, SubmitTransactionErrors, SubmitTransactionResponses, UpdateCustomerByExternalIdData, UpdateCustomerByExternalIdErrors, UpdateCustomerByExternalIdResponses, UpdateProductData2, UpdateProductErrors, UpdateProductResponses, UpsertProductData2, UpsertProductErrors, UpsertProductResponses, VerifyRedemptionData, VerifyRedemptionErrors, VerifyRedemptionResponses, VerifyVoucherData, VerifyVoucherErrors, VerifyVoucherResponses } from './types.gen.js';
2
+ import type { AdjustWalletData, AdjustWalletErrors, AdjustWalletResponses, BulkUpsertProductsData, BulkUpsertProductsErrors, BulkUpsertProductsResponses, CheckHealthData, CheckHealthErrors, CheckHealthResponses, CreateProductData2, CreateProductErrors, CreateProductResponses, CreateRewardFromProductData2, CreateRewardFromProductErrors, CreateRewardFromProductResponses, DeleteProductData, DeleteProductErrors, DeleteProductResponses, DownloadWalletPassData, DownloadWalletPassErrors, DownloadWalletPassResponses, LinkCustomerExternalIdData, LinkCustomerExternalIdErrors, LinkCustomerExternalIdResponses, ListBranchesData, ListBranchesErrors, ListBranchesResponses, ListCampaignsData, ListCampaignsErrors, ListCampaignsResponses, ListCustomerRedemptionsData, ListCustomerRedemptionsErrors, ListCustomerRedemptionsResponses, ListCustomerTransactionsData, ListCustomerTransactionsErrors, ListCustomerTransactionsResponses, ListCustomerVouchersData, ListCustomerVouchersErrors, ListCustomerVouchersResponses, ListLedgerEntriesData, ListLedgerEntriesErrors, ListLedgerEntriesResponses, ListProductsData, ListProductsErrors, ListProductsResponses, ListRewardsData, ListRewardsErrors, ListRewardsResponses, LookupCustomerData, LookupCustomerErrors, LookupCustomerResponses, LookupRedemptionData, LookupRedemptionErrors, LookupRedemptionResponses, LookupVoucherData, LookupVoucherErrors, LookupVoucherResponses, RedeemRewardData, RedeemRewardErrors, RedeemRewardResponses, RegisterCustomerData, RegisterCustomerErrors, RegisterCustomerResponses, ReplaceCustomerByExternalIdData, ReplaceCustomerByExternalIdErrors, ReplaceCustomerByExternalIdResponses, SendLoyaltyCardByExternalIdData, SendLoyaltyCardByExternalIdErrors, SendLoyaltyCardByExternalIdResponses, SendLoyaltyCardData, SendLoyaltyCardErrors, SendLoyaltyCardResponses, ShowCustomerData, ShowCustomerErrors, ShowCustomerResponses, ShowMeData, ShowMeErrors, ShowMeResponses, ShowProductData, ShowProductErrors, ShowProductResponses, ShowStatisticsData, ShowStatisticsErrors, ShowStatisticsResponses, ShowWalletData, ShowWalletErrors, ShowWalletResponses, SubmitTransactionData, SubmitTransactionErrors, SubmitTransactionResponses, UpdateCustomerByExternalIdData, UpdateCustomerByExternalIdErrors, UpdateCustomerByExternalIdResponses, UpdateProductData2, UpdateProductErrors, UpdateProductResponses, UpsertProductData2, UpsertProductErrors, UpsertProductResponses, VerifyRedemptionData2, VerifyRedemptionErrors, VerifyRedemptionResponses, VerifyVoucherData, VerifyVoucherErrors, VerifyVoucherResponses } from './types.gen.js';
3
3
  export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponse = unknown> = Options2<TData, ThrowOnError, TResponse> & {
4
4
  /**
5
5
  * You can provide a client instance returned by `createClient()` instead of
@@ -32,7 +32,7 @@ export declare class PuntjesApi extends HeyApiClient {
32
32
  key?: string;
33
33
  });
34
34
  lookupCustomer<ThrowOnError extends boolean = true>(options?: Options<LookupCustomerData, ThrowOnError>): RequestResult<LookupCustomerResponses, LookupCustomerErrors, ThrowOnError>;
35
- registerCustomer<ThrowOnError extends boolean = true>(options: Options<RegisterCustomerData, ThrowOnError>): RequestResult<RegisterCustomerResponses, RegisterCustomerErrors, ThrowOnError>;
35
+ registerCustomer<ThrowOnError extends boolean = true>(options?: Options<RegisterCustomerData, ThrowOnError>): RequestResult<RegisterCustomerResponses, RegisterCustomerErrors, ThrowOnError>;
36
36
  updateCustomerByExternalId<ThrowOnError extends boolean = true>(options: Options<UpdateCustomerByExternalIdData, ThrowOnError>): RequestResult<UpdateCustomerByExternalIdResponses, UpdateCustomerByExternalIdErrors, ThrowOnError>;
37
37
  replaceCustomerByExternalId<ThrowOnError extends boolean = true>(options: Options<ReplaceCustomerByExternalIdData, ThrowOnError>): RequestResult<ReplaceCustomerByExternalIdResponses, ReplaceCustomerByExternalIdErrors, ThrowOnError>;
38
38
  linkCustomerExternalId<ThrowOnError extends boolean = true>(options: Options<LinkCustomerExternalIdData, ThrowOnError>): RequestResult<LinkCustomerExternalIdResponses, LinkCustomerExternalIdErrors, ThrowOnError>;
@@ -49,7 +49,7 @@ export declare class PuntjesApi extends HeyApiClient {
49
49
  listCustomerRedemptions<ThrowOnError extends boolean = true>(options: Options<ListCustomerRedemptionsData, ThrowOnError>): RequestResult<ListCustomerRedemptionsResponses, ListCustomerRedemptionsErrors, ThrowOnError>;
50
50
  redeemReward<ThrowOnError extends boolean = true>(options: Options<RedeemRewardData, ThrowOnError>): RequestResult<RedeemRewardResponses, RedeemRewardErrors, ThrowOnError>;
51
51
  lookupRedemption<ThrowOnError extends boolean = true>(options: Options<LookupRedemptionData, ThrowOnError>): RequestResult<LookupRedemptionResponses, LookupRedemptionErrors, ThrowOnError>;
52
- verifyRedemption<ThrowOnError extends boolean = true>(options: Options<VerifyRedemptionData, ThrowOnError>): RequestResult<VerifyRedemptionResponses, VerifyRedemptionErrors, ThrowOnError>;
52
+ verifyRedemption<ThrowOnError extends boolean = true>(options: Options<VerifyRedemptionData2, ThrowOnError>): RequestResult<VerifyRedemptionResponses, VerifyRedemptionErrors, ThrowOnError>;
53
53
  listProducts<ThrowOnError extends boolean = true>(options?: Options<ListProductsData, ThrowOnError>): RequestResult<ListProductsResponses, ListProductsErrors, ThrowOnError>;
54
54
  createProduct<ThrowOnError extends boolean = true>(options: Options<CreateProductData2, ThrowOnError>): RequestResult<CreateProductResponses, CreateProductErrors, ThrowOnError>;
55
55
  bulkUpsertProducts<ThrowOnError extends boolean = true>(options: Options<BulkUpsertProductsData, ThrowOnError>): RequestResult<BulkUpsertProductsResponses, BulkUpsertProductsErrors, ThrowOnError>;
@@ -64,6 +64,7 @@ export declare class PuntjesApi extends HeyApiClient {
64
64
  verifyVoucher<ThrowOnError extends boolean = true>(options: Options<VerifyVoucherData, ThrowOnError>): RequestResult<VerifyVoucherResponses, VerifyVoucherErrors, ThrowOnError>;
65
65
  showStatistics<ThrowOnError extends boolean = true>(options?: Options<ShowStatisticsData, ThrowOnError>): RequestResult<ShowStatisticsResponses, ShowStatisticsErrors, ThrowOnError>;
66
66
  showMe<ThrowOnError extends boolean = true>(options?: Options<ShowMeData, ThrowOnError>): RequestResult<ShowMeResponses, ShowMeErrors, ThrowOnError>;
67
+ listBranches<ThrowOnError extends boolean = true>(options?: Options<ListBranchesData, ThrowOnError>): RequestResult<ListBranchesResponses, ListBranchesErrors, ThrowOnError>;
67
68
  checkHealth<ThrowOnError extends boolean = true>(options?: Options<CheckHealthData, ThrowOnError>): RequestResult<CheckHealthResponses, CheckHealthErrors, ThrowOnError>;
68
69
  }
69
70
  export {};
@@ -34,13 +34,13 @@ export class PuntjesApi extends HeyApiClient {
34
34
  });
35
35
  }
36
36
  registerCustomer(options) {
37
- return (options.client ?? this.client).post({
37
+ return (options?.client ?? this.client).post({
38
38
  security: [{ scheme: 'bearer', type: 'http' }],
39
39
  url: '/customers',
40
40
  ...options,
41
41
  headers: {
42
42
  'Content-Type': 'application/json',
43
- ...options.headers
43
+ ...options?.headers
44
44
  }
45
45
  });
46
46
  }
@@ -192,7 +192,11 @@ export class PuntjesApi extends HeyApiClient {
192
192
  return (options.client ?? this.client).post({
193
193
  security: [{ scheme: 'bearer', type: 'http' }],
194
194
  url: '/redemptions/{code}/verify',
195
- ...options
195
+ ...options,
196
+ headers: {
197
+ 'Content-Type': 'application/json',
198
+ ...options.headers
199
+ }
196
200
  });
197
201
  }
198
202
  listProducts(options) {
@@ -317,6 +321,13 @@ export class PuntjesApi extends HeyApiClient {
317
321
  ...options
318
322
  });
319
323
  }
324
+ listBranches(options) {
325
+ return (options?.client ?? this.client).get({
326
+ security: [{ scheme: 'bearer', type: 'http' }],
327
+ url: '/branches',
328
+ ...options
329
+ });
330
+ }
320
331
  checkHealth(options) {
321
332
  return (options?.client ?? this.client).get({ url: '/health', ...options });
322
333
  }
@@ -876,6 +876,10 @@ export type RedemptionCreatedData = {
876
876
  } & DiscountRedemptionData) | ({
877
877
  type: 'free_product';
878
878
  } & FreeProductRedemptionData);
879
+ /**
880
+ * The branches the reward has now; null means every branch.
881
+ */
882
+ branches: Array<BranchReferenceData> | null;
879
883
  };
880
884
  /**
881
885
  * RedemptionCustomerData
@@ -904,6 +908,10 @@ export type RedemptionLookupData = {
904
908
  } & DiscountRedemptionData) | ({
905
909
  type: 'free_product';
906
910
  } & FreeProductRedemptionData);
911
+ /**
912
+ * The branches the reward has now; null means every branch.
913
+ */
914
+ branches: Array<BranchReferenceData> | null;
907
915
  };
908
916
  /**
909
917
  * RedemptionRewardData
@@ -911,6 +919,10 @@ export type RedemptionLookupData = {
911
919
  export type RedemptionRewardData = {
912
920
  name: string;
913
921
  type: string;
922
+ /**
923
+ * The reward's id, the one GET /rewards lists.
924
+ */
925
+ id: number;
914
926
  };
915
927
  /**
916
928
  * RedemptionVerificationData
@@ -930,6 +942,10 @@ export type RedemptionVerificationData = {
930
942
  } & DiscountRedemptionData) | ({
931
943
  type: 'free_product';
932
944
  } & FreeProductRedemptionData);
945
+ /**
946
+ * The branches the reward has now; null means every branch.
947
+ */
948
+ branches: Array<BranchReferenceData> | null;
933
949
  };
934
950
  /**
935
951
  * RewardCatalogItemData
@@ -1181,6 +1197,7 @@ export type VendorBrandingData = {
1181
1197
  logo_url: string | null;
1182
1198
  brand_color_primary: string | null;
1183
1199
  brand_color_accent: string | null;
1200
+ default_branch: BranchReferenceData | null;
1184
1201
  };
1185
1202
  /**
1186
1203
  * VerifyCampaignVoucherData
@@ -1189,6 +1206,13 @@ export type VerifyCampaignVoucherData = {
1189
1206
  branch?: string | null;
1190
1207
  idempotency_key?: string | null;
1191
1208
  };
1209
+ /**
1210
+ * VerifyRedemptionData
1211
+ */
1212
+ export type VerifyRedemptionData = {
1213
+ branch?: string | null;
1214
+ idempotency_key?: string | null;
1215
+ };
1192
1216
  /**
1193
1217
  * VolumeBucketData
1194
1218
  */
@@ -1345,7 +1369,7 @@ export type LookupCustomerResponses = {
1345
1369
  };
1346
1370
  export type LookupCustomerResponse = LookupCustomerResponses[keyof LookupCustomerResponses];
1347
1371
  export type RegisterCustomerData = {
1348
- body: CreateCustomerData;
1372
+ body?: CreateCustomerData;
1349
1373
  path?: never;
1350
1374
  query?: never;
1351
1375
  url: '/customers';
@@ -1392,7 +1416,7 @@ export type RegisterCustomerResponses = {
1392
1416
  };
1393
1417
  export type RegisterCustomerResponse = RegisterCustomerResponses[keyof RegisterCustomerResponses];
1394
1418
  export type UpdateCustomerByExternalIdData = {
1395
- body: UpdateCustomerData;
1419
+ body?: UpdateCustomerData;
1396
1420
  path: {
1397
1421
  externalId: string | null;
1398
1422
  };
@@ -1445,7 +1469,7 @@ export type UpdateCustomerByExternalIdResponses = {
1445
1469
  };
1446
1470
  export type UpdateCustomerByExternalIdResponse = UpdateCustomerByExternalIdResponses[keyof UpdateCustomerByExternalIdResponses];
1447
1471
  export type ReplaceCustomerByExternalIdData = {
1448
- body: UpdateCustomerData;
1472
+ body?: UpdateCustomerData;
1449
1473
  path: {
1450
1474
  externalId: string | null;
1451
1475
  };
@@ -1549,7 +1573,7 @@ export type LinkCustomerExternalIdResponses = {
1549
1573
  };
1550
1574
  export type LinkCustomerExternalIdResponse = LinkCustomerExternalIdResponses[keyof LinkCustomerExternalIdResponses];
1551
1575
  export type SendLoyaltyCardByExternalIdData = {
1552
- body: SendLoyaltyCardRequestData;
1576
+ body?: SendLoyaltyCardRequestData;
1553
1577
  path: {
1554
1578
  externalId: string | null;
1555
1579
  };
@@ -1598,7 +1622,7 @@ export type SendLoyaltyCardByExternalIdResponses = {
1598
1622
  };
1599
1623
  export type SendLoyaltyCardByExternalIdResponse = SendLoyaltyCardByExternalIdResponses[keyof SendLoyaltyCardByExternalIdResponses];
1600
1624
  export type SendLoyaltyCardData = {
1601
- body: SendLoyaltyCardRequestData;
1625
+ body?: SendLoyaltyCardRequestData;
1602
1626
  path: {
1603
1627
  customer: string | null;
1604
1628
  };
@@ -1901,6 +1925,10 @@ export type DownloadWalletPassErrors = {
1901
1925
  * Something went wrong on our side. Quote the request_id when you report it.
1902
1926
  */
1903
1927
  500: ErrorResponse;
1928
+ /**
1929
+ * A service the request needs is not ready yet. Retry after the seconds in the Retry-After header.
1930
+ */
1931
+ 503: ErrorResponse;
1904
1932
  };
1905
1933
  export type DownloadWalletPassError = DownloadWalletPassErrors[keyof DownloadWalletPassErrors];
1906
1934
  export type DownloadWalletPassResponses = {
@@ -2128,8 +2156,8 @@ export type LookupRedemptionResponses = {
2128
2156
  };
2129
2157
  };
2130
2158
  export type LookupRedemptionResponse = LookupRedemptionResponses[keyof LookupRedemptionResponses];
2131
- export type VerifyRedemptionData = {
2132
- body?: never;
2159
+ export type VerifyRedemptionData2 = {
2160
+ body?: VerifyRedemptionData;
2133
2161
  path: {
2134
2162
  code: string | null;
2135
2163
  };
@@ -2137,6 +2165,10 @@ export type VerifyRedemptionData = {
2137
2165
  url: '/redemptions/{code}/verify';
2138
2166
  };
2139
2167
  export type VerifyRedemptionErrors = {
2168
+ /**
2169
+ * The request is missing something the API needs before it can act.
2170
+ */
2171
+ 400: ErrorResponse;
2140
2172
  /**
2141
2173
  * The credential is missing, malformed, or not accepted.
2142
2174
  */
@@ -2436,7 +2468,7 @@ export type ShowProductResponses = {
2436
2468
  };
2437
2469
  export type ShowProductResponse = ShowProductResponses[keyof ShowProductResponses];
2438
2470
  export type UpdateProductData2 = {
2439
- body: UpdateProductData;
2471
+ body?: UpdateProductData;
2440
2472
  path: {
2441
2473
  externalId: string | null;
2442
2474
  };
@@ -2649,7 +2681,7 @@ export type LookupVoucherResponses = {
2649
2681
  };
2650
2682
  export type LookupVoucherResponse = LookupVoucherResponses[keyof LookupVoucherResponses];
2651
2683
  export type VerifyVoucherData = {
2652
- body: VerifyCampaignVoucherData;
2684
+ body?: VerifyCampaignVoucherData;
2653
2685
  path: {
2654
2686
  code: string | null;
2655
2687
  };
@@ -2771,6 +2803,37 @@ export type ShowMeResponses = {
2771
2803
  };
2772
2804
  };
2773
2805
  export type ShowMeResponse = ShowMeResponses[keyof ShowMeResponses];
2806
+ export type ListBranchesData = {
2807
+ body?: never;
2808
+ path?: never;
2809
+ query?: never;
2810
+ url: '/branches';
2811
+ };
2812
+ export type ListBranchesErrors = {
2813
+ /**
2814
+ * The credential is missing, malformed, or not accepted.
2815
+ */
2816
+ 401: ErrorResponse;
2817
+ /**
2818
+ * The credential is valid, but this vendor may not do this right now.
2819
+ */
2820
+ 403: ErrorResponse;
2821
+ /**
2822
+ * Too many requests. `x-error-codes` names the limit; not every one of them clears by waiting.
2823
+ */
2824
+ 429: ErrorResponse;
2825
+ /**
2826
+ * Something went wrong on our side. Quote the request_id when you report it.
2827
+ */
2828
+ 500: ErrorResponse;
2829
+ };
2830
+ export type ListBranchesError = ListBranchesErrors[keyof ListBranchesErrors];
2831
+ export type ListBranchesResponses = {
2832
+ 200: {
2833
+ data: Array<BranchReferenceData>;
2834
+ };
2835
+ };
2836
+ export type ListBranchesResponse = ListBranchesResponses[keyof ListBranchesResponses];
2774
2837
  export type CheckHealthData = {
2775
2838
  body?: never;
2776
2839
  path?: never;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@puntjes/sdk",
3
- "version": "2.0.0",
3
+ "version": "2.2.0",
4
4
  "description": "The official TypeScript client for the Puntjes loyalty API.",
5
5
  "license": "MIT",
6
6
  "type": "module",