@fias/arche-sdk 2.31.0 → 2.32.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/dist/entity-ops.d.ts +6 -0
- package/dist/entity-ops.d.ts.map +1 -1
- package/dist/entity-ops.js +7 -1
- package/dist/entity-ops.js.map +1 -1
- package/dist/generated/permissions.d.ts +1 -1
- package/dist/generated/permissions.d.ts.map +1 -1
- package/dist/generated/permissions.js +4 -0
- package/dist/generated/permissions.js.map +1 -1
- package/dist/hooks.d.ts +40 -4
- package/dist/hooks.d.ts.map +1 -1
- package/dist/hooks.js +128 -20
- package/dist/hooks.js.map +1 -1
- package/dist/hooks.test.js +110 -0
- package/dist/hooks.test.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +102 -11
- package/dist/types.d.ts +218 -14
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/templates/default/AGENTS.md +61 -8
- package/templates/default/CLAUDE.md +61 -8
package/dist/entity-ops.d.ts
CHANGED
|
@@ -63,6 +63,9 @@ export declare const CONNECTIONS_ENTITY_ID = "ent_intg_connections_00000000000";
|
|
|
63
63
|
/** Connect an Account — a client-side entity: the HOST draws its connect
|
|
64
64
|
* sheet, where the person connects an account or lets this app use one. */
|
|
65
65
|
export declare const CONNECTIONS_CONNECT_ENTITY_ID = "ent_intg_connections_connect_000";
|
|
66
|
+
/** Web sources (ADR-038) — pages on sites Fias approved, read into a form the
|
|
67
|
+
* app declares: `list_sites`, `extract` (`web:sources:read`). Never the page's text. */
|
|
68
|
+
export declare const WEB_SOURCES_ENTITY_ID = "ent_intg_web_sources_00000000000";
|
|
66
69
|
/** X — act AS a connected X account (ADR-029 §3). */
|
|
67
70
|
export declare const X_ENTITY_ID = "ent_intg_twitter_000000000000000";
|
|
68
71
|
/** LinkedIn — act AS a connected LinkedIn member account (ADR-029 §3). */
|
|
@@ -73,6 +76,9 @@ export declare const ACTION_CONFIRMATION_ENTITY_ID = "ent_intg_action_confirmati
|
|
|
73
76
|
/** Manage or Request Access — a client-side entity: the HOST draws its access
|
|
74
77
|
* sheet for the person's own access to this app's workspace data (ADR-034). */
|
|
75
78
|
export declare const APP_ACCESS_DIALOG_ENTITY_ID = "ent_intg_app_access_dialog_00000";
|
|
79
|
+
/** Add people — a client-side entity: the HOST draws its sheet in which the
|
|
80
|
+
* person chooses who joins one of this app's workspaces (ADR-040 Q12). */
|
|
81
|
+
export declare const WORKSPACE_ADD_PEOPLE_ENTITY_ID = "ent_intg_workspace_add_people_00";
|
|
76
82
|
/** Pick from the Creative Library — a client-side entity: the HOST draws its
|
|
77
83
|
* picker of the styles and characters this arche can use (ADR-037 D8). */
|
|
78
84
|
export declare const CREATIVE_PICKER_ENTITY_ID = "ent_intg_creative_picker_0000000";
|
package/dist/entity-ops.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entity-ops.d.ts","sourceRoot":"","sources":["../src/entity-ops.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,OAAO,EAAmB,KAAK,UAAU,EAAE,MAAM,UAAU,CAAC;AAE5D,eAAO,MAAM,wBAAwB,qCAAqC,CAAC;AAC3E,eAAO,MAAM,0BAA0B,qCAAqC,CAAC;AAC7E,eAAO,MAAM,2BAA2B,qCAAqC,CAAC;AAC9E,eAAO,MAAM,sBAAsB,qCAAqC,CAAC;AACzE;gFACgF;AAChF,eAAO,MAAM,8BAA8B,qCAAqC,CAAC;AACjF;;;;;;yDAMyD;AACzD,eAAO,MAAM,+BAA+B,qCAAqC,CAAC;AAClF;;8BAE8B;AAC9B,eAAO,MAAM,wBAAwB,qCAAqC,CAAC;AAC3E;;;iEAGiE;AACjE,eAAO,MAAM,0BAA0B,qCAAqC,CAAC;AAC7E;;;;qBAIqB;AACrB,eAAO,MAAM,uBAAuB,q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AC;AAChD,eAAO,MAAM,iCAAiC,KAAK,CAAC;AAEpD;;;;;;;;;;;;GAYG;AACH,wBAAsB,cAAc,CAAC,CAAC,EACpC,MAAM,EAAE,UAAU,EAClB,QAAQ,EAAE,MAAM,EAChB,EAAE,EAAE,MAAM,EACV,IAAI,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM,GACjC,OAAO,CAAC,CAAC,CAAC,CAQZ;AAqCD;;;;;;;;GAQG;AACH,wBAAsB,aAAa,CAAC,CAAC,EACnC,MAAM,EAAE,UAAU,EAClB,EAAE,EAAE,MAAM,EACV,IAAI,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM,GACjC,OAAO,CAAC,CAAC,CAAC,CAKZ"}
|
package/dist/entity-ops.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.COMMUNITY_ASSET_MAX_PUBLISH_BATCH = exports.COMMUNITY_ASSET_MAX_URL_BATCH = exports.SCHEDULED_INVOCATIONS_ENTITY_ID = exports.SEND_TO_OPENER_ENTITY_ID = exports.CREATIVE_PICKER_ENTITY_ID = exports.APP_ACCESS_DIALOG_ENTITY_ID = exports.ACTION_CONFIRMATION_ENTITY_ID = exports.LINKEDIN_ENTITY_ID = exports.X_ENTITY_ID = exports.CONNECTIONS_CONNECT_ENTITY_ID = exports.CONNECTIONS_ENTITY_ID = exports.COMPANY_EMAIL_SEND_ENTITY_ID = exports.DOCUMENT_SIGN_ENTITY_ID = exports.COMMUNITY_ASSETS_ENTITY_ID = exports.VAULT_CREATIVE_ENTITY_ID = exports.VAULT_ARCHE_DOCUMENTS_ENTITY_ID = exports.VAULT_USER_DOCUMENTS_ENTITY_ID = exports.PLUGIN_STORE_ENTITY_ID = exports.PLUGIN_WORKSPACES_ENTITY_ID = exports.PLUGIN_DATASTORE_ENTITY_ID = exports.PLUGIN_STORAGE_ENTITY_ID = void 0;
|
|
3
|
+
exports.COMMUNITY_ASSET_MAX_PUBLISH_BATCH = exports.COMMUNITY_ASSET_MAX_URL_BATCH = exports.SCHEDULED_INVOCATIONS_ENTITY_ID = exports.SEND_TO_OPENER_ENTITY_ID = exports.CREATIVE_PICKER_ENTITY_ID = exports.WORKSPACE_ADD_PEOPLE_ENTITY_ID = exports.APP_ACCESS_DIALOG_ENTITY_ID = exports.ACTION_CONFIRMATION_ENTITY_ID = exports.LINKEDIN_ENTITY_ID = exports.X_ENTITY_ID = exports.WEB_SOURCES_ENTITY_ID = exports.CONNECTIONS_CONNECT_ENTITY_ID = exports.CONNECTIONS_ENTITY_ID = exports.COMPANY_EMAIL_SEND_ENTITY_ID = exports.DOCUMENT_SIGN_ENTITY_ID = exports.COMMUNITY_ASSETS_ENTITY_ID = exports.VAULT_CREATIVE_ENTITY_ID = exports.VAULT_ARCHE_DOCUMENTS_ENTITY_ID = exports.VAULT_USER_DOCUMENTS_ENTITY_ID = exports.PLUGIN_STORE_ENTITY_ID = exports.PLUGIN_WORKSPACES_ENTITY_ID = exports.PLUGIN_DATASTORE_ENTITY_ID = exports.PLUGIN_STORAGE_ENTITY_ID = void 0;
|
|
4
4
|
exports.invokeEntityOp = invokeEntityOp;
|
|
5
5
|
exports.invokeStoreOp = invokeStoreOp;
|
|
6
6
|
/**
|
|
@@ -68,6 +68,9 @@ exports.CONNECTIONS_ENTITY_ID = 'ent_intg_connections_00000000000';
|
|
|
68
68
|
/** Connect an Account — a client-side entity: the HOST draws its connect
|
|
69
69
|
* sheet, where the person connects an account or lets this app use one. */
|
|
70
70
|
exports.CONNECTIONS_CONNECT_ENTITY_ID = 'ent_intg_connections_connect_000';
|
|
71
|
+
/** Web sources (ADR-038) — pages on sites Fias approved, read into a form the
|
|
72
|
+
* app declares: `list_sites`, `extract` (`web:sources:read`). Never the page's text. */
|
|
73
|
+
exports.WEB_SOURCES_ENTITY_ID = 'ent_intg_web_sources_00000000000';
|
|
71
74
|
/** X — act AS a connected X account (ADR-029 §3). */
|
|
72
75
|
exports.X_ENTITY_ID = 'ent_intg_twitter_000000000000000';
|
|
73
76
|
/** LinkedIn — act AS a connected LinkedIn member account (ADR-029 §3). */
|
|
@@ -78,6 +81,9 @@ exports.ACTION_CONFIRMATION_ENTITY_ID = 'ent_intg_action_confirmation_000';
|
|
|
78
81
|
/** Manage or Request Access — a client-side entity: the HOST draws its access
|
|
79
82
|
* sheet for the person's own access to this app's workspace data (ADR-034). */
|
|
80
83
|
exports.APP_ACCESS_DIALOG_ENTITY_ID = 'ent_intg_app_access_dialog_00000';
|
|
84
|
+
/** Add people — a client-side entity: the HOST draws its sheet in which the
|
|
85
|
+
* person chooses who joins one of this app's workspaces (ADR-040 Q12). */
|
|
86
|
+
exports.WORKSPACE_ADD_PEOPLE_ENTITY_ID = 'ent_intg_workspace_add_people_00';
|
|
81
87
|
/** Pick from the Creative Library — a client-side entity: the HOST draws its
|
|
82
88
|
* picker of the styles and characters this arche can use (ADR-037 D8). */
|
|
83
89
|
exports.CREATIVE_PICKER_ENTITY_ID = 'ent_intg_creative_picker_0000000';
|
package/dist/entity-ops.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entity-ops.js","sourceRoot":"","sources":["../src/entity-ops.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"entity-ops.js","sourceRoot":"","sources":["../src/entity-ops.ts"],"names":[],"mappings":";;;AAkIA,wCAaC;AA8CD,sCASC;AAtMD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,qCAA4D;AAE/C,QAAA,wBAAwB,GAAG,kCAAkC,CAAC;AAC9D,QAAA,0BAA0B,GAAG,kCAAkC,CAAC;AAChE,QAAA,2BAA2B,GAAG,kCAAkC,CAAC;AACjE,QAAA,sBAAsB,GAAG,kCAAkC,CAAC;AACzE;gFACgF;AACnE,QAAA,8BAA8B,GAAG,kCAAkC,CAAC;AACjF;;;;;;yDAMyD;AAC5C,QAAA,+BAA+B,GAAG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,eAAe,EAAE;QACxC,QAAQ,EAAE,8BAAsB;QAChC,OAAO,EAAE,EAAE,EAAE,EAAE,GAAG,IAAI,EAAE;KACzB,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* `tests/architecture/sdk-permissions-match-db-types.test.ts` ensures
|
|
10
10
|
* this file stays in lockstep with the canonical source.
|
|
11
11
|
*/
|
|
12
|
-
export type PluginPermission = 'ai:actions' | 'assets:community:publish' | 'assets:community:read' | 'assets:read' | 'connections:use' | 'data:agents' | 'data:search' | 'data:store' | 'data:workspace' | 'docsign:envelopes:read' | 'email:company:send' | 'entities:audio_generate' | 'entities:client_invoke' | 'entities:image_edit' | 'entities:image_generate' | 'entities:invoke' | 'entities:web_search' | 'litcraft:hub' | 'navigation:open_arche' | 'opener:send' | 'sandbox:vendored-libraries' | 'schedule:invoke' | 'storage:local' | 'storage:sandbox' | 'store:purchase' | 'theme:read' | 'user:profile:read' | 'vault:arche-saves:write' | 'vault:creative:read' | 'vault:creative:write' | 'vault:documents:read' | 'vault:documents:write' | 'vault:user-documents:edit' | 'vault:user-documents:read' | 'vault:user-documents:write' | 'vault:workspace-documents:read';
|
|
12
|
+
export type PluginPermission = 'ai:actions' | 'assets:community:publish' | 'assets:community:read' | 'assets:read' | 'connections:use' | 'data:agents' | 'data:search' | 'data:store' | 'data:workspace' | 'data:workspace-people:read' | 'docsign:envelopes:read' | 'email:company:send' | 'entities:audio_generate' | 'entities:client_invoke' | 'entities:image_edit' | 'entities:image_generate' | 'entities:invoke' | 'entities:web_search' | 'litcraft:hub' | 'navigation:open_arche' | 'opener:send' | 'sandbox:vendored-libraries' | 'schedule:invoke' | 'storage:local' | 'storage:sandbox' | 'store:purchase' | 'theme:read' | 'user:profile:read' | 'vault:arche-saves:write' | 'vault:creative:read' | 'vault:creative:write' | 'vault:documents:read' | 'vault:documents:write' | 'vault:user-documents:edit' | 'vault:user-documents:read' | 'vault:user-documents:write' | 'vault:workspace-documents:read' | 'web:sources:read';
|
|
13
13
|
export declare const VALID_PLUGIN_PERMISSIONS: readonly PluginPermission[];
|
|
14
14
|
export declare function isValidPluginPermission(perm: string): perm is PluginPermission;
|
|
15
15
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"permissions.d.ts","sourceRoot":"","sources":["../../src/generated/permissions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,MAAM,MAAM,gBAAgB,GACxB,YAAY,GACZ,0BAA0B,GAC1B,uBAAuB,GACvB,aAAa,GACb,iBAAiB,GACjB,aAAa,GACb,aAAa,GACb,YAAY,GACZ,gBAAgB,GAChB,wBAAwB,GACxB,oBAAoB,GACpB,yBAAyB,GACzB,wBAAwB,GACxB,qBAAqB,GACrB,yBAAyB,GACzB,iBAAiB,GACjB,qBAAqB,GACrB,cAAc,GACd,uBAAuB,GACvB,aAAa,GACb,4BAA4B,GAC5B,iBAAiB,GACjB,eAAe,GACf,iBAAiB,GACjB,gBAAgB,GAChB,YAAY,GACZ,mBAAmB,GACnB,yBAAyB,GACzB,qBAAqB,GACrB,sBAAsB,GACtB,sBAAsB,GACtB,uBAAuB,GACvB,2BAA2B,GAC3B,2BAA2B,GAC3B,4BAA4B,GAC5B,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"permissions.d.ts","sourceRoot":"","sources":["../../src/generated/permissions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,MAAM,MAAM,gBAAgB,GACxB,YAAY,GACZ,0BAA0B,GAC1B,uBAAuB,GACvB,aAAa,GACb,iBAAiB,GACjB,aAAa,GACb,aAAa,GACb,YAAY,GACZ,gBAAgB,GAChB,4BAA4B,GAC5B,wBAAwB,GACxB,oBAAoB,GACpB,yBAAyB,GACzB,wBAAwB,GACxB,qBAAqB,GACrB,yBAAyB,GACzB,iBAAiB,GACjB,qBAAqB,GACrB,cAAc,GACd,uBAAuB,GACvB,aAAa,GACb,4BAA4B,GAC5B,iBAAiB,GACjB,eAAe,GACf,iBAAiB,GACjB,gBAAgB,GAChB,YAAY,GACZ,mBAAmB,GACnB,yBAAyB,GACzB,qBAAqB,GACrB,sBAAsB,GACtB,sBAAsB,GACtB,uBAAuB,GACvB,2BAA2B,GAC3B,2BAA2B,GAC3B,4BAA4B,GAC5B,gCAAgC,GAChC,kBAAkB,CAAC;AAEvB,eAAO,MAAM,wBAAwB,EAAE,SAAS,gBAAgB,EAuCtD,CAAC;AAEX,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,IAAI,gBAAgB,CAE9E;AAED;;;;GAIG;AACH,eAAO,MAAM,8BAA8B,EAAE,QAAQ,CAAC,MAAM,CAAC,gBAAgB,EAAE,MAAM,CAAC,CA4DrF,CAAC"}
|
|
@@ -23,6 +23,7 @@ exports.VALID_PLUGIN_PERMISSIONS = [
|
|
|
23
23
|
'data:search',
|
|
24
24
|
'data:store',
|
|
25
25
|
'data:workspace',
|
|
26
|
+
'data:workspace-people:read',
|
|
26
27
|
'docsign:envelopes:read',
|
|
27
28
|
'email:company:send',
|
|
28
29
|
'entities:audio_generate',
|
|
@@ -50,6 +51,7 @@ exports.VALID_PLUGIN_PERMISSIONS = [
|
|
|
50
51
|
'vault:user-documents:read',
|
|
51
52
|
'vault:user-documents:write',
|
|
52
53
|
'vault:workspace-documents:read',
|
|
54
|
+
'web:sources:read',
|
|
53
55
|
];
|
|
54
56
|
function isValidPluginPermission(perm) {
|
|
55
57
|
return exports.VALID_PLUGIN_PERMISSIONS.includes(perm);
|
|
@@ -69,6 +71,7 @@ exports.PLUGIN_PERMISSION_DESCRIPTIONS = {
|
|
|
69
71
|
'data:search': "Search this arche's own data semantically — costs credits per search.",
|
|
70
72
|
'data:store': "Save structured data in this arche's own private database.",
|
|
71
73
|
'data:workspace': 'Create team workspaces and manage their members.',
|
|
74
|
+
'data:workspace-people:read': 'See the names of the people in your workspace who use it with you — never their email or account details.',
|
|
72
75
|
'docsign:envelopes:read': 'Check on signature requests it started for you — who has signed, and what is still outstanding.',
|
|
73
76
|
'email:company:send': 'Send email as your Company from its own address (e.g. team@yourcompany.com) — only after a Company admin allows this arche to, and only to the people they choose. Each email is charged to the person using the arche.',
|
|
74
77
|
'entities:audio_generate': 'Generate audio with platform AI — costs credits.',
|
|
@@ -96,5 +99,6 @@ exports.PLUGIN_PERMISSION_DESCRIPTIONS = {
|
|
|
96
99
|
'vault:user-documents:read': 'Read documents YOU choose to share with it from your Vault — you pick each document, and you can remove access any time in Vault → Arche Access.',
|
|
97
100
|
'vault:user-documents:write': 'Save its work to your Documents — you choose the folder and the name each time.',
|
|
98
101
|
'vault:workspace-documents:read': "Read every document you can see in a team workspace — only after that workspace's owner or admin approves it there, and never files marked proprietary.",
|
|
102
|
+
'web:sources:read': 'Read figures from websites Fias approved, such as credit unions and banks — it receives only the values it asks for, never the pages themselves. A small charge when a page is fetched and read.',
|
|
99
103
|
};
|
|
100
104
|
//# sourceMappingURL=permissions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"permissions.js","sourceRoot":"","sources":["../../src/generated/permissions.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;
|
|
1
|
+
{"version":3,"file":"permissions.js","sourceRoot":"","sources":["../../src/generated/permissions.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;AAmFH,0DAEC;AA3CY,QAAA,wBAAwB,GAAgC;IACnE,YAAY;IACZ,0BAA0B;IAC1B,uBAAuB;IACvB,aAAa;IACb,iBAAiB;IACjB,aAAa;IACb,aAAa;IACb,YAAY;IACZ,gBAAgB;IAChB,4BAA4B;IAC5B,wBAAwB;IACxB,oBAAoB;IACpB,yBAAyB;IACzB,wBAAwB;IACxB,qBAAqB;IACrB,yBAAyB;IACzB,iBAAiB;IACjB,qBAAqB;IACrB,cAAc;IACd,uBAAuB;IACvB,aAAa;IACb,4BAA4B;IAC5B,iBAAiB;IACjB,eAAe;IACf,iBAAiB;IACjB,gBAAgB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sBAAsB,EAAE,yEAAyE;IACjG,uBAAuB,EAAE,mEAAmE;IAC5F,2BAA2B,EACzB,0MAA0M;IAC5M,2BAA2B,EACzB,kJAAkJ;IACpJ,4BAA4B,EAC1B,iFAAiF;IACnF,gCAAgC,EAC9B,yJAAyJ;IAC3J,kBAAkB,EAChB,kMAAkM;CACrM,CAAC"}
|
package/dist/hooks.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ArcheHandoffPayload, FiasUser, FiasTheme, FiasStorageApi, DataSubscriptionState, EntitySubscriptionState, EntityInvocationApi, FiasTextModel, FiasHolder, ClientEntityApi, ImageGenerationApi, ImageEntityFilter, ImageEntitySummary, NllbLanguageOption, AudioGenerationApi, FiasNavigationApi, StepNavigationApi, StepNavigationOptions, FiasDataStoreApi, FiasWorkspacesApi, FiasAccessState, FiasStoreApi, VaultDocumentsApi, VaultDocumentDownloadUrl, VaultUserDocumentSaveContentResult, ArcheAssetsApi, FiasConnectionsApi, FiasCreativeLibraryApi, FiasXApi, FiasLinkedInApi, FiasSchedulesApi, ArcheAssetBytesApi, ArcheAssetErrorCode, FiasContentApi, FiasContentErrorCode, FiasLocalStoreApi, FiasLocalStoreErrorCode, CommunityAssetsApi, CompanyEmailApi, FiasAIActionsDeclaration, FiasChromeApi, FiasOpenerApi } from './types';
|
|
1
|
+
import type { ArcheHandoffPayload, FiasUser, FiasTheme, FiasStorageApi, DataSubscriptionState, EntitySubscriptionState, EntityInvocationApi, FiasTextModel, FiasHolder, ClientEntityApi, ImageGenerationApi, ImageEntityFilter, ImageEntitySummary, NllbLanguageOption, AudioGenerationApi, FiasNavigationApi, StepNavigationApi, StepNavigationOptions, FiasDataStoreApi, FiasWorkspacesApi, FiasAccessState, FiasStoreApi, VaultDocumentsApi, VaultDocumentDownloadUrl, VaultUserDocumentSaveContentResult, ArcheAssetsApi, FiasConnectionsApi, FiasWebSourcesApi, FiasCreativeLibraryApi, FiasXApi, FiasLinkedInApi, FiasSchedulesApi, ArcheAssetBytesApi, ArcheAssetErrorCode, FiasContentApi, FiasContentErrorCode, FiasLocalStoreApi, FiasLocalStoreErrorCode, CommunityAssetsApi, CompanyEmailApi, FiasAIActionsDeclaration, FiasChromeApi, FiasOpenerApi } from './types';
|
|
2
2
|
/**
|
|
3
3
|
* Access the current user's profile information.
|
|
4
4
|
* Requires the `user:profile:read` permission in fias-plugin.json.
|
|
@@ -353,7 +353,8 @@ export declare function useFiasDataStore(): FiasDataStoreApi;
|
|
|
353
353
|
* @example
|
|
354
354
|
* const workspaces = useFiasWorkspaces();
|
|
355
355
|
* const ws = await workspaces.create('Acme Corp');
|
|
356
|
-
*
|
|
356
|
+
* // a person picks who to add, in a sheet Fias draws (ADR-040):
|
|
357
|
+
* const { added } = await workspaces.addPeople(ws.workspaceId);
|
|
357
358
|
* // or, inside a Fias org workspace, its members' shared space:
|
|
358
359
|
* const shared = await workspaces.openForWorkspace();
|
|
359
360
|
* // then, with useFiasDataStore():
|
|
@@ -947,6 +948,40 @@ export declare function useCreativeLibrary(): FiasCreativeLibraryApi;
|
|
|
947
948
|
* const x = accounts.find((a) => a.provider === 'x') ?? (await connections.connect('x'));
|
|
948
949
|
*/
|
|
949
950
|
export declare function useFiasConnections(): FiasConnectionsApi;
|
|
951
|
+
/**
|
|
952
|
+
* Pages on websites Fias approved, read as DATA (ADR-038). Requires
|
|
953
|
+
* `web:sources:read`.
|
|
954
|
+
*
|
|
955
|
+
* The app names a page on an approved site and a form — the fields it wants —
|
|
956
|
+
* and gets back values of those kinds (numbers, dates, yes/no, the app's own
|
|
957
|
+
* choices, lists of them), each `null` when the page does not say. It never
|
|
958
|
+
* receives the page's text, not even a short label. One copy of each page serves every app, fetched at most
|
|
959
|
+
* once an hour; a fresh fetch and its reading are charged to the user (well
|
|
960
|
+
* under a cent for a typical page), and a cached result is free.
|
|
961
|
+
*
|
|
962
|
+
* @example
|
|
963
|
+
* const web = useFiasWebSources();
|
|
964
|
+
* const result = await web.extract<{
|
|
965
|
+
* rates: Array<{ termMonths: number | null; ira: boolean | null; apy: number | null }>;
|
|
966
|
+
* }>({
|
|
967
|
+
* url: 'https://www.becu.org/everyday-banking/certificates',
|
|
968
|
+
* form: {
|
|
969
|
+
* description: 'Share certificate rates',
|
|
970
|
+
* fields: {
|
|
971
|
+
* rates: {
|
|
972
|
+
* kind: 'list',
|
|
973
|
+
* item: {
|
|
974
|
+
* termMonths: { kind: 'integer', min: 1, max: 120, description: 'Term in months' },
|
|
975
|
+
* ira: { kind: 'boolean', description: 'An IRA certificate' },
|
|
976
|
+
* apy: { kind: 'number', min: 0, max: 25, description: 'APY in percent' },
|
|
977
|
+
* },
|
|
978
|
+
* },
|
|
979
|
+
* },
|
|
980
|
+
* },
|
|
981
|
+
* });
|
|
982
|
+
* // Show result.site.name and result.fetchedAt beside the figures.
|
|
983
|
+
*/
|
|
984
|
+
export declare function useFiasWebSources(): FiasWebSourcesApi;
|
|
950
985
|
/**
|
|
951
986
|
* X, as an account the workspace this app is open in let it use (ADR-029 §3).
|
|
952
987
|
*
|
|
@@ -1010,7 +1045,8 @@ export declare function useFiasLinkedIn(): FiasLinkedInApi;
|
|
|
1010
1045
|
* The From address is always the Company's — you only choose recipients and
|
|
1011
1046
|
* content.
|
|
1012
1047
|
*
|
|
1013
|
-
* Name members by
|
|
1048
|
+
* Name members by their ref (`useFiasUser().ref`, or refs you stored); you
|
|
1049
|
+
* never see their addresses. Every email carries
|
|
1014
1050
|
* a one-click unsubscribe, and people who used it are skipped (`muted`).
|
|
1015
1051
|
*
|
|
1016
1052
|
* @example
|
|
@@ -1018,7 +1054,7 @@ export declare function useFiasLinkedIn(): FiasLinkedInApi;
|
|
|
1018
1054
|
* const email = useCompanyEmail();
|
|
1019
1055
|
* const result = await email.send({
|
|
1020
1056
|
* requestKey: `digest-${weekId}`,
|
|
1021
|
-
* to:
|
|
1057
|
+
* to: assigneeRefs.map((ref) => ({ ref })),
|
|
1022
1058
|
* subject: 'Your weekly digest',
|
|
1023
1059
|
* text: digestText,
|
|
1024
1060
|
* html: digestHtml,
|
package/dist/hooks.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../src/hooks.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,mBAAmB,EACnB,QAAQ,EACR,SAAS,EACT,cAAc,EACd,qBAAqB,EACrB,uBAAuB,EACvB,mBAAmB,EAInB,aAAa,EACb,UAAU,EACV,eAAe,EACf,kBAAkB,EAGlB,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAGlB,iBAAiB,EAEjB,iBAAiB,EACjB,qBAAqB,EACrB,gBAAgB,EAchB,iBAAiB,EAEjB,eAAe,
|
|
1
|
+
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../src/hooks.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,mBAAmB,EACnB,QAAQ,EACR,SAAS,EACT,cAAc,EACd,qBAAqB,EACrB,uBAAuB,EACvB,mBAAmB,EAInB,aAAa,EACb,UAAU,EACV,eAAe,EACf,kBAAkB,EAGlB,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAGlB,iBAAiB,EAEjB,iBAAiB,EACjB,qBAAqB,EACrB,gBAAgB,EAchB,iBAAiB,EAEjB,eAAe,EAOf,YAAY,EAMZ,iBAAiB,EAGjB,wBAAwB,EAKxB,kCAAkC,EASlC,cAAc,EAGd,kBAAkB,EAMlB,iBAAiB,EAEjB,sBAAsB,EAEtB,QAAQ,EAMR,eAAe,EACf,gBAAgB,EAGhB,kBAAkB,EAGlB,mBAAmB,EACnB,cAAc,EACd,oBAAoB,EAGpB,iBAAiB,EACjB,uBAAuB,EAYvB,kBAAkB,EAMlB,eAAe,EAGf,wBAAwB,EACxB,aAAa,EAEb,aAAa,EAGd,MAAM,SAAS,CAAC;AA0GjB;;;;;;;;;;;;GAYG;AAEH,wBAAgB,WAAW,IAAI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IACrC,MAAM,EAAE,iBAAiB,EAAE,CAAC;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,eAAe;IAC9B;;;;;;;;;;;;;;OAcG;IACH,WAAW,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;IACvD;;;;OAIG;IACH,UAAU,CACR,UAAU,EAAE,MAAM,EAClB,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,GAC5C,OAAO,CAAC,sBAAsB,CAAC,CAAC;CACpC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,eAAe,IAAI,eAAe,CAgCjD;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,mBAAmB,GAAG,IAAI,GAAG;IACpE,aAAa,EAAE,MAAM,IAAI,CAAC;CAC3B,CA0DA"}
|
package/dist/hooks.js
CHANGED
|
@@ -35,6 +35,7 @@ exports.useDataSubscription = useDataSubscription;
|
|
|
35
35
|
exports.useVaultUserDocuments = useVaultUserDocuments;
|
|
36
36
|
exports.useCreativeLibrary = useCreativeLibrary;
|
|
37
37
|
exports.useFiasConnections = useFiasConnections;
|
|
38
|
+
exports.useFiasWebSources = useFiasWebSources;
|
|
38
39
|
exports.useFiasX = useFiasX;
|
|
39
40
|
exports.useFiasSchedules = useFiasSchedules;
|
|
40
41
|
exports.useFiasLinkedIn = useFiasLinkedIn;
|
|
@@ -108,6 +109,8 @@ function createDebouncedWriter(bridge) {
|
|
|
108
109
|
}
|
|
109
110
|
return { schedule, flush };
|
|
110
111
|
}
|
|
112
|
+
/** The platform's `resolve_people` limit per call; `resolvePeople` pages above it. */
|
|
113
|
+
const RESOLVE_PEOPLE_PAGE = 100;
|
|
111
114
|
/**
|
|
112
115
|
* Access the current user's profile information.
|
|
113
116
|
* Requires the `user:profile:read` permission in fias-plugin.json.
|
|
@@ -439,6 +442,20 @@ function useImageEntities(filter) {
|
|
|
439
442
|
* run, so we use the same 2-minute ceiling as the image/audio surfaces.
|
|
440
443
|
*/
|
|
441
444
|
const CLIENT_ENTITY_INVOKE_TIMEOUT_MS = 120000;
|
|
445
|
+
/**
|
|
446
|
+
* Whether a `client_entity_invoke` failed because the host has no executor
|
|
447
|
+
* for the entity (an older Fias, or the dev harness): the capability is simply
|
|
448
|
+
* not available there. Hosts answer `CLIENT_ENTITY_UNAVAILABLE`; older ones
|
|
449
|
+
* only said so in the message ("no client-side executor …"), which is still
|
|
450
|
+
* recognised. Any other bridge error is the app's to fix.
|
|
451
|
+
*/
|
|
452
|
+
function isClientEntityUnavailable(err) {
|
|
453
|
+
if (!(err instanceof bridge_1.FiasBridgeError))
|
|
454
|
+
return false;
|
|
455
|
+
if (err.code === 'CLIENT_ENTITY_UNAVAILABLE')
|
|
456
|
+
return true;
|
|
457
|
+
return err.code === 'BRIDGE_ERROR' && err.message.includes('no client-side executor');
|
|
458
|
+
}
|
|
442
459
|
/**
|
|
443
460
|
* Invoke a client-side ("on-device") entity through the bridge's generic
|
|
444
461
|
* `client_entity_invoke` op. Client-side entities execute entirely in the
|
|
@@ -894,9 +911,7 @@ function useOpener() {
|
|
|
894
911
|
}
|
|
895
912
|
catch (err) {
|
|
896
913
|
// A host without it (an older Fias, the dev harness).
|
|
897
|
-
if (err
|
|
898
|
-
err.code === 'BRIDGE_ERROR' &&
|
|
899
|
-
err.message.includes('no client-side executor')) {
|
|
914
|
+
if (isClientEntityUnavailable(err)) {
|
|
900
915
|
throw new bridge_1.FiasBridgeError('Sending to another arche is not available here', 'SEND_UNAVAILABLE');
|
|
901
916
|
}
|
|
902
917
|
throw err;
|
|
@@ -1145,6 +1160,17 @@ function useFiasDataStore() {
|
|
|
1145
1160
|
batch,
|
|
1146
1161
|
]);
|
|
1147
1162
|
}
|
|
1163
|
+
/** A member target on the wire: a typed username, or the app's ref (ADR-040 §4). */
|
|
1164
|
+
function memberTargetPayload(member) {
|
|
1165
|
+
if (typeof member === 'string')
|
|
1166
|
+
return { username: member };
|
|
1167
|
+
if (member && typeof member === 'object' && typeof member.ref === 'string') {
|
|
1168
|
+
return { ref: member.ref };
|
|
1169
|
+
}
|
|
1170
|
+
// Most often `m.username` from a roster: apps created after app user refs
|
|
1171
|
+
// get `ref` there instead (ADR-040 §4).
|
|
1172
|
+
throw new Error('useFiasWorkspaces: name the member by { ref } from listMembers() (or a username a person typed)');
|
|
1173
|
+
}
|
|
1148
1174
|
/**
|
|
1149
1175
|
* Access workspace tenancy — team/org workspaces with role-gated membership
|
|
1150
1176
|
* (owner/admin/member/viewer) over `workspace`-scoped Data Store collections
|
|
@@ -1158,7 +1184,8 @@ function useFiasDataStore() {
|
|
|
1158
1184
|
* @example
|
|
1159
1185
|
* const workspaces = useFiasWorkspaces();
|
|
1160
1186
|
* const ws = await workspaces.create('Acme Corp');
|
|
1161
|
-
*
|
|
1187
|
+
* // a person picks who to add, in a sheet Fias draws (ADR-040):
|
|
1188
|
+
* const { added } = await workspaces.addPeople(ws.workspaceId);
|
|
1162
1189
|
* // or, inside a Fias org workspace, its members' shared space:
|
|
1163
1190
|
* const shared = await workspaces.openForWorkspace();
|
|
1164
1191
|
* // then, with useFiasDataStore():
|
|
@@ -1189,10 +1216,41 @@ function useFiasWorkspaces() {
|
|
|
1189
1216
|
const archive = (0, react_1.useCallback)(async (workspaceId) => {
|
|
1190
1217
|
await (0, entity_ops_1.invokeEntityOp)(bridge, entity_ops_1.PLUGIN_WORKSPACES_ENTITY_ID, 'archive', { workspaceId });
|
|
1191
1218
|
}, [bridge]);
|
|
1219
|
+
const resolvePeople = (0, react_1.useCallback)(async (refs, workspaceId) => {
|
|
1220
|
+
// Any length, in order: nothing to ask for an empty list, and the
|
|
1221
|
+
// platform's 100-per-call limit is the SDK's to page, not the app's.
|
|
1222
|
+
const people = [];
|
|
1223
|
+
for (let i = 0; i < refs.length; i += RESOLVE_PEOPLE_PAGE) {
|
|
1224
|
+
const page = refs.slice(i, i + RESOLVE_PEOPLE_PAGE);
|
|
1225
|
+
const res = await (0, entity_ops_1.invokeEntityOp)(bridge, entity_ops_1.PLUGIN_WORKSPACES_ENTITY_ID, 'resolve_people', workspaceId === undefined ? { refs: page } : { refs: page, workspaceId });
|
|
1226
|
+
people.push(...res.people);
|
|
1227
|
+
}
|
|
1228
|
+
return people;
|
|
1229
|
+
}, [bridge]);
|
|
1192
1230
|
const listMembers = (0, react_1.useCallback)(async (workspaceId) => {
|
|
1193
1231
|
const res = await (0, entity_ops_1.invokeEntityOp)(bridge, entity_ops_1.PLUGIN_WORKSPACES_ENTITY_ID, 'list_members', { workspaceId });
|
|
1194
1232
|
return res.members;
|
|
1195
1233
|
}, [bridge]);
|
|
1234
|
+
const addPeople = (0, react_1.useCallback)(async (workspaceId, options) => {
|
|
1235
|
+
let answer;
|
|
1236
|
+
try {
|
|
1237
|
+
answer = await bridge.request('client_entity_invoke', {
|
|
1238
|
+
entityId: entity_ops_1.WORKSPACE_ADD_PEOPLE_ENTITY_ID,
|
|
1239
|
+
input: options?.role ? { workspaceId, role: options.role } : { workspaceId },
|
|
1240
|
+
}, ADD_PEOPLE_SHEET_TIMEOUT_MS);
|
|
1241
|
+
}
|
|
1242
|
+
catch (err) {
|
|
1243
|
+
// A host without the sheet (an older Fias or dev harness) has no
|
|
1244
|
+
// executor for it: the sheet is simply not available there.
|
|
1245
|
+
if (isClientEntityUnavailable(err)) {
|
|
1246
|
+
throw new bridge_1.FiasBridgeError('Adding people is not available here', 'ADD_PEOPLE_UNAVAILABLE');
|
|
1247
|
+
}
|
|
1248
|
+
throw err;
|
|
1249
|
+
}
|
|
1250
|
+
if ('error' in answer)
|
|
1251
|
+
throw new bridge_1.FiasBridgeError(answer.error.message, answer.error.code);
|
|
1252
|
+
return { added: answer.added };
|
|
1253
|
+
}, [bridge]);
|
|
1196
1254
|
const addMember = (0, react_1.useCallback)(async (workspaceId, username, role, expiresAt) => {
|
|
1197
1255
|
const res = await (0, entity_ops_1.invokeEntityOp)(bridge, entity_ops_1.PLUGIN_WORKSPACES_ENTITY_ID, 'add_member', {
|
|
1198
1256
|
workspaceId,
|
|
@@ -1202,14 +1260,14 @@ function useFiasWorkspaces() {
|
|
|
1202
1260
|
});
|
|
1203
1261
|
return res.member;
|
|
1204
1262
|
}, [bridge]);
|
|
1205
|
-
const updateMember = (0, react_1.useCallback)(async (workspaceId,
|
|
1206
|
-
const res = await (0, entity_ops_1.invokeEntityOp)(bridge, entity_ops_1.PLUGIN_WORKSPACES_ENTITY_ID, 'update_member', { workspaceId,
|
|
1263
|
+
const updateMember = (0, react_1.useCallback)(async (workspaceId, member, role) => {
|
|
1264
|
+
const res = await (0, entity_ops_1.invokeEntityOp)(bridge, entity_ops_1.PLUGIN_WORKSPACES_ENTITY_ID, 'update_member', { workspaceId, ...memberTargetPayload(member), role });
|
|
1207
1265
|
return res.member;
|
|
1208
1266
|
}, [bridge]);
|
|
1209
|
-
const removeMember = (0, react_1.useCallback)(async (workspaceId,
|
|
1267
|
+
const removeMember = (0, react_1.useCallback)(async (workspaceId, member) => {
|
|
1210
1268
|
await (0, entity_ops_1.invokeEntityOp)(bridge, entity_ops_1.PLUGIN_WORKSPACES_ENTITY_ID, 'remove_member', {
|
|
1211
1269
|
workspaceId,
|
|
1212
|
-
|
|
1270
|
+
...memberTargetPayload(member),
|
|
1213
1271
|
});
|
|
1214
1272
|
}, [bridge]);
|
|
1215
1273
|
return (0, react_1.useMemo)(() => ({
|
|
@@ -1219,9 +1277,11 @@ function useFiasWorkspaces() {
|
|
|
1219
1277
|
get,
|
|
1220
1278
|
archive,
|
|
1221
1279
|
listMembers,
|
|
1280
|
+
addPeople,
|
|
1222
1281
|
addMember,
|
|
1223
1282
|
updateMember,
|
|
1224
1283
|
removeMember,
|
|
1284
|
+
resolvePeople,
|
|
1225
1285
|
}), [
|
|
1226
1286
|
create,
|
|
1227
1287
|
openForWorkspace,
|
|
@@ -1229,9 +1289,11 @@ function useFiasWorkspaces() {
|
|
|
1229
1289
|
get,
|
|
1230
1290
|
archive,
|
|
1231
1291
|
listMembers,
|
|
1292
|
+
addPeople,
|
|
1232
1293
|
addMember,
|
|
1233
1294
|
updateMember,
|
|
1234
1295
|
removeMember,
|
|
1296
|
+
resolvePeople,
|
|
1235
1297
|
]);
|
|
1236
1298
|
}
|
|
1237
1299
|
/** The refusals that mean "no access here" — the workspaces `get` verb's two answers. */
|
|
@@ -1316,13 +1378,10 @@ function useFiasAccess(workspaceId) {
|
|
|
1316
1378
|
}
|
|
1317
1379
|
catch (err) {
|
|
1318
1380
|
// A host without the sheet (an older Fias, or an older dev harness) has
|
|
1319
|
-
// no executor for it
|
|
1320
|
-
//
|
|
1321
|
-
//
|
|
1322
|
-
|
|
1323
|
-
if (err instanceof bridge_1.FiasBridgeError &&
|
|
1324
|
-
err.code === 'BRIDGE_ERROR' &&
|
|
1325
|
-
err.message.includes('no client-side executor')) {
|
|
1381
|
+
// no executor for it: the sheet is simply not available. Any other
|
|
1382
|
+
// bridge error (a missing permission, a call loop) is the app's to fix,
|
|
1383
|
+
// so it passes through unchanged.
|
|
1384
|
+
if (isClientEntityUnavailable(err)) {
|
|
1326
1385
|
throw new bridge_1.FiasBridgeError('Managing access is not available here', 'ACCESS_UNAVAILABLE');
|
|
1327
1386
|
}
|
|
1328
1387
|
throw err;
|
|
@@ -1366,6 +1425,8 @@ const lastAccessAnswers = new Map();
|
|
|
1366
1425
|
const FOCUS_REFETCH_MIN_MS = 30000;
|
|
1367
1426
|
/** How long a person may keep the access sheet open before the call gives up. */
|
|
1368
1427
|
const ACCESS_SHEET_TIMEOUT_MS = 30 * 60 * 1000;
|
|
1428
|
+
/** The Add people sheet waits on a person, like the access sheet. */
|
|
1429
|
+
const ADD_PEOPLE_SHEET_TIMEOUT_MS = ACCESS_SHEET_TIMEOUT_MS;
|
|
1369
1430
|
const sharedAccessByBridge = new WeakMap();
|
|
1370
1431
|
function peekSharedAccess(bridge, workspaceId) {
|
|
1371
1432
|
return sharedAccessByBridge.get(bridge)?.get(workspaceId);
|
|
@@ -3069,9 +3130,7 @@ function useCreativeLibrary() {
|
|
|
3069
3130
|
catch (err) {
|
|
3070
3131
|
// A host without the picker (an older Fias, the dev harness) has no
|
|
3071
3132
|
// executor for it: the picker is simply not available there.
|
|
3072
|
-
if (err
|
|
3073
|
-
err.code === 'BRIDGE_ERROR' &&
|
|
3074
|
-
err.message.includes('no client-side executor')) {
|
|
3133
|
+
if (isClientEntityUnavailable(err)) {
|
|
3075
3134
|
throw new bridge_1.FiasBridgeError('The Creative Library picker is not available here', 'PICKER_UNAVAILABLE');
|
|
3076
3135
|
}
|
|
3077
3136
|
throw err;
|
|
@@ -3118,6 +3177,54 @@ function useFiasConnections() {
|
|
|
3118
3177
|
}, [bridge]);
|
|
3119
3178
|
return (0, react_1.useMemo)(() => ({ list, connect, release }), [list, connect, release]);
|
|
3120
3179
|
}
|
|
3180
|
+
/**
|
|
3181
|
+
* Pages on websites Fias approved, read as DATA (ADR-038). Requires
|
|
3182
|
+
* `web:sources:read`.
|
|
3183
|
+
*
|
|
3184
|
+
* The app names a page on an approved site and a form — the fields it wants —
|
|
3185
|
+
* and gets back values of those kinds (numbers, dates, yes/no, the app's own
|
|
3186
|
+
* choices, lists of them), each `null` when the page does not say. It never
|
|
3187
|
+
* receives the page's text, not even a short label. One copy of each page serves every app, fetched at most
|
|
3188
|
+
* once an hour; a fresh fetch and its reading are charged to the user (well
|
|
3189
|
+
* under a cent for a typical page), and a cached result is free.
|
|
3190
|
+
*
|
|
3191
|
+
* @example
|
|
3192
|
+
* const web = useFiasWebSources();
|
|
3193
|
+
* const result = await web.extract<{
|
|
3194
|
+
* rates: Array<{ termMonths: number | null; ira: boolean | null; apy: number | null }>;
|
|
3195
|
+
* }>({
|
|
3196
|
+
* url: 'https://www.becu.org/everyday-banking/certificates',
|
|
3197
|
+
* form: {
|
|
3198
|
+
* description: 'Share certificate rates',
|
|
3199
|
+
* fields: {
|
|
3200
|
+
* rates: {
|
|
3201
|
+
* kind: 'list',
|
|
3202
|
+
* item: {
|
|
3203
|
+
* termMonths: { kind: 'integer', min: 1, max: 120, description: 'Term in months' },
|
|
3204
|
+
* ira: { kind: 'boolean', description: 'An IRA certificate' },
|
|
3205
|
+
* apy: { kind: 'number', min: 0, max: 25, description: 'APY in percent' },
|
|
3206
|
+
* },
|
|
3207
|
+
* },
|
|
3208
|
+
* },
|
|
3209
|
+
* },
|
|
3210
|
+
* });
|
|
3211
|
+
* // Show result.site.name and result.fetchedAt beside the figures.
|
|
3212
|
+
*/
|
|
3213
|
+
function useFiasWebSources() {
|
|
3214
|
+
const bridge = useBridge();
|
|
3215
|
+
const listSites = (0, react_1.useCallback)(async (options) => (0, entity_ops_1.invokeEntityOp)(bridge, entity_ops_1.WEB_SOURCES_ENTITY_ID, 'list_sites', {
|
|
3216
|
+
...(options?.category !== undefined ? { category: options.category } : {}),
|
|
3217
|
+
...(options?.search !== undefined ? { search: options.search } : {}),
|
|
3218
|
+
...(options?.limit !== undefined ? { limit: options.limit } : {}),
|
|
3219
|
+
...(options?.offset !== undefined ? { offset: options.offset } : {}),
|
|
3220
|
+
}), [bridge]);
|
|
3221
|
+
const extract = (0, react_1.useCallback)(async (request) => (0, entity_ops_1.invokeEntityOp)(bridge, entity_ops_1.WEB_SOURCES_ENTITY_ID, 'extract', {
|
|
3222
|
+
url: request.url,
|
|
3223
|
+
form: request.form,
|
|
3224
|
+
...(request.maxAgeSeconds !== undefined ? { maxAgeSeconds: request.maxAgeSeconds } : {}),
|
|
3225
|
+
}), [bridge]);
|
|
3226
|
+
return (0, react_1.useMemo)(() => ({ listSites, extract }), [listSites, extract]);
|
|
3227
|
+
}
|
|
3121
3228
|
/**
|
|
3122
3229
|
* X, as an account the workspace this app is open in let it use (ADR-029 §3).
|
|
3123
3230
|
*
|
|
@@ -3222,7 +3329,8 @@ function useFiasLinkedIn() {
|
|
|
3222
3329
|
* The From address is always the Company's — you only choose recipients and
|
|
3223
3330
|
* content.
|
|
3224
3331
|
*
|
|
3225
|
-
* Name members by
|
|
3332
|
+
* Name members by their ref (`useFiasUser().ref`, or refs you stored); you
|
|
3333
|
+
* never see their addresses. Every email carries
|
|
3226
3334
|
* a one-click unsubscribe, and people who used it are skipped (`muted`).
|
|
3227
3335
|
*
|
|
3228
3336
|
* @example
|
|
@@ -3230,7 +3338,7 @@ function useFiasLinkedIn() {
|
|
|
3230
3338
|
* const email = useCompanyEmail();
|
|
3231
3339
|
* const result = await email.send({
|
|
3232
3340
|
* requestKey: `digest-${weekId}`,
|
|
3233
|
-
* to:
|
|
3341
|
+
* to: assigneeRefs.map((ref) => ({ ref })),
|
|
3234
3342
|
* subject: 'Your weekly digest',
|
|
3235
3343
|
* text: digestText,
|
|
3236
3344
|
* html: digestHtml,
|