@aglyn/tenant-feature-instance 1.0.0-beta.259 → 1.0.0-beta.260
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aglyn/tenant-feature-instance",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.260",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"homepage": "https://aglyn.com",
|
|
6
6
|
"repository": {
|
|
@@ -25,12 +25,12 @@
|
|
|
25
25
|
"./package.json": "./package.json"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@aglyn/aglyn": "1.0.0-beta.
|
|
29
|
-
"@aglyn/shared-data-enums": "1.0.0-beta.
|
|
30
|
-
"@aglyn/shared-ui-jsx": "1.0.0-beta.
|
|
31
|
-
"@aglyn/shared-util-email": "1.0.0-beta.
|
|
32
|
-
"@aglyn/shared-util-http": "1.0.0-beta.
|
|
33
|
-
"@aglyn/shared-util-timestamp": "1.0.0-beta.
|
|
28
|
+
"@aglyn/aglyn": "1.0.0-beta.260",
|
|
29
|
+
"@aglyn/shared-data-enums": "1.0.0-beta.260",
|
|
30
|
+
"@aglyn/shared-ui-jsx": "1.0.0-beta.260",
|
|
31
|
+
"@aglyn/shared-util-email": "1.0.0-beta.260",
|
|
32
|
+
"@aglyn/shared-util-http": "1.0.0-beta.260",
|
|
33
|
+
"@aglyn/shared-util-timestamp": "1.0.0-beta.260",
|
|
34
34
|
"@swc/helpers": "0.5.23",
|
|
35
35
|
"lodash-es": "^4.18.1"
|
|
36
36
|
},
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether a site's workspace can take card payments, as the console can tell
|
|
3
|
+
* from the workspace owner's profile.
|
|
4
|
+
*
|
|
5
|
+
* - `pending` — the org or the owner's profile has not answered yet. Never
|
|
6
|
+
* gate on this: a notice that flashes before the read lands tells a
|
|
7
|
+
* connected merchant to connect.
|
|
8
|
+
* - `error` — the profile could not be read. Also never gated on.
|
|
9
|
+
* - `not-connected` — no Stripe account on file.
|
|
10
|
+
* - `charges-disabled` — Stripe has not enabled charges yet (onboarding
|
|
11
|
+
* unfinished, or Stripe needs more details).
|
|
12
|
+
* - `mode-mismatch` — the account is in the other Stripe mode from this
|
|
13
|
+
* deployment (a test account on a live deployment, or the reverse).
|
|
14
|
+
* - `mode-unverified` — a live deployment with an account whose mode was
|
|
15
|
+
* never recorded; reconnecting records it.
|
|
16
|
+
* - `ready` — charges go through.
|
|
17
|
+
*/
|
|
18
|
+
export type MerchantPaymentsState = 'pending' | 'error' | 'not-connected' | 'charges-disabled' | 'mode-mismatch' | 'mode-unverified' | 'ready';
|
|
19
|
+
export type MerchantPaymentsPlatformMode = 'live' | 'test' | undefined;
|
|
20
|
+
/**
|
|
21
|
+
* This deployment's Stripe mode, from its publishable key: `pk_live_…` is
|
|
22
|
+
* live, `pk_test_…` is test. The server reads the same answer off its secret
|
|
23
|
+
* key, and the two keys of one deployment are always a pair.
|
|
24
|
+
*/
|
|
25
|
+
export declare function merchantPaymentsPlatformMode(publishableKey?: string | undefined): MerchantPaymentsPlatformMode;
|
|
26
|
+
/**
|
|
27
|
+
* The verdict for one owner profile. It is the client's copy of the server's
|
|
28
|
+
* `merchantAccountReadiness` and has to answer exactly as that does: a console
|
|
29
|
+
* that calls an account ready while checkout refuses it, or the reverse, puts
|
|
30
|
+
* a notice beside a control that works, or none beside one that fails.
|
|
31
|
+
*
|
|
32
|
+
* Only a literal `true` enables charges and only a literal boolean records a
|
|
33
|
+
* mode, because a field written as `'true'` or `1` was written by something
|
|
34
|
+
* other than the onboarding route.
|
|
35
|
+
*/
|
|
36
|
+
export declare function merchantPaymentsStateFromProfile(profile: Record<string, unknown> | null | undefined, platformMode: MerchantPaymentsPlatformMode): Exclude<MerchantPaymentsState, 'pending' | 'error'>;
|
|
37
|
+
/**
|
|
38
|
+
* One sentence on what stands between the workspace and card payments, for a
|
|
39
|
+
* notice or a disabled control's reason. `null` when nothing does, or while
|
|
40
|
+
* the answer is unknown.
|
|
41
|
+
*/
|
|
42
|
+
export declare function merchantPaymentsBlockedReason(state: MerchantPaymentsState): string | null;
|
|
43
|
+
/**
|
|
44
|
+
* A site's store settings page (`payments`, `shipping`, `pos` …), or `null`
|
|
45
|
+
* until the site's console address resolves or when no installed plugin
|
|
46
|
+
* publishes store settings. Resolved through the plugin record-route seam, so
|
|
47
|
+
* a plugin that only needs to point at the page never imports the one that
|
|
48
|
+
* owns it.
|
|
49
|
+
*/
|
|
50
|
+
export declare function useStoreSettingsHref(hostId: string | undefined, page: string): string | null;
|
|
51
|
+
export interface MerchantPaymentsStatus {
|
|
52
|
+
state: MerchantPaymentsState;
|
|
53
|
+
/** The answer has arrived, so a notice may be shown or held. */
|
|
54
|
+
settled: boolean;
|
|
55
|
+
/** Settled and able to charge. */
|
|
56
|
+
ready: boolean;
|
|
57
|
+
/** Settled and NOT able to charge: the case to explain. */
|
|
58
|
+
blocked: boolean;
|
|
59
|
+
/** {@link merchantPaymentsBlockedReason} for the current state. */
|
|
60
|
+
reason: string | null;
|
|
61
|
+
/** The site's Payments settings page, where Stripe is connected. */
|
|
62
|
+
href: string | null;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Card-payment readiness for the workspace that owns a site.
|
|
66
|
+
*
|
|
67
|
+
* Reads the OWNER's profile, the document every money route checks, rather
|
|
68
|
+
* than the signed-in member's: an admin who is not the owner has no Stripe
|
|
69
|
+
* account of their own, and reading theirs would report a connected store as
|
|
70
|
+
* not set up.
|
|
71
|
+
*/
|
|
72
|
+
export declare function useMerchantPayments(hostId: string | undefined): MerchantPaymentsStatus;
|
|
73
|
+
export default useMerchantPayments;
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Aglyn LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/ 'use client';
|
|
17
|
+
import { pluginRecordHref } from "@aglyn/aglyn/plugin-manager/plugin-record-routes";
|
|
18
|
+
import { doc } from "firebase/firestore";
|
|
19
|
+
import { useMemo } from "react";
|
|
20
|
+
import { useFirestore } from "./firebase/firebase-services.js";
|
|
21
|
+
import { useConsoleHostRoute } from "./use-console-host-route.js";
|
|
22
|
+
import { useFirestoreDoc } from "./use-firestore-doc.js";
|
|
23
|
+
import { useOrgPlan } from "./use-org-plan.js";
|
|
24
|
+
/**
|
|
25
|
+
* This deployment's Stripe mode, from its publishable key: `pk_live_…` is
|
|
26
|
+
* live, `pk_test_…` is test. The server reads the same answer off its secret
|
|
27
|
+
* key, and the two keys of one deployment are always a pair.
|
|
28
|
+
*/ export function merchantPaymentsPlatformMode(// The dot form: a bundler inlines `process.env.NEXT_PUBLIC_…` into browser
|
|
29
|
+
// code only when the name is written out like this.
|
|
30
|
+
publishableKey = process.env.NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY) {
|
|
31
|
+
const key = String(publishableKey != null ? publishableKey : '').trim();
|
|
32
|
+
if (key.startsWith('pk_live_')) return 'live';
|
|
33
|
+
if (key.startsWith('pk_test_')) return 'test';
|
|
34
|
+
return undefined;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* The verdict for one owner profile. It is the client's copy of the server's
|
|
38
|
+
* `merchantAccountReadiness` and has to answer exactly as that does: a console
|
|
39
|
+
* that calls an account ready while checkout refuses it, or the reverse, puts
|
|
40
|
+
* a notice beside a control that works, or none beside one that fails.
|
|
41
|
+
*
|
|
42
|
+
* Only a literal `true` enables charges and only a literal boolean records a
|
|
43
|
+
* mode, because a field written as `'true'` or `1` was written by something
|
|
44
|
+
* other than the onboarding route.
|
|
45
|
+
*/ export function merchantPaymentsStateFromProfile(profile, platformMode) {
|
|
46
|
+
const accountId = typeof (profile == null ? void 0 : profile['stripeAccountId']) === 'string' ? profile['stripeAccountId'].trim() : '';
|
|
47
|
+
if (!accountId) return 'not-connected';
|
|
48
|
+
if ((profile == null ? void 0 : profile['stripeChargesEnabled']) !== true) return 'charges-disabled';
|
|
49
|
+
const accountLivemode = profile == null ? void 0 : profile['stripeAccountLivemode'];
|
|
50
|
+
if (typeof accountLivemode === 'boolean') {
|
|
51
|
+
if (!platformMode) return 'ready';
|
|
52
|
+
return accountLivemode === (platformMode === 'live') ? 'ready' : 'mode-mismatch';
|
|
53
|
+
}
|
|
54
|
+
return platformMode === 'live' ? 'mode-unverified' : 'ready';
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* One sentence on what stands between the workspace and card payments, for a
|
|
58
|
+
* notice or a disabled control's reason. `null` when nothing does, or while
|
|
59
|
+
* the answer is unknown.
|
|
60
|
+
*/ export function merchantPaymentsBlockedReason(state) {
|
|
61
|
+
switch(state){
|
|
62
|
+
case 'not-connected':
|
|
63
|
+
return 'Connect Stripe to take card payments.';
|
|
64
|
+
case 'charges-disabled':
|
|
65
|
+
return 'Finish setting up Stripe to take card payments: Stripe has not turned on charges for this account yet.';
|
|
66
|
+
case 'mode-mismatch':
|
|
67
|
+
case 'mode-unverified':
|
|
68
|
+
return 'Reconnect Stripe to take card payments: the connected account has not been confirmed for live payments.';
|
|
69
|
+
default:
|
|
70
|
+
return null;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* A site's store settings page (`payments`, `shipping`, `pos` …), or `null`
|
|
75
|
+
* until the site's console address resolves or when no installed plugin
|
|
76
|
+
* publishes store settings. Resolved through the plugin record-route seam, so
|
|
77
|
+
* a plugin that only needs to point at the page never imports the one that
|
|
78
|
+
* owns it.
|
|
79
|
+
*/ export function useStoreSettingsHref(hostId, page) {
|
|
80
|
+
const { orgSlug, subdomain } = useConsoleHostRoute(hostId);
|
|
81
|
+
return useMemo(()=>orgSlug && subdomain ? pluginRecordHref('store-settings', {
|
|
82
|
+
orgSlug,
|
|
83
|
+
host: subdomain
|
|
84
|
+
}, page) : null, [
|
|
85
|
+
orgSlug,
|
|
86
|
+
subdomain,
|
|
87
|
+
page
|
|
88
|
+
]);
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Card-payment readiness for the workspace that owns a site.
|
|
92
|
+
*
|
|
93
|
+
* Reads the OWNER's profile, the document every money route checks, rather
|
|
94
|
+
* than the signed-in member's: an admin who is not the owner has no Stripe
|
|
95
|
+
* account of their own, and reading theirs would report a connected store as
|
|
96
|
+
* not set up.
|
|
97
|
+
*/ export function useMerchantPayments(hostId) {
|
|
98
|
+
const firestore = useFirestore();
|
|
99
|
+
const { org, ready: orgReady } = useOrgPlan(hostId);
|
|
100
|
+
const href = useStoreSettingsHref(hostId, 'payments');
|
|
101
|
+
const ownerUid = typeof (org == null ? void 0 : org['ownerUid']) === 'string' ? org['ownerUid'] : '';
|
|
102
|
+
const { data: profile, status } = useFirestoreDoc(()=>ownerUid ? doc(firestore, 'profiles', ownerUid) : null, [
|
|
103
|
+
firestore,
|
|
104
|
+
ownerUid
|
|
105
|
+
]);
|
|
106
|
+
return useMemo(()=>{
|
|
107
|
+
let state;
|
|
108
|
+
if (!orgReady) state = 'pending';
|
|
109
|
+
else if (!ownerUid) state = 'not-connected';
|
|
110
|
+
else if (status === 'error') state = 'error';
|
|
111
|
+
else if (status !== 'success') state = 'pending';
|
|
112
|
+
else state = merchantPaymentsStateFromProfile(profile, merchantPaymentsPlatformMode());
|
|
113
|
+
const settled = state !== 'pending' && state !== 'error';
|
|
114
|
+
return {
|
|
115
|
+
state,
|
|
116
|
+
settled,
|
|
117
|
+
ready: state === 'ready',
|
|
118
|
+
blocked: settled && state !== 'ready',
|
|
119
|
+
reason: merchantPaymentsBlockedReason(state),
|
|
120
|
+
href
|
|
121
|
+
};
|
|
122
|
+
}, [
|
|
123
|
+
orgReady,
|
|
124
|
+
ownerUid,
|
|
125
|
+
status,
|
|
126
|
+
profile,
|
|
127
|
+
href
|
|
128
|
+
]);
|
|
129
|
+
}
|
|
130
|
+
export default useMerchantPayments;
|
|
131
|
+
|
|
132
|
+
//# sourceMappingURL=use-merchant-payments.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../libs/tenant/feature/instance/src/lib/hooks/use-merchant-payments.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n'use client'\n\nimport { pluginRecordHref } from '@aglyn/aglyn/plugin-manager/plugin-record-routes'\nimport { doc } from 'firebase/firestore'\nimport { useMemo } from 'react'\nimport { useFirestore } from './firebase/firebase-services'\nimport { useConsoleHostRoute } from './use-console-host-route'\nimport { useFirestoreDoc } from './use-firestore-doc'\nimport { useOrgPlan } from './use-org-plan'\n\n/**\n * Whether a site's workspace can take card payments, as the console can tell\n * from the workspace owner's profile.\n *\n * - `pending` — the org or the owner's profile has not answered yet. Never\n * gate on this: a notice that flashes before the read lands tells a\n * connected merchant to connect.\n * - `error` — the profile could not be read. Also never gated on.\n * - `not-connected` — no Stripe account on file.\n * - `charges-disabled` — Stripe has not enabled charges yet (onboarding\n * unfinished, or Stripe needs more details).\n * - `mode-mismatch` — the account is in the other Stripe mode from this\n * deployment (a test account on a live deployment, or the reverse).\n * - `mode-unverified` — a live deployment with an account whose mode was\n * never recorded; reconnecting records it.\n * - `ready` — charges go through.\n */\nexport type MerchantPaymentsState =\n | 'pending'\n | 'error'\n | 'not-connected'\n | 'charges-disabled'\n | 'mode-mismatch'\n | 'mode-unverified'\n | 'ready'\n\nexport type MerchantPaymentsPlatformMode = 'live' | 'test' | undefined\n\n/**\n * This deployment's Stripe mode, from its publishable key: `pk_live_…` is\n * live, `pk_test_…` is test. The server reads the same answer off its secret\n * key, and the two keys of one deployment are always a pair.\n */\nexport function merchantPaymentsPlatformMode(\n // The dot form: a bundler inlines `process.env.NEXT_PUBLIC_…` into browser\n // code only when the name is written out like this.\n publishableKey: string | undefined = process.env.NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY,\n): MerchantPaymentsPlatformMode {\n const key = String(publishableKey ?? '').trim()\n if (key.startsWith('pk_live_')) return 'live'\n if (key.startsWith('pk_test_')) return 'test'\n return undefined\n}\n\n/**\n * The verdict for one owner profile. It is the client's copy of the server's\n * `merchantAccountReadiness` and has to answer exactly as that does: a console\n * that calls an account ready while checkout refuses it, or the reverse, puts\n * a notice beside a control that works, or none beside one that fails.\n *\n * Only a literal `true` enables charges and only a literal boolean records a\n * mode, because a field written as `'true'` or `1` was written by something\n * other than the onboarding route.\n */\nexport function merchantPaymentsStateFromProfile(\n profile: Record<string, unknown> | null | undefined,\n platformMode: MerchantPaymentsPlatformMode,\n): Exclude<MerchantPaymentsState, 'pending' | 'error'> {\n const accountId = typeof profile?.['stripeAccountId'] === 'string' ? profile['stripeAccountId'].trim() : ''\n if (!accountId) return 'not-connected'\n if (profile?.['stripeChargesEnabled'] !== true) return 'charges-disabled'\n const accountLivemode = profile?.['stripeAccountLivemode']\n if (typeof accountLivemode === 'boolean') {\n if (!platformMode) return 'ready'\n return accountLivemode === (platformMode === 'live') ? 'ready' : 'mode-mismatch'\n }\n return platformMode === 'live' ? 'mode-unverified' : 'ready'\n}\n\n/**\n * One sentence on what stands between the workspace and card payments, for a\n * notice or a disabled control's reason. `null` when nothing does, or while\n * the answer is unknown.\n */\nexport function merchantPaymentsBlockedReason(state: MerchantPaymentsState): string | null {\n switch (state) {\n case 'not-connected':\n return 'Connect Stripe to take card payments.'\n case 'charges-disabled':\n return 'Finish setting up Stripe to take card payments: Stripe has not turned on charges for this account yet.'\n case 'mode-mismatch':\n case 'mode-unverified':\n return 'Reconnect Stripe to take card payments: the connected account has not been confirmed for live payments.'\n default:\n return null\n }\n}\n\n/**\n * A site's store settings page (`payments`, `shipping`, `pos` …), or `null`\n * until the site's console address resolves or when no installed plugin\n * publishes store settings. Resolved through the plugin record-route seam, so\n * a plugin that only needs to point at the page never imports the one that\n * owns it.\n */\nexport function useStoreSettingsHref(hostId: string | undefined, page: string): string | null {\n const { orgSlug, subdomain } = useConsoleHostRoute(hostId)\n return useMemo(\n () => (orgSlug && subdomain ? pluginRecordHref('store-settings', { orgSlug, host: subdomain }, page) : null),\n [orgSlug, subdomain, page],\n )\n}\n\nexport interface MerchantPaymentsStatus {\n state: MerchantPaymentsState\n /** The answer has arrived, so a notice may be shown or held. */\n settled: boolean\n /** Settled and able to charge. */\n ready: boolean\n /** Settled and NOT able to charge: the case to explain. */\n blocked: boolean\n /** {@link merchantPaymentsBlockedReason} for the current state. */\n reason: string | null\n /** The site's Payments settings page, where Stripe is connected. */\n href: string | null\n}\n\n/**\n * Card-payment readiness for the workspace that owns a site.\n *\n * Reads the OWNER's profile, the document every money route checks, rather\n * than the signed-in member's: an admin who is not the owner has no Stripe\n * account of their own, and reading theirs would report a connected store as\n * not set up.\n */\nexport function useMerchantPayments(hostId: string | undefined): MerchantPaymentsStatus {\n const firestore = useFirestore()\n const { org, ready: orgReady } = useOrgPlan(hostId)\n const href = useStoreSettingsHref(hostId, 'payments')\n const ownerUid = typeof org?.['ownerUid'] === 'string' ? (org['ownerUid'] as string) : ''\n const { data: profile, status } = useFirestoreDoc<Record<string, unknown>>(\n () => (ownerUid ? doc(firestore, 'profiles', ownerUid) : null),\n [firestore, ownerUid],\n )\n return useMemo(() => {\n let state: MerchantPaymentsState\n if (!orgReady) state = 'pending'\n else if (!ownerUid) state = 'not-connected'\n else if (status === 'error') state = 'error'\n else if (status !== 'success') state = 'pending'\n else state = merchantPaymentsStateFromProfile(profile, merchantPaymentsPlatformMode())\n const settled = state !== 'pending' && state !== 'error'\n return {\n state,\n settled,\n ready: state === 'ready',\n blocked: settled && state !== 'ready',\n reason: merchantPaymentsBlockedReason(state),\n href,\n }\n }, [orgReady, ownerUid, status, profile, href])\n}\n\nexport default useMerchantPayments\n"],"names":["pluginRecordHref","doc","useMemo","useFirestore","useConsoleHostRoute","useFirestoreDoc","useOrgPlan","merchantPaymentsPlatformMode","publishableKey","process","env","NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY","key","String","trim","startsWith","undefined","merchantPaymentsStateFromProfile","profile","platformMode","accountId","accountLivemode","merchantPaymentsBlockedReason","state","useStoreSettingsHref","hostId","page","orgSlug","subdomain","host","useMerchantPayments","firestore","org","ready","orgReady","href","ownerUid","data","status","settled","blocked","reason"],"mappings":"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"}
|
package/src/lib/tenant.d.ts
CHANGED
|
@@ -49,6 +49,7 @@ export * from './hooks/use-host-org-id';
|
|
|
49
49
|
export * from './hooks/use-container-options';
|
|
50
50
|
export * from './hooks/use-org-member-options';
|
|
51
51
|
export * from './hooks/use-org-plan';
|
|
52
|
+
export * from './hooks/use-merchant-payments';
|
|
52
53
|
export * from './hooks/use-scope-tokens';
|
|
53
54
|
export * from './hooks/use-host-resource-api';
|
|
54
55
|
export * from './hooks/use-host-version-api';
|
package/src/lib/tenant.js
CHANGED
|
@@ -48,6 +48,7 @@ export * from "./hooks/use-host-org-id.js";
|
|
|
48
48
|
export * from "./hooks/use-container-options.js";
|
|
49
49
|
export * from "./hooks/use-org-member-options.js";
|
|
50
50
|
export * from "./hooks/use-org-plan.js";
|
|
51
|
+
export * from "./hooks/use-merchant-payments.js";
|
|
51
52
|
export * from "./hooks/use-scope-tokens.js";
|
|
52
53
|
export * from "./hooks/use-host-resource-api.js";
|
|
53
54
|
export * from "./hooks/use-host-version-api.js";
|
package/src/lib/tenant.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../libs/tenant/feature/instance/src/lib/tenant.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2022 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport * from './constants/mock-data'\nexport * from './constants/site-paths'\nexport * from './constants/firebase-config'\nexport * from './constants/firebase-emulator-hosts'\n\nexport * from './hooks/firebase/app-check-recaptcha-container'\nexport * from './hooks/firebase/auth-persistence'\nexport * from './hooks/firebase/firebase-services'\nexport * from './hooks/firebase/firestore-cache'\nexport * from './hooks/firebase/firestore-stall-recovery'\nexport * from './hooks/firebase/firestore-bounded-read'\nexport * from './hooks/helpers/use-doc'\nexport * from './hooks/helpers/use-modify-doc-callback'\nexport * from './hooks/helpers/besigner-nodes-converter'\nexport * from './hooks/helpers/guarded-nodes-save'\nexport * from './hooks/helpers/guarded-seed-write'\n\nexport * from './hooks/firestore-denial-reporter'\nexport * from './hooks/use-firestore-collection'\nexport * from './hooks/use-paged-collection'\nexport * from './hooks/use-sorted-paged-collection'\nexport * from './hooks/sorted-collection-window'\nexport * from './hooks/host-collection-queries'\nexport * from './hooks/list-filter-constraints'\nexport * from './hooks/use-firestore-doc'\nexport * from './hooks/use-switcher-collection'\nexport * from './hooks/use-host-activity-logger'\nexport * from './hooks/use-live-artifact-count'\nexport * from './hooks/use-component'\nexport * from './hooks/use-component-version'\nexport * from './hooks/use-host-document-version'\nexport * from './hooks/use-host-template'\nexport * from './hooks/use-console-host-route'\nexport * from './hooks/use-host-org-id'\nexport * from './hooks/use-container-options'\nexport * from './hooks/use-org-member-options'\nexport * from './hooks/use-org-plan'\nexport * from './hooks/use-scope-tokens'\nexport * from './hooks/use-host-resource-api'\nexport * from './hooks/use-host-version-api'\nexport * from './hooks/use-duplicate-resource-api'\nexport * from './hooks/use-plugin-api-post'\nexport * from './components/duplicate-resource-dialog'\nexport * from './hooks/use-plugin-config'\nexport * from './hooks/use-host'\nexport * from './hooks/use-layout'\nexport * from './hooks/use-layout-version'\nexport * from './hooks/use-screen'\nexport * from './hooks/use-screen-version'\nexport * from './hooks/use-user-name'\nexport * from './hooks/use-user-photo'\n"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED,cAAc,2BAAuB;AACrC,cAAc,4BAAwB;AACtC,cAAc,iCAA6B;AAC3C,cAAc,yCAAqC;AAEnD,cAAc,oDAAgD;AAC9D,cAAc,uCAAmC;AACjD,cAAc,wCAAoC;AAClD,cAAc,sCAAkC;AAChD,cAAc,+CAA2C;AACzD,cAAc,6CAAyC;AACvD,cAAc,6BAAyB;AACvC,cAAc,6CAAyC;AACvD,cAAc,8CAA0C;AACxD,cAAc,wCAAoC;AAClD,cAAc,wCAAoC;AAElD,cAAc,uCAAmC;AACjD,cAAc,sCAAkC;AAChD,cAAc,kCAA8B;AAC5C,cAAc,yCAAqC;AACnD,cAAc,sCAAkC;AAChD,cAAc,qCAAiC;AAC/C,cAAc,qCAAiC;AAC/C,cAAc,+BAA2B;AACzC,cAAc,qCAAiC;AAC/C,cAAc,sCAAkC;AAChD,cAAc,qCAAiC;AAC/C,cAAc,2BAAuB;AACrC,cAAc,mCAA+B;AAC7C,cAAc,uCAAmC;AACjD,cAAc,+BAA2B;AACzC,cAAc,oCAAgC;AAC9C,cAAc,6BAAyB;AACvC,cAAc,mCAA+B;AAC7C,cAAc,oCAAgC;AAC9C,cAAc,0BAAsB;AACpC,cAAc,8BAA0B;AACxC,cAAc,mCAA+B;AAC7C,cAAc,kCAA8B;AAC5C,cAAc,wCAAoC;AAClD,cAAc,iCAA6B;AAC3C,cAAc,4CAAwC;AACtD,cAAc,+BAA2B;AACzC,cAAc,sBAAkB;AAChC,cAAc,wBAAoB;AAClC,cAAc,gCAA4B;AAC1C,cAAc,wBAAoB;AAClC,cAAc,gCAA4B;AAC1C,cAAc,2BAAuB;AACrC,cAAc,4BAAwB"}
|
|
1
|
+
{"version":3,"sources":["../../../../../../../libs/tenant/feature/instance/src/lib/tenant.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2022 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport * from './constants/mock-data'\nexport * from './constants/site-paths'\nexport * from './constants/firebase-config'\nexport * from './constants/firebase-emulator-hosts'\n\nexport * from './hooks/firebase/app-check-recaptcha-container'\nexport * from './hooks/firebase/auth-persistence'\nexport * from './hooks/firebase/firebase-services'\nexport * from './hooks/firebase/firestore-cache'\nexport * from './hooks/firebase/firestore-stall-recovery'\nexport * from './hooks/firebase/firestore-bounded-read'\nexport * from './hooks/helpers/use-doc'\nexport * from './hooks/helpers/use-modify-doc-callback'\nexport * from './hooks/helpers/besigner-nodes-converter'\nexport * from './hooks/helpers/guarded-nodes-save'\nexport * from './hooks/helpers/guarded-seed-write'\n\nexport * from './hooks/firestore-denial-reporter'\nexport * from './hooks/use-firestore-collection'\nexport * from './hooks/use-paged-collection'\nexport * from './hooks/use-sorted-paged-collection'\nexport * from './hooks/sorted-collection-window'\nexport * from './hooks/host-collection-queries'\nexport * from './hooks/list-filter-constraints'\nexport * from './hooks/use-firestore-doc'\nexport * from './hooks/use-switcher-collection'\nexport * from './hooks/use-host-activity-logger'\nexport * from './hooks/use-live-artifact-count'\nexport * from './hooks/use-component'\nexport * from './hooks/use-component-version'\nexport * from './hooks/use-host-document-version'\nexport * from './hooks/use-host-template'\nexport * from './hooks/use-console-host-route'\nexport * from './hooks/use-host-org-id'\nexport * from './hooks/use-container-options'\nexport * from './hooks/use-org-member-options'\nexport * from './hooks/use-org-plan'\nexport * from './hooks/use-merchant-payments'\nexport * from './hooks/use-scope-tokens'\nexport * from './hooks/use-host-resource-api'\nexport * from './hooks/use-host-version-api'\nexport * from './hooks/use-duplicate-resource-api'\nexport * from './hooks/use-plugin-api-post'\nexport * from './components/duplicate-resource-dialog'\nexport * from './hooks/use-plugin-config'\nexport * from './hooks/use-host'\nexport * from './hooks/use-layout'\nexport * from './hooks/use-layout-version'\nexport * from './hooks/use-screen'\nexport * from './hooks/use-screen-version'\nexport * from './hooks/use-user-name'\nexport * from './hooks/use-user-photo'\n"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED,cAAc,2BAAuB;AACrC,cAAc,4BAAwB;AACtC,cAAc,iCAA6B;AAC3C,cAAc,yCAAqC;AAEnD,cAAc,oDAAgD;AAC9D,cAAc,uCAAmC;AACjD,cAAc,wCAAoC;AAClD,cAAc,sCAAkC;AAChD,cAAc,+CAA2C;AACzD,cAAc,6CAAyC;AACvD,cAAc,6BAAyB;AACvC,cAAc,6CAAyC;AACvD,cAAc,8CAA0C;AACxD,cAAc,wCAAoC;AAClD,cAAc,wCAAoC;AAElD,cAAc,uCAAmC;AACjD,cAAc,sCAAkC;AAChD,cAAc,kCAA8B;AAC5C,cAAc,yCAAqC;AACnD,cAAc,sCAAkC;AAChD,cAAc,qCAAiC;AAC/C,cAAc,qCAAiC;AAC/C,cAAc,+BAA2B;AACzC,cAAc,qCAAiC;AAC/C,cAAc,sCAAkC;AAChD,cAAc,qCAAiC;AAC/C,cAAc,2BAAuB;AACrC,cAAc,mCAA+B;AAC7C,cAAc,uCAAmC;AACjD,cAAc,+BAA2B;AACzC,cAAc,oCAAgC;AAC9C,cAAc,6BAAyB;AACvC,cAAc,mCAA+B;AAC7C,cAAc,oCAAgC;AAC9C,cAAc,0BAAsB;AACpC,cAAc,mCAA+B;AAC7C,cAAc,8BAA0B;AACxC,cAAc,mCAA+B;AAC7C,cAAc,kCAA8B;AAC5C,cAAc,wCAAoC;AAClD,cAAc,iCAA6B;AAC3C,cAAc,4CAAwC;AACtD,cAAc,+BAA2B;AACzC,cAAc,sBAAkB;AAChC,cAAc,wBAAoB;AAClC,cAAc,gCAA4B;AAC1C,cAAc,wBAAoB;AAClC,cAAc,gCAA4B;AAC1C,cAAc,2BAAuB;AACrC,cAAc,4BAAwB"}
|