@cinerino/sdk 11.0.0-alpha.3 → 11.0.0-alpha.4

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.
@@ -2,8 +2,6 @@
2
2
  import * as client from '../../../lib/';
3
3
  import * as auth from '../auth/authAsAdmin';
4
4
 
5
- // const project = { id: 'cinerino' };
6
-
7
5
  async function main() {
8
6
  const authClient = await auth.login();
9
7
  await authClient.refreshAccessToken();
@@ -4,6 +4,8 @@
4
4
  import { factory, loadCloudAdmin } from '../../../lib/index';
5
5
  import * as auth from '../auth/authAsAdmin';
6
6
 
7
+ const project = { id: String(process.env.PROJECT_ID) };
8
+
7
9
  async function main() {
8
10
  const authClient = await auth.login();
9
11
  await authClient.refreshAccessToken();
@@ -14,7 +16,7 @@ async function main() {
14
16
  endpoint: <string>process.env.API_ADMIN_ENDPOINT,
15
17
  auth: authClient
16
18
  })).createCreativeWorkInstance({
17
- project: { id: 'cinerino' },
19
+ project,
18
20
  seller: { id: '' }
19
21
  });
20
22
 
@@ -4,6 +4,8 @@ import * as moment from 'moment';
4
4
  import { factory, loadCloudAdmin } from '../../../lib/index';
5
5
  import * as auth from '../auth/authAsAdmin';
6
6
 
7
+ const project = { id: String(process.env.PROJECT_ID) };
8
+
7
9
  async function main() {
8
10
  const authClient = await auth.login();
9
11
  await authClient.refreshAccessToken();
@@ -14,7 +16,7 @@ async function main() {
14
16
  endpoint: <string>process.env.API_ADMIN_ENDPOINT,
15
17
  auth: authClient
16
18
  })).createEventInstance({
17
- project: { id: 'cinerino' },
19
+ project,
18
20
  seller: { id: '' }
19
21
  });
20
22
 
@@ -5,6 +5,8 @@
5
5
  import * as client from '../../../../lib/index';
6
6
  import * as auth from '../../auth/authAsAdmin';
7
7
 
8
+ const project = { id: String(process.env.PROJECT_ID) };
9
+
8
10
  async function main() {
9
11
  // 管理者として操作する場合はこちら
10
12
  const authClient = await auth.login();
@@ -24,7 +26,7 @@ async function main() {
24
26
  endpoint: <string>process.env.API_TXN_ENDPOINT,
25
27
  auth: authClient
26
28
  })).createReturnOrderInstance({
27
- project: { id: 'cinerino' },
29
+ project,
28
30
  seller: { id: '' }
29
31
  });
30
32
 
@@ -0,0 +1,31 @@
1
+ // tslint:disable:no-console no-implicit-dependencies no-magic-numbers
2
+ // import * as moment from 'moment';
3
+
4
+ const project = { id: String(process.env.PROJECT_ID) };
5
+
6
+ async function main() {
7
+ console.log('searching sellers...');
8
+ const response = await fetch(`${<string>process.env.ST_API_ADMIN_ENDPOINT}/sellers?limit=10&page=1`, {
9
+ method: 'GET',
10
+ headers: {
11
+ authorization: `Bearer ${process.env.SAMPLE_ACCESS_TOKEN}`,
12
+ 'X-Project-ID': project.id
13
+ }
14
+ });
15
+ if (!response.ok) {
16
+ console.dir(await response.json());
17
+ throw new Error('Network response was not ok');
18
+ }
19
+ const data = await response.json();
20
+ // tslint:disable-next-line:no-null-keyword
21
+ console.dir(data, { depth: null });
22
+ console.log(data.length, 'data found.');
23
+ }
24
+
25
+ main()
26
+ .then(() => {
27
+ console.log('main processed.');
28
+ })
29
+ .catch((err) => {
30
+ console.error(err);
31
+ });
@@ -1,10 +1,8 @@
1
1
  import { IAdditionalOptions, IOptions, IUnset as IUnsetOnService } from '../service';
2
- import type { AuthorizationService } from './admin/authorization';
3
2
  import type { CreativeWorkService } from './admin/creativeWork';
4
3
  import type { CustomerService } from './admin/customer';
5
4
  import type { EventService } from './admin/event';
6
5
  import type { MeService } from './admin/me';
7
- import type { MemberService } from './admin/member';
8
6
  import type { NoteService } from './admin/note';
9
7
  import type { OfferService } from './admin/offer';
10
8
  import type { OfferCatalogService } from './admin/offerCatalog';
@@ -15,13 +13,6 @@ import type { ReservationService } from './admin/reservation';
15
13
  import type { SellerService } from './admin/seller';
16
14
  export declare namespace service {
17
15
  type IUnset = IUnsetOnService;
18
- /**
19
- * 承認サービス
20
- */
21
- type Authorization = AuthorizationService;
22
- namespace Authorization {
23
- let svc: typeof AuthorizationService | undefined;
24
- }
25
16
  /**
26
17
  * コンテンツサービス
27
18
  */
@@ -50,13 +41,6 @@ export declare namespace service {
50
41
  namespace Me {
51
42
  let svc: typeof MeService | undefined;
52
43
  }
53
- /**
54
- * メンバーサービス
55
- */
56
- type Member = MemberService;
57
- namespace Member {
58
- let svc: typeof MemberService | undefined;
59
- }
60
44
  /**
61
45
  * メモサービス
62
46
  */
@@ -120,12 +104,10 @@ export declare namespace service {
120
104
  export declare class CloudAdmin {
121
105
  options: Pick<IOptions, 'auth' | 'endpoint'>;
122
106
  constructor(options: Pick<IOptions, 'auth' | 'endpoint'>);
123
- createAuthorizationInstance(params: Pick<IOptions, 'project'> & Pick<IAdditionalOptions, 'seller'>): Promise<AuthorizationService>;
124
107
  createCreativeWorkInstance(params: Pick<IOptions, 'project'> & Pick<IAdditionalOptions, 'seller'>): Promise<CreativeWorkService>;
125
108
  createCustomerInstance(params: Pick<IOptions, 'project'> & Pick<IAdditionalOptions, 'seller'>): Promise<CustomerService>;
126
109
  createEventInstance(params: Pick<IOptions, 'project'> & Pick<IAdditionalOptions, 'seller'>): Promise<EventService>;
127
110
  createMeInstance(): Promise<MeService>;
128
- createMemberInstance(params: Pick<IOptions, 'project'> & Pick<IAdditionalOptions, 'seller'>): Promise<MemberService>;
129
111
  createNoteInstance(params: Pick<IOptions, 'project'> & Pick<IAdditionalOptions, 'seller'>): Promise<NoteService>;
130
112
  createOfferInstance(params: Pick<IOptions, 'project'> & Pick<IAdditionalOptions, 'seller'>): Promise<OfferService>;
131
113
  createOfferCatalogInstance(params: Pick<IOptions, 'project'> & Pick<IAdditionalOptions, 'seller'>): Promise<OfferCatalogService>;
@@ -50,9 +50,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
50
50
  exports.CloudAdmin = exports.service = void 0;
51
51
  var service;
52
52
  (function (service) {
53
- var Authorization;
54
- (function (Authorization) {
55
- })(Authorization = service.Authorization || (service.Authorization = {}));
56
53
  var CreativeWork;
57
54
  (function (CreativeWork) {
58
55
  })(CreativeWork = service.CreativeWork || (service.CreativeWork = {}));
@@ -65,9 +62,6 @@ var service;
65
62
  var Me;
66
63
  (function (Me) {
67
64
  })(Me = service.Me || (service.Me = {}));
68
- var Member;
69
- (function (Member) {
70
- })(Member = service.Member || (service.Member = {}));
71
65
  var Note;
72
66
  (function (Note) {
73
67
  })(Note = service.Note || (service.Note = {}));
@@ -108,23 +102,6 @@ var CloudAdmin = /** @class */ (function () {
108
102
  }
109
103
  this.options = options;
110
104
  }
111
- CloudAdmin.prototype.createAuthorizationInstance = function (params) {
112
- return __awaiter(this, void 0, void 0, function () {
113
- var _a;
114
- return __generator(this, function (_b) {
115
- switch (_b.label) {
116
- case 0:
117
- if (!(service.Authorization.svc === undefined)) return [3 /*break*/, 2];
118
- _a = service.Authorization;
119
- return [4 /*yield*/, Promise.resolve().then(function () { return require('./admin/authorization'); })];
120
- case 1:
121
- _a.svc = (_b.sent()).AuthorizationService;
122
- _b.label = 2;
123
- case 2: return [2 /*return*/, new service.Authorization.svc(__assign(__assign(__assign({}, this.options), params), { retryableStatusCodes: defaultRetryableStatusCodes }))];
124
- }
125
- });
126
- });
127
- };
128
105
  CloudAdmin.prototype.createCreativeWorkInstance = function (params) {
129
106
  return __awaiter(this, void 0, void 0, function () {
130
107
  var _a;
@@ -193,23 +170,6 @@ var CloudAdmin = /** @class */ (function () {
193
170
  });
194
171
  });
195
172
  };
196
- CloudAdmin.prototype.createMemberInstance = function (params) {
197
- return __awaiter(this, void 0, void 0, function () {
198
- var _a;
199
- return __generator(this, function (_b) {
200
- switch (_b.label) {
201
- case 0:
202
- if (!(service.Member.svc === undefined)) return [3 /*break*/, 2];
203
- _a = service.Member;
204
- return [4 /*yield*/, Promise.resolve().then(function () { return require('./admin/member'); })];
205
- case 1:
206
- _a.svc = (_b.sent()).MemberService;
207
- _b.label = 2;
208
- case 2: return [2 /*return*/, new service.Member.svc(__assign(__assign(__assign({}, this.options), params), { retryableStatusCodes: defaultRetryableStatusCodes }))];
209
- }
210
- });
211
- });
212
- };
213
173
  CloudAdmin.prototype.createNoteInstance = function (params) {
214
174
  return __awaiter(this, void 0, void 0, function () {
215
175
  var _a;