@cinerino/sdk 12.3.0 → 12.5.0-alpha.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.
@@ -4,9 +4,12 @@ import * as client from '../../../../lib/index';
4
4
  import * as auth from '../../auth/authAsAdmin';
5
5
 
6
6
  const PROJECT_ID = String(process.env.PROJECT_ID);
7
+ const SELLER_ID = '59d20831e53ebc2b4e774466';
8
+ // const SELLER_ID = '64b47a8e43423b261dbcabc5';
7
9
  const MEMBER_TIER_IDENTIFIER = 'bronze';
8
- const OFFER_IDENTIFIER = '20250924ValidForMemberTier';
9
- const itemOfferedIdentifier = '20250924ValidForMemberTier';
10
+ const OFFER_IDENTIFIER = '20250925ValidForMemberTier1';
11
+ const OFFER_IDENTIFIER2 = '20250925ValidForMemberTier2';
12
+ const itemOfferedIdentifier = '20250925ValidForMemberTier';
10
13
 
11
14
  // tslint:disable-next-line:max-func-body-length
12
15
  async function main() {
@@ -20,7 +23,7 @@ async function main() {
20
23
  auth: authClient
21
24
  })).createProductOfferInstance({
22
25
  project: { id: PROJECT_ID },
23
- seller: { id: '' }
26
+ seller: { id: SELLER_ID }
24
27
  });
25
28
 
26
29
  const now = new Date();
@@ -33,14 +36,15 @@ async function main() {
33
36
  validThrough: now
34
37
  },
35
38
  {
36
- identifier: OFFER_IDENTIFIER,
39
+ identifier: OFFER_IDENTIFIER2,
37
40
  validForMemberTier: { identifier: MEMBER_TIER_IDENTIFIER },
38
41
  validFrom: now,
39
42
  validThrough: now
40
43
  }
41
44
  ],
42
45
  {
43
- itemOfferedIdentifier
46
+ itemOfferedIdentifier,
47
+ offeredById: SELLER_ID
44
48
  }
45
49
  );
46
50
  console.log('created.');
@@ -54,22 +58,24 @@ async function main() {
54
58
  validThrough: now
55
59
  },
56
60
  {
57
- identifier: OFFER_IDENTIFIER,
61
+ identifier: OFFER_IDENTIFIER2,
58
62
  validForMemberTier: { identifier: MEMBER_TIER_IDENTIFIER },
59
63
  validFrom: now,
60
64
  validThrough: now
61
65
  }
62
66
  ],
63
67
  {
64
- itemOfferedIdentifier
68
+ itemOfferedIdentifier,
69
+ offeredById: SELLER_ID
65
70
  }
66
71
  );
67
72
  console.log('updated.');
68
73
 
69
74
  const offers = await productOfferService.findProductOffers({
70
75
  limit: 10,
71
- page: 1,
72
- itemOfferedIdentifier
76
+ page: 1
77
+ // itemOfferedIdentifier,
78
+ // offeredById: SELLER_ID
73
79
  });
74
80
  // tslint:disable-next-line:no-null-keyword
75
81
  console.dir(offers, { depth: null });
@@ -5,7 +5,7 @@ import * as client from '../../../../lib/index';
5
5
  import * as auth from '../../auth/authAsAdmin';
6
6
 
7
7
  const PROJECT_ID = String(process.env.PROJECT_ID);
8
- const SELLER_ID = '';
8
+ const SELLER_ID = '59d20831e53ebc2b4e774466';
9
9
 
10
10
  async function main() {
11
11
  const authClient = await auth.login();
@@ -38,7 +38,8 @@ async function main() {
38
38
  }
39
39
  ],
40
40
  {
41
- itemOfferedIdentifier: itemOfferedIdentifier
41
+ itemOfferedIdentifier: itemOfferedIdentifier,
42
+ offeredById: SELLER_ID
42
43
  }
43
44
  );
44
45
  console.log('created.');
@@ -55,7 +56,8 @@ async function main() {
55
56
  }
56
57
  ],
57
58
  {
58
- itemOfferedIdentifier: itemOfferedIdentifier
59
+ itemOfferedIdentifier: itemOfferedIdentifier,
60
+ offeredById: SELLER_ID
59
61
  }
60
62
  );
61
63
  console.log('updated.');
@@ -64,6 +66,7 @@ async function main() {
64
66
  limit: 10,
65
67
  page: 1,
66
68
  itemOfferedIdentifier
69
+ // offeredById: SELLER_ID
67
70
  });
68
71
  console.log(existingOffers.length, 'offers found.', existingOffers);
69
72
  }
@@ -25,6 +25,7 @@ export interface IFindParams {
25
25
  * 有効なメンバープログラムティアコード
26
26
  */
27
27
  validForMemberTierIdentifier?: string;
28
+ offeredById?: string;
28
29
  }
29
30
  /**
30
31
  * プロダクトオファーサービス
@@ -42,6 +43,10 @@ export declare class ProductOfferService extends Service {
42
43
  * プロダクトオファーコレクションコード
43
44
  */
44
45
  itemOfferedIdentifier: string;
46
+ /**
47
+ * オファー提供販売者ID
48
+ */
49
+ offeredById: string;
45
50
  }): Promise<void>;
46
51
  /**
47
52
  * メンバープログラムティアで有効なプロダクトオファーを編集する
@@ -55,6 +60,10 @@ export declare class ProductOfferService extends Service {
55
60
  * プロダクトオファーコレクションコード
56
61
  */
57
62
  itemOfferedIdentifier: string;
63
+ /**
64
+ * オファー提供販売者ID
65
+ */
66
+ offeredById: string;
58
67
  }): Promise<void>;
59
68
  findProductOffers(params: IFindParams): Promise<(Omit<factory.productOffer.IProductOffer, 'project'> & {
60
69
  id: string;
@@ -72,16 +72,16 @@ var ProductOfferService = /** @class */ (function (_super) {
72
72
  */
73
73
  params, options) {
74
74
  return __awaiter(this, void 0, void 0, function () {
75
- var itemOfferedIdentifier;
75
+ var itemOfferedIdentifier, offeredById;
76
76
  return __generator(this, function (_a) {
77
77
  switch (_a.label) {
78
78
  case 0:
79
- itemOfferedIdentifier = options.itemOfferedIdentifier;
79
+ itemOfferedIdentifier = options.itemOfferedIdentifier, offeredById = options.offeredById;
80
80
  return [4 /*yield*/, this.fetch({
81
81
  uri: BASE_URI,
82
82
  method: 'POST',
83
83
  body: params,
84
- qs: { itemOfferedIdentifier: itemOfferedIdentifier },
84
+ qs: { itemOfferedIdentifier: itemOfferedIdentifier, offeredById: offeredById },
85
85
  expectedStatusCodes: [http_status_1.NO_CONTENT]
86
86
  })];
87
87
  case 1:
@@ -100,16 +100,16 @@ var ProductOfferService = /** @class */ (function (_super) {
100
100
  */
101
101
  params, options) {
102
102
  return __awaiter(this, void 0, void 0, function () {
103
- var itemOfferedIdentifier;
103
+ var itemOfferedIdentifier, offeredById;
104
104
  return __generator(this, function (_a) {
105
105
  switch (_a.label) {
106
106
  case 0:
107
- itemOfferedIdentifier = options.itemOfferedIdentifier;
107
+ itemOfferedIdentifier = options.itemOfferedIdentifier, offeredById = options.offeredById;
108
108
  return [4 /*yield*/, this.fetch({
109
109
  uri: BASE_URI,
110
110
  method: 'PUT',
111
111
  body: params,
112
- qs: { itemOfferedIdentifier: itemOfferedIdentifier },
112
+ qs: { itemOfferedIdentifier: itemOfferedIdentifier, offeredById: offeredById },
113
113
  expectedStatusCodes: [http_status_1.NO_CONTENT]
114
114
  })];
115
115
  case 1:
@@ -17,6 +17,10 @@ export declare class ProductOfferService extends Service {
17
17
  * プロダクトオファーコレクションコード
18
18
  */
19
19
  itemOfferedIdentifier: string;
20
+ /**
21
+ * オファー提供販売者ID
22
+ */
23
+ offeredById: string;
20
24
  }): Promise<void>;
21
25
  /**
22
26
  * メンバープログラムティアで有効なプロダクトオファーを編集する
@@ -30,6 +34,10 @@ export declare class ProductOfferService extends Service {
30
34
  * プロダクトオファーコレクションコード
31
35
  */
32
36
  itemOfferedIdentifier: string;
37
+ /**
38
+ * オファー提供販売者ID
39
+ */
40
+ offeredById: string;
33
41
  }): Promise<void>;
34
42
  /**
35
43
  * プロダクトオファーを検索する
package/lib/bundle.js CHANGED
@@ -4051,16 +4051,16 @@ var ProductOfferService = /** @class */ (function (_super) {
4051
4051
  */
4052
4052
  params, options) {
4053
4053
  return __awaiter(this, void 0, void 0, function () {
4054
- var itemOfferedIdentifier;
4054
+ var itemOfferedIdentifier, offeredById;
4055
4055
  return __generator(this, function (_a) {
4056
4056
  switch (_a.label) {
4057
4057
  case 0:
4058
- itemOfferedIdentifier = options.itemOfferedIdentifier;
4058
+ itemOfferedIdentifier = options.itemOfferedIdentifier, offeredById = options.offeredById;
4059
4059
  return [4 /*yield*/, this.fetch({
4060
4060
  uri: BASE_URI,
4061
4061
  method: 'POST',
4062
4062
  body: params,
4063
- qs: { itemOfferedIdentifier: itemOfferedIdentifier },
4063
+ qs: { itemOfferedIdentifier: itemOfferedIdentifier, offeredById: offeredById },
4064
4064
  expectedStatusCodes: [http_status_1.NO_CONTENT]
4065
4065
  })];
4066
4066
  case 1:
@@ -4079,16 +4079,16 @@ var ProductOfferService = /** @class */ (function (_super) {
4079
4079
  */
4080
4080
  params, options) {
4081
4081
  return __awaiter(this, void 0, void 0, function () {
4082
- var itemOfferedIdentifier;
4082
+ var itemOfferedIdentifier, offeredById;
4083
4083
  return __generator(this, function (_a) {
4084
4084
  switch (_a.label) {
4085
4085
  case 0:
4086
- itemOfferedIdentifier = options.itemOfferedIdentifier;
4086
+ itemOfferedIdentifier = options.itemOfferedIdentifier, offeredById = options.offeredById;
4087
4087
  return [4 /*yield*/, this.fetch({
4088
4088
  uri: BASE_URI,
4089
4089
  method: 'PUT',
4090
4090
  body: params,
4091
- qs: { itemOfferedIdentifier: itemOfferedIdentifier },
4091
+ qs: { itemOfferedIdentifier: itemOfferedIdentifier, offeredById: offeredById },
4092
4092
  expectedStatusCodes: [http_status_1.NO_CONTENT]
4093
4093
  })];
4094
4094
  case 1:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cinerino/sdk",
3
- "version": "12.3.0",
3
+ "version": "12.5.0-alpha.0",
4
4
  "description": "Cinerino SDK",
5
5
  "main": "./lib/index.js",
6
6
  "browser": {
@@ -93,7 +93,7 @@
93
93
  "watchify": "^3.11.1"
94
94
  },
95
95
  "dependencies": {
96
- "@chevre/factory": "4.399.0-alpha.22",
96
+ "@chevre/factory": "4.399.0-alpha.24",
97
97
  "debug": "3.2.7",
98
98
  "http-status": "1.7.4",
99
99
  "idtoken-verifier": "2.0.3",