@shopify/app-bridge-types 0.0.18 → 0.2.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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#623](https://github.com/Shopify/extensibility/pull/623) [`6334cc4f89f8c22c871dfb122f8d5aba358b26a3`](https://github.com/Shopify/extensibility/commit/6334cc4f89f8c22c871dfb122f8d5aba358b26a3) Thanks [@SammyJoeOsborne](https://github.com/SammyJoeOsborne)! - Updating ReviewRequestDeclinedResponse type with new recently-installed code
8
+
9
+ ## 0.1.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [#518](https://github.com/Shopify/extensibility/pull/518) [`bc1af9034c8cca66ebd7a44474aa7a11de7013e9`](https://github.com/Shopify/extensibility/commit/bc1af9034c8cca66ebd7a44474aa7a11de7013e9) Thanks [@SammyJoeOsborne](https://github.com/SammyJoeOsborne)! - Adding types for reviews plugin api.
14
+
3
15
  ## 0.0.18
4
16
 
5
17
  ### Patch Changes
package/dist/shopify.ts CHANGED
@@ -60,6 +60,21 @@ interface AdminUser {
60
60
  accountAccess?: string;
61
61
  }
62
62
 
63
+ /**
64
+ * This API interface provides methods to retrieve app and extension status information.
65
+ */
66
+ interface AppApi {
67
+ /**
68
+ * The list of extensions from the current app.
69
+ * @returns A promise that resolves to the array of ExtensionResponse containing extension status information.
70
+ *
71
+ * This array may be empty if the app has no extensions.
72
+ *
73
+ * @throws {Error} When the App API is not available or the request fails.
74
+ */
75
+ extensions(): Promise<ExtensionInfo[]>;
76
+ }
77
+
63
78
  export interface AppBridgeAttributes {
64
79
  }
65
80
 
@@ -337,6 +352,33 @@ interface _EnvironmentApi {
337
352
  pos?: boolean;
338
353
  }
339
354
 
355
+ /**
356
+ * Represents an activation record for an extension.
357
+ * Contains information about where an extension is activated.
358
+ */
359
+ interface ExtensionActivation {
360
+ /**
361
+ * The target identifier for the extension activation.
362
+ */
363
+ target: string;
364
+ }
365
+
366
+ /**
367
+ * Contains the status information for the App's extension.
368
+ * This includes the extension's handle, and activation targets.
369
+ */
370
+ interface ExtensionInfo {
371
+ /**
372
+ * The unique identifier for the extension.
373
+ */
374
+ handle: string;
375
+ /**
376
+ * List of activation records for the extension.
377
+ * Contains information about where the extension is currently activated.
378
+ */
379
+ activations: ExtensionActivation[];
380
+ }
381
+
340
382
  interface Filters {
341
383
  /**
342
384
  * Whether to show hidden resources, referring to products that are not published on any sales channels.
@@ -876,6 +918,26 @@ type ResourceTypes = {
876
918
  collection: Collection;
877
919
  };
878
920
 
921
+ type ReviewRequestDeclinedCode = 'mobile-app' | 'already-reviewed' | 'annual-limit-reached' | 'cooldown-period' | 'merchant-ineligible' | 'recently-installed';
922
+
923
+ interface ReviewRequestDeclinedResponse {
924
+ success: false;
925
+ code: ReviewRequestDeclinedCode;
926
+ message: string;
927
+ }
928
+
929
+ type ReviewRequestResponse = ReviewRequestSuccessResponse | ReviewRequestDeclinedResponse;
930
+
931
+ interface ReviewRequestSuccessResponse {
932
+ success: true;
933
+ code: 'success';
934
+ message: 'Review modal shown successfully';
935
+ }
936
+
937
+ interface ReviewsApi {
938
+ request(): Promise<ReviewRequestResponse>;
939
+ }
940
+
879
941
  interface RuleSet {
880
942
  appliedDisjunctively: boolean;
881
943
  rules: CollectionRule[];
@@ -982,8 +1044,10 @@ export interface ShopifyGlobal {
982
1044
  intents: IntentsApi;
983
1045
  webVitals: WebVitalsApi;
984
1046
  support: SupportApi;
1047
+ reviews: ReviewsApi;
985
1048
  scopes: Scopes;
986
1049
  picker: PickerApi;
1050
+ app: AppApi;
987
1051
  }
988
1052
 
989
1053
  interface SupportApi {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shopify/app-bridge-types",
3
- "version": "0.0.18",
3
+ "version": "0.2.0",
4
4
  "description": "Companion types library for the Shopify App Bridge script",
5
5
  "private": false,
6
6
  "publishConfig": {