@tekrom/tsoft-app-gate 0.5.0 → 0.6.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.
package/README.md CHANGED
@@ -9,7 +9,7 @@ npm install @tekrom/tsoft-app-gate
9
9
  Paketleyici kullanmıyorsanız tarayıcı derlemesini `<script>` ile yükleyin; aynı API `TSoftAppGate` global'i altında gelir:
10
10
 
11
11
  ```html
12
- <script src="https://cdn.jsdelivr.net/npm/@tekrom/tsoft-app-gate@0.4/dist/tsoft-app-gate.min.js"></script>
12
+ <script src="https://cdn.jsdelivr.net/npm/@tekrom/tsoft-app-gate@0.5/dist/tsoft-app-gate.min.js"></script>
13
13
  <script>
14
14
  const app = TSoftAppGate.createApp();
15
15
  </script>
@@ -158,8 +158,17 @@ Panelin seçicisini açar, seçilen kayıtların kimliklerini döner: `{ ids, ca
158
158
  | `type` | Gerekli kapsam |
159
159
  |---|---|
160
160
  | `product` | `read_products` |
161
+ | `category` | `read_products` (panel kategori ağacı; eski panellerde `unsupported_resource`) |
161
162
 
162
- Kapsam yoksa `missing_scope`, bilinmeyen tür `unsupported_resource` döner. Seçici açıkken yeni bir seçim istenirse önceki istek `cancelled: true` ile kapanır.
163
+ Kapsam yoksa `missing_scope`, bilinmeyen tür `unsupported_resource` döner. Kategori seçicisi yeni bir türdür; desteklemeyen panelde kendi seçicinize düşün:
164
+
165
+ ```js
166
+ try {
167
+ const { ids, cancelled } = await app.pickResource({ type: 'category' });
168
+ } catch (e) {
169
+ if (e.code === 'unsupported_resource') openOwnCategoryPicker();
170
+ }
171
+ ``` Seçici açıkken yeni bir seçim istenirse önceki istek `cancelled: true` ile kapanır.
163
172
 
164
173
  ### `setHeight(height)` ve `autoResize({ target? })`
165
174
 
@@ -30,8 +30,11 @@ export type PanelListResource = 'orders' | 'products' | 'apps';
30
30
  /** Kimlikle açılan panel sayfaları; kimlik `^[A-Za-z0-9_-]{1,64}$` olmalı. */
31
31
  export type PanelDetailResource = 'order' | 'product';
32
32
  export type PanelResource = PanelListResource | PanelDetailResource;
33
- /** Seçici türü ve istediği kapsam: `product` → `read_products`. */
34
- export type PickableResource = 'product';
33
+ /**
34
+ * Seçici türü ve istediği kapsam: `product` ve `category` → `read_products`.
35
+ * `category` eski panellerde `unsupported_resource` döner.
36
+ */
37
+ export type PickableResource = 'product' | 'category';
35
38
  /**
36
39
  * Panelin sol menüsünde uygulamanın adı altında görünen bağlantı. `path` uygulamanın
37
40
  * kendi adresi altında `/` ile başlayan yol olmalı (`/orders?status=1` gibi); etiket
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tekrom/tsoft-app-gate",
3
- "version": "0.5.0",
3
+ "version": "0.6.0",
4
4
  "description": "T-Soft paneli içinde açılan uygulamalar için App Bridge istemcisi",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",