@code.store/arcxp-sdk-ts 5.0.3 → 5.1.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.
@@ -0,0 +1,26 @@
1
+ import { type ArcAPIOptions, ArcAbstractAPI } from '../abstract-api.js';
2
+ import type { GetAllRetailCampaignCategoriesParams, GetAllRetailCampaignCategoriesResponse, GetAllRetailCampaignsParams, GetAllRetailCampaignsResponse, GetAllRetailConditionCategoriesParams, GetAllRetailConditionCategoriesResponse, GetAllRetailOfferAttributesParams, GetAllRetailOfferAttributesResponse, GetAllRetailOffersParams, GetAllRetailOffersResponse, GetAllRetailPricingRatesParams, GetAllRetailPricingRatesResponse, GetAllRetailPricingStrategiesParams, GetAllRetailPricingStrategiesResponse, GetAllRetailProductAttributesParams, GetAllRetailProductAttributesResponse, GetAllRetailProductsParams, GetAllRetailProductsResponse, GetRetailCampaignByIdParams, GetRetailCampaignByNameParams, GetRetailCampaignCategoryByIdParams, GetRetailOfferAttributeByIdParams, GetRetailOfferByIdParams, GetRetailPricingCycleParams, GetRetailPricingRateByIdParams, GetRetailPricingStrategyByIdParams, GetRetailProductAttributeByIdParams, GetRetailProductByIdParams, GetRetailProductByPriceCodeParams, GetRetailProductBySkuParams, RetailCampaign, RetailCampaignCategory, RetailOffer, RetailOfferAttribute, RetailPricingCycle, RetailPricingRate, RetailPricingStrategy, RetailProduct, RetailProductAttribute } from './types.js';
3
+ export declare class ArcDeveloperRetail extends ArcAbstractAPI {
4
+ constructor(options: ArcAPIOptions);
5
+ getProductById(id: number, params?: GetRetailProductByIdParams): Promise<RetailProduct>;
6
+ getProductBySku(sku: string, params?: GetRetailProductBySkuParams): Promise<RetailProduct>;
7
+ getProductByPriceCode(priceCode: number, params?: GetRetailProductByPriceCodeParams): Promise<RetailProduct>;
8
+ getAllProducts(params?: GetAllRetailProductsParams): Promise<GetAllRetailProductsResponse>;
9
+ getPricingStrategyById(id: number, params?: GetRetailPricingStrategyByIdParams): Promise<RetailPricingStrategy>;
10
+ getAllPricingStrategies(params?: GetAllRetailPricingStrategiesParams): Promise<GetAllRetailPricingStrategiesResponse>;
11
+ getPricingRateById(id: number, params?: GetRetailPricingRateByIdParams): Promise<RetailPricingRate>;
12
+ getAllPricingRates(params?: GetAllRetailPricingRatesParams): Promise<GetAllRetailPricingRatesResponse>;
13
+ getPricingCycle(priceCode: number, cycleIndex: number, startDate: string, params?: GetRetailPricingCycleParams): Promise<RetailPricingCycle>;
14
+ getCampaignById(id: number, params?: GetRetailCampaignByIdParams): Promise<RetailCampaign>;
15
+ getCampaignByName(campaignName: string, params?: GetRetailCampaignByNameParams): Promise<RetailCampaign>;
16
+ getAllCampaigns(params?: GetAllRetailCampaignsParams): Promise<GetAllRetailCampaignsResponse>;
17
+ getCampaignCategoryById(id: number, params?: GetRetailCampaignCategoryByIdParams): Promise<RetailCampaignCategory>;
18
+ getAllCampaignCategories(params?: GetAllRetailCampaignCategoriesParams): Promise<GetAllRetailCampaignCategoriesResponse>;
19
+ getOfferById(id: number, params?: GetRetailOfferByIdParams): Promise<RetailOffer>;
20
+ getAllOffers(params?: GetAllRetailOffersParams): Promise<GetAllRetailOffersResponse>;
21
+ getOfferAttributeById(id: number, params?: GetRetailOfferAttributeByIdParams): Promise<RetailOfferAttribute>;
22
+ getAllOfferAttributes(params?: GetAllRetailOfferAttributesParams): Promise<GetAllRetailOfferAttributesResponse>;
23
+ getProductAttributeById(id: number, params?: GetRetailProductAttributeByIdParams): Promise<RetailProductAttribute>;
24
+ getAllProductAttributes(params?: GetAllRetailProductAttributesParams): Promise<GetAllRetailProductAttributesResponse>;
25
+ getAllConditionCategories(params?: GetAllRetailConditionCategoriesParams): Promise<GetAllRetailConditionCategoriesResponse>;
26
+ }
@@ -0,0 +1,259 @@
1
+ export type PaginatedResponse<T> = {
2
+ result: T[];
3
+ lastPage: number;
4
+ page: number;
5
+ size: number;
6
+ sort: string;
7
+ sortDirection: string;
8
+ totalCount: number;
9
+ };
10
+ export type PaginationParams = {
11
+ page?: number;
12
+ size?: number;
13
+ sort?: string;
14
+ sortDirection?: 'ASC' | 'DESC';
15
+ search?: string;
16
+ };
17
+ export type RetailProductAttribute = {
18
+ id: number;
19
+ name: string;
20
+ value: string;
21
+ };
22
+ export type RetailProduct = {
23
+ createdOn?: string;
24
+ createdBy?: string;
25
+ modifiedOn?: string;
26
+ modifiedBy?: string;
27
+ id: number;
28
+ sku: string;
29
+ active: boolean;
30
+ gift: boolean;
31
+ taxInclusive: boolean;
32
+ description: string;
33
+ shortDescription: string;
34
+ image: string;
35
+ imageAction?: string;
36
+ name: string;
37
+ thumbnail: string;
38
+ maxSubscriptionAssociations?: number;
39
+ attributes: RetailProductAttribute[];
40
+ publishedOfferCount: number;
41
+ publishedOnOffer: boolean;
42
+ type: 'Subscription' | 'Physical' | 'Override' | 'Event';
43
+ defaultSwgProduct: boolean;
44
+ onHand: number;
45
+ productTaxCode?: string;
46
+ productURL?: string;
47
+ redirectURLs?: string[];
48
+ };
49
+ export type GetRetailProductByIdParams = {
50
+ site?: string;
51
+ };
52
+ export type GetRetailProductBySkuParams = {
53
+ site?: string;
54
+ };
55
+ export type GetRetailProductByPriceCodeParams = {
56
+ site?: string;
57
+ };
58
+ export type GetAllRetailProductsParams = PaginationParams & {
59
+ site?: string;
60
+ };
61
+ export type GetAllRetailProductsResponse = PaginatedResponse<RetailProduct[]>;
62
+ export type RetailPricingRate = {
63
+ createdOn?: string;
64
+ createdBy?: string;
65
+ modifiedOn?: string;
66
+ modifiedBy?: string;
67
+ id: number;
68
+ amount: number;
69
+ billingCount: number;
70
+ billingFrequency: 'Day' | 'Week' | 'Month' | 'Year' | 'OneTime' | 'Hour';
71
+ durationCount: number;
72
+ duration: 'Week' | 'Month' | 'Year' | 'UntilCancelled' | 'Day' | 'Hour';
73
+ taxInclusive: boolean;
74
+ };
75
+ export type RetailPricingStrategy = {
76
+ createdOn?: string;
77
+ createdBy?: string;
78
+ modifiedOn?: string;
79
+ modifiedBy?: string;
80
+ id: number;
81
+ priceCode: string;
82
+ name: string;
83
+ description: string;
84
+ productId?: number;
85
+ active: boolean;
86
+ gift: boolean;
87
+ summary: string;
88
+ currencyCode: string;
89
+ currencyDisplayFormat: string;
90
+ currencyLocale: string;
91
+ rates: RetailPricingRate[];
92
+ publishedOffers?: Record<string, string>;
93
+ taxInclusive: boolean;
94
+ pricingRates: RetailPricingRate[];
95
+ changeEligible: boolean;
96
+ };
97
+ export type GetRetailPricingStrategyByIdParams = {
98
+ site?: string;
99
+ };
100
+ export type GetAllRetailPricingStrategiesParams = PaginationParams & {
101
+ site?: string;
102
+ };
103
+ export type GetAllRetailPricingStrategiesResponse = PaginatedResponse<RetailPricingStrategy[]>;
104
+ export type GetRetailPricingRateByIdParams = {
105
+ site?: string;
106
+ };
107
+ export type GetAllRetailPricingRatesParams = PaginationParams & {
108
+ site?: string;
109
+ };
110
+ export type GetAllRetailPricingRatesResponse = PaginatedResponse<RetailPricingRate[]>;
111
+ export type RetailPricingCycle = {
112
+ timeUMType: string;
113
+ timeQty: number;
114
+ price: number;
115
+ finalPayment: boolean;
116
+ paymentDate: string;
117
+ gift: boolean;
118
+ durationType: string;
119
+ durationQty: number;
120
+ currency: string;
121
+ };
122
+ export type GetRetailPricingCycleParams = {
123
+ site?: string;
124
+ };
125
+ export type RetailCampaignCategory = {
126
+ createdOn?: string;
127
+ createdBy?: string;
128
+ modifiedOn?: string;
129
+ modifiedBy?: string;
130
+ id: number;
131
+ name: string;
132
+ level: number;
133
+ inUse: boolean;
134
+ children?: RetailCampaignCategory[];
135
+ };
136
+ export type RetailCampaign = {
137
+ createdOn?: string;
138
+ createdBy?: string;
139
+ modifiedOn?: string;
140
+ modifiedBy?: string;
141
+ id: number;
142
+ canRenew: boolean;
143
+ canRestart: boolean;
144
+ canStart: boolean;
145
+ name: string;
146
+ validFrom: string;
147
+ validUntil: string;
148
+ publishedOffers?: Record<string, string>;
149
+ publishedProducts?: Record<string, string>;
150
+ publishedPrices?: Record<string, string>;
151
+ campaignCategory?: RetailCampaignCategory;
152
+ campaignCategories?: RetailCampaignCategory[];
153
+ offerId?: number;
154
+ };
155
+ export type GetRetailCampaignByIdParams = {
156
+ site?: string;
157
+ };
158
+ export type GetRetailCampaignByNameParams = {
159
+ site?: string;
160
+ };
161
+ export type GetAllRetailCampaignsParams = PaginationParams & {
162
+ site?: string;
163
+ };
164
+ export type GetAllRetailCampaignsResponse = PaginatedResponse<RetailCampaign[]>;
165
+ export type GetRetailCampaignCategoryByIdParams = {
166
+ site?: string;
167
+ };
168
+ export type GetAllRetailCampaignCategoriesParams = PaginationParams & {
169
+ site?: string;
170
+ };
171
+ export type GetAllRetailCampaignCategoriesResponse = PaginatedResponse<RetailCampaignCategory[]>;
172
+ export type RetailOfferAttribute = {
173
+ id: number;
174
+ name: string;
175
+ value: string;
176
+ };
177
+ export type RetailOfferProduct = {
178
+ createdOn?: string;
179
+ createdBy?: string;
180
+ modifiedOn?: string;
181
+ modifiedBy?: string;
182
+ product: RetailProduct;
183
+ productOverride: RetailProduct;
184
+ pricingStrategies: RetailPricingStrategy[];
185
+ };
186
+ export type RetailOffer = {
187
+ createdOn?: string;
188
+ createdBy?: string;
189
+ modifiedOn?: string;
190
+ modifiedBy?: string;
191
+ id: number;
192
+ name: string;
193
+ active: boolean;
194
+ isDefault: boolean;
195
+ disclaimerText: string;
196
+ largeImage: string;
197
+ mediumImage: string;
198
+ smallImage: string;
199
+ pageSubTitle: string;
200
+ pageTitle: string;
201
+ published: boolean;
202
+ publishedOn?: string;
203
+ templateName: string;
204
+ publishedBy?: number;
205
+ validFrom: string;
206
+ validUntil: string;
207
+ products: RetailOfferProduct[];
208
+ campaigns: RetailCampaign[];
209
+ attributes: RetailOfferAttribute[];
210
+ };
211
+ export type GetRetailOfferByIdParams = {
212
+ site?: string;
213
+ };
214
+ export type GetAllRetailOffersParams = PaginationParams & {
215
+ site?: string;
216
+ };
217
+ export type GetAllRetailOffersResponse = PaginatedResponse<RetailOffer[]>;
218
+ export type GetRetailOfferAttributeByIdParams = {
219
+ site?: string;
220
+ };
221
+ export type GetAllRetailOfferAttributesParams = PaginationParams & {
222
+ site?: string;
223
+ };
224
+ export type GetAllRetailOfferAttributesResponse = PaginatedResponse<RetailOfferAttribute[]>;
225
+ export type GetRetailProductAttributeByIdParams = {
226
+ site?: string;
227
+ };
228
+ export type GetAllRetailProductAttributesParams = PaginationParams & {
229
+ site?: string;
230
+ };
231
+ export type GetAllRetailProductAttributesResponse = PaginatedResponse<RetailProductAttribute[]>;
232
+ export type RetailConditionValue = {
233
+ createdBy: number;
234
+ createdOn: string;
235
+ deletedOn: string;
236
+ modifiedBy: number;
237
+ modifiedOn: string;
238
+ createdName: string;
239
+ modifiedName: string;
240
+ externalID: number;
241
+ id: number;
242
+ value: string;
243
+ tenantID: number;
244
+ };
245
+ export type RetailConditionCategory = {
246
+ createdOn?: string;
247
+ createdBy?: string;
248
+ modifiedOn?: string;
249
+ modifiedBy?: string;
250
+ id: number;
251
+ conditionType: 'CONTENT' | 'AUDIENCE' | 'ENTITLEMENT';
252
+ name: string;
253
+ values: RetailConditionValue[];
254
+ tenantID: number;
255
+ };
256
+ export type GetAllRetailConditionCategoriesParams = PaginationParams & {
257
+ site?: string;
258
+ };
259
+ export type GetAllRetailConditionCategoriesResponse = PaginatedResponse<RetailConditionCategory[]>;
@@ -195,8 +195,8 @@ export interface UserAddress {
195
195
  * @example 123 Main St.
196
196
  */
197
197
  line1?: string;
198
- line2: string;
199
- locality: string;
198
+ line2?: string;
199
+ locality?: string;
200
200
  region?: string;
201
201
  postal?: string;
202
202
  country?: string;
@@ -11,6 +11,7 @@ import { ArcMigrationCenter } from './migration-center/index.js';
11
11
  import { ArcProtoCenter } from './photo-center/index.js';
12
12
  import { ArcRedirect } from './redirect/index.js';
13
13
  import { ArcRetailEvents } from './retail-events/index.js';
14
+ import { ArcDeveloperRetail } from './developer-retail/index.js';
14
15
  import { ArcSales } from './sales/index.js';
15
16
  import { ArcSigningService } from './signing-service/index.js';
16
17
  import { ArcSite } from './site/index.js';
@@ -33,6 +34,7 @@ export declare const ArcAPI: (options: ArcAPIOptions) => {
33
34
  Tags: ArcTags;
34
35
  ContentOps: ArcContentOps;
35
36
  RetailEvents: ArcRetailEvents;
37
+ DeveloperRetail: ArcDeveloperRetail;
36
38
  Custom: Custom;
37
39
  };
38
40
  export type ArcAPIType = ReturnType<typeof ArcAPI>;
@@ -1,5 +1,6 @@
1
+ import type { UserAttribute } from '../identity/types';
1
2
  export type MigrateBatchSubscriptionsPayload = {
2
- subscriptions: (PaidSubscription | FreeSubscription)[];
3
+ subscriptions: (PaidSubscription | FreeSubscription | SharedSubscription | LinkedSubscription)[];
3
4
  payments: PaymentInfo[];
4
5
  };
5
6
  export type MigrateBatchSubscriptionsResponse = {
@@ -11,19 +12,14 @@ interface BaseSubscription {
11
12
  legacyID: string;
12
13
  ownerClientID: string;
13
14
  sku: string;
14
- priceCode: string;
15
- currentCycle: number;
16
- nextEventDateUTC: string;
17
15
  paymentMethod?: Record<string, any>;
16
+ attributes?: UserAttribute[];
18
17
  }
19
18
  export interface PaidSubscription extends BaseSubscription {
20
- legacyID: string;
21
- ownerClientID: string;
22
- sku: string;
19
+ type: 'paid';
23
20
  priceCode: string;
24
21
  currentCycle: number;
25
22
  nextEventDateUTC: string;
26
- type: 'paid';
27
23
  paymentMethod: {
28
24
  providerID: number;
29
25
  token: string;
@@ -38,11 +34,28 @@ export interface PaidSubscription extends BaseSubscription {
38
34
  country: string;
39
35
  };
40
36
  }
37
+ export interface LinkedSubscription extends BaseSubscription {
38
+ type: 'linked';
39
+ nextEventDateUTC?: string;
40
+ paymentMethod: {
41
+ providerID: number;
42
+ [key: string]: any;
43
+ };
44
+ }
45
+ export interface SharedSubscription extends BaseSubscription {
46
+ type: 'shared';
47
+ nextEventDateUTC?: string;
48
+ paymentMethod: {
49
+ providerID: number;
50
+ [key: string]: any;
51
+ };
52
+ }
41
53
  export interface FreeSubscription extends BaseSubscription {
42
54
  type: 'free';
55
+ nextEventDateUTC?: string;
43
56
  paymentMethod: {
44
57
  providerID: number;
45
- token: string;
58
+ [key: string]: any;
46
59
  };
47
60
  }
48
61
  export type PaymentInfo = {
package/dist/index.cjs CHANGED
@@ -584,6 +584,128 @@ class ArcRetailEvents {
584
584
  }
585
585
  }
586
586
 
587
+ class ArcDeveloperRetail extends ArcAbstractAPI {
588
+ constructor(options) {
589
+ super({ ...options, apiPath: 'retail/api/v1' });
590
+ }
591
+ // ============================================
592
+ // Product Methods
593
+ // ============================================
594
+ async getProductById(id, params) {
595
+ const { data } = await this.client.get(`/product/${id}`, { params });
596
+ return data;
597
+ }
598
+ async getProductBySku(sku, params) {
599
+ const { data } = await this.client.get(`/product/sku/${sku}`, { params });
600
+ return data;
601
+ }
602
+ async getProductByPriceCode(priceCode, params) {
603
+ const { data } = await this.client.get(`/product/pricecode/${priceCode}`, { params });
604
+ return data;
605
+ }
606
+ async getAllProducts(params) {
607
+ const { data } = await this.client.get('/product', { params });
608
+ return data;
609
+ }
610
+ // ============================================
611
+ // Pricing Strategy Methods
612
+ // ============================================
613
+ async getPricingStrategyById(id, params) {
614
+ const { data } = await this.client.get(`/pricing/strategy/${id}`, { params });
615
+ return data;
616
+ }
617
+ async getAllPricingStrategies(params) {
618
+ const { data } = await this.client.get('/pricing/strategy', { params });
619
+ return data;
620
+ }
621
+ // ============================================
622
+ // Pricing Rate Methods
623
+ // ============================================
624
+ async getPricingRateById(id, params) {
625
+ const { data } = await this.client.get(`/pricing/rate/${id}`, { params });
626
+ return data;
627
+ }
628
+ async getAllPricingRates(params) {
629
+ const { data } = await this.client.get('/pricing/rate', { params });
630
+ return data;
631
+ }
632
+ // ============================================
633
+ // Pricing Cycle Methods
634
+ // ============================================
635
+ async getPricingCycle(priceCode, cycleIndex, startDate, params) {
636
+ const { data } = await this.client.get(`/pricing/cycle/${priceCode}/${cycleIndex}/${startDate}`, {
637
+ params,
638
+ });
639
+ return data;
640
+ }
641
+ // ============================================
642
+ // Campaign Methods
643
+ // ============================================
644
+ async getCampaignById(id, params) {
645
+ const { data } = await this.client.get(`/campaign/${id}`, { params });
646
+ return data;
647
+ }
648
+ async getCampaignByName(campaignName, params) {
649
+ const { data } = await this.client.get(`/campaign/${campaignName}/get`, { params });
650
+ return data;
651
+ }
652
+ async getAllCampaigns(params) {
653
+ const { data } = await this.client.get('/campaign', { params });
654
+ return data;
655
+ }
656
+ // ============================================
657
+ // Campaign Category Methods
658
+ // ============================================
659
+ async getCampaignCategoryById(id, params) {
660
+ const { data } = await this.client.get(`/campaign/category/${id}`, { params });
661
+ return data;
662
+ }
663
+ async getAllCampaignCategories(params) {
664
+ const { data } = await this.client.get('/campaign/category', { params });
665
+ return data;
666
+ }
667
+ // ============================================
668
+ // Offer Methods
669
+ // ============================================
670
+ async getOfferById(id, params) {
671
+ const { data } = await this.client.get(`/offer/${id}`, { params });
672
+ return data;
673
+ }
674
+ async getAllOffers(params) {
675
+ const { data } = await this.client.get('/offer', { params });
676
+ return data;
677
+ }
678
+ // ============================================
679
+ // Offer Attribute Methods
680
+ // ============================================
681
+ async getOfferAttributeById(id, params) {
682
+ const { data } = await this.client.get(`/offer/attribute/${id}`, { params });
683
+ return data;
684
+ }
685
+ async getAllOfferAttributes(params) {
686
+ const { data } = await this.client.get('/offer/attribute', { params });
687
+ return data;
688
+ }
689
+ // ============================================
690
+ // Product Attribute Methods
691
+ // ============================================
692
+ async getProductAttributeById(id, params) {
693
+ const { data } = await this.client.get(`/product/attribute/${id}`, { params });
694
+ return data;
695
+ }
696
+ async getAllProductAttributes(params) {
697
+ const { data } = await this.client.get('/product/attribute', { params });
698
+ return data;
699
+ }
700
+ // ============================================
701
+ // Condition Category Methods
702
+ // ============================================
703
+ async getAllConditionCategories(params) {
704
+ const { data } = await this.client.get('/condition/categories', { params });
705
+ return data;
706
+ }
707
+ }
708
+
587
709
  class ArcSales extends ArcAbstractAPI {
588
710
  constructor(options) {
589
711
  super({ ...options, apiPath: 'sales/api/v1' });
@@ -740,6 +862,7 @@ const ArcAPI = (options) => {
740
862
  Tags: new ArcTags(options),
741
863
  ContentOps: new ArcContentOps(options),
742
864
  RetailEvents: new ArcRetailEvents(options),
865
+ DeveloperRetail: new ArcDeveloperRetail(options),
743
866
  Custom: new Custom(options),
744
867
  };
745
868
  API.MigrationCenter.setMaxRPS(12);