datocms-plugin-sdk 2.0.12 → 2.0.15
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/cjs/hooks/renderPage.js.map +1 -1
- package/dist/cjs/icon.js.map +1 -1
- package/dist/cjs/manifest.js +51 -31
- package/dist/cjs/manifest.js.map +1 -1
- package/dist/esm/ctx/base.d.ts +2 -0
- package/dist/esm/hooks/onBeforeItemUpsert.d.ts +9 -2
- package/dist/esm/hooks/renderPage.d.ts +6 -0
- package/dist/esm/hooks/renderPage.js.map +1 -1
- package/dist/esm/icon.d.ts +39 -1
- package/dist/esm/icon.js.map +1 -1
- package/dist/esm/manifest.js +51 -31
- package/dist/esm/manifest.js.map +1 -1
- package/dist/types/ctx/base.d.ts +2 -0
- package/dist/types/hooks/onBeforeItemUpsert.d.ts +9 -2
- package/dist/types/hooks/renderPage.d.ts +6 -0
- package/dist/types/icon.d.ts +39 -1
- package/manifest.json +51 -31
- package/package.json +2 -2
- package/src/ctx/base.ts +3 -0
- package/src/hooks/onBeforeItemUpsert.ts +9 -2
- package/src/hooks/renderPage.ts +7 -0
- package/src/icon.ts +46 -3
- package/src/manifest.ts +52 -31
package/src/manifest.ts
CHANGED
|
@@ -275,6 +275,16 @@ export const manifest: Manifest = {
|
|
|
275
275
|
},
|
|
276
276
|
type: 'string',
|
|
277
277
|
},
|
|
278
|
+
location: {
|
|
279
|
+
comment: {
|
|
280
|
+
markdownText: 'Current page location.',
|
|
281
|
+
},
|
|
282
|
+
location: {
|
|
283
|
+
filePath: 'src/hooks/renderPage.ts',
|
|
284
|
+
lineNumber: 22,
|
|
285
|
+
},
|
|
286
|
+
type: '{\n pathname: string;\n search: string;\n hash: string;\n }',
|
|
287
|
+
},
|
|
278
288
|
},
|
|
279
289
|
},
|
|
280
290
|
],
|
|
@@ -1735,7 +1745,7 @@ export const manifest: Manifest = {
|
|
|
1735
1745
|
name: 'onBeforeItemUpsert',
|
|
1736
1746
|
comment: {
|
|
1737
1747
|
markdownText:
|
|
1738
|
-
'This
|
|
1748
|
+
'This hook is called when the user attempts to save a record. You can use it to block record saving.\n\nIf you return `false`, the record will NOT be saved. A small on-page error will say "A plugin blocked the action".\nHowever, for better UX, consider also using `ctx.alert()` to better explain to the user why their save was blocked.\n\nIf you return `true`, the save will proceed as normal.\n\nThis hook runs BEFORE serverside validation. You can use it to do your own additional validation before returning.\nClientside validations are not affected by this hook, since those occur on individual fields\' `onBlur()` events.',
|
|
1739
1749
|
tag: 'beforeHooks',
|
|
1740
1750
|
},
|
|
1741
1751
|
nonCtxArguments: [
|
|
@@ -1763,7 +1773,7 @@ export const manifest: Manifest = {
|
|
|
1763
1773
|
},
|
|
1764
1774
|
location: {
|
|
1765
1775
|
filePath: 'src/hooks/onBeforeItemUpsert.ts',
|
|
1766
|
-
lineNumber:
|
|
1776
|
+
lineNumber: 47,
|
|
1767
1777
|
},
|
|
1768
1778
|
type: '(path: string, locale?: string) => Promise<void>',
|
|
1769
1779
|
},
|
|
@@ -1774,7 +1784,7 @@ export const manifest: Manifest = {
|
|
|
1774
1784
|
returnType: 'MaybePromise<boolean>',
|
|
1775
1785
|
location: {
|
|
1776
1786
|
filePath: 'src/hooks/onBeforeItemUpsert.ts',
|
|
1777
|
-
lineNumber:
|
|
1787
|
+
lineNumber: 22,
|
|
1778
1788
|
},
|
|
1779
1789
|
},
|
|
1780
1790
|
manualFieldExtensions: {
|
|
@@ -3136,6 +3146,17 @@ export const manifest: Manifest = {
|
|
|
3136
3146
|
},
|
|
3137
3147
|
type: 'string',
|
|
3138
3148
|
},
|
|
3149
|
+
isEnvironmentPrimary: {
|
|
3150
|
+
comment: {
|
|
3151
|
+
markdownText:
|
|
3152
|
+
'Whether the current environment is the primary one.',
|
|
3153
|
+
},
|
|
3154
|
+
location: {
|
|
3155
|
+
filePath: 'src/ctx/base.ts',
|
|
3156
|
+
lineNumber: 64,
|
|
3157
|
+
},
|
|
3158
|
+
type: 'boolean',
|
|
3159
|
+
},
|
|
3139
3160
|
owner: {
|
|
3140
3161
|
comment: {
|
|
3141
3162
|
markdownText:
|
|
@@ -3143,7 +3164,7 @@ export const manifest: Manifest = {
|
|
|
3143
3164
|
},
|
|
3144
3165
|
location: {
|
|
3145
3166
|
filePath: 'src/ctx/base.ts',
|
|
3146
|
-
lineNumber:
|
|
3167
|
+
lineNumber: 67,
|
|
3147
3168
|
},
|
|
3148
3169
|
type: 'Account | Organization',
|
|
3149
3170
|
},
|
|
@@ -3155,7 +3176,7 @@ export const manifest: Manifest = {
|
|
|
3155
3176
|
},
|
|
3156
3177
|
location: {
|
|
3157
3178
|
filePath: 'src/ctx/base.ts',
|
|
3158
|
-
lineNumber:
|
|
3179
|
+
lineNumber: 75,
|
|
3159
3180
|
},
|
|
3160
3181
|
type: 'Account | undefined',
|
|
3161
3182
|
},
|
|
@@ -3166,7 +3187,7 @@ export const manifest: Manifest = {
|
|
|
3166
3187
|
},
|
|
3167
3188
|
location: {
|
|
3168
3189
|
filePath: 'src/ctx/base.ts',
|
|
3169
|
-
lineNumber:
|
|
3190
|
+
lineNumber: 81,
|
|
3170
3191
|
},
|
|
3171
3192
|
type: '{\n /** Preferred locale */\n locale: string;\n }',
|
|
3172
3193
|
},
|
|
@@ -3177,7 +3198,7 @@ export const manifest: Manifest = {
|
|
|
3177
3198
|
},
|
|
3178
3199
|
location: {
|
|
3179
3200
|
filePath: 'src/ctx/base.ts',
|
|
3180
|
-
lineNumber:
|
|
3201
|
+
lineNumber: 87,
|
|
3181
3202
|
},
|
|
3182
3203
|
type: 'Theme',
|
|
3183
3204
|
},
|
|
@@ -3197,7 +3218,7 @@ export const manifest: Manifest = {
|
|
|
3197
3218
|
},
|
|
3198
3219
|
location: {
|
|
3199
3220
|
filePath: 'src/ctx/base.ts',
|
|
3200
|
-
lineNumber:
|
|
3221
|
+
lineNumber: 97,
|
|
3201
3222
|
},
|
|
3202
3223
|
type: 'Partial<Record<string, ItemType>>',
|
|
3203
3224
|
},
|
|
@@ -3208,7 +3229,7 @@ export const manifest: Manifest = {
|
|
|
3208
3229
|
},
|
|
3209
3230
|
location: {
|
|
3210
3231
|
filePath: 'src/ctx/base.ts',
|
|
3211
|
-
lineNumber:
|
|
3232
|
+
lineNumber: 104,
|
|
3212
3233
|
},
|
|
3213
3234
|
type: 'Partial<Record<string, Field>>',
|
|
3214
3235
|
},
|
|
@@ -3219,7 +3240,7 @@ export const manifest: Manifest = {
|
|
|
3219
3240
|
},
|
|
3220
3241
|
location: {
|
|
3221
3242
|
filePath: 'src/ctx/base.ts',
|
|
3222
|
-
lineNumber:
|
|
3243
|
+
lineNumber: 111,
|
|
3223
3244
|
},
|
|
3224
3245
|
type: 'Partial<Record<string, Fieldset>>',
|
|
3225
3246
|
},
|
|
@@ -3230,7 +3251,7 @@ export const manifest: Manifest = {
|
|
|
3230
3251
|
},
|
|
3231
3252
|
location: {
|
|
3232
3253
|
filePath: 'src/ctx/base.ts',
|
|
3233
|
-
lineNumber:
|
|
3254
|
+
lineNumber: 118,
|
|
3234
3255
|
},
|
|
3235
3256
|
type: 'Partial<Record<string, User>>',
|
|
3236
3257
|
},
|
|
@@ -3241,7 +3262,7 @@ export const manifest: Manifest = {
|
|
|
3241
3262
|
},
|
|
3242
3263
|
location: {
|
|
3243
3264
|
filePath: 'src/ctx/base.ts',
|
|
3244
|
-
lineNumber:
|
|
3265
|
+
lineNumber: 125,
|
|
3245
3266
|
},
|
|
3246
3267
|
type: 'Partial<Record<string, SsoUser>>',
|
|
3247
3268
|
},
|
|
@@ -3265,7 +3286,7 @@ export const manifest: Manifest = {
|
|
|
3265
3286
|
},
|
|
3266
3287
|
location: {
|
|
3267
3288
|
filePath: 'src/ctx/base.ts',
|
|
3268
|
-
lineNumber:
|
|
3289
|
+
lineNumber: 168,
|
|
3269
3290
|
},
|
|
3270
3291
|
type: '(itemTypeId: string) => Promise<Field[]>',
|
|
3271
3292
|
},
|
|
@@ -3278,7 +3299,7 @@ export const manifest: Manifest = {
|
|
|
3278
3299
|
},
|
|
3279
3300
|
location: {
|
|
3280
3301
|
filePath: 'src/ctx/base.ts',
|
|
3281
|
-
lineNumber:
|
|
3302
|
+
lineNumber: 187,
|
|
3282
3303
|
},
|
|
3283
3304
|
type: '(itemTypeId: string) => Promise<Fieldset[]>',
|
|
3284
3305
|
},
|
|
@@ -3291,7 +3312,7 @@ export const manifest: Manifest = {
|
|
|
3291
3312
|
},
|
|
3292
3313
|
location: {
|
|
3293
3314
|
filePath: 'src/ctx/base.ts',
|
|
3294
|
-
lineNumber:
|
|
3315
|
+
lineNumber: 204,
|
|
3295
3316
|
},
|
|
3296
3317
|
type: '() => Promise<Field[]>',
|
|
3297
3318
|
},
|
|
@@ -3304,7 +3325,7 @@ export const manifest: Manifest = {
|
|
|
3304
3325
|
},
|
|
3305
3326
|
location: {
|
|
3306
3327
|
filePath: 'src/ctx/base.ts',
|
|
3307
|
-
lineNumber:
|
|
3328
|
+
lineNumber: 217,
|
|
3308
3329
|
},
|
|
3309
3330
|
type: '() => Promise<User[]>',
|
|
3310
3331
|
},
|
|
@@ -3317,7 +3338,7 @@ export const manifest: Manifest = {
|
|
|
3317
3338
|
},
|
|
3318
3339
|
location: {
|
|
3319
3340
|
filePath: 'src/ctx/base.ts',
|
|
3320
|
-
lineNumber:
|
|
3341
|
+
lineNumber: 230,
|
|
3321
3342
|
},
|
|
3322
3343
|
type: '() => Promise<SsoUser[]>',
|
|
3323
3344
|
},
|
|
@@ -3339,7 +3360,7 @@ export const manifest: Manifest = {
|
|
|
3339
3360
|
},
|
|
3340
3361
|
location: {
|
|
3341
3362
|
filePath: 'src/ctx/base.ts',
|
|
3342
|
-
lineNumber:
|
|
3363
|
+
lineNumber: 252,
|
|
3343
3364
|
},
|
|
3344
3365
|
type: '(params: Record<string, unknown>) => Promise<void>',
|
|
3345
3366
|
},
|
|
@@ -3352,7 +3373,7 @@ export const manifest: Manifest = {
|
|
|
3352
3373
|
},
|
|
3353
3374
|
location: {
|
|
3354
3375
|
filePath: 'src/ctx/base.ts',
|
|
3355
|
-
lineNumber:
|
|
3376
|
+
lineNumber: 303,
|
|
3356
3377
|
},
|
|
3357
3378
|
type: '(\n fieldId: string,\n changes: FieldAppearanceChange[],\n ) => Promise<void>',
|
|
3358
3379
|
},
|
|
@@ -3374,7 +3395,7 @@ export const manifest: Manifest = {
|
|
|
3374
3395
|
},
|
|
3375
3396
|
location: {
|
|
3376
3397
|
filePath: 'src/ctx/base.ts',
|
|
3377
|
-
lineNumber:
|
|
3398
|
+
lineNumber: 408,
|
|
3378
3399
|
},
|
|
3379
3400
|
type: '(message: string) => Promise<void>',
|
|
3380
3401
|
},
|
|
@@ -3387,7 +3408,7 @@ export const manifest: Manifest = {
|
|
|
3387
3408
|
},
|
|
3388
3409
|
location: {
|
|
3389
3410
|
filePath: 'src/ctx/base.ts',
|
|
3390
|
-
lineNumber:
|
|
3411
|
+
lineNumber: 423,
|
|
3391
3412
|
},
|
|
3392
3413
|
type: '(message: string) => Promise<void>',
|
|
3393
3414
|
},
|
|
@@ -3400,7 +3421,7 @@ export const manifest: Manifest = {
|
|
|
3400
3421
|
},
|
|
3401
3422
|
location: {
|
|
3402
3423
|
filePath: 'src/ctx/base.ts',
|
|
3403
|
-
lineNumber:
|
|
3424
|
+
lineNumber: 447,
|
|
3404
3425
|
},
|
|
3405
3426
|
type: '<CtaValue = unknown>(\n toast: Toast<CtaValue>,\n ) => Promise<CtaValue | null>',
|
|
3406
3427
|
},
|
|
@@ -3422,7 +3443,7 @@ export const manifest: Manifest = {
|
|
|
3422
3443
|
},
|
|
3423
3444
|
location: {
|
|
3424
3445
|
filePath: 'src/ctx/base.ts',
|
|
3425
|
-
lineNumber:
|
|
3446
|
+
lineNumber: 333,
|
|
3426
3447
|
},
|
|
3427
3448
|
type: '(itemTypeId: string) => Promise<Item | null>',
|
|
3428
3449
|
},
|
|
@@ -3435,7 +3456,7 @@ export const manifest: Manifest = {
|
|
|
3435
3456
|
},
|
|
3436
3457
|
location: {
|
|
3437
3458
|
filePath: 'src/ctx/base.ts',
|
|
3438
|
-
lineNumber:
|
|
3459
|
+
lineNumber: 354,
|
|
3439
3460
|
},
|
|
3440
3461
|
type: '{\n (\n itemTypeId: string,\n options: { multiple: true; initialLocationQuery?: ItemListLocationQuery },\n ): Promise<Item[] | null>;\n (\n itemTypeId: string,\n options?: {\n multiple: false;\n initialLocationQuery?: ItemListLocationQuery;\n },\n ): Promise<Item | null>;\n }',
|
|
3441
3462
|
},
|
|
@@ -3448,7 +3469,7 @@ export const manifest: Manifest = {
|
|
|
3448
3469
|
},
|
|
3449
3470
|
location: {
|
|
3450
3471
|
filePath: 'src/ctx/base.ts',
|
|
3451
|
-
lineNumber:
|
|
3472
|
+
lineNumber: 386,
|
|
3452
3473
|
},
|
|
3453
3474
|
type: '(itemId: string) => Promise<Item | null>',
|
|
3454
3475
|
},
|
|
@@ -3470,7 +3491,7 @@ export const manifest: Manifest = {
|
|
|
3470
3491
|
},
|
|
3471
3492
|
location: {
|
|
3472
3493
|
filePath: 'src/ctx/base.ts',
|
|
3473
|
-
lineNumber:
|
|
3494
|
+
lineNumber: 474,
|
|
3474
3495
|
},
|
|
3475
3496
|
type: '{\n (options: { multiple: true }): Promise<Upload[] | null>;\n (options?: { multiple: false }): Promise<Upload | null>;\n }',
|
|
3476
3497
|
},
|
|
@@ -3483,7 +3504,7 @@ export const manifest: Manifest = {
|
|
|
3483
3504
|
},
|
|
3484
3505
|
location: {
|
|
3485
3506
|
filePath: 'src/ctx/base.ts',
|
|
3486
|
-
lineNumber:
|
|
3507
|
+
lineNumber: 502,
|
|
3487
3508
|
},
|
|
3488
3509
|
type: '(\n uploadId: string,\n ) => Promise<(Upload & { deleted?: true }) | null>',
|
|
3489
3510
|
},
|
|
@@ -3496,7 +3517,7 @@ export const manifest: Manifest = {
|
|
|
3496
3517
|
},
|
|
3497
3518
|
location: {
|
|
3498
3519
|
filePath: 'src/ctx/base.ts',
|
|
3499
|
-
lineNumber:
|
|
3520
|
+
lineNumber: 530,
|
|
3500
3521
|
},
|
|
3501
3522
|
type: '(\n /** The "single asset" field structure */\n fileFieldValue: FileFieldValue,\n /** Shows metadata information for a specific locale */\n locale?: string,\n ) => Promise<FileFieldValue | null>',
|
|
3502
3523
|
},
|
|
@@ -3518,7 +3539,7 @@ export const manifest: Manifest = {
|
|
|
3518
3539
|
},
|
|
3519
3540
|
location: {
|
|
3520
3541
|
filePath: 'src/ctx/base.ts',
|
|
3521
|
-
lineNumber:
|
|
3542
|
+
lineNumber: 561,
|
|
3522
3543
|
},
|
|
3523
3544
|
type: '(modal: Modal) => Promise<unknown>',
|
|
3524
3545
|
},
|
|
@@ -3531,7 +3552,7 @@ export const manifest: Manifest = {
|
|
|
3531
3552
|
},
|
|
3532
3553
|
location: {
|
|
3533
3554
|
filePath: 'src/ctx/base.ts',
|
|
3534
|
-
lineNumber:
|
|
3555
|
+
lineNumber: 598,
|
|
3535
3556
|
},
|
|
3536
3557
|
type: '(options: ConfirmOptions) => Promise<unknown>',
|
|
3537
3558
|
},
|
|
@@ -3552,7 +3573,7 @@ export const manifest: Manifest = {
|
|
|
3552
3573
|
},
|
|
3553
3574
|
location: {
|
|
3554
3575
|
filePath: 'src/ctx/base.ts',
|
|
3555
|
-
lineNumber:
|
|
3576
|
+
lineNumber: 612,
|
|
3556
3577
|
},
|
|
3557
3578
|
type: '(path: string) => Promise<void>',
|
|
3558
3579
|
},
|