@joymerrevent/porters-connect 0.22.0 → 0.24.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 +130 -1
- package/README.md +1 -1
- package/dist/index.d.cts +154 -67
- package/dist/index.d.ts +154 -67
- package/dist/index.js +256 -150
- package/dist/index.js.map +1 -1
- package/dist/requires-newer-typescript.d.cts +222 -0
- package/dist/requires-newer-typescript.d.ts +222 -0
- package/package.json +13 -3
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,129 @@
|
|
|
5
5
|
|
|
6
6
|
## [Unreleased]
|
|
7
7
|
|
|
8
|
+
## [0.24.0] - 2026-09-24
|
|
9
|
+
|
|
10
|
+
**トークンの取り方と置き場所を別々に渡せるようにした版**です。**破壊的変更を 2 つ**含みます
|
|
11
|
+
(構築オプション `auth` の廃止と、日時(`DateTime`)に渡す値の制限)。あわせて、Refresh Token が拒否されたときに
|
|
12
|
+
回復しなかった不具合を直し、使い方ドキュメントを実装と突き合わせて直しました。
|
|
13
|
+
|
|
14
|
+
### Changed
|
|
15
|
+
|
|
16
|
+
- **(破壊的)トークンの取り方を `tokenProvider` で、置き場所を `tokenStore` で別々に渡すようになりました**
|
|
17
|
+
([ADR-0091][adr91])。キャッシュ・期限の判断・失効時の取り直し・同時呼び出しの 1 本化・`tokenStore` への保存は、
|
|
18
|
+
既定の取り方でも、渡した取り方でもクライアントが受け持ちます。これまで取り方を差し替えるには
|
|
19
|
+
`getAccessToken` を丸ごと自前で書くしかなく、期限の判断や同時呼び出しのまとめ方まで利用者の実装に任されていました。
|
|
20
|
+
|
|
21
|
+
```ts
|
|
22
|
+
// 変更前
|
|
23
|
+
const porters = new PortersClient({
|
|
24
|
+
hostname,
|
|
25
|
+
auth: { getAccessToken: async () => await myTokenService.get() },
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
// 変更後
|
|
29
|
+
const porters = new PortersClient({
|
|
30
|
+
hostname,
|
|
31
|
+
tokenProvider: {
|
|
32
|
+
acquire: async () => ({
|
|
33
|
+
accessToken: { token: await myTokenService.get() },
|
|
34
|
+
}),
|
|
35
|
+
},
|
|
36
|
+
});
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
- `TokenProvider` は `{ acquire, refresh?, exchange? }` です。`acquire` は必須、`refresh` と `exchange` は
|
|
40
|
+
使うときだけ渡します。期限(`expiresAt`)を返せば、その 60 秒前に取り直します。
|
|
41
|
+
- **構築オプション `auth` は無くなりました**。`auth` や、`getAccessToken` だけを持つ古い形を渡すと、構築時に
|
|
42
|
+
`PortersConfigError`(`category: "config"`)で止まります(型でも弾きます)。
|
|
43
|
+
- **`StoredTokens` の形が変わりました**: `{ accessToken: { token, expiresAt? }, refreshToken?: { token, expiresAt? } }`。
|
|
44
|
+
`tokenStore` に以前の形で保存されていた値は「保存なし」として扱い、上げた直後の 1 回だけ `code_direct` で
|
|
45
|
+
取り直します(保存先を手で消す必要はありません)。
|
|
46
|
+
- `tokenStore` は `tokenProvider` を渡したときも使われます。
|
|
47
|
+
- `porters.auth` の 6 メソッドは、どの取り方でも動きます。`exchangeAuthorizationCode` には `tokenProvider` の
|
|
48
|
+
`exchange` が、`authorizationUrl` / `revokeUrl` には `appId` が要ります。
|
|
49
|
+
- 既定の取り方で `appId` / `appSecret` が無いときは、PORTERS へ何も送らずに `PortersConfigError` になります。
|
|
50
|
+
- 保存済みの Access Token がまだ有効なら、起動直後にも取りに行きません。
|
|
51
|
+
- `GetAccessTokenOptions` を公開 API から外し、`IssuedToken`(`{ token, expiresAt? }`)を足しました。
|
|
52
|
+
- 書き方は[認証とトークン][oauth-guide]の「トークンの取り方を差し替える」にあります。
|
|
53
|
+
|
|
54
|
+
- **(破壊的)日時(`DateTime` / `System[DateTime]`)の項目に書く値と、`condition` に書く値は、時刻とタイムゾーンの
|
|
55
|
+
そろった ISO 8601 だけを受け付けるようになりました**。形は `YYYY-MM-DDTHH:MM[:SS[.sss]]` に `Z` か `±HH:MM` が
|
|
56
|
+
付いたものです。`new Date().toISOString()` の出力はそのまま渡せます。
|
|
57
|
+
|
|
58
|
+
これまでは、次の値が送る前に止まらず、**ずれた値が PORTERS に届いていました**。
|
|
59
|
+
|
|
60
|
+
| 渡した値 | これまで(実行環境が日本時間のとき) | これから |
|
|
61
|
+
| ---------------------------------------- | ------------------------------------ | -------------------- |
|
|
62
|
+
| `"2026/09/10"`(PORTERS の形式) | `2026/09/09 15:00:00` として送る | `PortersConfigError` |
|
|
63
|
+
| `"2026-09-10T12:00:00"`(ゾーン無し) | 実行環境のタイムゾーンで読んで送る | `PortersConfigError` |
|
|
64
|
+
| `"2026-09-10"`(日付だけ) | UTC の 0 時として送る | `PortersConfigError` |
|
|
65
|
+
| `"2026-02-30T00:00:00Z"` / `…T24:00:00Z` | 3/2・翌日に繰り上げて送る | `PortersConfigError` |
|
|
66
|
+
- エラーは `PortersConfigError`(`category: "validation"`)で、`hint` がゾーンの要ることを示します。
|
|
67
|
+
- 日本時間で考えているなら、`"2026-09-10T09:00:00+09:00"` のようにオフセットを付けて渡します。
|
|
68
|
+
- `Date` / `Age` の項目(日付だけ)は変わりません。
|
|
69
|
+
|
|
70
|
+
### Fixed
|
|
71
|
+
|
|
72
|
+
- **既定の取り方で、PORTERS が Refresh Token を受け付けなかったとき(期限切れ・無効)に、`code_direct` で取り直す
|
|
73
|
+
ようになりました**。手元に記録した期限がまだ先だと、これまでは同じ refresh を繰り返して `PortersAuthError` になり、
|
|
74
|
+
`porters.auth.clearTokens()` を呼ぶまで回復しませんでした。同じ `tokenStore` を使う別のプロセスが先に更新して、
|
|
75
|
+
手元の Refresh Token が古くなったときにも起きていました。`PortersAuthError` が返るのは、`code_direct` でも
|
|
76
|
+
取り直せないとき(初回の権限付与が済んでいない・取り消された、App ID / App Secret が違う、など)だけです。
|
|
77
|
+
渡した `tokenProvider` の失敗は、これまでどおりそのまま届けます。
|
|
78
|
+
- トークンの取得が認証 API の 401 / 402 で失敗したときに、Access Token の期限切れと取り違えて、もう一度取り直しを
|
|
79
|
+
強いていたのをやめました(失敗する取得を 2 回送っていました)。
|
|
80
|
+
- **使い方ドキュメントを実装と突き合わせ、挙動と食い違っていた記述を直しました**。主なもの:
|
|
81
|
+
`create` を自動で再送しないのは届いたか分からないときだけ/エラーの型と HTTP ステータスの対応/
|
|
82
|
+
Activity の `P_ResourceId` は `expand` できない/Attachment の `search` で絞れるのは `resourceId` だけ/
|
|
83
|
+
一括書き込みは約 15000 字でも分ける/`base64ToBytes` は読めない文字列で例外を投げる、など。
|
|
84
|
+
トークンの取得や OAuth の URL 作成で出る `PortersConfigError` を、メッセージから
|
|
85
|
+
[トラブルシューティング][troubleshooting]で引けるようにしました。
|
|
86
|
+
|
|
87
|
+
## [0.23.0] - 2026-09-24
|
|
88
|
+
|
|
89
|
+
**カスタム項目を宣言で `create` の必須にできるようにした版**です。あわせて、利用者の TypeScript の下限を
|
|
90
|
+
**5.4** と定め、それより古い版でははっきりした型エラーになるようにしました。**TypeScript 5.4 より前を使っている
|
|
91
|
+
場合は破壊的変更です**(下の Changed)。
|
|
92
|
+
|
|
93
|
+
### Added
|
|
94
|
+
|
|
95
|
+
- **カスタム項目を宣言で `create` の必須にできるようになりました**([ADR-0089][adr89])。宣言のビルダーに
|
|
96
|
+
`{ required: true }` を渡すと、その項目は `create` / `createMany` の入力型で必須になります。
|
|
97
|
+
|
|
98
|
+
```ts
|
|
99
|
+
const fields = defineFields({
|
|
100
|
+
candidate: (f) => ({
|
|
101
|
+
U_score: f.number({ required: true }), // create で必須
|
|
102
|
+
U_source: f.option(), // 任意のまま
|
|
103
|
+
}),
|
|
104
|
+
});
|
|
105
|
+
const t = porters.tenant(1, { fields });
|
|
106
|
+
|
|
107
|
+
await t.candidate.create({ P_Owner: 5, U_score: 80 }); // U_score を渡さないとコンパイルエラー
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
- `required` を書かなければ、これまでと同じく任意です。`update` / `updateMany` では常に任意です。
|
|
111
|
+
- 型で止めるだけで、実行時には検査しません(標準項目の必須と同じ扱い)。
|
|
112
|
+
- `TenantScope<typeof fields>` と書いた型でも必須になります。新しい型引数は要りません。
|
|
113
|
+
- `generateFieldDecls` は、テナントが入力必須にしている項目(Field Read の `P_Required` が `1`)に
|
|
114
|
+
`{ required: true }` を付けて出します。`create` で必須にしない項目は、生成したファイルから消します。
|
|
115
|
+
- `readCustomCatalog` の戻り値に `required`(alias → 入力必須かどうか)が増えました。
|
|
116
|
+
- `verifyFields` の報告に `requiredMismatch`(宣言の `required` とテナントの入力必須の食い違い)が増えました。
|
|
117
|
+
読み書きは壊れないので、`ok` は変わらず、`assertFieldsMatch` も止めません。
|
|
118
|
+
- 新しく公開した型: `FieldOptions` / `RequiredFor` / `DeclaredRequiredOf` / `RequiredMismatch`。
|
|
119
|
+
|
|
120
|
+
### Changed
|
|
121
|
+
|
|
122
|
+
- **(TypeScript 5.4 より前を使っている場合は破壊的)型を読むには TypeScript 5.4 以上が要ります**
|
|
123
|
+
([ADR-0090][adr90])。同梱の型定義が、5.4 で入った型(`NoInfer`)を使うためです。5.4 より前の TypeScript では、
|
|
124
|
+
このパッケージから `import` したものを使った行が、`requires TypeScript 5.4 or later` を含む型エラーになります。
|
|
125
|
+
そのときは TypeScript を上げてください。`bundler` / `node16` / `node` のどの解決方式でも同じです。
|
|
126
|
+
- **`verifyFields` の報告を自分で組み立てているコード**(テストのスタブなど)は、`requiredMismatch: []` を
|
|
127
|
+
足してください。`FieldVerification` に項目が増えたためで、`verifyFields` の戻り値を読むだけのコードは変わりません。
|
|
128
|
+
- 内部の検査を増やしました(利用者への影響はありません)。CI で、TypeScript の下限の版(5.4 の系で最も古い安定版)と
|
|
129
|
+
開発で使う版で利用者のコードをコンパイルし、下限より前の版では上の型エラーになることを確かめます。
|
|
130
|
+
|
|
8
131
|
## [0.22.0] - 2026-09-23
|
|
9
132
|
|
|
10
133
|
**読み取りの値の検証を 1 つ増やし、使い方ドキュメントを組み直した版**です。破壊的変更はありませんが、
|
|
@@ -1333,7 +1456,9 @@ Attachment)あるのに、受け口の形が 3 つとも違っていました
|
|
|
1333
1456
|
[ref]: docs/usage/reference/README.md
|
|
1334
1457
|
[kac]: https://keepachangelog.com/en/1.1.0/
|
|
1335
1458
|
[semver]: https://semver.org/
|
|
1336
|
-
[unreleased]: https://github.com/Joymerrevent/porters-connect/compare/v0.
|
|
1459
|
+
[unreleased]: https://github.com/Joymerrevent/porters-connect/compare/v0.24.0...HEAD
|
|
1460
|
+
[0.24.0]: https://github.com/Joymerrevent/porters-connect/compare/v0.23.0...v0.24.0
|
|
1461
|
+
[0.23.0]: https://github.com/Joymerrevent/porters-connect/compare/v0.22.0...v0.23.0
|
|
1337
1462
|
[0.22.0]: https://github.com/Joymerrevent/porters-connect/compare/v0.21.0...v0.22.0
|
|
1338
1463
|
[0.21.0]: https://github.com/Joymerrevent/porters-connect/compare/v0.20.1...v0.21.0
|
|
1339
1464
|
[0.20.1]: https://github.com/Joymerrevent/porters-connect/compare/v0.20.0...v0.20.1
|
|
@@ -1374,3 +1499,7 @@ Attachment)あるのに、受け口の形が 3 つとも違っていました
|
|
|
1374
1499
|
[adr87]: docs/adr/0087-tenant-scoped-field-declarations.md
|
|
1375
1500
|
[howto-custom-fields]: docs/usage/topics/custom-fields.md
|
|
1376
1501
|
[ref-department]: docs/usage/reference/resource-api/resources/department.md
|
|
1502
|
+
[adr89]: docs/adr/0089-custom-field-required-on-create.md
|
|
1503
|
+
[adr90]: docs/adr/0090-typescript-floor.md
|
|
1504
|
+
[adr91]: docs/adr/0091-token-provider-and-store.md
|
|
1505
|
+
[troubleshooting]: docs/usage/reference/troubleshooting.md
|
package/README.md
CHANGED
|
@@ -34,7 +34,7 @@ XML レスポンスを型付きオブジェクトに変換し、独自仕様の
|
|
|
34
34
|
4. **付与するスコープ**の決定(リソース別に `_r` / `_w`。Read でも複数要ることがあります)。
|
|
35
35
|
|
|
36
36
|
揃えかたは[始める前に][s-prereq]に、権限付与の手順は[認証を通して、疎通を確認する][s-auth]に
|
|
37
|
-
あります。実行環境は **Node.js 22.12
|
|
37
|
+
あります。実行環境は **Node.js 22.12 以上**で、型定義は同梱です(型を読むには **TypeScript 5.4 以上**が要ります)。ビルド済みの JavaScript ファイルは ESM(`import`)の 1 つですが、
|
|
38
38
|
CJS(`require`)からも `require("@joymerrevent/porters-connect")` で読めます([CJS から使う][s-cjs])。
|
|
39
39
|
|
|
40
40
|
契約や権限付与を**待っている間**も、PORTERS に繋がずにコードとテストは書けます
|
package/dist/index.d.cts
CHANGED
|
@@ -1,22 +1,42 @@
|
|
|
1
|
-
/**
|
|
2
|
-
type
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
/** One token and, when known, its absolute expiry (epoch ms). No `expiresAt` means "unknown". */
|
|
2
|
+
type IssuedToken = {
|
|
3
|
+
token: string;
|
|
4
|
+
expiresAt?: number;
|
|
5
5
|
};
|
|
6
|
-
/**
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
/**
|
|
7
|
+
* Tokens as obtained from a {@link TokenProvider} and persisted by a {@link TokenStore}.
|
|
8
|
+
* `refreshToken` is present only when the issuer hands one out; a value and its expiry always
|
|
9
|
+
* travel together.
|
|
10
|
+
*/
|
|
11
11
|
type StoredTokens = {
|
|
12
|
-
accessToken:
|
|
13
|
-
refreshToken
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
accessToken: IssuedToken;
|
|
13
|
+
refreshToken?: IssuedToken;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Where tokens come from. Pass one as `tokenProvider` to obtain tokens elsewhere (for example
|
|
17
|
+
* from a central service that holds the App Secret); leave it out for the built-in `code_direct`
|
|
18
|
+
* flow. The client caches what these return, renews shortly before expiry, retries once on an
|
|
19
|
+
* expired-token response, collapses concurrent renewals into one, and saves to `tokenStore`.
|
|
20
|
+
*/
|
|
21
|
+
type TokenProvider = {
|
|
22
|
+
/** Obtain tokens from scratch. Called first, and whenever renewal is not possible. */
|
|
23
|
+
acquire(): Promise<StoredTokens>;
|
|
24
|
+
/**
|
|
25
|
+
* Renew tokens. Called instead of {@link TokenProvider.acquire} while `current.refreshToken`
|
|
26
|
+
* is usable — or, when the issuer hands out no refresh token, whenever renewal is needed.
|
|
27
|
+
* Leave it out to renew by calling `acquire` again.
|
|
28
|
+
*/
|
|
29
|
+
refresh?(current: StoredTokens): Promise<StoredTokens>;
|
|
30
|
+
/**
|
|
31
|
+
* Exchange an authorization `code` returned to your redirect URL after the browser grant.
|
|
32
|
+
* Needed only for `porters.auth.exchangeAuthorizationCode`. PORTERS expires a `code` 30 seconds
|
|
33
|
+
* after issuing it, so do not do slow work here.
|
|
34
|
+
*/
|
|
35
|
+
exchange?(code: string): Promise<StoredTokens>;
|
|
16
36
|
};
|
|
17
37
|
/**
|
|
18
38
|
* Pluggable token persistence (default: in-memory). Async so it can back onto
|
|
19
|
-
* redis / DB / file for multi-instance server use.
|
|
39
|
+
* redis / DB / file for multi-instance server use. Used with every token provider.
|
|
20
40
|
*/
|
|
21
41
|
type TokenStore = {
|
|
22
42
|
get(): Promise<StoredTokens | undefined>;
|
|
@@ -146,18 +166,18 @@ type RevokeUrlOptions = AuthorizationUrlOptions;
|
|
|
146
166
|
* The `porters.auth.*` surface. The initial per-Company-DB grant
|
|
147
167
|
* needs a human to open {@link AuthApi.authorizationUrl} in a browser and consent; the
|
|
148
168
|
* library only builds the URL and exchanges the returned `code`. Day-to-day token
|
|
149
|
-
* acquisition
|
|
150
|
-
* touch this surface.
|
|
169
|
+
* acquisition and renewal are handled by the client, whichever token provider is in use, so
|
|
170
|
+
* most callers never touch this surface.
|
|
151
171
|
*/
|
|
152
172
|
type AuthApi = {
|
|
153
173
|
/** Build the browser `code`-grant URL to open for the initial permission grant. */
|
|
154
174
|
authorizationUrl(opts: AuthorizationUrlOptions): string;
|
|
155
175
|
/**
|
|
156
|
-
* Exchange a redirect `?code=` for tokens
|
|
157
|
-
* Resolves `void` on success (
|
|
158
|
-
* {@link AuthApi.getToken});
|
|
159
|
-
*
|
|
160
|
-
* code), or `PortersNetworkError`.
|
|
176
|
+
* Exchange a redirect `?code=` for tokens through the token provider's `exchange`, and save
|
|
177
|
+
* them (cache and `tokenStore`). Resolves `void` on success (inspect via
|
|
178
|
+
* {@link AuthApi.getToken}); rejects with {@link PortersConfigError} when the provider has no
|
|
179
|
+
* `exchange` or the built-in one lacks `appId` / `appSecret`, `PortersAuthError` (token-endpoint
|
|
180
|
+
* error or expired code), or `PortersNetworkError`.
|
|
161
181
|
*/
|
|
162
182
|
exchangeAuthorizationCode(code: string): Promise<void>;
|
|
163
183
|
/**
|
|
@@ -776,7 +796,7 @@ type CandidateCreateInput = CreateInput<typeof FIELDS$g, (typeof REQUIRED_ON_CRE
|
|
|
776
796
|
/** Fields for `update`: all optional (`null` omits, `""` clears a text field). */
|
|
777
797
|
type CandidateUpdateInput = UpdateInput<typeof FIELDS$g>;
|
|
778
798
|
/** The Candidate accessor; `C` is the declared custom-field catalog merged on. */
|
|
779
|
-
type CandidateResource<C extends FieldCatalog = EmptyCatalog> = Resource<typeof FIELDS$g & C, (typeof REQUIRED_ON_CREATE$b)[number]>;
|
|
799
|
+
type CandidateResource<C extends FieldCatalog = EmptyCatalog, CR extends keyof C = never> = Resource<typeof FIELDS$g & C, (typeof REQUIRED_ON_CREATE$b)[number] | CR>;
|
|
780
800
|
|
|
781
801
|
declare const FIELDS$f: {
|
|
782
802
|
readonly P_Id: "System[Id]";
|
|
@@ -914,7 +934,7 @@ type JobCreateInput = CreateInput<typeof FIELDS$f, (typeof REQUIRED_ON_CREATE$a)
|
|
|
914
934
|
/** Fields for `update`: all optional (`null` omits, `""` clears a text field). */
|
|
915
935
|
type JobUpdateInput = UpdateInput<typeof FIELDS$f>;
|
|
916
936
|
/** The Job accessor; `C` is the declared custom-field catalog merged on. */
|
|
917
|
-
type JobResource<C extends FieldCatalog = EmptyCatalog> = Resource<typeof FIELDS$f & C, (typeof REQUIRED_ON_CREATE$a)[number], typeof REFERENCES$7>;
|
|
937
|
+
type JobResource<C extends FieldCatalog = EmptyCatalog, CR extends keyof C = never> = Resource<typeof FIELDS$f & C, (typeof REQUIRED_ON_CREATE$a)[number] | CR, typeof REFERENCES$7>;
|
|
918
938
|
|
|
919
939
|
declare const FIELDS$e: {
|
|
920
940
|
readonly P_Id: "System[Id]";
|
|
@@ -947,7 +967,7 @@ type ClientCreateInput = CreateInput<typeof FIELDS$e, (typeof REQUIRED_ON_CREATE
|
|
|
947
967
|
/** Fields for `update`: all optional (`null` omits, `""` clears a text field). */
|
|
948
968
|
type ClientUpdateInput = UpdateInput<typeof FIELDS$e>;
|
|
949
969
|
/** The Client accessor; `C` is the declared custom-field catalog merged on. */
|
|
950
|
-
type ClientResource<C extends FieldCatalog = EmptyCatalog> = Resource<typeof FIELDS$e & C, (typeof REQUIRED_ON_CREATE$9)[number]>;
|
|
970
|
+
type ClientResource<C extends FieldCatalog = EmptyCatalog, CR extends keyof C = never> = Resource<typeof FIELDS$e & C, (typeof REQUIRED_ON_CREATE$9)[number] | CR>;
|
|
951
971
|
|
|
952
972
|
declare const FIELDS$d: {
|
|
953
973
|
readonly P_Id: "System[Id]";
|
|
@@ -1015,7 +1035,7 @@ type RecruiterCreateInput = CreateInput<typeof FIELDS$d, (typeof REQUIRED_ON_CRE
|
|
|
1015
1035
|
/** Fields for `update`: all optional (`null` omits, `""` clears a text field). */
|
|
1016
1036
|
type RecruiterUpdateInput = UpdateInput<typeof FIELDS$d>;
|
|
1017
1037
|
/** The Recruiter accessor; `C` is the declared custom-field catalog merged on. */
|
|
1018
|
-
type RecruiterResource<C extends FieldCatalog = EmptyCatalog> = Resource<typeof FIELDS$d & C, (typeof REQUIRED_ON_CREATE$8)[number], typeof REFERENCES$6>;
|
|
1038
|
+
type RecruiterResource<C extends FieldCatalog = EmptyCatalog, CR extends keyof C = never> = Resource<typeof FIELDS$d & C, (typeof REQUIRED_ON_CREATE$8)[number] | CR, typeof REFERENCES$6>;
|
|
1019
1039
|
|
|
1020
1040
|
declare const FIELDS$c: {
|
|
1021
1041
|
readonly P_Id: "System[Id]";
|
|
@@ -1083,7 +1103,7 @@ type ContactCreateInput = CreateInput<typeof FIELDS$c, (typeof REQUIRED_ON_CREAT
|
|
|
1083
1103
|
/** Fields for `update`: all optional (`null` omits, `""` clears a text field). */
|
|
1084
1104
|
type ContactUpdateInput = UpdateInput<typeof FIELDS$c>;
|
|
1085
1105
|
/** The Contact accessor; `C` is the declared custom-field catalog merged on. */
|
|
1086
|
-
type ContactResource<C extends FieldCatalog = EmptyCatalog> = Resource<typeof FIELDS$c & C, (typeof REQUIRED_ON_CREATE$7)[number], typeof REFERENCES$5>;
|
|
1106
|
+
type ContactResource<C extends FieldCatalog = EmptyCatalog, CR extends keyof C = never> = Resource<typeof FIELDS$c & C, (typeof REQUIRED_ON_CREATE$7)[number] | CR, typeof REFERENCES$5>;
|
|
1087
1107
|
|
|
1088
1108
|
declare const FIELDS$b: {
|
|
1089
1109
|
readonly P_Id: "System[Id]";
|
|
@@ -1198,7 +1218,7 @@ type OpportunityCreateInput = CreateInput<typeof FIELDS$b, (typeof REQUIRED_ON_C
|
|
|
1198
1218
|
/** Fields for `update`: all optional (`null` omits, `""` clears a text field). */
|
|
1199
1219
|
type OpportunityUpdateInput = UpdateInput<typeof FIELDS$b>;
|
|
1200
1220
|
/** The Opportunity accessor; `C` is the declared custom-field catalog merged on. */
|
|
1201
|
-
type OpportunityResource<C extends FieldCatalog = EmptyCatalog> = Resource<typeof FIELDS$b & C, (typeof REQUIRED_ON_CREATE$6)[number], typeof REFERENCES$4>;
|
|
1221
|
+
type OpportunityResource<C extends FieldCatalog = EmptyCatalog, CR extends keyof C = never> = Resource<typeof FIELDS$b & C, (typeof REQUIRED_ON_CREATE$6)[number] | CR, typeof REFERENCES$4>;
|
|
1202
1222
|
|
|
1203
1223
|
declare const FIELDS$a: {
|
|
1204
1224
|
readonly P_Id: "System[Id]";
|
|
@@ -1230,7 +1250,7 @@ type ActivityCreateInput = CreateInput<typeof FIELDS$a, (typeof REQUIRED_ON_CREA
|
|
|
1230
1250
|
/** Fields for `update`: all optional (`null` omits, `""` clears a text field). */
|
|
1231
1251
|
type ActivityUpdateInput = UpdateInput<typeof FIELDS$a>;
|
|
1232
1252
|
/** The Activity accessor; `C` is the declared custom-field catalog merged on. */
|
|
1233
|
-
type ActivityResource<C extends FieldCatalog = EmptyCatalog> = Resource<typeof FIELDS$a & C, (typeof REQUIRED_ON_CREATE$5)[number]>;
|
|
1253
|
+
type ActivityResource<C extends FieldCatalog = EmptyCatalog, CR extends keyof C = never> = Resource<typeof FIELDS$a & C, (typeof REQUIRED_ON_CREATE$5)[number] | CR>;
|
|
1234
1254
|
|
|
1235
1255
|
declare const FIELDS$9: {
|
|
1236
1256
|
readonly P_Id: "System[Id]";
|
|
@@ -1311,7 +1331,7 @@ type ContractCreateInput = CreateInput<typeof FIELDS$9, (typeof REQUIRED_ON_CREA
|
|
|
1311
1331
|
/** Fields for `update`: all optional (`null` omits, `""` clears a text field). */
|
|
1312
1332
|
type ContractUpdateInput = UpdateInput<typeof FIELDS$9>;
|
|
1313
1333
|
/** The Contract accessor; `C` is the declared custom-field catalog merged on. */
|
|
1314
|
-
type ContractResource<C extends FieldCatalog = EmptyCatalog> = Resource<typeof FIELDS$9 & C, (typeof REQUIRED_ON_CREATE$4)[number], typeof REFERENCES$3>;
|
|
1334
|
+
type ContractResource<C extends FieldCatalog = EmptyCatalog, CR extends keyof C = never> = Resource<typeof FIELDS$9 & C, (typeof REQUIRED_ON_CREATE$4)[number] | CR, typeof REFERENCES$3>;
|
|
1315
1335
|
|
|
1316
1336
|
declare const FIELDS$8: {
|
|
1317
1337
|
readonly P_Id: "System[Id]";
|
|
@@ -1751,7 +1771,7 @@ type SalesCreateInput = CreateInput<typeof FIELDS$8, (typeof REQUIRED_ON_CREATE$
|
|
|
1751
1771
|
/** Fields for `update`: all optional (`null` omits, `""` clears a text field). */
|
|
1752
1772
|
type SalesUpdateInput = UpdateInput<typeof FIELDS$8>;
|
|
1753
1773
|
/** The Sales accessor; `C` is the declared custom-field catalog merged on. */
|
|
1754
|
-
type SalesResource<C extends FieldCatalog = EmptyCatalog> = Resource<typeof FIELDS$8 & C, (typeof REQUIRED_ON_CREATE$3)[number], typeof REFERENCES$2>;
|
|
1774
|
+
type SalesResource<C extends FieldCatalog = EmptyCatalog, CR extends keyof C = never> = Resource<typeof FIELDS$8 & C, (typeof REQUIRED_ON_CREATE$3)[number] | CR, typeof REFERENCES$2>;
|
|
1755
1775
|
|
|
1756
1776
|
/** Resource name -> the numeric id PORTERS uses for it (docs/usage/reference/resource-api/resources-list.md). */
|
|
1757
1777
|
declare const RESOURCE_VALUES: {
|
|
@@ -2212,7 +2232,7 @@ type ProcessCreateInput = CreateInput<typeof FIELDS$6, (typeof REQUIRED_ON_CREAT
|
|
|
2212
2232
|
/** Fields for `update`: all optional (`null` omits, `""` clears a text field). */
|
|
2213
2233
|
type ProcessUpdateInput = UpdateInput<typeof FIELDS$6>;
|
|
2214
2234
|
/** The Process accessor; `C` is the declared custom-field catalog merged on. */
|
|
2215
|
-
type ProcessResource<C extends FieldCatalog = EmptyCatalog> = Resource<typeof FIELDS$6 & C, (typeof REQUIRED_ON_CREATE$1)[number], typeof REFERENCES$1>;
|
|
2235
|
+
type ProcessResource<C extends FieldCatalog = EmptyCatalog, CR extends keyof C = never> = Resource<typeof FIELDS$6 & C, (typeof REQUIRED_ON_CREATE$1)[number] | CR, typeof REFERENCES$1>;
|
|
2216
2236
|
|
|
2217
2237
|
declare const FIELDS$5: {
|
|
2218
2238
|
readonly P_Id: "System[Id]";
|
|
@@ -2290,7 +2310,7 @@ type ResumeCreateInput = CreateInput<typeof FIELDS$5, (typeof REQUIRED_ON_CREATE
|
|
|
2290
2310
|
/** Fields for `update`: all optional (`null` omits, `""` clears a text field). */
|
|
2291
2311
|
type ResumeUpdateInput = UpdateInput<typeof FIELDS$5>;
|
|
2292
2312
|
/** The Resume accessor; `C` is the declared custom-field catalog merged on. */
|
|
2293
|
-
type ResumeResource<C extends FieldCatalog = EmptyCatalog> = Resource<typeof FIELDS$5 & C, (typeof REQUIRED_ON_CREATE)[number], typeof REFERENCES>;
|
|
2313
|
+
type ResumeResource<C extends FieldCatalog = EmptyCatalog, CR extends keyof C = never> = Resource<typeof FIELDS$5 & C, (typeof REQUIRED_ON_CREATE)[number] | CR, typeof REFERENCES>;
|
|
2294
2314
|
|
|
2295
2315
|
/** A decoded Attachment. A field is `null` unless it was returned (see `field`). */
|
|
2296
2316
|
type Attachment = {
|
|
@@ -2550,40 +2570,56 @@ type OptionResource = {
|
|
|
2550
2570
|
search(query?: OptionSearchQuery): Promise<Option[]>;
|
|
2551
2571
|
};
|
|
2552
2572
|
|
|
2553
|
-
/**
|
|
2554
|
-
|
|
2573
|
+
/**
|
|
2574
|
+
* One custom field's declaration — the builder's return value: its Data Type and whether
|
|
2575
|
+
* `create` requires it.
|
|
2576
|
+
*/
|
|
2577
|
+
type FieldDef<D extends DataType, R extends boolean = false> = {
|
|
2555
2578
|
readonly dataType: D;
|
|
2579
|
+
/** `true` makes the field required in `create` / `createMany` input. Type-only: no runtime check. */
|
|
2580
|
+
readonly required: R;
|
|
2581
|
+
};
|
|
2582
|
+
/**
|
|
2583
|
+
* Options every builder method takes. `required: true` makes the field required in the
|
|
2584
|
+
* `create` / `createMany` input type; leave it out (or `false`) and the field stays optional,
|
|
2585
|
+
* as it always was. `update` input never requires it.
|
|
2586
|
+
*
|
|
2587
|
+
* @example
|
|
2588
|
+
* defineFields({ candidate: (f) => ({ U_score: f.number({ required: true }) }) });
|
|
2589
|
+
*/
|
|
2590
|
+
type FieldOptions<R extends boolean = boolean> = {
|
|
2591
|
+
readonly required?: R;
|
|
2556
2592
|
};
|
|
2557
2593
|
declare const CUSTOM_DATA_TYPES: readonly ["Number", "SinglelineText", "MultilineText", "Mail", "Telephone", "URL", "Date", "DateTime", "Age", "Option", "User", "Image", "Link"];
|
|
2558
2594
|
type CustomDataType = (typeof CUSTOM_DATA_TYPES)[number];
|
|
2559
2595
|
/** Builder passed to each resource declaration: one method per declarable Data Type. */
|
|
2560
2596
|
type FieldBuilder = {
|
|
2561
|
-
number(): FieldDef<"Number"
|
|
2562
|
-
singlelineText(): FieldDef<"SinglelineText"
|
|
2563
|
-
multilineText(): FieldDef<"MultilineText"
|
|
2564
|
-
mail(): FieldDef<"Mail"
|
|
2565
|
-
telephone(): FieldDef<"Telephone"
|
|
2566
|
-
url(): FieldDef<"URL"
|
|
2567
|
-
date(): FieldDef<"Date"
|
|
2568
|
-
dateTime(): FieldDef<"DateTime"
|
|
2569
|
-
age(): FieldDef<"Age"
|
|
2570
|
-
option(): FieldDef<"Option"
|
|
2571
|
-
user(): FieldDef<"User"
|
|
2597
|
+
number<R extends boolean = false>(options?: FieldOptions<R>): FieldDef<"Number", NoInfer<R>>;
|
|
2598
|
+
singlelineText<R extends boolean = false>(options?: FieldOptions<R>): FieldDef<"SinglelineText", NoInfer<R>>;
|
|
2599
|
+
multilineText<R extends boolean = false>(options?: FieldOptions<R>): FieldDef<"MultilineText", NoInfer<R>>;
|
|
2600
|
+
mail<R extends boolean = false>(options?: FieldOptions<R>): FieldDef<"Mail", NoInfer<R>>;
|
|
2601
|
+
telephone<R extends boolean = false>(options?: FieldOptions<R>): FieldDef<"Telephone", NoInfer<R>>;
|
|
2602
|
+
url<R extends boolean = false>(options?: FieldOptions<R>): FieldDef<"URL", NoInfer<R>>;
|
|
2603
|
+
date<R extends boolean = false>(options?: FieldOptions<R>): FieldDef<"Date", NoInfer<R>>;
|
|
2604
|
+
dateTime<R extends boolean = false>(options?: FieldOptions<R>): FieldDef<"DateTime", NoInfer<R>>;
|
|
2605
|
+
age<R extends boolean = false>(options?: FieldOptions<R>): FieldDef<"Age", NoInfer<R>>;
|
|
2606
|
+
option<R extends boolean = false>(options?: FieldOptions<R>): FieldDef<"Option", NoInfer<R>>;
|
|
2607
|
+
user<R extends boolean = false>(options?: FieldOptions<R>): FieldDef<"User", NoInfer<R>>;
|
|
2572
2608
|
/**
|
|
2573
2609
|
* An Image field (FT-18). Reads back `FileName` alone unless the query's `image` option asks
|
|
2574
2610
|
* for `ContentType` / `Content`; writes the three sub-elements, checked before send.
|
|
2575
2611
|
*/
|
|
2576
|
-
image(): FieldDef<"Image"
|
|
2612
|
+
image<R extends boolean = false>(options?: FieldOptions<R>): FieldDef<"Image", NoInfer<R>>;
|
|
2577
2613
|
/**
|
|
2578
2614
|
* A Link field (FT-20). Reads back a Contact id, a `UserRef`, or a `DepartmentRef` — whichever
|
|
2579
2615
|
* the tenant configured, told apart by shape; writes the referenced id.
|
|
2580
2616
|
*/
|
|
2581
|
-
link(): FieldDef<"Link"
|
|
2617
|
+
link<R extends boolean = false>(options?: FieldOptions<R>): FieldDef<"Link", NoInfer<R>>;
|
|
2582
2618
|
};
|
|
2583
2619
|
/** Data resources that accept custom fields. Master / Attachment are excluded. */
|
|
2584
2620
|
type CustomFieldResource = "candidate" | "job" | "client" | "recruiter" | "contact" | "opportunity" | "activity" | "contract" | "sales" | "process" | "resume";
|
|
2585
2621
|
/** One resource's custom field declarations: alias -> {@link FieldDef}. */
|
|
2586
|
-
type ResourceDecl = Record<string, FieldDef<DataType>>;
|
|
2622
|
+
type ResourceDecl = Record<string, FieldDef<DataType, boolean>>;
|
|
2587
2623
|
/** Declaration input: per (data) resource, a builder fn returning its custom fields. */
|
|
2588
2624
|
type FieldDecls = {
|
|
2589
2625
|
[R in CustomFieldResource]?: (f: FieldBuilder) => ResourceDecl;
|
|
@@ -2601,6 +2637,16 @@ type CatalogOf<R extends ResourceDecl> = {
|
|
|
2601
2637
|
type DeclaredCatalogsOf<D extends FieldDecls> = {
|
|
2602
2638
|
[R in keyof D]: D[R] extends (f: FieldBuilder) => infer Out ? Out extends ResourceDecl ? CatalogOf<Out> : never : never;
|
|
2603
2639
|
};
|
|
2640
|
+
type RequiredAliasesOf<R extends ResourceDecl> = {
|
|
2641
|
+
[K in keyof R]: R[K]["required"] extends true ? K : never;
|
|
2642
|
+
}[keyof R];
|
|
2643
|
+
declare const requiredOnCreateBrand: unique symbol;
|
|
2644
|
+
/** Per declared resource, the aliases declared `required: true` — carried on the type only. */
|
|
2645
|
+
type DeclaredRequiredOf<D extends FieldDecls> = {
|
|
2646
|
+
readonly [requiredOnCreateBrand]: {
|
|
2647
|
+
[R in keyof D]: D[R] extends (f: FieldBuilder) => infer Out ? Out extends ResourceDecl ? RequiredAliasesOf<Out> : never : never;
|
|
2648
|
+
};
|
|
2649
|
+
};
|
|
2604
2650
|
declare const definedFieldsBrand: unique symbol;
|
|
2605
2651
|
/** A validated set of custom field catalogs (branded — the client does not re-validate). */
|
|
2606
2652
|
type DefinedFields<C extends DeclaredCatalogs = DeclaredCatalogs> = C & {
|
|
@@ -2608,6 +2654,14 @@ type DefinedFields<C extends DeclaredCatalogs = DeclaredCatalogs> = C & {
|
|
|
2608
2654
|
};
|
|
2609
2655
|
/** The custom catalog declared for resource `K` (or `{}` if none) — types each accessor. */
|
|
2610
2656
|
type CustomFor<C extends DeclaredCatalogs, K extends CustomFieldResource> = K extends keyof C ? C[K] extends CustomCatalog ? C[K] : EmptyCatalog : EmptyCatalog;
|
|
2657
|
+
/**
|
|
2658
|
+
* The aliases of resource `K` that `create` requires because the declaration said
|
|
2659
|
+
* `required: true` (or `never`). Read off the phantom that {@link defineFields} puts on its
|
|
2660
|
+
* result type, so a scope typed `TenantScope<typeof fields>` picks it up with no extra type argument.
|
|
2661
|
+
*/
|
|
2662
|
+
type RequiredFor<C extends DeclaredCatalogs, K extends CustomFieldResource> = C extends {
|
|
2663
|
+
readonly [requiredOnCreateBrand]: infer Rq;
|
|
2664
|
+
} ? K extends keyof Rq ? Extract<Rq[K], keyof CustomFor<C, K>> : never : never;
|
|
2611
2665
|
/**
|
|
2612
2666
|
* Declare tenant-specific custom fields per data resource. This is the validation
|
|
2613
2667
|
* boundary: it throws {@link PortersConfigError} synchronously for an unknown resource key or an
|
|
@@ -2621,7 +2675,7 @@ type CustomFor<C extends DeclaredCatalogs, K extends CustomFieldResource> = K ex
|
|
|
2621
2675
|
* });
|
|
2622
2676
|
* const t = porters.tenant(1, { fields: myFields });
|
|
2623
2677
|
*/
|
|
2624
|
-
declare const defineFields: <D extends FieldDecls>(decls: D) => DefinedFields<DeclaredCatalogsOf<D>>;
|
|
2678
|
+
declare const defineFields: <D extends FieldDecls>(decls: D) => DefinedFields<DeclaredCatalogsOf<D> & DeclaredRequiredOf<D>>;
|
|
2625
2679
|
|
|
2626
2680
|
/**
|
|
2627
2681
|
* The slice of a `tenant(id)` scope this tooling needs. Structural on purpose: pass
|
|
@@ -2673,6 +2727,13 @@ type TenantCustomCatalog = {
|
|
|
2673
2727
|
* (`generateFieldDecls` has it off by default). A field PORTERS returned without a name is absent.
|
|
2674
2728
|
*/
|
|
2675
2729
|
readonly names: Readonly<Record<string, string>>;
|
|
2730
|
+
/**
|
|
2731
|
+
* Bare alias -> whether the tenant marks the field required (`Field.P_Required` is `1`), for
|
|
2732
|
+
* every field in {@link TenantCustomCatalog.fields}. Any other value — `0`, absent, or one
|
|
2733
|
+
* PORTERS does not document — reads as `false`: a wrong `true` would make generated code demand
|
|
2734
|
+
* a value the tenant does not, and the caller would get a compile error with no visible reason.
|
|
2735
|
+
*/
|
|
2736
|
+
readonly required: Readonly<Record<string, boolean>>;
|
|
2676
2737
|
};
|
|
2677
2738
|
/** Options for {@link readCustomCatalog}. */
|
|
2678
2739
|
type ReadCustomCatalogOptions = {
|
|
@@ -2767,6 +2828,20 @@ type UnverifiableResource = {
|
|
|
2767
2828
|
/** Whatever Field Read rejected with (a `PortersError`, typically permission or network). */
|
|
2768
2829
|
readonly cause: unknown;
|
|
2769
2830
|
};
|
|
2831
|
+
/**
|
|
2832
|
+
* Declared `required: true` while the tenant does not mark the field required, or the reverse.
|
|
2833
|
+
* Harmless either way — reads and writes work — so it does not clear {@link FieldVerification.ok}.
|
|
2834
|
+
* `declared: true, tenant: false` is a declaration stricter than the tenant (perhaps on purpose);
|
|
2835
|
+
* `declared: false, tenant: true` means `create` will not stop a missing value at compile time.
|
|
2836
|
+
*/
|
|
2837
|
+
type RequiredMismatch = {
|
|
2838
|
+
readonly resource: CustomFieldResource;
|
|
2839
|
+
readonly alias: string;
|
|
2840
|
+
/** Whether the declaration says `required: true`. */
|
|
2841
|
+
readonly declared: boolean;
|
|
2842
|
+
/** Whether the tenant marks the field required (`Field.P_Required` is `1`). */
|
|
2843
|
+
readonly tenant: boolean;
|
|
2844
|
+
};
|
|
2770
2845
|
/** A tenant field that exists but no declaration can express (carried through from the catalog). */
|
|
2771
2846
|
type UndeclarableTenantField = UndeclarableField & {
|
|
2772
2847
|
readonly resource: CustomFieldResource;
|
|
@@ -2778,8 +2853,8 @@ type FieldVerification = {
|
|
|
2778
2853
|
* {@link FieldVerification.missing}, {@link FieldVerification.typeMismatch} or
|
|
2779
2854
|
* {@link FieldVerification.unverifiable}.
|
|
2780
2855
|
*
|
|
2781
|
-
* `undeclared` and `
|
|
2782
|
-
* there to be read.
|
|
2856
|
+
* `undeclared`, `undeclarable` and `requiredMismatch` do **not** clear this flag: none of them
|
|
2857
|
+
* breaks anything, they are there to be read.
|
|
2783
2858
|
*/
|
|
2784
2859
|
readonly ok: boolean;
|
|
2785
2860
|
readonly missing: readonly MissingField[];
|
|
@@ -2787,6 +2862,7 @@ type FieldVerification = {
|
|
|
2787
2862
|
readonly undeclared: readonly UndeclaredField[];
|
|
2788
2863
|
readonly unverifiable: readonly UnverifiableResource[];
|
|
2789
2864
|
readonly undeclarable: readonly UndeclarableTenantField[];
|
|
2865
|
+
readonly requiredMismatch: readonly RequiredMismatch[];
|
|
2790
2866
|
};
|
|
2791
2867
|
/** Options for {@link verifyFields}. */
|
|
2792
2868
|
type VerifyFieldsOptions = {
|
|
@@ -2820,7 +2896,7 @@ declare const verifyFields: (source: FieldCatalogSource, fields: DeclaredCatalog
|
|
|
2820
2896
|
* resource that could not be read**. That last one is deliberate: "we could not check" is not
|
|
2821
2897
|
* "everything is fine", and passing it silently would defeat the point of asking.
|
|
2822
2898
|
*
|
|
2823
|
-
* `undeclared` / `undeclarable` never throw — nothing is broken by
|
|
2899
|
+
* `undeclared` / `undeclarable` / `requiredMismatch` never throw — nothing is broken by any of them.
|
|
2824
2900
|
*
|
|
2825
2901
|
* @example
|
|
2826
2902
|
* assertFieldsMatch(await verifyFields(porters.tenant(1), myFields));
|
|
@@ -2862,10 +2938,21 @@ type PortersClientOptions = {
|
|
|
2862
2938
|
appId?: string;
|
|
2863
2939
|
appSecret?: string;
|
|
2864
2940
|
scopes?: Scope[];
|
|
2865
|
-
/**
|
|
2866
|
-
|
|
2867
|
-
|
|
2941
|
+
/**
|
|
2942
|
+
* Where tokens come from. Leave it out for the built-in flow (`code_direct` with `appId` /
|
|
2943
|
+
* `appSecret`); pass one to obtain tokens another way — for example from a central service that
|
|
2944
|
+
* holds the App Secret. Either way the client caches, renews before expiry, retries once on an
|
|
2945
|
+
* expired token, and saves to `tokenStore`.
|
|
2946
|
+
*/
|
|
2947
|
+
tokenProvider?: TokenProvider;
|
|
2948
|
+
/** Token persistence, used with every token provider; defaults to in-memory. */
|
|
2868
2949
|
tokenStore?: TokenStore;
|
|
2950
|
+
/**
|
|
2951
|
+
* **Not a client option any more.** Pass a `tokenProvider` (`{ acquire, refresh?, exchange? }`)
|
|
2952
|
+
* instead; the client manages caching and renewal for it. Typed `never` so a leftover `auth`
|
|
2953
|
+
* fails to compile; at runtime the constructor rejects it with {@link PortersConfigError}.
|
|
2954
|
+
*/
|
|
2955
|
+
auth?: never;
|
|
2869
2956
|
/** Injectable HTTP transport; defaults to a fetch-based transport. */
|
|
2870
2957
|
transport?: Transport;
|
|
2871
2958
|
/**
|
|
@@ -2913,22 +3000,22 @@ type TenantOptions<C extends DeclaredCatalogs = EmptyCatalog> = {
|
|
|
2913
3000
|
* (no nesting) are deliberately absent: none of them takes a partition.
|
|
2914
3001
|
*/
|
|
2915
3002
|
type TenantScope<C extends DeclaredCatalogs = EmptyCatalog> = {
|
|
2916
|
-
readonly candidate: CandidateResource<CustomFor<C, "candidate">>;
|
|
2917
|
-
readonly job: JobResource<CustomFor<C, "job">>;
|
|
2918
|
-
readonly client: ClientResource<CustomFor<C, "client">>;
|
|
2919
|
-
readonly recruiter: RecruiterResource<CustomFor<C, "recruiter">>;
|
|
2920
|
-
readonly contact: ContactResource<CustomFor<C, "contact">>;
|
|
2921
|
-
readonly opportunity: OpportunityResource<CustomFor<C, "opportunity">>;
|
|
2922
|
-
readonly activity: ActivityResource<CustomFor<C, "activity">>;
|
|
2923
|
-
readonly contract: ContractResource<CustomFor<C, "contract">>;
|
|
2924
|
-
readonly sales: SalesResource<CustomFor<C, "sales">>;
|
|
3003
|
+
readonly candidate: CandidateResource<CustomFor<C, "candidate">, RequiredFor<C, "candidate">>;
|
|
3004
|
+
readonly job: JobResource<CustomFor<C, "job">, RequiredFor<C, "job">>;
|
|
3005
|
+
readonly client: ClientResource<CustomFor<C, "client">, RequiredFor<C, "client">>;
|
|
3006
|
+
readonly recruiter: RecruiterResource<CustomFor<C, "recruiter">, RequiredFor<C, "recruiter">>;
|
|
3007
|
+
readonly contact: ContactResource<CustomFor<C, "contact">, RequiredFor<C, "contact">>;
|
|
3008
|
+
readonly opportunity: OpportunityResource<CustomFor<C, "opportunity">, RequiredFor<C, "opportunity">>;
|
|
3009
|
+
readonly activity: ActivityResource<CustomFor<C, "activity">, RequiredFor<C, "activity">>;
|
|
3010
|
+
readonly contract: ContractResource<CustomFor<C, "contract">, RequiredFor<C, "contract">>;
|
|
3011
|
+
readonly sales: SalesResource<CustomFor<C, "sales">, RequiredFor<C, "sales">>;
|
|
2925
3012
|
/**
|
|
2926
3013
|
* Phase history, reached through the resource it belongs to: `t.phase.of("client")`.
|
|
2927
3014
|
* PORTERS requires that `resource` on every Phase call, so it is bound once.
|
|
2928
3015
|
*/
|
|
2929
3016
|
readonly phase: PhaseAccessor;
|
|
2930
|
-
readonly process: ProcessResource<CustomFor<C, "process">>;
|
|
2931
|
-
readonly resume: ResumeResource<CustomFor<C, "resume">>;
|
|
3017
|
+
readonly process: ProcessResource<CustomFor<C, "process">, RequiredFor<C, "process">>;
|
|
3018
|
+
readonly resume: ResumeResource<CustomFor<C, "resume">, RequiredFor<C, "resume">>;
|
|
2932
3019
|
/**
|
|
2933
3020
|
* Attachments, reached through the resource they belong to: `t.attachment.of("resume")`.
|
|
2934
3021
|
* PORTERS requires that `resource` on every Attachment Read, and the same value fills the
|
|
@@ -3104,4 +3191,4 @@ declare const decodeTimeOfDay: (iso: string) => string;
|
|
|
3104
3191
|
*/
|
|
3105
3192
|
declare const encodeTimeOfDay: (time: string) => string;
|
|
3106
3193
|
|
|
3107
|
-
export { type Activity, type ActivityCreateInput, type ActivityPage, type ActivityResource, type ActivitySearchQuery, type ActivityUpdateInput, type Attachment, type AttachmentAccessor, type AttachmentCreate, type AttachmentPage, type AttachmentResource, type AttachmentSearchQuery, type AttachmentUpdate, type AttachmentWalkQuery, type AuthApi, type AuthorizationUrlOptions, type BulkWriteResult, type BulkWriteResultItem, type Candidate, type CandidateCreateInput, type CandidatePage, type CandidateResource, type CandidateSearchQuery, type CandidateUpdateInput, type Client, type ClientCreateInput, type ClientPage, type ClientResource, type ClientSearchQuery, type ClientUpdateInput, type Condition, type Contact, type ContactCreateInput, type ContactPage, type ContactResource, type ContactSearchQuery, type ContactUpdateInput, type Contract, type ContractCreateInput, type ContractPage, type ContractResource, type ContractSearchQuery, type ContractUpdateInput, type CustomDataType, type CustomFieldResource, type CustomFor, type DeclaredCatalogs, type DefinedFields, type Department, type DepartmentPage, type DepartmentRef, type DepartmentResource, type DepartmentSearchQuery, type ErrorCategory, type Expand, type ExpandedReadRecord, type FetchTransportOptions, type Field, type FieldAccessor, type FieldBuilder, type FieldCatalogSource, type FieldDecls, type FieldDef, type FieldPage, type FieldResource, type FieldSearchQuery, type FieldTypeMismatch, type FieldValue, type FieldVerification, type GenerateFieldDeclsOptions, type
|
|
3194
|
+
export { type Activity, type ActivityCreateInput, type ActivityPage, type ActivityResource, type ActivitySearchQuery, type ActivityUpdateInput, type Attachment, type AttachmentAccessor, type AttachmentCreate, type AttachmentPage, type AttachmentResource, type AttachmentSearchQuery, type AttachmentUpdate, type AttachmentWalkQuery, type AuthApi, type AuthorizationUrlOptions, type BulkWriteResult, type BulkWriteResultItem, type Candidate, type CandidateCreateInput, type CandidatePage, type CandidateResource, type CandidateSearchQuery, type CandidateUpdateInput, type Client, type ClientCreateInput, type ClientPage, type ClientResource, type ClientSearchQuery, type ClientUpdateInput, type Condition, type Contact, type ContactCreateInput, type ContactPage, type ContactResource, type ContactSearchQuery, type ContactUpdateInput, type Contract, type ContractCreateInput, type ContractPage, type ContractResource, type ContractSearchQuery, type ContractUpdateInput, type CustomDataType, type CustomFieldResource, type CustomFor, type DeclaredCatalogs, type DeclaredRequiredOf, type DefinedFields, type Department, type DepartmentPage, type DepartmentRef, type DepartmentResource, type DepartmentSearchQuery, type ErrorCategory, type Expand, type ExpandedReadRecord, type FetchTransportOptions, type Field, type FieldAccessor, type FieldBuilder, type FieldCatalogSource, type FieldDecls, type FieldDef, type FieldOptions, type FieldPage, type FieldResource, type FieldSearchQuery, type FieldTypeMismatch, type FieldValue, type FieldVerification, type GenerateFieldDeclsOptions, type ImageContentType, type ImageOption, type ImageReadRecord, type ImageSelectedValue, type ImageSubField, type ImageValue, type ImageWriteValue, type IssuedToken, type ItemState, type Job, type JobCreateInput, type JobPage, type JobResource, type JobSearchQuery, type JobUpdateInput, type LinkValue, type MissingField, type MockHandler, type MockReply, type MockTransportOptions, type Opportunity, type OpportunityCreateInput, type OpportunityPage, type OpportunityResource, type OpportunitySearchQuery, type OpportunityUpdateInput, type Option, type OptionResource, type OptionSearchQuery, type Order, type Partition, type PartitionId, type PartitionPage, type PartitionResource, type PartitionSearchQuery, type Phase, type PhaseAccessor, type PhaseCreateInput, type PhasePage, type PhaseResource, type PhaseSearchQuery, type PhaseUpdateInput, PortersAuthError, PortersClient, type PortersClientOptions, PortersConfigError, PortersError, type PortersErrorContext, type PortersErrorOptions, PortersNetworkError, PortersResourceError, type Process, type ProcessCreateInput, type ProcessPage, type ProcessResource, type ProcessSearchQuery, type ProcessUpdateInput, type ReadCustomCatalogOptions, type ReadFieldAlias, type Recruiter, type RecruiterCreateInput, type RecruiterPage, type RecruiterResource, type RecruiterSearchQuery, type RecruiterUpdateInput, type ReferenceMap, type ReferenceRecord, type RequiredFor, type RequiredMismatch, type ResourceName, type ResourcePageOf, type ResourceType, type Resume, type ResumeCreateInput, type ResumePage, type ResumeResource, type ResumeSearchQuery, type ResumeUpdateInput, type RevokeUrlOptions, type Sales, type SalesCreateInput, type SalesPage, type SalesResource, type SalesSearchQuery, type SalesUpdateInput, type Scheme, type Scope, type SearchQuery, type StoredTokens, type TenantCustomCatalog, type TenantOptions, type TenantScope, type Throttle, type ThrottleOptions, type TokenProvider, type TokenStore, type Transport, type TransportRequest, type TransportResponse, type UndeclarableField, type UndeclarableReason, type UndeclarableTenantField, type UndeclaredField, type UnverifiableResource, type User, type UserPage, type UserRef, type UserResource, type UserSearchQuery, type VerifyFieldsOptions, assertFieldsMatch, base64ToBytes, bytesToBase64, createFetchTransport, createMockTransport, createThrottle, decodeTimeOfDay, defineFields, encodeTimeOfDay, generateFieldDecls, rawValue, readCustomCatalog, resourceNameOf, resourceValueOf, verifyFields };
|