@staging-apiplus/ecommerce 0.0.0-stage → 0.0.2

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/README.md CHANGED
@@ -1,3 +1,29 @@
1
- # Temporary Holding Version
1
+ # `@staging-apiplus/ecommerce`
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Sell online: connect a QuickPage store to the site and manage products, orders and payments.
4
+
5
+ A first-party QuickPage **app** (`app.kind: "app"`). It supports the **site** surface: designers install it per site from Settings → Apps. The version lives in `package.json` and `src/package.ts`; keep them equal.
6
+
7
+ ## What it adds
8
+
9
+ - **Connection:** `commerce-store`. Platform-only; the host runs connect, create and unlink.
10
+ - **UI:** the E-commerce card in the app detail: the connected store with its avatar, Go to store and Unlink store, or an Add store popover that lists the stores to connect (click one to connect it) and creates a new store. The create-store dialog collects the business name, country, currency and, optionally, the address, invoice details (company name, tax ID) and phone, with `phone` and `province` fields the host renders with its country-aware pickers.
11
+ - **Setup guide:** connect the store, enable sign-in, then create the product and cart pages.
12
+ - **Requires:** `@staging-apiplus/platform-login` (`>=0.0.1`), installed together with the app.
13
+
14
+ ## Permissions
15
+
16
+ `commerce.store` (edit), `site.pages` (edit), `site.login` is granted through the required Platform login app. Site permissions are derived from the manifest; the app declares none.
17
+
18
+ ## Commands
19
+
20
+ ```bash
21
+ pnpm run validate # apps validate (checks the manifest)
22
+ pnpm run build # apps build → dist/
23
+ ```
24
+
25
+ ## Publishing
26
+
27
+ This app is published to the `@staging-apiplus` npm scope with `make publish-code-packages-npm` from the repository root. It reaches the dev registry (Verdaccio, served through the mock registry gateway) with `make publish-code-packages-dev` from the repository root, or `pnpm run publish:dev` in this folder. `pnpm run publish:npm` (`apps publish`) is the production path.
28
+
29
+ Source: `src/package.ts` (manifest), `src/configure_ui.ts` (UI, setup and messages in `en` and `th`).
@@ -0,0 +1,496 @@
1
+ {
2
+ "kind": "app",
3
+ "id": "@staging-apiplus/ecommerce",
4
+ "version": "0.0.2",
5
+ "engine": "^1.0.0",
6
+ "modules": {},
7
+ "app": {
8
+ "name": "E-commerce",
9
+ "description": "Sell online: connect your store and manage products, orders and payments.",
10
+ "messages": {
11
+ "en": {
12
+ "store_title": "E-commerce",
13
+ "description_connected": "Create and manage your products and store data in the commerce backend.",
14
+ "description_disconnected": "Connect your commerce data to your website to display your store information.",
15
+ "add_store": "Add store",
16
+ "select_store": "Select Store",
17
+ "connected": "Connected",
18
+ "go_to_store": "Go to store",
19
+ "unlink_store": "Unlink store",
20
+ "unlink_description": "Unlink {store} from this QuickPage? The store and its products will remain unchanged.",
21
+ "unlink_failed": "Could not unlink the store. Please try again.",
22
+ "create_store": "Create new store",
23
+ "search_store": "Search stores",
24
+ "store_picker": "Available stores",
25
+ "no_stores": "No store yet",
26
+ "no_matches": "No stores match your search.",
27
+ "load_error": "Could not load stores.",
28
+ "business_name": "Business name",
29
+ "country": "Country",
30
+ "currency": "Currency",
31
+ "currency_hint": "Country suggests a currency. Your manual selection stays unchanged when you change country.",
32
+ "optional_details": "Optional store details",
33
+ "legal_name": "Legal name (Optional)",
34
+ "description": "Description (Optional)",
35
+ "address_line_1": "Address line 1 (Optional)",
36
+ "address_line_2": "Address line 2 (Optional)",
37
+ "city": "City/District (Optional)",
38
+ "province": "State/Province (Optional)",
39
+ "postal_code": "Postal Code (Optional)",
40
+ "invoice_details_title": "Invoice and receipt details",
41
+ "invoice_details_description": "Printed in the header of every invoice and receipt, with the business address. If Company name is empty, the legal name is used, then the business name.",
42
+ "company_name": "Company name (Optional)",
43
+ "tax_id": "Tax ID (Optional)",
44
+ "phone": "Phone (Optional)",
45
+ "sample_data": "Add sample products",
46
+ "sample_hint": "Sample products are real catalog records. You can edit or remove them in StoreAdmin.",
47
+ "create_connect": "Create and connect",
48
+ "create_failed": "Could not create the store. Your information is still here.",
49
+ "created_unconnected": "Store created, but could not connect.",
50
+ "created_store_retained": "The store remains available even if you close this dialog.",
51
+ "retry_connection": "Retry connection",
52
+ "setup_title": "Set up your store",
53
+ "step_store": "Connect a store",
54
+ "step_store_hint": "Products, orders and payments live in the store.",
55
+ "step_store_action": "Go to Store",
56
+ "step_login": "Turn on customer sign-in",
57
+ "step_login_hint": "Customers sign in to check out and see their orders.",
58
+ "step_login_action": "Turn on sign-in",
59
+ "step_pages": "Create store pages",
60
+ "step_pages_hint": "Adds empty Products, Cart, Checkout and Account pages for you to design.",
61
+ "step_pages_action": "Create pages",
62
+ "page_products": "Products",
63
+ "page_cart": "Cart",
64
+ "page_checkout": "Checkout",
65
+ "page_account": "Account",
66
+ "step_account": "Require sign-in for Account",
67
+ "step_account_hint": "Only signed-in customers can open the Account page.",
68
+ "step_account_action": "Require sign-in",
69
+ "step_library": "Add the Essentials library",
70
+ "step_library_hint": "Gallery, slider and tabs for your product pages.",
71
+ "step_library_action": "Add library",
72
+ "step_payments": "Set up payments",
73
+ "step_payments_hint": "Turn on a payment provider with at least one payment method in StoreAdmin.",
74
+ "step_payments_action": "Open payments",
75
+ "step_products": "Add products",
76
+ "step_products_hint": "Add the products you sell in StoreAdmin.",
77
+ "step_products_action": "Open products",
78
+ "step_shipping": "Set up shipping",
79
+ "step_shipping_hint": "Choose where you ship and what it costs.",
80
+ "step_shipping_action": "Open shipping",
81
+ "step_taxes": "Set up taxes",
82
+ "step_taxes_hint": "Set the taxes you charge.",
83
+ "step_taxes_action": "Open taxes",
84
+ "step_publish": "Publish your site",
85
+ "step_publish_hint": "Publish from the top bar when your pages are ready."
86
+ },
87
+ "th": {
88
+ "store_title": "อีคอมเมิร์ซ",
89
+ "description_connected": "สร้างและจัดการสินค้าและข้อมูลร้านค้าในระบบหลังบ้านของร้านค้า",
90
+ "description_disconnected": "เชื่อมต่อข้อมูลการขายกับเว็บไซต์ของคุณเพื่อแสดงข้อมูลร้านค้า",
91
+ "add_store": "เพิ่มร้านค้า",
92
+ "select_store": "เลือกร้านค้า",
93
+ "connected": "เชื่อมต่อแล้ว",
94
+ "go_to_store": "ไปที่ร้านค้า",
95
+ "unlink_store": "ยกเลิกการเชื่อมต่อร้านค้า",
96
+ "unlink_description": "ยกเลิกการเชื่อมต่อ {store} กับ QuickPage นี้หรือไม่ ร้านค้าและสินค้าจะยังคงอยู่",
97
+ "unlink_failed": "ไม่สามารถยกเลิกการเชื่อมต่อร้านค้าได้ โปรดลองอีกครั้ง",
98
+ "create_store": "สร้างร้านค้าใหม่",
99
+ "search_store": "ค้นหาร้านค้า",
100
+ "store_picker": "ร้านค้าที่พร้อมใช้งาน",
101
+ "no_stores": "ยังไม่มีร้านค้า",
102
+ "no_matches": "ไม่พบร้านค้าที่ตรงกับการค้นหา",
103
+ "load_error": "ไม่สามารถโหลดร้านค้าได้",
104
+ "business_name": "ชื่อธุรกิจ",
105
+ "country": "ประเทศ",
106
+ "currency": "สกุลเงิน",
107
+ "currency_hint": "ระบบแนะนำสกุลเงินตามประเทศ หากคุณเลือกสกุลเงินเอง ระบบจะไม่เปลี่ยนเมื่อคุณเปลี่ยนประเทศ",
108
+ "optional_details": "รายละเอียดร้านค้าเพิ่มเติม",
109
+ "legal_name": "ชื่อตามกฎหมาย (ไม่จำเป็น)",
110
+ "description": "คำอธิบาย (ไม่จำเป็น)",
111
+ "address_line_1": "ที่อยู่บรรทัดที่ 1 (ไม่จำเป็น)",
112
+ "address_line_2": "ที่อยู่บรรทัดที่ 2 (ไม่จำเป็น)",
113
+ "city": "เมือง/เขต (ไม่จำเป็น)",
114
+ "province": "รัฐ/จังหวัด (ไม่จำเป็น)",
115
+ "postal_code": "รหัสไปรษณีย์ (ไม่จำเป็น)",
116
+ "invoice_details_title": "รายละเอียดใบแจ้งหนี้และใบเสร็จ",
117
+ "invoice_details_description": "แสดงที่ส่วนหัวของใบแจ้งหนี้และใบเสร็จทุกใบ พร้อมที่อยู่ธุรกิจ หากไม่ได้กรอกชื่อบริษัท ระบบจะใช้ชื่อตามกฎหมาย แล้วจึงใช้ชื่อธุรกิจ",
118
+ "company_name": "ชื่อบริษัท (ไม่จำเป็น)",
119
+ "tax_id": "เลขประจำตัวผู้เสียภาษี (ไม่จำเป็น)",
120
+ "phone": "เบอร์โทรศัพท์ (ไม่จำเป็น)",
121
+ "sample_data": "เพิ่มสินค้าตัวอย่าง",
122
+ "sample_hint": "สินค้าตัวอย่างเป็นสินค้าจริงในแค็ตตาล็อก คุณสามารถแก้ไขหรือลบได้ใน StoreAdmin",
123
+ "create_connect": "สร้างและเชื่อมต่อ",
124
+ "create_failed": "ไม่สามารถสร้างร้านค้าได้ ข้อมูลที่คุณกรอกยังอยู่",
125
+ "created_unconnected": "สร้างร้านค้าแล้ว แต่ไม่สามารถเชื่อมต่อได้",
126
+ "created_store_retained": "ร้านค้าจะยังพร้อมใช้งานแม้ว่าคุณจะปิดหน้าต่างนี้",
127
+ "retry_connection": "ลองเชื่อมต่ออีกครั้ง",
128
+ "setup_title": "ตั้งค่าร้านค้าของคุณ",
129
+ "step_store": "เชื่อมต่อร้านค้า",
130
+ "step_store_hint": "สินค้า คำสั่งซื้อ และการชำระเงินอยู่ในร้านค้า",
131
+ "step_store_action": "ไปที่ร้านค้า",
132
+ "step_login": "เปิดการเข้าสู่ระบบสำหรับลูกค้า",
133
+ "step_login_hint": "ลูกค้าเข้าสู่ระบบเพื่อชำระเงินและดูคำสั่งซื้อของตน",
134
+ "step_login_action": "เปิดการเข้าสู่ระบบ",
135
+ "step_pages": "สร้างหน้าร้านค้า",
136
+ "step_pages_hint": "เพิ่มหน้าสินค้า ตะกร้า ชำระเงิน และบัญชีแบบว่างเพื่อให้คุณออกแบบ",
137
+ "step_pages_action": "สร้างหน้า",
138
+ "page_products": "สินค้า",
139
+ "page_cart": "ตะกร้าสินค้า",
140
+ "page_checkout": "ชำระเงิน",
141
+ "page_account": "บัญชี",
142
+ "step_account": "กำหนดให้เข้าสู่ระบบก่อนเข้าหน้าบัญชี",
143
+ "step_account_hint": "เฉพาะลูกค้าที่เข้าสู่ระบบแล้วเท่านั้นที่เปิดหน้าบัญชีได้",
144
+ "step_account_action": "กำหนดให้เข้าสู่ระบบ",
145
+ "step_library": "เพิ่มไลบรารี Essentials",
146
+ "step_library_hint": "แกลเลอรี สไลเดอร์ และแท็บสำหรับหน้าสินค้า",
147
+ "step_library_action": "เพิ่มไลบรารี",
148
+ "step_payments": "ตั้งค่าการชำระเงิน",
149
+ "step_payments_hint": "เปิดใช้ผู้ให้บริการชำระเงินที่มีวิธีชำระเงินอย่างน้อยหนึ่งวิธีใน StoreAdmin",
150
+ "step_payments_action": "เปิดการชำระเงิน",
151
+ "step_products": "เพิ่มสินค้า",
152
+ "step_products_hint": "เพิ่มสินค้าที่คุณขายใน StoreAdmin",
153
+ "step_products_action": "เปิดสินค้า",
154
+ "step_shipping": "ตั้งค่าการจัดส่ง",
155
+ "step_shipping_hint": "เลือกพื้นที่จัดส่งและค่าจัดส่ง",
156
+ "step_shipping_action": "เปิดการจัดส่ง",
157
+ "step_taxes": "ตั้งค่าภาษี",
158
+ "step_taxes_hint": "กำหนดภาษีที่คุณเรียกเก็บ",
159
+ "step_taxes_action": "เปิดภาษี",
160
+ "step_publish": "เผยแพร่เว็บไซต์",
161
+ "step_publish_hint": "เผยแพร่จากแถบด้านบนเมื่อหน้าเว็บพร้อม"
162
+ }
163
+ },
164
+ "surfaces": {
165
+ "site": {
166
+ "connection": {
167
+ "type": "commerce-store"
168
+ },
169
+ "requires": [
170
+ {
171
+ "packageId": "@staging-apiplus/platform-login",
172
+ "version": ">=0.0.1"
173
+ }
174
+ ],
175
+ "ui": {
176
+ "title": "store_title",
177
+ "body": [
178
+ {
179
+ "type": "text",
180
+ "when": {
181
+ "connection": "connected"
182
+ },
183
+ "text": "description_connected",
184
+ "tone": "muted"
185
+ },
186
+ {
187
+ "type": "text",
188
+ "when": {
189
+ "connection": "disconnected"
190
+ },
191
+ "text": "description_disconnected",
192
+ "tone": "muted"
193
+ },
194
+ {
195
+ "type": "card",
196
+ "when": {
197
+ "connection": "connected"
198
+ },
199
+ "layout": "row",
200
+ "children": [
201
+ {
202
+ "type": "value",
203
+ "label": "connected",
204
+ "value": "connection.account.title",
205
+ "avatar": true
206
+ },
207
+ {
208
+ "type": "button",
209
+ "label": "go_to_store",
210
+ "variant": "secondary",
211
+ "action": {
212
+ "type": "open-connection-admin"
213
+ }
214
+ },
215
+ {
216
+ "type": "button",
217
+ "label": "unlink_store",
218
+ "variant": "ghost",
219
+ "action": {
220
+ "type": "disconnect",
221
+ "confirm": {
222
+ "title": "unlink_store",
223
+ "body": {
224
+ "key": "unlink_description",
225
+ "params": {
226
+ "store": "connection.account.title"
227
+ }
228
+ },
229
+ "confirmLabel": "unlink_store",
230
+ "errorText": "unlink_failed"
231
+ }
232
+ }
233
+ }
234
+ ]
235
+ },
236
+ {
237
+ "type": "store-picker",
238
+ "when": {
239
+ "connection": "disconnected"
240
+ },
241
+ "triggerLabel": "add_store",
242
+ "title": "select_store",
243
+ "searchLabel": "search_store",
244
+ "listLabel": "store_picker",
245
+ "emptyText": "no_stores",
246
+ "noMatchesText": "no_matches",
247
+ "loadErrorText": "load_error",
248
+ "create": {
249
+ "label": "create_store",
250
+ "dialog": "create-store"
251
+ }
252
+ }
253
+ ],
254
+ "dialogs": {
255
+ "create-store": {
256
+ "title": "create_store",
257
+ "fields": [
258
+ {
259
+ "name": "title",
260
+ "label": "business_name",
261
+ "type": "text"
262
+ },
263
+ {
264
+ "name": "countryCode",
265
+ "label": "country",
266
+ "type": "select",
267
+ "options": "country",
268
+ "default": "TH"
269
+ },
270
+ {
271
+ "name": "baseCurrency",
272
+ "label": "currency",
273
+ "description": "currency_hint",
274
+ "type": "select",
275
+ "options": "currency",
276
+ "default": {
277
+ "from": "countryCode",
278
+ "map": "currency-of-country"
279
+ }
280
+ },
281
+ {
282
+ "type": "group",
283
+ "label": "optional_details",
284
+ "children": [
285
+ {
286
+ "name": "legalName",
287
+ "label": "legal_name",
288
+ "type": "text"
289
+ },
290
+ {
291
+ "name": "description",
292
+ "label": "description",
293
+ "type": "textarea"
294
+ },
295
+ {
296
+ "name": "addressLine1",
297
+ "label": "address_line_1",
298
+ "type": "text",
299
+ "autocomplete": "address-line1"
300
+ },
301
+ {
302
+ "name": "addressLine2",
303
+ "label": "address_line_2",
304
+ "type": "text",
305
+ "autocomplete": "address-line2"
306
+ },
307
+ {
308
+ "name": "city",
309
+ "label": "city",
310
+ "type": "text",
311
+ "autocomplete": "address-level2"
312
+ },
313
+ {
314
+ "name": "provinceCode",
315
+ "label": "province",
316
+ "type": "province",
317
+ "countryFrom": "countryCode"
318
+ },
319
+ {
320
+ "name": "postalCode",
321
+ "label": "postal_code",
322
+ "type": "text",
323
+ "autocomplete": "postal-code"
324
+ },
325
+ {
326
+ "type": "heading",
327
+ "label": "invoice_details_title",
328
+ "description": "invoice_details_description"
329
+ },
330
+ {
331
+ "name": "companyName",
332
+ "label": "company_name",
333
+ "type": "text",
334
+ "autocomplete": "organization"
335
+ },
336
+ {
337
+ "name": "taxId",
338
+ "label": "tax_id",
339
+ "type": "text"
340
+ },
341
+ {
342
+ "name": "phone",
343
+ "label": "phone",
344
+ "type": "phone",
345
+ "defaultCountryFrom": "countryCode"
346
+ }
347
+ ]
348
+ },
349
+ {
350
+ "name": "seedSampleData",
351
+ "label": "sample_data",
352
+ "description": "sample_hint",
353
+ "type": "checkbox",
354
+ "default": true
355
+ }
356
+ ],
357
+ "submit": {
358
+ "type": "create-account",
359
+ "label": "create_connect",
360
+ "errorText": "create_failed",
361
+ "createdUnconnectedText": "created_unconnected",
362
+ "createdRetainedText": "created_store_retained",
363
+ "retryLabel": "retry_connection"
364
+ }
365
+ }
366
+ }
367
+ },
368
+ "setup": {
369
+ "title": "setup_title",
370
+ "steps": [
371
+ {
372
+ "id": "store",
373
+ "label": "step_store",
374
+ "description": "step_store_hint",
375
+ "type": "connect",
376
+ "actionLabel": "step_store_action"
377
+ },
378
+ {
379
+ "id": "login",
380
+ "label": "step_login",
381
+ "description": "step_login_hint",
382
+ "type": "enable-login",
383
+ "actionLabel": "step_login_action",
384
+ "provider": {
385
+ "packageId": "@staging-apiplus/platform-login",
386
+ "definitionId": "platform"
387
+ }
388
+ },
389
+ {
390
+ "id": "pages",
391
+ "label": "step_pages",
392
+ "description": "step_pages_hint",
393
+ "type": "create-pages",
394
+ "actionLabel": "step_pages_action",
395
+ "pages": [
396
+ {
397
+ "path": "/products",
398
+ "title": "page_products"
399
+ },
400
+ {
401
+ "path": "/cart",
402
+ "title": "page_cart"
403
+ },
404
+ {
405
+ "path": "/checkout",
406
+ "title": "page_checkout"
407
+ },
408
+ {
409
+ "path": "/account",
410
+ "title": "page_account"
411
+ }
412
+ ]
413
+ },
414
+ {
415
+ "id": "account-access",
416
+ "label": "step_account",
417
+ "description": "step_account_hint",
418
+ "after": [
419
+ "pages",
420
+ "login"
421
+ ],
422
+ "type": "protect-pages",
423
+ "actionLabel": "step_account_action",
424
+ "paths": [
425
+ "/account"
426
+ ]
427
+ },
428
+ {
429
+ "id": "library",
430
+ "label": "step_library",
431
+ "description": "step_library_hint",
432
+ "type": "add-library",
433
+ "actionLabel": "step_library_action",
434
+ "packageId": "@staging-apiplus/essentials",
435
+ "version": "^0.0.5"
436
+ },
437
+ {
438
+ "id": "payments",
439
+ "label": "step_payments",
440
+ "description": "step_payments_hint",
441
+ "after": [
442
+ "store"
443
+ ],
444
+ "type": "admin-task",
445
+ "actionLabel": "step_payments_action",
446
+ "path": "setting/payments",
447
+ "check": "payments"
448
+ },
449
+ {
450
+ "id": "products",
451
+ "label": "step_products",
452
+ "description": "step_products_hint",
453
+ "after": [
454
+ "store"
455
+ ],
456
+ "type": "admin-task",
457
+ "actionLabel": "step_products_action",
458
+ "path": "products"
459
+ },
460
+ {
461
+ "id": "shipping",
462
+ "label": "step_shipping",
463
+ "description": "step_shipping_hint",
464
+ "after": [
465
+ "store"
466
+ ],
467
+ "type": "admin-task",
468
+ "actionLabel": "step_shipping_action",
469
+ "path": "setting/shipping_and_delivery"
470
+ },
471
+ {
472
+ "id": "taxes",
473
+ "label": "step_taxes",
474
+ "description": "step_taxes_hint",
475
+ "after": [
476
+ "store"
477
+ ],
478
+ "type": "admin-task",
479
+ "actionLabel": "step_taxes_action",
480
+ "path": "setting/taxes"
481
+ },
482
+ {
483
+ "id": "publish",
484
+ "label": "step_publish",
485
+ "description": "step_publish_hint",
486
+ "after": [
487
+ "pages"
488
+ ],
489
+ "type": "publish"
490
+ }
491
+ ]
492
+ }
493
+ }
494
+ }
495
+ }
496
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "name": "@staging-apiplus/ecommerce",
3
+ "version": "0.0.2",
4
+ "description": "Sell online: connect your store and manage products, orders and payments.",
5
+ "app": {
6
+ "kind": "app",
7
+ "engine": "^1.0.0",
8
+ "manifest": "./dist/app-package.json",
9
+ "modules": []
10
+ },
11
+ "peerDependencies": {
12
+ "@staging-apiplus/platform-login": ">=0.0.1"
13
+ },
14
+ "exports": {}
15
+ }
package/package.json CHANGED
@@ -1,6 +1,31 @@
1
1
  {
2
2
  "name": "@staging-apiplus/ecommerce",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.0.2",
4
+ "description": "Sell online: connect your store and manage products, orders and payments.",
5
+ "files": [
6
+ "dist"
7
+ ],
8
+ "type": "module",
9
+ "exports": {},
10
+ "scripts": {
11
+ "validate": "apps validate",
12
+ "build": "apps build",
13
+ "publish:npm": "apps publish",
14
+ "publish:dev": "apps publish:dev"
15
+ },
16
+ "devDependencies": {
17
+ "@packages/app-cli": "workspace:@packages/app-cli@^0.0.1",
18
+ "@packages/app-sdk": "workspace:@packages/app-sdk@^0.0.1",
19
+ "tsx": "catalog:dev",
20
+ "typescript": "catalog:dev"
21
+ },
22
+ "app": {
23
+ "kind": "app",
24
+ "engine": "^1.0.0",
25
+ "manifest": "./dist/app-package.json",
26
+ "modules": []
27
+ },
28
+ "peerDependencies": {
29
+ "@staging-apiplus/platform-login": ">=0.0.1"
30
+ }
31
+ }