@final-commerce/command-frame 0.1.29 → 0.1.30

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.
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Get secret value action
3
+ * Calls the getSecretVal action on the parent window
4
+ */
5
+ import type { GetSecretVal } from "./types";
6
+ export declare const getSecretVal: GetSecretVal;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Get secret value action
3
+ * Calls the getSecretVal action on the parent window
4
+ */
5
+ import { commandFrameClient } from "../../client";
6
+ export const getSecretVal = async (params) => {
7
+ return await commandFrameClient.call("getSecretVal", params);
8
+ };
@@ -0,0 +1,2 @@
1
+ import { GetSecretVal } from "./types";
2
+ export declare const mockGetSecretVal: GetSecretVal;
@@ -0,0 +1,7 @@
1
+ export const mockGetSecretVal = async (params) => {
2
+ console.log("[Mock] getSecretVal called", params);
3
+ return {
4
+ key: params.key,
5
+ value: `mock-value-for-${params.key}`
6
+ };
7
+ };
@@ -0,0 +1,9 @@
1
+ export interface GetSecretValParams {
2
+ key: string;
3
+ extensionId?: string;
4
+ }
5
+ export interface GetSecretValResponse {
6
+ key: string;
7
+ value: string;
8
+ }
9
+ export type GetSecretVal = (params: GetSecretValParams) => Promise<GetSecretValResponse>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Get secrets keys action
3
+ * Calls the getSecretsKeys action on the parent window
4
+ */
5
+ import type { GetSecretsKeys } from "./types";
6
+ export declare const getSecretsKeys: GetSecretsKeys;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Get secrets keys action
3
+ * Calls the getSecretsKeys action on the parent window
4
+ */
5
+ import { commandFrameClient } from "../../client";
6
+ export const getSecretsKeys = async (params) => {
7
+ return await commandFrameClient.call("getSecretsKeys", params);
8
+ };
@@ -0,0 +1,2 @@
1
+ import { GetSecretsKeys } from "./types";
2
+ export declare const mockGetSecretsKeys: GetSecretsKeys;
@@ -0,0 +1,6 @@
1
+ export const mockGetSecretsKeys = async () => {
2
+ console.log("[Mock] getSecretsKeys called");
3
+ return {
4
+ keys: ["api-key", "api-secret", "webhook-url"]
5
+ };
6
+ };
@@ -0,0 +1,7 @@
1
+ export interface GetSecretsKeysParams {
2
+ extensionId?: string;
3
+ }
4
+ export interface GetSecretsKeysResponse {
5
+ keys: string[];
6
+ }
7
+ export type GetSecretsKeys = (params?: GetSecretsKeysParams) => Promise<GetSecretsKeysResponse>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Set secret value action
3
+ * Calls the setSecretVal action on the parent window
4
+ */
5
+ import type { SetSecretVal } from "./types";
6
+ export declare const setSecretVal: SetSecretVal;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Set secret value action
3
+ * Calls the setSecretVal action on the parent window
4
+ */
5
+ import { commandFrameClient } from "../../client";
6
+ export const setSecretVal = async (params) => {
7
+ return await commandFrameClient.call("setSecretVal", params);
8
+ };
@@ -0,0 +1,2 @@
1
+ import { SetSecretVal } from "./types";
2
+ export declare const mockSetSecretVal: SetSecretVal;
@@ -0,0 +1,6 @@
1
+ export const mockSetSecretVal = async (params) => {
2
+ console.log("[Mock] setSecretVal called", params);
3
+ return {
4
+ success: true
5
+ };
6
+ };
@@ -0,0 +1,9 @@
1
+ export interface SetSecretValParams {
2
+ key: string;
3
+ value: string;
4
+ extensionId?: string;
5
+ }
6
+ export interface SetSecretValResponse {
7
+ success: boolean;
8
+ }
9
+ export type SetSecretVal = (params: SetSecretValParams) => Promise<SetSecretValResponse>;
@@ -0,0 +1 @@
1
+ export {};
package/dist/index.d.ts CHANGED
@@ -58,6 +58,9 @@ export declare const command: {
58
58
  readonly getCustomExtensions: import("./actions/get-custom-extensions/types").GetCustomExtensions;
59
59
  readonly getCurrentCompanyCustomExtensions: import("./actions/get-current-company-custom-extensions/types").GetCurrentCompanyCustomExtensions;
60
60
  readonly getCustomExtensionCustomTables: import("./actions/get-custom-extension-custom-tables/types").GetCustomExtensionCustomTables;
61
+ readonly getSecretsKeys: import("./actions/get-secrets-keys/types").GetSecretsKeys;
62
+ readonly getSecretVal: import("./actions/get-secret-val/types").GetSecretVal;
63
+ readonly setSecretVal: import("./actions/set-secret-val/types").SetSecretVal;
61
64
  };
62
65
  export type { ExampleFunction, ExampleFunctionParams, ExampleFunctionResponse } from "./actions/example-function/types";
63
66
  export type { GenerateAPIKey, GenerateAPIKeyParams, GenerateAPIKeyResponse } from "./actions/generate-api-key/types";
@@ -145,3 +148,6 @@ export type { DeleteCustomTableData, DeleteCustomTableDataParams, DeleteCustomTa
145
148
  export type { GetCustomExtensions, GetCustomExtensionsResponse } from "./actions/get-custom-extensions/types";
146
149
  export type { GetCustomExtensionCustomTables, GetCustomExtensionCustomTablesParams, GetCustomExtensionCustomTablesResponse } from "./actions/get-custom-extension-custom-tables/types";
147
150
  export type { GetCurrentCompanyCustomExtensions, GetCurrentCompanyCustomExtensionsParams, GetCurrentCompanyCustomExtensionsResponse } from "./actions/get-current-company-custom-extensions/types";
151
+ export type { GetSecretsKeys, GetSecretsKeysParams, GetSecretsKeysResponse } from "./actions/get-secrets-keys/types";
152
+ export type { GetSecretVal, GetSecretValParams, GetSecretValResponse } from "./actions/get-secret-val/types";
153
+ export type { SetSecretVal, SetSecretValParams, SetSecretValResponse } from "./actions/set-secret-val/types";
package/dist/index.js CHANGED
@@ -65,6 +65,9 @@ import { deleteCustomTableData } from "./actions/delete-custom-table-data/action
65
65
  import { getCustomExtensions } from "./actions/get-custom-extensions/action";
66
66
  import { getCurrentCompanyCustomExtensions } from "./actions/get-current-company-custom-extensions/action";
67
67
  import { getCustomExtensionCustomTables } from "./actions/get-custom-extension-custom-tables/action";
68
+ import { getSecretsKeys } from "./actions/get-secrets-keys/action";
69
+ import { getSecretVal } from "./actions/get-secret-val/action";
70
+ import { setSecretVal } from "./actions/set-secret-val/action";
68
71
  import { generateAPIKey } from "./actions/generate-api-key/action";
69
72
  // Export actions as command object
70
73
  export const command = {
@@ -134,7 +137,11 @@ export const command = {
134
137
  // Custom Extensions Actions
135
138
  getCustomExtensions,
136
139
  getCurrentCompanyCustomExtensions,
137
- getCustomExtensionCustomTables
140
+ getCustomExtensionCustomTables,
141
+ // Secret Storage Actions
142
+ getSecretsKeys,
143
+ getSecretVal,
144
+ setSecretVal,
138
145
  };
139
146
  // Export Common Types
140
147
  export * from "./CommonTypes";
@@ -1,5 +1,8 @@
1
1
  import { mockGetContextManage } from "../../actions/get-context/mock";
2
2
  import { mockGenerateAPIKey } from "../../actions/generate-api-key/mock";
3
+ import { mockGetSecretsKeys } from "../../actions/get-secrets-keys/mock";
4
+ import { mockGetSecretVal } from "../../actions/get-secret-val/mock";
5
+ import { mockSetSecretVal } from "../../actions/set-secret-val/mock";
3
6
  // Custom Tables Mocks
4
7
  import { mockGetCustomTables } from "../../actions/get-custom-tables/mock";
5
8
  import { mockGetCustomTableData } from "../../actions/get-custom-table-data/mock";
@@ -19,6 +22,9 @@ const mockGetFinalContextManage = async () => {
19
22
  export const MANAGE_MOCKS = {
20
23
  getContext: mockGetContextManage,
21
24
  getFinalContext: mockGetFinalContextManage,
25
+ getSecretsKeys: mockGetSecretsKeys,
26
+ getSecretVal: mockGetSecretVal,
27
+ setSecretVal: mockSetSecretVal,
22
28
  generateAPIKey: mockGenerateAPIKey,
23
29
  // Custom Tables Actions
24
30
  getCustomTables: mockGetCustomTables,
@@ -1,7 +1,10 @@
1
- import type { GetContext, GetFinalContext, GenerateAPIKey, GetCustomTables, GetCustomTableData, UpsertCustomTableData, DeleteCustomTableData, GetCustomExtensions, GetCurrentCompanyCustomExtensions, GetCustomExtensionCustomTables } from "../../index";
1
+ import type { GetContext, GetFinalContext, GetSecretsKeys, GetSecretVal, SetSecretVal, GenerateAPIKey, GetCustomTables, GetCustomTableData, UpsertCustomTableData, DeleteCustomTableData, GetCustomExtensions, GetCurrentCompanyCustomExtensions, GetCustomExtensionCustomTables } from "../../index";
2
2
  export interface ManageProviderActions {
3
3
  getContext: GetContext;
4
4
  getFinalContext: GetFinalContext;
5
+ getSecretsKeys: GetSecretsKeys;
6
+ getSecretVal: GetSecretVal;
7
+ setSecretVal: SetSecretVal;
5
8
  generateAPIKey: GenerateAPIKey;
6
9
  getCustomTables: GetCustomTables;
7
10
  getCustomTableData: GetCustomTableData;
@@ -56,6 +56,9 @@ import { mockDeleteCustomTableData } from "../../actions/delete-custom-table-dat
56
56
  import { mockGetCustomExtensions } from "../../actions/get-custom-extensions/mock";
57
57
  import { mockGetCurrentCompanyCustomExtensions } from "../../actions/get-current-company-custom-extensions/mock";
58
58
  import { mockGetCustomExtensionCustomTables } from "../../actions/get-custom-extension-custom-tables/mock";
59
+ import { mockGetSecretsKeys } from "../../actions/get-secrets-keys/mock";
60
+ import { mockGetSecretVal } from "../../actions/get-secret-val/mock";
61
+ import { mockSetSecretVal } from "../../actions/set-secret-val/mock";
59
62
  export const RENDER_MOCKS = {
60
63
  addCartDiscount: mockAddCartDiscount,
61
64
  addCartFee: mockAddCartFee,
@@ -115,4 +118,7 @@ export const RENDER_MOCKS = {
115
118
  getCustomExtensions: mockGetCustomExtensions,
116
119
  getCurrentCompanyCustomExtensions: mockGetCurrentCompanyCustomExtensions,
117
120
  getCustomExtensionCustomTables: mockGetCustomExtensionCustomTables,
121
+ getSecretsKeys: mockGetSecretsKeys,
122
+ getSecretVal: mockGetSecretVal,
123
+ setSecretVal: mockSetSecretVal,
118
124
  };
@@ -1,4 +1,4 @@
1
- import type { ExampleFunction, GetProducts, AddCustomSale, GetCustomers, AssignCustomer, AddCustomer, GetCategories, GetOrders, GetRefunds, AddProductDiscount, AddProductToCart, RemoveProductFromCart, UpdateCartItemQuantity, AddCartDiscount, GetContext, GetFinalContext, AddProductNote, AddProductFee, AdjustInventory, AddOrderNote, AddCartFee, ClearCart, ParkOrder, ResumeParkedOrder, DeleteParkedOrder, InitiateRefund, CashPayment, TapToPayPayment, TerminalPayment, VendaraPayment, AddCustomerNote, RemoveCustomerFromCart, GoToStationHome, OpenCashDrawer, ShowNotification, ShowConfirmation, AuthenticateUser, PartialPayment, SwitchUser, TriggerWebhook, TriggerZapierWebhook, SetRefundStockAction, SelectAllRefundItems, ResetRefundDetails, CalculateRefundTotal, GetRemainingRefundableQuantities, ProcessPartialRefund, GetCurrentCart, Print, SetActiveOrder, GetCustomTables, GetCustomTableData, UpsertCustomTableData, DeleteCustomTableData, GetCustomExtensions, GetCurrentCompanyCustomExtensions, GetCustomExtensionCustomTables, GetCustomTableFields } from "../../index";
1
+ import type { ExampleFunction, GetProducts, AddCustomSale, GetCustomers, AssignCustomer, AddCustomer, GetCategories, GetOrders, GetRefunds, AddProductDiscount, AddProductToCart, RemoveProductFromCart, UpdateCartItemQuantity, AddCartDiscount, GetContext, GetFinalContext, AddProductNote, AddProductFee, AdjustInventory, AddOrderNote, AddCartFee, ClearCart, ParkOrder, ResumeParkedOrder, DeleteParkedOrder, InitiateRefund, CashPayment, TapToPayPayment, TerminalPayment, VendaraPayment, AddCustomerNote, RemoveCustomerFromCart, GoToStationHome, OpenCashDrawer, ShowNotification, ShowConfirmation, AuthenticateUser, PartialPayment, SwitchUser, TriggerWebhook, TriggerZapierWebhook, SetRefundStockAction, SelectAllRefundItems, ResetRefundDetails, CalculateRefundTotal, GetRemainingRefundableQuantities, ProcessPartialRefund, GetCurrentCart, Print, SetActiveOrder, GetCustomTables, GetCustomTableData, UpsertCustomTableData, DeleteCustomTableData, GetCustomExtensions, GetCurrentCompanyCustomExtensions, GetCustomExtensionCustomTables, GetCustomTableFields, GetSecretsKeys, GetSecretVal, SetSecretVal } from "../../index";
2
2
  export interface RenderProviderActions {
3
3
  exampleFunction: ExampleFunction;
4
4
  getProducts: GetProducts;
@@ -58,4 +58,7 @@ export interface RenderProviderActions {
58
58
  getCurrentCompanyCustomExtensions: GetCurrentCompanyCustomExtensions;
59
59
  getCustomExtensionCustomTables: GetCustomExtensionCustomTables;
60
60
  getCustomTableFields: GetCustomTableFields;
61
+ getSecretsKeys: GetSecretsKeys;
62
+ getSecretVal: GetSecretVal;
63
+ setSecretVal: SetSecretVal;
61
64
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@final-commerce/command-frame",
3
- "version": "0.1.29",
3
+ "version": "0.1.30",
4
4
  "description": "Commands Frame library",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",